Skip to content

Commit 73bc9ab

Browse files
committed
fix: increased UART Read Timeout
1 parent 368a7ef commit 73bc9ab

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/bus/uart/uart.c

+4-2
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,12 @@
22
#include "uart.h"
33
#include "../../helpers/delay.h"
44
#include "../../commands.h"
5+
#include "../../registers/system/watchdog.h"
56

67
/**********/
78
/* Macros */
89
/**********/
9-
#define UART_READ_TIMEOUT (FCY / 1000) // 1 ms
10+
#define UART_READ_TIMEOUT (FCY / 10UL) // 100 ms
1011

1112
/**************/
1213
/* Interrupts */
@@ -329,8 +330,9 @@ void UART_Initialize(const EUxSelect select) {
329330

330331
uint8_t UART_Read(const EUxSelect select) {
331332
// Wait for data to become available.
332-
uint16_t timeout = 0;
333+
uint32_t timeout = 0;
333334
while (timeout++ < UART_READ_TIMEOUT) {
335+
WATCHDOG_TimerClear();
334336
if (UART_IsRxReady(select)) {
335337
break;
336338
}

0 commit comments

Comments
 (0)