diff options
author | Giovanni Di Sirio <gdisirio@gmail.com> | 2016-07-21 10:07:25 +0000 |
---|---|---|
committer | Giovanni Di Sirio <gdisirio@gmail.com> | 2016-07-21 10:07:25 +0000 |
commit | 94ab7ac7e989e3c1f6723e6f6ed91df5f6dc019c (patch) | |
tree | 3c378a6fb69449fbe0a79cfa5bd238c5005d3934 /os/hal/ports/STM32/LLD | |
parent | 10dd7c5f02b05e09f109f07aff4a82d153775e0e (diff) | |
download | ChibiOS-94ab7ac7e989e3c1f6723e6f6ed91df5f6dc019c.tar.gz ChibiOS-94ab7ac7e989e3c1f6723e6f6ed91df5f6dc019c.tar.bz2 ChibiOS-94ab7ac7e989e3c1f6723e6f6ed91df5f6dc019c.zip |
git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@9716 35acf78f-673a-0410-8e92-d51de3d6d3f4
Diffstat (limited to 'os/hal/ports/STM32/LLD')
-rw-r--r-- | os/hal/ports/STM32/LLD/USARTv2/hal_uart_lld.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/os/hal/ports/STM32/LLD/USARTv2/hal_uart_lld.c b/os/hal/ports/STM32/LLD/USARTv2/hal_uart_lld.c index 0012ef259..e74f8b553 100644 --- a/os/hal/ports/STM32/LLD/USARTv2/hal_uart_lld.c +++ b/os/hal/ports/STM32/LLD/USARTv2/hal_uart_lld.c @@ -243,7 +243,7 @@ static void usart_start(UARTDriver *uartp) { cr1 = USART_CR1_UE | USART_CR1_PEIE | USART_CR1_TE | USART_CR1_RE;
u->CR1 = uartp->config->cr1 | cr1;
- /* Set receive timeout and check it appliance */
+ /* Set receive timeout and checks if it is really applied.*/
if (tmo > 0) {
osalDbgAssert(tmo <= USART_RTOR_RTO, "Timeout overflow");
u->RTOR = tmo;
@@ -334,7 +334,9 @@ static void serve_usart_irq(UARTDriver *uartp) { _uart_tx2_isr_code(uartp);
}
- if ((isr & USART_ISR_IDLE) || (isr & USART_ISR_RTOF)) {
+ /* Timeout interrupt sources are only checked if enabled in CR1.*/
+ if (((cr1 & USART_CR1_IDLEIE) && (isr & USART_ISR_IDLE)) ||
+ ((cr1 & USART_CR1_RTOIE) && (isr & USART_ISR_RTOF))) {
_uart_timeout_isr_code(uartp);
}
}
|