Add missing destroy function.
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.
This commit is contained in:
@@ -97,6 +97,13 @@ typedef void (*relay_chn_state_listener_t)(uint8_t chn_id, relay_chn_state_t old
|
||||
*/
|
||||
esp_err_t relay_chn_create(const gpio_num_t* gpio_map, uint8_t gpio_count);
|
||||
|
||||
/**
|
||||
* @brief Destroy the relay channels and free resources.
|
||||
*
|
||||
* This function cleans up the relay channels and releases any resources allocated during their creation.
|
||||
*/
|
||||
void relay_chn_destroy(void);
|
||||
|
||||
/**
|
||||
* @brief Register a channel state change listener.
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user