mirror of
https://github.com/skot/ESP-Miner.git
synced 2025-03-17 13:22:53 +01:00
serial sync for 1397 too.
This commit is contained in:
parent
c7b916c996
commit
9f040b2d95
@ -390,28 +390,29 @@ void BM1397_send_work(void *pvParameters, bm_job *next_bm_job)
|
||||
asic_result *BM1397_receive_work(void)
|
||||
{
|
||||
|
||||
// wait for a response, wait time is pretty arbitrary
|
||||
int received = SERIAL_rx(asic_response_buffer, 9, 60000);
|
||||
// // wait for a response, wait time is pretty arbitrary
|
||||
// int received = SERIAL_rx(asic_response_buffer, 9, 60000);
|
||||
|
||||
if (received < 0)
|
||||
{
|
||||
ESP_LOGI(TAG, "Error in serial RX");
|
||||
return NULL;
|
||||
}
|
||||
else if (received == 0)
|
||||
{
|
||||
// Didn't find a solution, restart and try again
|
||||
return NULL;
|
||||
}
|
||||
// if (received < 0)
|
||||
// {
|
||||
// ESP_LOGI(TAG, "Error in serial RX");
|
||||
// return NULL;
|
||||
// }
|
||||
// else if (received == 0)
|
||||
// {
|
||||
// // Didn't find a solution, restart and try again
|
||||
// return NULL;
|
||||
// }
|
||||
|
||||
if (received != 9 || asic_response_buffer[0] != 0xAA || asic_response_buffer[1] != 0x55)
|
||||
{
|
||||
ESP_LOGI(TAG, "Serial RX invalid %i", received);
|
||||
ESP_LOG_BUFFER_HEX(TAG, asic_response_buffer, received);
|
||||
return NULL;
|
||||
}
|
||||
// if (received != 9 || asic_response_buffer[0] != 0xAA || asic_response_buffer[1] != 0x55)
|
||||
// {
|
||||
// ESP_LOGI(TAG, "Serial RX invalid %i", received);
|
||||
// ESP_LOG_BUFFER_HEX(TAG, asic_response_buffer, received);
|
||||
// return NULL;
|
||||
// }
|
||||
|
||||
return (asic_result *)asic_response_buffer;
|
||||
// return (asic_result *)asic_response_buffer;
|
||||
return SERIAL_rx_aa55(asic_response_buffer, 9);
|
||||
}
|
||||
|
||||
task_result *BM1397_proccess_work(void *pvParameters)
|
||||
|
Loading…
x
Reference in New Issue
Block a user