From c56a790f64b84d04b9e5dfec6d0f667f51bbaf8a Mon Sep 17 00:00:00 2001 From: Wu Jian Gang Date: Mon, 12 Sep 2016 17:25:51 +0800 Subject: [PATCH] header: callbacks use "void *" as arguments --- components/esp32/cpu_start.c | 4 ++-- components/esp32/include/esp_event.h | 7 +++---- components/esp32/include/esp_wifi.h | 2 +- components/esp32/wifi.c | 2 +- 4 files changed, 7 insertions(+), 8 deletions(-) diff --git a/components/esp32/cpu_start.c b/components/esp32/cpu_start.c index e66ed10cb5..ec032c580b 100644 --- a/components/esp32/cpu_start.c +++ b/components/esp32/cpu_start.c @@ -198,7 +198,7 @@ static void do_global_ctors(void) { (*p)(); } -extern esp_err_t app_main(); +extern esp_err_t app_main(void *param); void user_start_cpu0(void) { ets_setup_syscalls(); @@ -223,7 +223,7 @@ void user_start_cpu0(void) { #include "esp_wifi.h" esp_wifi_startup(app_main); #else - app_main(); + app_main(NULL); #endif ets_printf("Starting scheduler on PRO CPU.\n"); diff --git a/components/esp32/include/esp_event.h b/components/esp32/include/esp_event.h index 145bea5913..b35d46e484 100644 --- a/components/esp32/include/esp_event.h +++ b/components/esp32/include/esp_event.h @@ -108,12 +108,12 @@ typedef struct { /** * @brief Application specified event callback function * - * @param system_event_t *event : event type defined in this file + * @param void *param : parameter passed to callback function * * @return ESP_OK : succeed * @return others : fail */ -typedef esp_err_t (*system_event_cb_t)(system_event_t *event); +typedef esp_err_t (*system_event_cb_t)(void *param); /** * @brief Set application specified event callback function @@ -123,8 +123,7 @@ typedef esp_err_t (*system_event_cb_t)(system_event_t *event); * * @param system_event_cb_t cb : callback * - * @return ESP_OK : succeed - * @return others : fail + * @return system_event_cb_t : old callback */ system_event_cb_t esp_event_set_cb(system_event_cb_t cb); diff --git a/components/esp32/include/esp_wifi.h b/components/esp32/include/esp_wifi.h index cb7df6dcca..8c127a1ff4 100644 --- a/components/esp32/include/esp_wifi.h +++ b/components/esp32/include/esp_wifi.h @@ -153,7 +153,7 @@ typedef enum { * @return ESP_OK : succeed * @return others : fail */ -typedef esp_err_t (* wifi_startup_cb_t)(void); +typedef esp_err_t (* wifi_startup_cb_t)(void *param); void esp_wifi_startup(wifi_startup_cb_t cb); typedef struct { diff --git a/components/esp32/wifi.c b/components/esp32/wifi.c index 5ac3c990b8..8a2a09376d 100644 --- a/components/esp32/wifi.c +++ b/components/esp32/wifi.c @@ -54,7 +54,7 @@ static void esp_wifi_task(void *pvParameters) } if (startup_cb) { - err = (*startup_cb)(); + err = (*startup_cb)(NULL); if (err != ESP_OK) { WIFI_DEBUG("startup_cb fail, ret=%d\n", err); break;