mirror of
https://github.com/espressif/esp-idf.git
synced 2025-10-03 12:07:52 +00:00
esp_netif: example init code fixed to assert only variables, not
function calls so it won't be skipped if compiled without asserts
This commit is contained in:
@@ -47,8 +47,10 @@ static void initialise_wifi(void)
|
||||
esp_netif_init();
|
||||
wifi_event_group = xEventGroupCreate();
|
||||
ESP_ERROR_CHECK(esp_event_loop_create_default());
|
||||
assert(esp_netif_create_default_wifi_ap());
|
||||
assert(esp_netif_create_default_wifi_sta());
|
||||
esp_netif_t *ap_netif = esp_netif_create_default_wifi_ap();
|
||||
assert(ap_netif);
|
||||
esp_netif_t *sta_netif = esp_netif_create_default_wifi_sta();
|
||||
assert(sta_netif);
|
||||
wifi_init_config_t cfg = WIFI_INIT_CONFIG_DEFAULT();
|
||||
ESP_ERROR_CHECK( esp_wifi_init(&cfg) );
|
||||
ESP_ERROR_CHECK( esp_event_handler_register(WIFI_EVENT, WIFI_EVENT_STA_DISCONNECTED, &event_handler, NULL) );
|
||||
|
Reference in New Issue
Block a user