Support WISDOM DTZ178 and WASION DTSD342 meter data acquisition on CH32V208RBT6 board

This commit is contained in:
xuyanghang 2025-04-23 17:25:49 +08:00
parent fd1e44de35
commit 7a785b041e
1 changed files with 4 additions and 1 deletions

View File

@ -99,6 +99,9 @@ static uint32 Rs485Init(struct SerialDriver *rs485_drv, struct BusConfigureInfo
switch (rs485_cfg->data_cfg.serial_data_bits) { switch (rs485_cfg->data_cfg.serial_data_bits) {
case DATA_BITS_8: case DATA_BITS_8:
if (rs485_cfg->data_cfg.serial_parity_mode == PARITY_ODD || rs485_cfg->data_cfg.serial_parity_mode == PARITY_EVEN)
USART_InitStructure_Rs485.USART_WordLength = USART_WordLength_9b;
else
USART_InitStructure_Rs485.USART_WordLength = USART_WordLength_8b; USART_InitStructure_Rs485.USART_WordLength = USART_WordLength_8b;
break; break;
case DATA_BITS_9: case DATA_BITS_9: