]> granicus.if.org Git - esp-idf/commitdiff
examples: change max register area size to maximum value
authoraleks <aleks@espressif.com>
Mon, 7 Jan 2019 10:33:20 +0000 (11:33 +0100)
committeraleks <aleks@espressif.com>
Fri, 11 Jan 2019 08:49:11 +0000 (09:49 +0100)
esp-idf/components/freemodbus/modbus_controller/modbus_controller.c: The MB_INST_MAX_SIZE is changed to max value=(65535*2);
Update support for coils read into freemodbus.c;

TW#28143
Closes https://github.com/espressif/esp-idf/issues/2884

components/freemodbus/Kconfig
components/freemodbus/modbus_controller/mbcontroller.h
examples/protocols/modbus_slave/main/freemodbus.c

index b6d3d29fb4b514ef902d3bb8a0ebb73c295a2fa9..2ed7ee3e0fabde477e7f8bce533f483267a8eeca 100644 (file)
@@ -22,7 +22,7 @@ config MB_SERIAL_BUF_SIZE
     default 256
     help
         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.
         
 config MB_SERIAL_TASK_PRIO
index b6b206e2a68f5798795e221e8de299960cd7308e..267fa34aed11cc4ef18dd29c3d8f818176f84867 100644 (file)
@@ -26,7 +26,7 @@
 
 /* ----------------------- Defines ------------------------------------------*/
 #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_PRIORITY              (CONFIG_MB_SERIAL_TASK_PRIO - 1) // priority of MB controller task
index ff52efcb46d391727d7525f379572428935403c4..fe0232bf2e593ab9ae2de046d3df37ebf2eaedd6 100644 (file)
@@ -129,7 +129,8 @@ void app_main()
         mb_event_group_t event = mbcontroller_check_event((MB_EVENT_HOLDING_REG_WR
                                                         | MB_EVENT_INPUT_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
         if((event & MB_EVENT_HOLDING_REG_WR) || (event & MB_EVENT_HOLDING_REG_RD)) {
             // Get parameter information from parameter queue