move core wifi init stuff to _start

This commit is contained in:
Morgan Allen 2018-09-21 23:21:02 -07:00
parent ad29c7077e
commit c4913a64f7
1 changed files with 2 additions and 2 deletions

View File

@ -102,8 +102,6 @@ uint8_t wifi_manager_add_ap(char *ssid, char *password) {
};
void wifi_manager_connect() {
wifi_init_config_t cfg = WIFI_INIT_CONFIG_DEFAULT();
ESP_ERROR_CHECK(esp_wifi_init(&cfg));
wifi_config_t wifi_config = {
.sta = {
}
@ -212,6 +210,8 @@ EventGroupHandle_t wifi_manager_start() {
tcpip_adapter_init();
ESP_ERROR_CHECK(esp_event_loop_init(wifi_event_handler, NULL) );
wifi_init_config_t cfg = WIFI_INIT_CONFIG_DEFAULT();
ESP_ERROR_CHECK(esp_wifi_init(&cfg));
xTaskCreate(&wifi_manager_main_loop, "wm_main_loop", 4096, NULL, 6, NULL);