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:
David Cermak
2019-10-17 11:36:34 +02:00
parent 20add7da60
commit 6e0d274f58
10 changed files with 26 additions and 13 deletions

View File

@@ -129,8 +129,10 @@ void initialise_wifi(void)
esp_netif_init();
wifi_event_group = xEventGroupCreate();
ESP_ERROR_CHECK(esp_event_loop_create_default());
assert(sta_netif = esp_netif_create_default_wifi_sta());
assert(ap_netif = esp_netif_create_default_wifi_ap());
esp_netif_t *sta_netif = esp_netif_create_default_wifi_sta();
assert(sta_netif);
esp_netif_t *ap_netif = esp_netif_create_default_wifi_ap();
assert(ap_netif);
ESP_ERROR_CHECK(esp_event_handler_register(WIFI_EVENT, ESP_EVENT_ANY_ID, &wifi_event_handler, NULL));
ESP_ERROR_CHECK(esp_event_handler_register(IP_EVENT, IP_EVENT_STA_GOT_IP, &ip_event_handler, NULL));