8000 Prevent possible endless loop in Uart::write/Serial::print · h2zero/n-able-Arduino@6264e83 · GitHub
[go: up one dir, main page]

Skip to content

Commit 6264e83

Browse files
committed
Prevent possible endless loop in Uart::write/Serial::print
1 parent c3d85f6 commit 6264e83

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

cores/nRF5/Uart.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -237,12 +237,12 @@ size_t Uart::write(const uint8_t data)
237237
return 0;
238238
}
239239

240+
nrfUart->EVENTS_TXDRDY = 0x0UL;
241+
240242
nrfUart->TXD = data;
241243

242244
while(!nrfUart->EVENTS_TXDRDY);
243245

244-
nrfUart->EVENTS_TXDRDY = 0x0UL;
245-
246246
return 1;
247247
}
248248

0 commit comments

Comments
 (0)
0