The tilt sensitivity values were passed to the NVS module without
the boundaries being checked, even though the maximum
percent value is 100. This commit fixes this issue.
Also test cases are added to cover the upper boundary checks
for the tilt sensitivity settings.
Fixes #1086
- `TILT_STOP` command is prioritized in `relay_chn_tilt_issue_cmd()` because it should override any other tilt commands.
- The debug logs are cleaned up.
Fixes #1088
Refs #1085
Specific `_*all` and `_*all_with` functions were implemented to make
the API more concise and clean, and to replace the use of
`RELAY_CHN_ID_ALL`, which caused confusion within the API.
Refs #1085
Unnecessary `#if CONFIG_FOO == 1` checks were removed and the
statements were simplified to` #if CONFIG_FOO`.
`#ifdef CONFIG_FOO` statements were also changed to `#if CONFIG_FOO`
to keep the style as uniform as possible.
Refs #1085
The config parameter names defined in the relay_chn_defs.h file
have been changed back to their original names (with the CONFIG_ prefix),
so that they are not confused with application-level defines.
Refs #1085
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
- Optimized tilt counting data by reducing the tilt counter variables into one for smaller memory footprint. So the `relay_chn_tilt_counter_t` type is replaced by a single `uint16_t` variable in the `relay_chn_tilt_ctl_t` structure. Hence the `relay_chn_tilt_counter_t` type has been removed since it is not necessary anymore.
- Refactored tilt count handling in NVS: consolidate forward and reverse counts into a single tilt count parameter.
- Updated NVS test files that affected by the data type and function signature changes.
Fixes #1079
- 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.
The addition of a single-channel mode implied further modularisation of the component. This commit has broken the component down into the following modules to avoid a huge single source file and to make unit testing easier.
The modules:
- Separation of public and private code
- *types and *defs
- public relay_chn API
- *adapter
- *output
- *run_info
- *core
- *ctl (control)
- *tilt
Closes #957.