serial sync for 1397 too.

This commit is contained in:
Skot 2024-02-14 23:46:53 -05:00 committed by Georges Palauqui
parent c7b916c996
commit 9f040b2d95
No known key found for this signature in database
GPG Key ID: 1E45F544CE4D04A5

View File

@ -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)