From 8230b31cd13ce2e89df0993a94fed92830c9fc3d Mon Sep 17 00:00:00 2001 From: Georges Palauqui Date: Mon, 10 Jun 2024 11:32:28 +0200 Subject: [PATCH] fix 2.1.8 hotfix for Hex --- main/main.c | 22 ++++++++++------------ 1 file changed, 10 insertions(+), 12 deletions(-) diff --git a/main/main.c b/main/main.c index 1921c905..02caf18a 100644 --- a/main/main.c +++ b/main/main.c @@ -118,7 +118,16 @@ void app_main(void) } xTaskCreate(SYSTEM_task, "SYSTEM_task", 4096, (void *) &GLOBAL_STATE, 3, NULL); - xTaskCreate(POWER_MANAGEMENT_task, "power mangement", 8192, (void *) &GLOBAL_STATE, 10, NULL); + if (GLOBAL_STATE.board_version >= 300 && GLOBAL_STATE.board_version < 400) { + // this is a HEX board + ESP_LOGI(TAG, "Starting HEX power management"); + vTaskDelay(2000 / portTICK_PERIOD_MS); + xTaskCreate(POWER_MANAGEMENT_HEX_task, "power mangement", 8192, (void *) &GLOBAL_STATE, 10, NULL); + } else { + // this is NOT a HEX board + ESP_LOGI(TAG, "Starting BITAXE power management"); + xTaskCreate(POWER_MANAGEMENT_task, "power mangement", 8192, (void *) &GLOBAL_STATE, 10, NULL); + } ESP_LOGI(TAG, "Welcome to the bitaxe!"); // pull the wifi credentials and hostname out of NVS @@ -165,17 +174,6 @@ void app_main(void) xTaskCreate(USER_INPUT_task, "user input", 8192, (void *) &GLOBAL_STATE, 5, NULL); - if (GLOBAL_STATE.board_version >= 300 && GLOBAL_STATE.board_version < 400) { - // this is a HEX board - ESP_LOGI(TAG, "Starting HEX power management"); - vTaskDelay(2000 / portTICK_PERIOD_MS); - xTaskCreate(POWER_MANAGEMENT_HEX_task, "power mangement", 8192, (void *) &GLOBAL_STATE, 10, NULL); - } else { - // this is NOT a HEX board - ESP_LOGI(TAG, "Starting BITAXE power management"); - xTaskCreate(POWER_MANAGEMENT_task, "power mangement", 8192, (void *) &GLOBAL_STATE, 10, NULL); - } - ESP_LOGI(TAG, "Starting init functions"); if (GLOBAL_STATE.ASIC_functions.init_fn != NULL) { wifi_softap_off();