]> granicus.if.org Git - esp-idf/commitdiff
Rename Kconfig options (components/freemodbus)
authorRoland Dobai <dobai.roland@gmail.com>
Fri, 26 Apr 2019 16:47:21 +0000 (18:47 +0200)
committerRoland Dobai <dobai.roland@gmail.com>
Tue, 21 May 2019 07:09:01 +0000 (09:09 +0200)
16 files changed:
components/freemodbus/Kconfig
components/freemodbus/common/esp_modbus_slave.c
components/freemodbus/common/include/esp_modbus_common.h
components/freemodbus/common/mbc_slave.h
components/freemodbus/modbus/include/mbconfig.h
components/freemodbus/port/portevent.c
components/freemodbus/port/portserial.c
components/freemodbus/port/portserial_m.c
components/freemodbus/port/porttimer.c
components/freemodbus/port/porttimer_m.c
components/freemodbus/sdkconfig.rename [new file with mode: 0644]
components/freemodbus/serial_slave/modbus_controller/mbc_serial_slave.c
components/freemodbus/serial_slave/modbus_controller/mbc_serial_slave.h
docs/en/api-reference/protocols/modbus.rst
examples/protocols/modbus_master/sdkconfig.defaults
examples/protocols/modbus_slave/sdkconfig.defaults

index a0ac5f882ad2ab8c998c90c8ea45d69303fedeff..113202d122873abc2ab16384a925543559f9dd25 100644 (file)
@@ -1,6 +1,6 @@
 menu "Modbus configuration"
 
-    config MB_MASTER_TIMEOUT_MS_RESPOND
+    config FMB_MASTER_TIMEOUT_MS_RESPOND
         int "Slave respond timeout (Milliseconds)"
         default 150
         range 50 400
@@ -9,7 +9,7 @@ menu "Modbus configuration"
                 If master sends a frame which is not broadcast, it has to wait sometime for slave response.
                 if slave is not respond in this time, the master will process timeout error.
 
-    config MB_MASTER_DELAY_MS_CONVERT
+    config FMB_MASTER_DELAY_MS_CONVERT
         int "Slave conversion delay (Milliseconds)"
         default 200
         range 50 400
@@ -18,7 +18,7 @@ menu "Modbus configuration"
                 If master sends a broadcast frame, it has to wait conversion time to delay,
                 then master can send next frame.
 
-    config MB_QUEUE_LENGTH
+    config FMB_QUEUE_LENGTH
         int "Modbus serial task queue length"
         range 0 200
         default 20
@@ -26,7 +26,7 @@ menu "Modbus configuration"
                 Modbus serial driver queue length. It is used by event queue task.
                 See the serial driver API for more information.
 
-    config MB_SERIAL_TASK_STACK_SIZE
+    config FMB_SERIAL_TASK_STACK_SIZE
         int "Modbus serial task stack size"
         range 768 8192
         default 2048
@@ -34,7 +34,7 @@ menu "Modbus configuration"
                 Modbus serial task stack size for event queue task.
                 It may be adjusted when debugging is enabled (for example).
 
-    config MB_SERIAL_BUF_SIZE
+    config FMB_SERIAL_BUF_SIZE
         int "Modbus serial task RX/TX buffer size"
         range 0 2048
         default 256
@@ -43,33 +43,33 @@ menu "Modbus configuration"
                 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
+    config FMB_SERIAL_TASK_PRIO
         int "Modbus serial task priority"
         range 3 10
         default 10
         help
                 Modbus UART driver event task priority.
-                The priority of Modbus controller task is equal to (CONFIG_MB_SERIAL_TASK_PRIO - 1).
+                The priority of Modbus controller task is equal to (CONFIG_FMB_SERIAL_TASK_PRIO - 1).
 
-    config MB_CONTROLLER_SLAVE_ID_SUPPORT
+    config FMB_CONTROLLER_SLAVE_ID_SUPPORT
         bool "Modbus controller slave ID support"
         default n
         help
                 Modbus slave ID support enable.
                 When enabled the Modbus <Report Slave ID> command is supported by stack.
 
-    config MB_CONTROLLER_SLAVE_ID
+    config FMB_CONTROLLER_SLAVE_ID
         hex "Modbus controller slave ID"
         range 0 4294967295
         default 0x00112233
