We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 368a7ef commit 73bc9abCopy full SHA for 73bc9ab
src/bus/uart/uart.c
@@ -2,11 +2,12 @@
2
#include "uart.h"
3
#include "../../helpers/delay.h"
4
#include "../../commands.h"
5
+#include "../../registers/system/watchdog.h"
6
7
/**********/
8
/* Macros */
9
-#define UART_READ_TIMEOUT (FCY / 1000) // 1 ms
10
+#define UART_READ_TIMEOUT (FCY / 10UL) // 100 ms
11
12
/**************/
13
/* Interrupts */
@@ -329,8 +330,9 @@ void UART_Initialize(const EUxSelect select) {
329
330
331
uint8_t UART_Read(const EUxSelect select) {
332
// Wait for data to become available.
- uint16_t timeout = 0;
333
+ uint32_t timeout = 0;
334
while (timeout++ < UART_READ_TIMEOUT) {
335
+ WATCHDOG_TimerClear();
336
if (UART_IsRxReady(select)) {
337
break;
338
}
0 commit comments