Commit Graph

8 Commits

Author SHA1 Message Date
5e8e5a4cab Add notification system for relay channel state changes
- 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
2025-09-02 15:46:48 +03:00
7a0f9b1420 Optimize timer callbacks
It turned out that esp_event was adding extra complexity to the code base and it was completely unnecessary. So it has been removed from the component completely. The actions are now executed directly in the `relay_chn_distpacth_cmd()` and `relay_chn_tilt_dispatch_cmd()` functions.
This change has simplified the component as well as reduced the memory footprint.

Fixes #1084, refs #1083
2025-08-22 17:41:08 +03:00
b19f0c553b Add NVS support for relay channel config persistence
- Introduced NVS configuration options in Kconfig.
- Implemented NVS initialization and deinitialization in relay_chn_core.
- Added functions for storing and retrieving relay channel direction and tilt sensitivity in NVS.
- Updated relay_chn_tilt and relay_chn_output to utilize NVS for state management.
- Created relay_chn_nvs.c and relay_chn_nvs.h for NVS-related functionalities.

Closes #1074.
2025-08-19 17:33:45 +03:00
9f1134763e Refactor and update the relay_chn component.
Refactor relay channel component to support single and multi-channel modes; update CMake configuration and enhance API documentation.
2025-08-13 18:36:48 +03:00
5a38956146 Restructure the project tree.
Restructured the project tree to align with Espressif's project tree pattern and practice. Also updated the affected cmake files.

Fixes: #1033
2025-07-07 22:57:02 +03:00
41c292cc89 Restructure the project tree for unit testing
Restructure the whole project tree so that the component can be unit tested. Also update some cmake files to update the modified paths, update test cases etc.
2025-07-04 00:38:57 +03:00
b47244b5d1 Move relay_chn.c into src directory. 2025-02-11 14:40:37 +03:00
d3fb1e6620 Add source files. 2025-02-11 12:28:32 +03:00