-        depends on MB_CONTROLLER_SLAVE_ID_SUPPORT
+        depends on FMB_CONTROLLER_SLAVE_ID_SUPPORT
         help
                 Modbus slave ID value to identify modbus device
                 in the network using <Report Slave ID> command.
                 Most significant byte of ID is used as short device ID and
                 other three bytes used as long ID.
 
-    config MB_CONTROLLER_NOTIFY_TIMEOUT
+    config FMB_CONTROLLER_NOTIFY_TIMEOUT
         int "Modbus controller notification timeout (ms)"
         range 0 200
         default 20
@@ -77,7 +77,7 @@ menu "Modbus configuration"
                 Modbus controller notification timeout in milliseconds.
                 This timeout is used to send notification about accessed parameters.
 
-    config MB_CONTROLLER_NOTIFY_QUEUE_SIZE
+    config FMB_CONTROLLER_NOTIFY_QUEUE_SIZE
         int "Modbus controller notification queue size"
         range 0 200
         default 20
@@ -85,7 +85,7 @@ menu "Modbus configuration"
                 Modbus controller notification queue size.
                 The notification queue is used to get information about accessed parameters.
 
-    config MB_CONTROLLER_STACK_SIZE
+    config FMB_CONTROLLER_STACK_SIZE
         int "Modbus controller stack size"
         range 0 8192
         default 4096
@@ -93,7 +93,7 @@ menu "Modbus configuration"
                 Modbus controller task stack size. The Stack size may be adjusted when
                 debug mode is used which requires more stack size (for example).
 
-    config MB_EVENT_QUEUE_TIMEOUT
+    config FMB_EVENT_QUEUE_TIMEOUT
         int "Modbus stack event queue timeout (ms)"
         range 0 500
         default 20
@@ -101,21 +101,21 @@ menu "Modbus configuration"
                 Modbus stack event queue timeout in milliseconds. This may help to optimize
                 Modbus stack event processing time.
 
-    config MB_TIMER_PORT_ENABLED
+    config FMB_TIMER_PORT_ENABLED
         bool "Modbus slave stack use timer for 3.5T symbol time measurement"
         default y
         help
                 If this option is set the Modbus stack uses timer for T3.5 time measurement.
                 Else the internal UART TOUT timeout is used for 3.5T symbol time measurement.
 
-    config MB_TIMER_GROUP
+    config FMB_TIMER_GROUP
         int "Modbus Timer group number"
         range 0 1
         default 0
         help
             Modbus Timer group number that is used for timeout measurement.
 
-    config MB_TIMER_INDEX
+    config FMB_TIMER_INDEX
         int "Modbus Timer index in the group"
         range 0 1
         default 0
index ad173c0e82692e9ff0ff8eb2c374bc6c18686d5d..8883a98f2708c7352ef570d3173e72701cfe2e8c 100644 (file)
 #include "esp_modbus_callbacks.h"   // for modbus callbacks function pointers declaration
 #include "mbc_serial_slave.h"       // for create function of serial port
 
-#ifdef CONFIG_MB_CONTROLLER_SLAVE_ID_SUPPORT
+#ifdef CONFIG_FMB_CONTROLLER_SLAVE_ID_SUPPORT
 
 #define MB_ID_BYTE0(id) ((uint8_t)(id))
 #define MB_ID_BYTE1(id) ((uint8_t)(((uint16_t)(id) >> 8) & 0xFF))
 #define MB_ID_BYTE2(id) ((uint8_t)(((uint32_t)(id) >> 16) & 0xFF))
 #define MB_ID_BYTE3(id) ((uint8_t)(((uint32_t)(id) >> 24) & 0xFF))
 
-#define MB_CONTROLLER_SLAVE_ID (CONFIG_MB_CONTROLLER_SLAVE_ID)
+#define MB_CONTROLLER_SLAVE_ID (CONFIG_FMB_CONTROLLER_SLAVE_ID)
 #define MB_SLAVE_ID_SHORT      (MB_ID_BYTE3(MB_CONTROLLER_SLAVE_ID))
 
 // Slave ID constant
