issue #100 resolved - ASIC not always starting/hashing after boot (due to race condition) (#152)

* fix ASIC not starting - order is important

* Revert "fix ASIC not starting - order is important"

This reverts commit c313a6f3e7a54e02a6b43315f641c44fcab051d2.

* better approach resolving race condition in serial communication; moving serial from ASIC_task / ASIC_result_task to app_main()
This commit is contained in:
MoellerDi 2024-05-24 05:18:44 +02:00 committed by GitHub
parent afd4a30985
commit ec4af81479
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 2 additions and 5 deletions

View File

@ -138,6 +138,8 @@ void app_main(void)
SERIAL_init();
(*GLOBAL_STATE.ASIC_functions.init_fn)(GLOBAL_STATE.POWER_MANAGEMENT_MODULE.frequency_value);
SERIAL_set_baud((*GLOBAL_STATE.ASIC_functions.set_max_baud_fn)());
SERIAL_clear_buffer();
xTaskCreate(stratum_task, "stratum admin", 8192, (void *) &GLOBAL_STATE, 5, NULL);
xTaskCreate(create_jobs_task, "stratum miner", 8192, (void *) &GLOBAL_STATE, 10, NULL);

View File

@ -12,7 +12,6 @@ const char *TAG = "asic_result";
void ASIC_result_task(void *pvParameters)
{
GlobalState *GLOBAL_STATE = (GlobalState *)pvParameters;
SERIAL_clear_buffer();
char *user = nvs_config_get_string(NVS_CONFIG_STRATUM_USER, STRATUM_USER);

View File

@ -25,10 +25,6 @@ void ASIC_task(void *pvParameters)
GLOBAL_STATE->valid_jobs[i] = 0;
}
int baud = (*GLOBAL_STATE->ASIC_functions.set_max_baud_fn)();
vTaskDelay(10 / portTICK_PERIOD_MS);
SERIAL_set_baud(baud);
SYSTEM_notify_mining_started(&GLOBAL_STATE->SYSTEM_MODULE);
ESP_LOGI(TAG, "ASIC Ready!");
while (1)