mirror of
https://github.com/skot/ESP-Miner.git
synced 2025-03-26 17:51:45 +01:00
serial hack/fix
This commit is contained in:
parent
06e05b5623
commit
8d4d66f608
@ -649,7 +649,7 @@ void BM1366_send_work(void * pvParameters, bm_job * next_bm_job)
|
||||
asic_result * BM1366_receive_work(void)
|
||||
{
|
||||
// wait for a response, wait time is pretty arbitrary
|
||||
int received = SERIAL_rx(asic_response_buffer, 11, 60000);
|
||||
int received = SERIAL_rx(asic_response_buffer, 11, 20);
|
||||
|
||||
if (received < 0) {
|
||||
ESP_LOGI(TAG, "Error in serial RX");
|
||||
|
@ -60,10 +60,11 @@ int SERIAL_send(uint8_t *data, int len, bool debug)
|
||||
return uart_write_bytes(UART_NUM_1, (const char *)data, len);
|
||||
}
|
||||
|
||||
/// @brief waits for a serial response from the device
|
||||
/// @param buf buffer to read data into
|
||||
/// @param buf number of ms to wait before timing out
|
||||
/// @return number of bytes read, or -1 on error
|
||||
/// @brief reads serial bytes into a buffer
|
||||
/// @param buf
|
||||
/// @param size
|
||||
/// @param timeout_ms
|
||||
/// @return
|
||||
int16_t SERIAL_rx(uint8_t *buf, uint16_t size, uint16_t timeout_ms)
|
||||
{
|
||||
int16_t bytes_read = uart_read_bytes(UART_NUM_1, buf, size, timeout_ms / portTICK_PERIOD_MS);
|
||||
|
Loading…
x
Reference in New Issue
Block a user