@@ -127,7 +127,7 @@ esp_err_t mbc_slave_start()
     MB_SLAVE_CHECK((slave_interface_ptr->start != NULL), 
                     ESP_ERR_INVALID_STATE,
                     "Slave interface is not correctly initialized.");
-#ifdef CONFIG_MB_CONTROLLER_SLAVE_ID_SUPPORT
+#ifdef CONFIG_FMB_CONTROLLER_SLAVE_ID_SUPPORT
     // Set the slave ID if the KConfig option is selected
     eMBErrorCode status = eMBSetSlaveID(MB_SLAVE_ID_SHORT, TRUE, (UCHAR*)mb_slave_id, sizeof(mb_slave_id));
     MB_SLAVE_CHECK((status == MB_ENOERR), ESP_ERR_INVALID_STATE, "mb stack set slave ID failure.");
@@ -252,4 +252,4 @@ eMBErrorCode eMBRegInputCB(UCHAR * pucRegBuffer, USHORT usAddress,
                     "Slave interface is not correctly initialized.");
     error = slave_interface_ptr->slave_reg_cb_input(pucRegBuffer, usAddress, usNRegs);
     return error;
-}
\ No newline at end of file
+}
index d24cb2938b7b215406887bf3a6f80b892ba08a72..7bec02476a7406c63a96c438f0b5126b870d6cac 100644 (file)
@@ -18,8 +18,8 @@
 
 #include "driver/uart.h"                    // for UART types
 
-#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_STACK_SIZE            (CONFIG_FMB_CONTROLLER_STACK_SIZE)   // Stack size for Modbus controller
+#define MB_CONTROLLER_PRIORITY              (CONFIG_FMB_SERIAL_TASK_PRIO - 1)    // priority of MB controller task
 
 // Default port defines
 #define MB_DEVICE_ADDRESS   (1)             // Default slave device address in Modbus
index 360547044aa59bc070767a845e981b4bd836e1bc..1565da1a7370b8c382df410c1d88e07b5536eefe 100644 (file)
@@ -26,8 +26,8 @@
 #define MB_INST_MIN_SIZE                    (2) // The minimal size of Modbus registers area in bytes
 #define MB_INST_MAX_SIZE                    (65535 * 2) // The maximum size of Modbus area in bytes
 
-#define MB_CONTROLLER_NOTIFY_QUEUE_SIZE     (CONFIG_MB_CONTROLLER_NOTIFY_QUEUE_SIZE) // Number of messages in parameter notification queue
-#define MB_CONTROLLER_NOTIFY_TIMEOUT        (pdMS_TO_TICKS(CONFIG_MB_CONTROLLER_NOTIFY_TIMEOUT)) // notification timeout
+#define MB_CONTROLLER_NOTIFY_QUEUE_SIZE     (CONFIG_FMB_CONTROLLER_NOTIFY_QUEUE_SIZE) // Number of messages in parameter notification queue
+#define MB_CONTROLLER_NOTIFY_TIMEOUT        (pdMS_TO_TICKS(CONFIG_FMB_CONTROLLER_NOTIFY_TIMEOUT)) // notification timeout
 
 #define MB_SLAVE_TAG "MB_CONTROLLER_SLAVE"
 
index 1380fc0b3caa07bd67e900b2fe8b53139738ba89..ce160d82710de501a862fdfb338354ffe5fa0f68 100644 (file)
@@ -101,7 +101,7 @@ PR_BEGIN_EXTERN_C
 #define MB_FUNC_OTHER_REP_SLAVEID_BUF           ( 32 )
 
 /*! \brief If the <em>Report Slave ID</em> function should be enabled. */
-#define MB_FUNC_OTHER_REP_SLAVEID_ENABLED       (  CONFIG_MB_CONTROLLER_SLAVE_ID_SUPPORT )
+#define MB_FUNC_OTHER_REP_SLAVEID_ENABLED       (  CONFIG_FMB_CONTROLLER_SLAVE_ID_SUPPORT )
 
 /*! \brief If the <em>Read Input Registers</em> function should be enabled. */
 #define MB_FUNC_READ_INPUT_ENABLED              (  1 )
@@ -138,11 +138,11 @@ PR_BEGIN_EXTERN_C
 #if MB_MASTER_RTU_ENABLED || MB_MASTER_ASCII_ENABLED
 /*! \brief If master send a broadcast frame, the master will wait time of convert to delay,
  * then master can send other frame */
