From e355057de63fdf5e8fbfba51c688f18beec3490e Mon Sep 17 00:00:00 2001 From: Johny Mattsson Date: Thu, 29 Sep 2016 18:21:18 +1000 Subject: [PATCH] Fix our esp_event_send() implementation. --- components/base_nodemcu/include/nodemcu_esp_event.h | 2 +- components/base_nodemcu/user_main.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) 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);