/* Enable clocking on AFIO */
RCC->APB2ENR |= RCC_APB2_AFIO;
+ RCC->APB2ENR |= gpio_uart[port].sysctl;
/* Configure USART pins */
if (port == USART1_PORT)
{
- RCC->APB2ENR |= gpio_uart[port].sysctl;
RCC->APB2ENR |= gpio_uart[port].sysctl1;
}
else
{
- RCC->APB1ENR |= gpio_uart[port].sysctl;
RCC->APB1ENR |= gpio_uart[port].sysctl1;
}
/* Read and clear the IRQ status */
status = base->SR;
+
+ /* Check hw errors */
+ ser_handles[port]->status = status &
+ (BV(SR_ORE) | BV(SR_FE) | BV(SR_PE) | BV(SR_NE));
+
/* Process the IRQ */
if (status & BV(CR1_RXNEIE))
{