header: callbacks use "void *" as arguments

This commit is contained in:
Wu Jian Gang
2016-09-12 17:25:51 +08:00
parent c5f8396df4
commit c56a790f64
4 changed files with 7 additions and 8 deletions

View File

@@ -198,7 +198,7 @@ static void do_global_ctors(void) {
(*p)(); (*p)();
} }
extern esp_err_t app_main(); extern esp_err_t app_main(void *param);
void user_start_cpu0(void) { void user_start_cpu0(void) {
ets_setup_syscalls(); ets_setup_syscalls();
@@ -223,7 +223,7 @@ void user_start_cpu0(void) {
#include "esp_wifi.h" #include "esp_wifi.h"
esp_wifi_startup(app_main); esp_wifi_startup(app_main);
#else #else
app_main(); app_main(NULL);
#endif #endif
ets_printf("Starting scheduler on PRO CPU.\n"); ets_printf("Starting scheduler on PRO CPU.\n");

View File

@@ -108,12 +108,12 @@ typedef struct {
/** /**
* @brief Application specified event callback function * @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 ESP_OK : succeed
* @return others : fail * @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 * @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 * @param system_event_cb_t cb : callback
* *
* @return ESP_OK : succeed * @return system_event_cb_t : old callback
* @return others : fail
*/ */
system_event_cb_t esp_event_set_cb(system_event_cb_t cb); system_event_cb_t esp_event_set_cb(system_event_cb_t cb);

View File

@@ -153,7 +153,7 @@ typedef enum {
* @return ESP_OK : succeed * @return ESP_OK : succeed
* @return others : fail * @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); void esp_wifi_startup(wifi_startup_cb_t cb);
typedef struct { typedef struct {

View File

@@ -54,7 +54,7 @@ static void esp_wifi_task(void *pvParameters)
} }
if (startup_cb) { if (startup_cb) {
err = (*startup_cb)(); err = (*startup_cb)(NULL);
if (err != ESP_OK) { if (err != ESP_OK) {
WIFI_DEBUG("startup_cb fail, ret=%d\n", err); WIFI_DEBUG("startup_cb fail, ret=%d\n", err);
break; break;