freemodbus: configure timer handler placement

place timer interrupt handler into flash by default;
add default settings for timer and UART interrupts to place them into IRAM into example defaults;
CONFIG_FMB_TIMER_PORT_ENABLED default = n, when enabled, the UART_ISR_IN_IRAM set to y


* Original commit: espressif/esp-idf@cfdd5f0ef7
This commit is contained in:
Alex Lisitsyn
2019-11-12 22:16:55 +08:00
committed by aleks
parent 64eb1b79e8
commit 236d1dcfa4
3 changed files with 9 additions and 7 deletions

View File

@@ -122,14 +122,16 @@ menu "Modbus configuration"
help
Modbus Timer Index in the group that is used for timeout measurement.
config FMB_ISR_IN_IRAM
bool "Place interrupt handlers into IRAM"
default y
config FMB_TIMER_ISR_IN_IRAM
bool "Place timer interrupt handler into IRAM"
default n
select UART_ISR_IN_IRAM
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
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).
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

View File

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

View File

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