-
Notifications
You must be signed in to change notification settings - Fork 249
Clean up duplicate ASIC reset code #986
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Build was fine in vscode, not sure why it's failing on GitHub
@@ -20,12 +20,6 @@ | |||
#define BM1366_CHIP_ID 0x1366 | |||
#define BM1366_CHIP_ID_RESPONSE_LENGTH 11 | |||
|
|||
#ifdef CONFIG_GPIO_ASIC_RESET |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This probably never worked, CONFIG_GPIO_ASIC_RESET
was undefined here.
@@ -102,6 +103,12 @@ void app_main(void) | |||
queue_init(&GLOBAL_STATE.stratum_queue); | |||
queue_init(&GLOBAL_STATE.ASIC_jobs_queue); | |||
|
|||
if (asic_reset() != ESP_OK) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Subtle change here, needs some testing. The asic is now reset before the serial port is initialised.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will do some testing on this
* Unify ASIC reset code * Add missing include Build was fine in vscode, not sure why it's failing on GitHub * Move asic_reset into separate file
Before the initialisation of the ASIC, it's reset. This code is the same for all models, and arguably doesn't belong in the ASIC module. Code is extracted into it's own class and re-used in main and self-test.