mbed library sources. Supersedes mbed-src.

Fork of mbed-dev by mbed official

Files at this revision

API Documentation at this revision

Comitter:
funshine
Date:
Sat Apr 08 17:03:55 2017 +0000
Parent:
161:2cc1468da177
Commit message:
add code to handle serial port rx error in uart_irq()

Changed in this revision

targets/TARGET_STM/TARGET_STM32F3/serial_api.c Show annotated file Show diff for this revision Revisions of this file
diff -r 2cc1468da177 -r 16168a1438f3 targets/TARGET_STM/TARGET_STM32F3/serial_api.c
--- a/targets/TARGET_STM/TARGET_STM32F3/serial_api.c	Thu Mar 30 13:45:57 2017 +0100
+++ b/targets/TARGET_STM/TARGET_STM32F3/serial_api.c	Sat Apr 08 17:03:55 2017 +0000
@@ -300,6 +300,18 @@
                 __HAL_UART_CLEAR_FLAG(huart, UART_CLEAR_OREF);
             }
         }
+        if (__HAL_UART_GET_FLAG(huart, UART_FLAG_PE) != RESET) {
+            __HAL_UART_CLEAR_FLAG(huart, UART_CLEAR_PEF);
+        }
+        if (__HAL_UART_GET_FLAG(huart, UART_FLAG_FE) != RESET) {
+            __HAL_UART_CLEAR_FLAG(huart, UART_CLEAR_FEF);
+        }
+        if (__HAL_UART_GET_FLAG(huart, UART_FLAG_NE) != RESET) {
+            __HAL_UART_CLEAR_FLAG(huart, UART_CLEAR_NEF);
+        }
+        if (__HAL_UART_GET_FLAG(huart, UART_FLAG_ORE) != RESET) {
+            __HAL_UART_CLEAR_FLAG(huart, UART_CLEAR_OREF);
+        }
     }
 }