-#define MB_MASTER_DELAY_MS_CONVERT              ( CONFIG_MB_MASTER_DELAY_MS_CONVERT )
+#define MB_MASTER_DELAY_MS_CONVERT              ( CONFIG_FMB_MASTER_DELAY_MS_CONVERT )
 /*! \brief If master send a frame which is not broadcast,the master will wait sometime for slave.
  * And if slave is not respond in this time,the master will process this timeout error.
  * Then master can send other frame */
-#define MB_MASTER_TIMEOUT_MS_RESPOND            ( CONFIG_MB_MASTER_TIMEOUT_MS_RESPOND )
+#define MB_MASTER_TIMEOUT_MS_RESPOND            ( CONFIG_FMB_MASTER_TIMEOUT_MS_RESPOND )
 /*! \brief The total slaves in Modbus Master system.
  * \note : The slave ID must be continuous from 1.*/
 #define MB_MASTER_TOTAL_SLAVE_NUM               ( 247 )
index 247a4283dc1bc721cbf2877700a2ae2bdc32893f..2c6597eef7e5bed8f1b267c75d280a143ddffda5 100644 (file)
@@ -57,7 +57,7 @@
 static xQueueHandle xQueueHdl;
 
 #define MB_EVENT_QUEUE_SIZE     (1)
-#define MB_EVENT_QUEUE_TIMEOUT  (pdMS_TO_TICKS(CONFIG_MB_EVENT_QUEUE_TIMEOUT))
+#define MB_EVENT_QUEUE_TIMEOUT  (pdMS_TO_TICKS(CONFIG_FMB_EVENT_QUEUE_TIMEOUT))
 
 /* ----------------------- Start implementation -----------------------------*/
 BOOL
index aed86fcf5aa0e7987e1a3c0f24e0601c99c0566c..43bc887e465f1046c433950250f3e1a0a121bf8a 100644 (file)
 #define MB_UART_RTS   (CONFIG_MB_UART_RTS)
 
 #define MB_BAUD_RATE_DEFAULT        (115200)
-#define MB_QUEUE_LENGTH             (CONFIG_MB_QUEUE_LENGTH)
+#define MB_QUEUE_LENGTH             (CONFIG_FMB_QUEUE_LENGTH)
 
-#define MB_SERIAL_TASK_PRIO         (CONFIG_MB_SERIAL_TASK_PRIO)
-#define MB_SERIAL_TASK_STACK_SIZE   (CONFIG_MB_SERIAL_TASK_STACK_SIZE)
+#define MB_SERIAL_TASK_PRIO         (CONFIG_FMB_SERIAL_TASK_PRIO)
+#define MB_SERIAL_TASK_STACK_SIZE   (CONFIG_FMB_SERIAL_TASK_STACK_SIZE)
 #define MB_SERIAL_TOUT              (3) // 3.5*8 = 28 ticks, TOUT=3 -> ~24..33 ticks
 
 // Set buffer size for transmission
-#define MB_SERIAL_BUF_SIZE          (CONFIG_MB_SERIAL_BUF_SIZE)
+#define MB_SERIAL_BUF_SIZE          (CONFIG_FMB_SERIAL_BUF_SIZE)
 
 // Note: This code uses mixed coding standard from legacy IDF code and used freemodbus stack
 
index c225c3003e04a04bb04529a5da7a2d5c680ba183..74a4a1be04f953995eb75aced0e6a77501d69502 100644 (file)
 /* ----------------------- Defines ------------------------------------------*/
 
 #define MB_BAUD_RATE_DEFAULT        (115200)
-#define MB_QUEUE_LENGTH             (CONFIG_MB_QUEUE_LENGTH)
+#define MB_QUEUE_LENGTH             (CONFIG_FMB_QUEUE_LENGTH)
 
