Added tests for covering initialization error handling cases like; NULL pointer, invalid GPIO count etc.
This changed implied removing the `relay_chn_create` from the Unity's `setUp` function and place it in each testcase.
Refs #1050, #1030.
- Replaced the buggy, oldschool, plain pointer based list approach with more robust FreeRTOS linked list implementation for the listener API. Fixes #1049.
- Added relevant test cases. Refs #1030.
The component allocates resources (timers, event loop) in relay_chn_create but never frees them. This is a resource leak.
Hence, a destroy function added to free the resources gracefully.
Fixes #1048.
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.
This commit adds reverse tilting capability using tilt counters.
Normally tilting action is based on the last run command of the channel
and reverse tilting was not possible before this implementation.
Reverse tilting means when TILT_REVERSE command is issued while the
last run was forward. In this case the channel will not tilt unless it has tilted
forward (TILT_FORWARD) before. If the channel has tilted forward before,
the forward tilt is counted. This tilt count is the limit for reverse tilting.
So when reverse tilting, the channel automatically will issue the TILT_STOP
command as soon as the tilt count value has reached.
Improves the code structure by reorganizing functions, minimizing
the interaction with the relay channel driving API and independizing
the tilting codes as much as possible from the plain channel driving
API for more reliable operation.
With this change the tilting API;
* has its own events and event handler
* does not depend on the channel's state change listener
* does not interfere with channel driver API
* has its own tilt command issuing logic
* has its own timing management
"relay_chn_tilt_sensitivity_set" and "relay_chn_tilt_sensitivity_get"
functions wasn't capable of dealing with "RELAY_CHN_ID_ALL"
channel ID. Hence it was causing load access system errors. This
commit fixes this bug and matures the sensitivity setter and getter.
* Add tilt feature.
* Fix the following bugs:
* warning: comparison is always true due to limited range of data type.
* Remove unnecessary esp_timer checks.
* The scheduled FREE command disrupts the current command.
* Fatal pin mapping issue.
* Make code optimizations and improvements:
* Optimize event loop queue size depending on channel count.
* Change the channels' starting state to FREE.
* Remove the unnecessary relay_chn_invalidate_inertia_timer function.
* Change the relay_chn_start_inertia_timer function as relay_chn_start_esp_timer_once and modify the function so that it be a generic esp timer start function.
* Optimize the if statement that checks the last run cmd in the relay_chn_execute_stop.