Handle usart errors.

This commit is contained in:
Gareth McMullin 2016-08-22 09:57:52 +12:00
parent ca364a889e
commit 45e322b9a3
1 changed files with 3 additions and 0 deletions

View File

@ -247,7 +247,10 @@ void usbuart_usb_in_cb(usbd_device *dev, uint8_t ep)
*/ */
void USBUSART_ISR(void) void USBUSART_ISR(void)
{ {
uint32_t err = USART_SR(USBUSART);
char c = usart_recv(USBUSART); char c = usart_recv(USBUSART);
if (err & (USART_SR_ORE | USART_SR_FE))
return;
/* Turn on LED */ /* Turn on LED */
gpio_set(LED_PORT_UART, LED_UART); gpio_set(LED_PORT_UART, LED_UART);