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
This commit is contained in:
@@ -8,8 +8,6 @@
|
||||
|
||||
#include "esp_err.h"
|
||||
#include "esp_log.h"
|
||||
#include "esp_event_base.h"
|
||||
#include "esp_event.h"
|
||||
#include "esp_timer.h"
|
||||
#include "relay_chn_defs.h"
|
||||
#include "relay_chn_types.h"
|
||||
@@ -19,9 +17,6 @@
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/// Event base used by *_core, *_ctl, and *_tilt modules.
|
||||
ESP_EVENT_DECLARE_BASE(RELAY_CHN_CMD_EVENT);
|
||||
|
||||
/**
|
||||
* @brief Initializes the relay channel timer.
|
||||
*
|
||||
@@ -59,7 +54,7 @@ esp_err_t relay_chn_init_run_limit_timer(relay_chn_ctl_t *chn_ctl);
|
||||
void relay_chn_issue_cmd(relay_chn_ctl_t* chn_ctl, relay_chn_cmd_t cmd);
|
||||
|
||||
/**
|
||||
* @brief Dispatches a relay channel command to the event loop.
|
||||
* @brief Dispatches a relay channel command.
|
||||
*
|
||||
* @param chn_ctl Pointer to the relay channel control structure.
|
||||
* @param cmd The command to dispatch.
|
||||
@@ -118,11 +113,6 @@ char *relay_chn_state_str(relay_chn_state_t state);
|
||||
bool relay_chn_is_channel_id_valid(uint8_t chn_id);
|
||||
#endif // RELAY_CHN_COUNT > 1
|
||||
|
||||
#if RELAY_CHN_ENABLE_TILTING == 1
|
||||
/// Relay channel event loop handle declaration for *_tilt module.
|
||||
extern esp_event_loop_handle_t relay_chn_event_loop;
|
||||
#endif // RELAY_CHN_ENABLE_TILTING
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
Reference in New Issue
Block a user