-#define MB_SERIAL_TASK_PRIO         (CONFIG_MB_SERIAL_TASK_PRIO)
-#define MB_SERIAL_TASK_STACK_SIZE   (CONFIG_MB_SERIAL_TASK_STACK_SIZE)
+#define MB_SERIAL_TASK_PRIO         (CONFIG_FMB_SERIAL_TASK_PRIO)
+#define MB_SERIAL_TASK_STACK_SIZE   (CONFIG_FMB_SERIAL_TASK_STACK_SIZE)
 #define MB_SERIAL_TOUT              (3) // 3.5*8 = 28 ticks, TOUT=3 -> ~24..33 ticks
 
 // Set buffer size for transmission
-#define MB_SERIAL_BUF_SIZE          (CONFIG_MB_SERIAL_BUF_SIZE)
+#define MB_SERIAL_BUF_SIZE          (CONFIG_FMB_SERIAL_BUF_SIZE)
 #define MB_SERIAL_TX_TOUT_MS        (100)
 #define MB_SERIAL_TX_TOUT_TICKS     pdMS_TO_TICKS(MB_SERIAL_TX_TOUT_MS) // timeout for transmission
 
index 928e290a0bbe4dc829bc67a4c92b9d8693fdb42c..2859aa01669361e36baa252c04aabd9ed3bf18c5 100644 (file)
@@ -51,7 +51,7 @@
 #include "sdkconfig.h"
 #include "port_serial_slave.h"
 
-#ifdef CONFIG_MB_TIMER_PORT_ENABLED
+#ifdef CONFIG_FMB_TIMER_PORT_ENABLED
 
 #define MB_US50_FREQ            (20000) // 20kHz 1/20000 = 50mks
 #define MB_DISCR_TIME_US        (50)    // 50uS = one discreet for timer
@@ -61,8 +61,8 @@
 #define MB_TIMER_DIVIDER        ((TIMER_BASE_CLK / 1000000UL) * MB_DISCR_TIME_US - 1) // divider for 50uS
 #define MB_TIMER_WITH_RELOAD    (1)
 
-static const USHORT usTimerIndex = CONFIG_MB_TIMER_INDEX; // Modbus Timer index used by stack
-static const USHORT usTimerGroupIndex = CONFIG_MB_TIMER_GROUP; // Modbus Timer group index used by stack
+static const USHORT usTimerIndex = CONFIG_FMB_TIMER_INDEX; // Modbus Timer index used by stack
+static const USHORT usTimerGroupIndex = CONFIG_FMB_TIMER_GROUP; // Modbus Timer group index used by stack
 
 static timg_dev_t *MB_TG[2] = {&TIMERG0, &TIMERG1};
 
