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

@@ -68,7 +68,8 @@ void wifi_init_sta(void)
esp_netif_init();
ESP_ERROR_CHECK(esp_event_loop_create_default());
assert(esp_netif_create_default_wifi_sta());
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));