forked from espressif/esp-idf
freemodbus: fix issues when modbus master and slave work simultaneously
This commit is contained in:
@@ -54,7 +54,7 @@
|
||||
#endif
|
||||
|
||||
#ifndef MB_PORT_HAS_CLOSE
|
||||
#define MB_PORT_HAS_CLOSE 0
|
||||
#define MB_PORT_HAS_CLOSE 1
|
||||
#endif
|
||||
|
||||
/* ----------------------- Static variables ---------------------------------*/
|
||||
|
@@ -57,7 +57,7 @@
|
||||
/* ----------------------- Variables ----------------------------------------*/
|
||||
static USHORT usT35TimeOut50us;
|
||||
|
||||
static const USHORT usTimerIndex = MB_TIMER_INDEX; // Initialize Modbus Timer index used by stack,
|
||||
static const USHORT usTimerIndex = MB_TIMER_INDEX ^ 1; // Initialize Modbus Timer index used by stack,
|
||||
static const USHORT usTimerGroupIndex = MB_TIMER_GROUP; // Timer group index used by stack
|
||||
static timer_isr_handle_t xTimerIntHandle; // Timer interrupt handle
|
||||
|
||||
|
@@ -28,7 +28,7 @@
|
||||
#include "port_serial_slave.h"
|
||||
|
||||
// Shared pointer to interface structure
|
||||
static mb_slave_interface_t* mbs_interface_ptr = NULL; // &default_interface_inst;
|
||||
static mb_slave_interface_t* mbs_interface_ptr = NULL;
|
||||
|
||||
// Modbus task function
|
||||
static void modbus_slave_task(void *pvParameters)
|
||||
@@ -36,7 +36,6 @@ static void modbus_slave_task(void *pvParameters)
|
||||
// Modbus interface must be initialized before start
|
||||
MB_SLAVE_ASSERT(mbs_interface_ptr != NULL);
|
||||
mb_slave_options_t* mbs_opts = &mbs_interface_ptr->opts;
|
||||
|
||||
MB_SLAVE_ASSERT(mbs_opts != NULL);
|
||||
// Main Modbus stack processing cycle
|
||||
for (;;) {
|
||||
|
Reference in New Issue
Block a user