Fix our esp_event_send() implementation.
This commit is contained in:
parent
f9bf50cf03
commit
e355057de6
|
@ -63,7 +63,7 @@ typedef struct {
|
||||||
nodemcu_esp_event_cb callback;
|
nodemcu_esp_event_cb callback;
|
||||||
} nodemcu_esp_event_reg_t;
|
} nodemcu_esp_event_reg_t;
|
||||||
|
|
||||||
extern nodemcu_esp_event_reg_t *esp_event_cb_table;
|
extern nodemcu_esp_event_reg_t esp_event_cb_table;
|
||||||
|
|
||||||
#define NODEMCU_ESP_EVENT(evcode, func) \
|
#define NODEMCU_ESP_EVENT(evcode, func) \
|
||||||
static const LOCK_IN_SECTION(".esp_event_cb_table") \
|
static const LOCK_IN_SECTION(".esp_event_cb_table") \
|
||||||
|
|
|
@ -73,7 +73,7 @@ static void handle_esp_event (task_param_t param, task_prio_t prio)
|
||||||
NODE_ERR("default event handler failed for %d", evt.event_id);
|
NODE_ERR("default event handler failed for %d", evt.event_id);
|
||||||
|
|
||||||
nodemcu_esp_event_reg_t *evregs;
|
nodemcu_esp_event_reg_t *evregs;
|
||||||
for (evregs = esp_event_cb_table; evregs->callback; ++evregs)
|
for (evregs = &esp_event_cb_table; evregs->callback; ++evregs)
|
||||||
{
|
{
|
||||||
if (evregs->event_id == evt.event_id)
|
if (evregs->event_id == evt.event_id)
|
||||||
evregs->callback (&evt);
|
evregs->callback (&evt);
|
||||||
|
|
Loading…
Reference in New Issue