Skip to content
This repository has been archived by the owner on Aug 8, 2024. It is now read-only.

Commit

Permalink
issue skot#100 resolved - ASIC not always starting/hashing after boot…
Browse files Browse the repository at this point in the history
… (due to race condition) (skot#152)

* fix ASIC not starting - order is important

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

This reverts commit c313a6f.

* better approach resolving race condition in serial communication; moving serial from ASIC_task / ASIC_result_task to app_main()
  • Loading branch information
MoellerDi authored May 24, 2024
1 parent c9ecc00 commit f72bcda
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 5 deletions.
2 changes: 2 additions & 0 deletions main/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
1 change: 0 additions & 1 deletion main/tasks/asic_result_task.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down
4 changes: 0 additions & 4 deletions main/tasks/asic_task.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit f72bcda

Please sign in to comment.