forked from espressif/esp-idf
header: callbacks use "void *" as arguments
This commit is contained in:
@@ -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");
|
||||||
|
@@ -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);
|
||||||
|
|
||||||
|
@@ -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 {
|
||||||
|
@@ -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;
|
||||||
|
Reference in New Issue
Block a user