- Introduced a new notification module to handle state change listeners. - Added functions to register and unregister listeners for relay channel state changes. - Implemented a queue-based system to manage notifications and listener callbacks. - Updated core relay channel logic to utilize the new notification system. - Removed old listener management code from relay channel core. - Refactored the former listener tests to notify tests and added tests for the notification system, including handling of multiple listeners and queue overflow scenarios. - Updated CMakeLists.txt to include new source files and headers for the notification module. - Revised README.md to include warnings about callback execution context and performance considerations. Refs #1096, #1085 and closes #1097
28 lines
741 B
CMake
28 lines
741 B
CMake
set(include_dirs "include")
|
|
set(priv_include_dirs "private_include")
|
|
|
|
set(srcs "src/relay_chn_core.c"
|
|
"src/relay_chn_output.c"
|
|
"src/relay_chn_run_info.c"
|
|
"src/relay_chn_notify.c")
|
|
|
|
if(CONFIG_RELAY_CHN_ENABLE_TILTING)
|
|
list(APPEND srcs "src/relay_chn_tilt.c")
|
|
endif()
|
|
|
|
if(CONFIG_RELAY_CHN_COUNT GREATER 1)
|
|
list(APPEND srcs "src/relay_chn_ctl_multi.c")
|
|
else()
|
|
list(APPEND srcs "src/relay_chn_ctl_single.c")
|
|
endif()
|
|
|
|
if(CONFIG_RELAY_CHN_NVS)
|
|
list(APPEND srcs "src/relay_chn_nvs.c")
|
|
endif()
|
|
|
|
|
|
idf_component_register(SRCS ${srcs}
|
|
INCLUDE_DIRS ${include_dirs}
|
|
PRIV_INCLUDE_DIRS ${priv_include_dirs}
|
|
REQUIRES driver esp_timer nvs_flash)
|