From 59cba9a9fdd873bba23a9ad3547091860c4dcd28 Mon Sep 17 00:00:00 2001 From: Erik Olof Gunnar Andersson Date: Tue, 8 Oct 2024 17:11:14 +0200 Subject: [PATCH] Configure wifi before system init --- main/main.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/main/main.c b/main/main.c index b36216c1..0d6e5159 100644 --- a/main/main.c +++ b/main/main.c @@ -153,11 +153,6 @@ void app_main(void) vTaskDelay(60 * 60 * 1000 / portTICK_PERIOD_MS); } - SYSTEM_init_system(&GLOBAL_STATE); - - xTaskCreate(SYSTEM_task, "SYSTEM_task", 4096, (void *) &GLOBAL_STATE, 3, NULL); - xTaskCreate(POWER_MANAGEMENT_task, "power mangement", 8192, (void *) &GLOBAL_STATE, 10, NULL); - // pull the wifi credentials and hostname out of NVS char * wifi_ssid = nvs_config_get_string(NVS_CONFIG_WIFI_SSID, WIFI_SSID); char * wifi_pass = nvs_config_get_string(NVS_CONFIG_WIFI_PASS, WIFI_PASS); @@ -200,6 +195,11 @@ void app_main(void) free(wifi_pass); free(hostname); + SYSTEM_init_system(&GLOBAL_STATE); + + xTaskCreate(SYSTEM_task, "SYSTEM_task", 4096, (void *) &GLOBAL_STATE, 3, NULL); + xTaskCreate(POWER_MANAGEMENT_task, "power mangement", 8192, (void *) &GLOBAL_STATE, 10, NULL); + // set the startup_done flag GLOBAL_STATE.SYSTEM_MODULE.startup_done = true; GLOBAL_STATE.new_stratum_version_rolling_msg = false;