mirror of
https://github.com/espressif/esp-idf.git
synced 2024-10-05 20:47:46 -04:00
Merge branch 'feature/freemodbus_mb_inst_config' into 'master'
examples: freemodbus port serial slave increase MB_INST_MAX_SIZE See merge request idf/esp-idf!4080
This commit is contained in:
commit
1e93c4e48b
@ -22,7 +22,7 @@ config MB_SERIAL_BUF_SIZE
|
|||||||
default 256
|
default 256
|
||||||
help
|
help
|
||||||
Modbus serial task RX and TX buffer size for UART driver initialization.
|
Modbus serial task RX and TX buffer size for UART driver initialization.
|
||||||
This buffer is used for modbus frame transfer. The Modbus protocol maximum
|
This buffer is used for Modbus frame transfer. The Modbus protocol maximum
|
||||||
frame size is 256 bytes. Bigger size can be used for non standard implementations.
|
frame size is 256 bytes. Bigger size can be used for non standard implementations.
|
||||||
|
|
||||||
config MB_SERIAL_TASK_PRIO
|
config MB_SERIAL_TASK_PRIO
|
||||||
|
@ -26,7 +26,7 @@
|
|||||||
|
|
||||||
/* ----------------------- Defines ------------------------------------------*/
|
/* ----------------------- Defines ------------------------------------------*/
|
||||||
#define MB_INST_MIN_SIZE (2) // The minimal size of Modbus registers area in bytes
|
#define MB_INST_MIN_SIZE (2) // The minimal size of Modbus registers area in bytes
|
||||||
#define MB_INST_MAX_SIZE (2048) // The maximum size of Modbus area in bytes
|
#define MB_INST_MAX_SIZE (65535 * 2) // The maximum size of Modbus area in bytes
|
||||||
|
|
||||||
#define MB_CONTROLLER_STACK_SIZE (CONFIG_MB_CONTROLLER_STACK_SIZE) // Stack size for Modbus controller
|
#define MB_CONTROLLER_STACK_SIZE (CONFIG_MB_CONTROLLER_STACK_SIZE) // Stack size for Modbus controller
|
||||||
#define MB_CONTROLLER_PRIORITY (CONFIG_MB_SERIAL_TASK_PRIO - 1) // priority of MB controller task
|
#define MB_CONTROLLER_PRIORITY (CONFIG_MB_SERIAL_TASK_PRIO - 1) // priority of MB controller task
|
||||||
|
@ -129,7 +129,8 @@ void app_main()
|
|||||||
mb_event_group_t event = mbcontroller_check_event((MB_EVENT_HOLDING_REG_WR
|
mb_event_group_t event = mbcontroller_check_event((MB_EVENT_HOLDING_REG_WR
|
||||||
| MB_EVENT_INPUT_REG_RD
|
| MB_EVENT_INPUT_REG_RD
|
||||||
| MB_EVENT_HOLDING_REG_RD
|
| MB_EVENT_HOLDING_REG_RD
|
||||||
| MB_EVENT_DISCRETE_RD));
|
| MB_EVENT_DISCRETE_RD
|
||||||
|
| MB_EVENT_COILS_RD));
|
||||||
// Filter events and process them accordingly
|
// Filter events and process them accordingly
|
||||||
if((event & MB_EVENT_HOLDING_REG_WR) || (event & MB_EVENT_HOLDING_REG_RD)) {
|
if((event & MB_EVENT_HOLDING_REG_WR) || (event & MB_EVENT_HOLDING_REG_RD)) {
|
||||||
// Get parameter information from parameter queue
|
// Get parameter information from parameter queue
|
||||||
|
Loading…
Reference in New Issue
Block a user