@@ -82,7 +82,7 @@ static void IRAM_ATTR vTimerGroupIsr(void *param)
 
 BOOL xMBPortTimersInit(USHORT usTim1Timerout50us)
 {
-#ifdef CONFIG_MB_TIMER_PORT_ENABLED
+#ifdef CONFIG_FMB_TIMER_PORT_ENABLED
     MB_PORT_CHECK((usTim1Timerout50us > 0), FALSE,
             "Modbus timeout discreet is incorrect.");
     esp_err_t xErr;
@@ -123,7 +123,7 @@ BOOL xMBPortTimersInit(USHORT usTim1Timerout50us)
 
 void vMBPortTimersEnable()
 {
-#ifdef CONFIG_MB_TIMER_PORT_ENABLED
+#ifdef CONFIG_FMB_TIMER_PORT_ENABLED
     ESP_ERROR_CHECK(timer_pause(usTimerGroupIndex, usTimerIndex));
     ESP_ERROR_CHECK(timer_set_counter_value(usTimerGroupIndex, usTimerIndex, 0ULL));
     ESP_ERROR_CHECK(timer_enable_intr(usTimerGroupIndex, usTimerIndex));
@@ -133,7 +133,7 @@ void vMBPortTimersEnable()
 
 void vMBPortTimersDisable()
 {
-#ifdef CONFIG_MB_TIMER_PORT_ENABLED
+#ifdef CONFIG_FMB_TIMER_PORT_ENABLED
     ESP_ERROR_CHECK(timer_pause(usTimerGroupIndex, usTimerIndex));
     ESP_ERROR_CHECK(timer_set_counter_value(usTimerGroupIndex, usTimerIndex, 0ULL));
     // Disable timer interrupt
@@ -143,7 +143,7 @@ void vMBPortTimersDisable()
 
 void vMBPortTimerClose()
 {
-#ifdef CONFIG_MB_TIMER_PORT_ENABLED
+#ifdef CONFIG_FMB_TIMER_PORT_ENABLED
     ESP_ERROR_CHECK(timer_pause(usTimerGroupIndex, usTimerIndex));
     ESP_ERROR_CHECK(timer_disable_intr(usTimerGroupIndex, usTimerIndex));
 #endif
index 2a5bf62fcf30b9acf002495940a27e23ae9b1730..c2b5b423c51a14b4f99ecd6e53c1a02bd6d90bab 100644 (file)
@@ -50,8 +50,8 @@
 #define MB_TIMER_WITH_RELOAD    (1)
 
 // Timer group and timer number to measure time (configurable in KConfig)
-#define MB_TIMER_INDEX CONFIG_MB_TIMER_INDEX
-#define MB_TIMER_GROUP CONFIG_MB_TIMER_GROUP
+#define MB_TIMER_INDEX CONFIG_FMB_TIMER_INDEX
+#define MB_TIMER_GROUP CONFIG_FMB_TIMER_GROUP
 
 #define MB_TIMER_IO_LED 0
 
diff --git a/components/freemodbus/sdkconfig.rename b/components/freemodbus/sdkconfig.rename
new file mode 100644 (file)
index 0000000..41e5dbe
--- /dev/null
@@ -0,0 +1,18 @@
+# sdkconfig replacement configurations for deprecated options formatted as
+# CONFIG_DEPRECATED_OPTION CONFIG_NEW_OPTION
+
+CONFIG_MB_MASTER_TIMEOUT_MS_RESPOND     CONFIG_FMB_MASTER_TIMEOUT_MS_RESPOND
+CONFIG_MB_MASTER_DELAY_MS_CONVERT       CONFIG_FMB_MASTER_DELAY_MS_CONVERT
+CONFIG_MB_QUEUE_LENGTH                  CONFIG_FMB_QUEUE_LENGTH
+CONFIG_MB_SERIAL_TASK_STACK_SIZE        CONFIG_FMB_SERIAL_TASK_STACK_SIZE
+CONFIG_MB_SERIAL_BUF_SIZE               CONFIG_FMB_SERIAL_BUF_SIZE
+CONFIG_MB_SERIAL_TASK_PRIO              CONFIG_FMB_SERIAL_TASK_PRIO
+CONFIG_MB_CONTROLLER_SLAVE_ID_SUPPORT   CONFIG_FMB_CONTROLLER_SLAVE_ID_SUPPORT
+CONFIG_MB_CONTROLLER_SLAVE_ID           CONFIG_FMB_CONTROLLER_SLAVE_ID
+CONFIG_MB_CONTROLLER_NOTIFY_TIMEOUT     CONFIG_FMB_CONTROLLER_NOTIFY_TIMEOUT
+CONFIG_MB_CONTROLLER_NOTIFY_QUEUE_SIZE  CONFIG_FMB_CONTROLLER_NOTIFY_QUEUE_SIZE
+CONFIG_MB_CONTROLLER_STACK_SIZE         CONFIG_FMB_CONTROLLER_STACK_SIZE
+CONFIG_MB_EVENT_QUEUE_TIMEOUT           CONFIG_FMB_EVENT_QUEUE_TIMEOUT
+CONFIG_MB_TIMER_PORT_ENABLED            CONFIG_FMB_TIMER_PORT_ENABLED
+CONFIG_MB_TIMER_GROUP                   CONFIG_FMB_TIMER_GROUP
+CONFIG_MB_TIMER_INDEX                   CONFIG_FMB_TIMER_INDEX
index c97b4c61c51570a6e4f78ef4f7fad045f305dd68..86e9616d0282c77285f22663f848f43009dc0268 100644 (file)
@@ -95,7 +95,7 @@ static esp_err_t mbc_serial_slave_start(void)
                          (eMBParity)mbs_opts->mbs_comm.parity);
     MB_SLAVE_CHECK((status == MB_ENOERR), ESP_ERR_INVALID_STATE,
             "mb stack initialization failure, eMBInit() returns (0x%x).", status);
-#ifdef CONFIG_MB_CONTROLLER_SLAVE_ID_SUPPORT
+#ifdef CONFIG_FMB_CONTROLLER_SLAVE_ID_SUPPORT
     status = eMBSetSlaveID(MB_SLAVE_ID_SHORT, TRUE, (UCHAR*)mb_slave_id, sizeof(mb_slave_id));
     MB_SLAVE_CHECK((status == MB_ENOERR), ESP_ERR_INVALID_STATE, "mb stack set slave ID failure.");
 #endif
index eb851e3fe6e5152485295a6b94cde4b08e7fa5cd..ef37ce77fb96359455e4eb10a50766671ff3db3d 100644 (file)
@@ -23,8 +23,8 @@
 #include "esp_modbus_common.h"      // for common defines
 
 /* ----------------------- Defines ------------------------------------------*/
-#define MB_CONTROLLER_NOTIFY_QUEUE_SIZE     (CONFIG_MB_CONTROLLER_NOTIFY_QUEUE_SIZE) // Number of messages in parameter notification queue
-#define MB_CONTROLLER_NOTIFY_TIMEOUT        (pdMS_TO_TICKS(CONFIG_MB_CONTROLLER_NOTIFY_TIMEOUT)) // notification timeout
+#define MB_CONTROLLER_NOTIFY_QUEUE_SIZE     (CONFIG_FMB_CONTROLLER_NOTIFY_QUEUE_SIZE) // Number of messages in parameter notification queue
+#define MB_CONTROLLER_NOTIFY_TIMEOUT        (pdMS_TO_TICKS(CONFIG_FMB_CONTROLLER_NOTIFY_TIMEOUT)) // notification timeout
 
 /*
  * @brief Initialize Modbus controller and stack
index 9898eacc4f5433f0ecb65af89e0d8023f7aea0b7..b9fb8cb990673156ac709fd8d39c938becd5c9f2 100644 (file)
@@ -66,7 +66,7 @@ The blocking call to function waits for event specified in the input parameter a
 
 .. doxygenfunction:: mbc_slave_get_param_info
 
-The function gets information about accessed parameters from modbus controller event queue. The KConfig 'CONFIG_MB_CONTROLLER_NOTIFY_QUEUE_SIZE' key can be used to configure the notification queue size. The timeout parameter allows to specify timeout for waiting notification. The :cpp:type:`mb_param_info_t` structure contain information about accessed parameter.
+The function gets information about accessed parameters from modbus controller event queue. The KConfig 'CONFIG_FMB_CONTROLLER_NOTIFY_QUEUE_SIZE' key can be used to configure the notification queue size. The timeout parameter allows to specify timeout for waiting notification. The :cpp:type:`mb_param_info_t` structure contain information about accessed parameter.
 
 
 Modbus serial master interface API overview
index 0be6a31c3db35257885251e890b26486f2fcb2d0..98e7ac19fe6114118898ae6fcc308185d2e035c6 100644 (file)
@@ -1,11 +1,11 @@
 #
 # Modbus configuration
 #
-CONFIG_MB_TIMER_PORT_ENABLED=y
-CONFIG_MB_TIMER_GROUP=0
-CONFIG_MB_TIMER_INDEX=0
-CONFIG_MB_MASTER_DELAY_MS_CONVERT=200
-CONFIG_MB_MASTER_TIMEOUT_MS_RESPOND=150
+CONFIG_FMB_TIMER_PORT_ENABLED=y
+CONFIG_FMB_TIMER_GROUP=0
+CONFIG_FMB_TIMER_INDEX=0
+CONFIG_FMB_MASTER_DELAY_MS_CONVERT=200
+CONFIG_FMB_MASTER_TIMEOUT_MS_RESPOND=150
 CONFIG_MB_UART_RXD=22
 CONFIG_MB_UART_TXD=23
-CONFIG_MB_UART_RTS=18
\ No newline at end of file
+CONFIG_MB_UART_RTS=18
index f174a74a1d7002dd55afcd4059db575a8eeab341..e79d7fa6244d7fe67eabb9eb1815857dfddfae77 100644 (file)
@@ -3,4 +3,4 @@
 #
 CONFIG_MB_UART_RXD=22
 CONFIG_MB_UART_TXD=23
-CONFIG_MB_UART_RTS=18
\ No newline at end of file
+CONFIG_MB_UART_RTS=18