|
|
@@ -85,7 +85,7 @@ static esp_err_t mbc_serial_master_setup(void* comm_info)
|
|
|
(uint32_t)comm_info_ptr->mode);
|
|
|
MB_MASTER_CHECK((comm_info_ptr->port < UART_NUM_MAX), ESP_ERR_INVALID_ARG,
|
|
|
"mb wrong port to set = (0x%x).", (uint32_t)comm_info_ptr->port);
|
|
|
- MB_MASTER_CHECK((comm_info_ptr->parity <= UART_PARITY_EVEN), ESP_ERR_INVALID_ARG,
|
|
|
+ MB_MASTER_CHECK((comm_info_ptr->parity <= UART_PARITY_ODD), ESP_ERR_INVALID_ARG,
|
|
|
"mb wrong parity option = (0x%x).", (uint32_t)comm_info_ptr->parity);
|
|
|
// Save the communication options
|
|
|
mbm_opts->mbm_comm = *(mb_communication_info_t*)comm_info_ptr;
|
|
|
@@ -104,7 +104,8 @@ static esp_err_t mbc_serial_master_start(void)
|
|
|
|
|
|
// Initialize Modbus stack using mbcontroller parameters
|
|
|
status = eMBMasterInit((eMBMode)comm_info->mode, (UCHAR)comm_info->port,
|
|
|
- (ULONG)comm_info->baudrate, (eMBParity)comm_info->parity);
|
|
|
+ (ULONG)comm_info->baudrate,
|
|
|
+ MB_PORT_PARITY_GET(comm_info->parity));
|
|
|
MB_MASTER_CHECK((status == MB_ENOERR), ESP_ERR_INVALID_STATE,
|
|
|
"mb stack initialization failure, eMBInit() returns (0x%x).", status);
|
|
|
status = eMBMasterEnable();
|