diff --git a/components/base_nodemcu/include/nodemcu_esp_event.h b/components/base_nodemcu/include/nodemcu_esp_event.h index d860e597..2a2f2184 100644 --- a/components/base_nodemcu/include/nodemcu_esp_event.h +++ b/components/base_nodemcu/include/nodemcu_esp_event.h @@ -63,7 +63,7 @@ typedef struct { nodemcu_esp_event_cb callback; } 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) \ static const LOCK_IN_SECTION(".esp_event_cb_table") \ diff --git a/components/base_nodemcu/user_main.c b/components/base_nodemcu/user_main.c index 0549ba32..50fd910f 100644 --- a/components/base_nodemcu/user_main.c +++ b/components/base_nodemcu/user_main.c @@ -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); 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) evregs->callback (&evt);