Merge branch 'bugfix/freemodbus_revert_uart_isr_in_ram_by_default' into 'master'

freemodbus: fix issue with CONFIG_UART_ISR_IN_IRAM set by default

See merge request espressif/esp-idf!6655
This commit is contained in:
Ivan Grokhotkov 2019-11-12 22:16:56 +08:00
commit eca812249b
5 changed files with 14 additions and 7 deletions

View File

@ -122,14 +122,16 @@ menu "Modbus configuration"
help help
Modbus Timer Index in the group that is used for timeout measurement. Modbus Timer Index in the group that is used for timeout measurement.
config FMB_ISR_IN_IRAM config FMB_TIMER_ISR_IN_IRAM
bool "Place interrupt handlers into IRAM" bool "Place timer interrupt handler into IRAM"
default y default n
select UART_ISR_IN_IRAM select UART_ISR_IN_IRAM
help help
This option places Modbus IRQ handlers into IRAM. This option places Modbus timer IRQ handler into IRAM.
This allows to avoid delays related to processing of non-IRAM-safe interrupts This allows to avoid delays related to processing of non-IRAM-safe interrupts
during a flash write operation (NVS updating a value, or some other during a flash write operation (NVS updating a value, or some other
flash API which has to perform an read/write operation and disable CPU cache). flash API which has to perform an read/write operation and disable CPU cache).
This option has dependency with the UART_ISR_IN_IRAM option which places UART interrupt
handler into IRAM to prevent delays related to processing of UART events.
endmenu endmenu

View File

@ -130,8 +130,8 @@ PR_BEGIN_EXTERN_C
/*! \brief If the <em>Read/Write Multiple Registers</em> function should be enabled. */ /*! \brief If the <em>Read/Write Multiple Registers</em> function should be enabled. */
#define MB_FUNC_READWRITE_HOLDING_ENABLED ( 1 ) #define MB_FUNC_READWRITE_HOLDING_ENABLED ( 1 )
/*! \brief Check the option to place handlers into IRAM */ /*! \brief Check the option to place timer handler into IRAM */
#define MB_ISR_IN_IRAM ( CONFIG_FMB_ISR_IN_IRAM ) #define MB_PORT_TIMER_ISR_IN_IRAM ( CONFIG_FMB_TIMER_ISR_IN_IRAM )
/*! @} */ /*! @} */
#ifdef __cplusplus #ifdef __cplusplus

View File

@ -43,7 +43,7 @@ PR_BEGIN_EXTERN_C
#define MB_PORT_SERIAL_ISR_FLAG ESP_INTR_FLAG_LOWMED #define MB_PORT_SERIAL_ISR_FLAG ESP_INTR_FLAG_LOWMED
#endif #endif
#if MB_ISR_IN_IRAM #if MB_PORT_TIMER_ISR_IN_IRAM
#define MB_PORT_ISR_ATTR IRAM_ATTR #define MB_PORT_ISR_ATTR IRAM_ATTR
#define MB_PORT_TIMER_ISR_FLAG ESP_INTR_FLAG_IRAM #define MB_PORT_TIMER_ISR_FLAG ESP_INTR_FLAG_IRAM
#else #else

View File

@ -4,6 +4,7 @@
CONFIG_FMB_TIMER_PORT_ENABLED=y CONFIG_FMB_TIMER_PORT_ENABLED=y
CONFIG_FMB_TIMER_GROUP=0 CONFIG_FMB_TIMER_GROUP=0
CONFIG_FMB_TIMER_INDEX=0 CONFIG_FMB_TIMER_INDEX=0
CONFIG_FMB_TIMER_ISR_IN_IRAM=y
CONFIG_FMB_MASTER_DELAY_MS_CONVERT=200 CONFIG_FMB_MASTER_DELAY_MS_CONVERT=200
CONFIG_FMB_MASTER_TIMEOUT_MS_RESPOND=150 CONFIG_FMB_MASTER_TIMEOUT_MS_RESPOND=150
CONFIG_MB_UART_RXD=22 CONFIG_MB_UART_RXD=22

View File

@ -4,3 +4,7 @@
CONFIG_MB_UART_RXD=22 CONFIG_MB_UART_RXD=22
CONFIG_MB_UART_TXD=23 CONFIG_MB_UART_TXD=23
CONFIG_MB_UART_RTS=18 CONFIG_MB_UART_RTS=18
CONFIG_FMB_TIMER_PORT_ENABLED=y
CONFIG_FMB_TIMER_GROUP=0
CONFIG_FMB_TIMER_INDEX=0
CONFIG_FMB_TIMER_ISR_IN_IRAM=y