summaryrefslogtreecommitdiff
path: root/chip/stm32/uart.c
diff options
context:
space:
mode:
authorAlexandru M Stan <amstan@chromium.org>2014-12-16 12:50:42 -0800
committerchrome-internal-fetch <chrome-internal-fetch@google.com>2014-12-18 00:46:20 +0000
commitd09526a63e019efa9c96ba446785bf4ac4c704bb (patch)
tree03f7d4abbf0bb80d59ca5fb39ccad83bc0bdfa72 /chip/stm32/uart.c
parent86835f7067b7ce26431ca459be3d59662736275f (diff)
downloadchrome-ec-d09526a63e019efa9c96ba446785bf4ac4c704bb.tar.gz
stm32f0: USART: Disable ORECF interrupt we never check for
When the EC is busy enough to start missing RX characters an ORECF might come (Overrun error), we never check for this bit, so that means the interrupt handler will be called in a loop because it never clears that bit. This disables the overrun detection feature. BUG=chrome-os-partner:33451 TEST=get firmware to poll the EC for keyboard presses, type really fast on the keyboard, note how system does not watchdog reset anymore but loses the occasional character instead. BRANCH=None Change-Id: I711483768e4ba80aaeb4a324c7dee790b3a23682 Signed-off-by: Alexandru M Stan <amstan@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/236088 Reviewed-by: Randall Spangler <rspangler@chromium.org>
Diffstat (limited to 'chip/stm32/uart.c')
-rw-r--r--chip/stm32/uart.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/chip/stm32/uart.c b/chip/stm32/uart.c
index d0240966f2..3544b95efe 100644
--- a/chip/stm32/uart.c
+++ b/chip/stm32/uart.c
@@ -288,7 +288,13 @@ void uart_init(void)
* so clear UE first.
*/
STM32_USART_CR1(UARTN_BASE) &= ~STM32_USART_CR1_UE;
- STM32_USART_CR3(UARTN_BASE) |= STM32_USART_CR3_WUS_START_BIT;
+
+ /*
+ * Also disable the RX overrun interrupt, since we don't care about it
+ * and we don't want to clear an extra flag in the interrupt
+ */
+ STM32_USART_CR3(UARTN_BASE) |= STM32_USART_CR3_WUS_START_BIT |
+ STM32_USART_CR3_OVRDIS;
#endif
/*