mirror of
https://github.com/oliverschmidt/contiki.git
synced 2025-01-21 23:31:11 +00:00
cc2538: uart: Fix garbled output occurring upon lpm_enter()
lpm_enter() must not enter PM1+ if the UART is transmitting. Otherwise, the UART clock gets disabled, and its TX is broken. The commit b8b54a033c67e2dbb98dabda6d1b4c9e64d5db90 had already partially fixed this issue, but it could still occur while transmitting stop bits because, contrary to UART_FR.BUSY, UART_FR.TXFE takes only the data bits into account, not the stop bits. Signed-off-by: Benoît Thébaudeau <benoit.thebaudeau.dev@gmail.com>
This commit is contained in:
parent
9e91a3832d
commit
a52a3d94d3
@ -230,9 +230,7 @@ permit_pm1(void)
|
||||
const uart_regs_t *regs;
|
||||
|
||||
for(regs = &uart_regs[0]; regs < &uart_regs[UART_INSTANCE_COUNT]; regs++) {
|
||||
/* Note: UART_FR.TXFE reads 0 if the UART clock is gated. */
|
||||
if((REG(SYS_CTRL_RCGCUART) & regs->sys_ctrl_rcgcuart_uart) != 0 &&
|
||||
(REG(regs->base + UART_FR) & UART_FR_TXFE) == 0) {
|
||||
if((REG(regs->base + UART_FR) & UART_FR_BUSY) != 0) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user