From 1302514ea8723f05fc0a9ccdbc9cf45c4fa80f81 Mon Sep 17 00:00:00 2001 From: Kevin O'Connor Date: Wed, 3 Oct 2018 11:55:08 -0400 Subject: stm32f1: Serial should have a higher irq priority than timers It's possible for the code to stay in the timer irq for up to 100ms, so serial irqs should have a higher irq priority to prevent them from being starved. (The timer code disables irqs during event dispatch, so serial irqs would only be permitted between events anyway.) Signed-off-by: Kevin O'Connor --- src/stm32f1/serial.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/stm32f1/serial.c') diff --git a/src/stm32f1/serial.c b/src/stm32f1/serial.c index bc6ebb94..cfc5d04d 100644 --- a/src/stm32f1/serial.c +++ b/src/stm32f1/serial.c @@ -29,8 +29,8 @@ serial_init(void) LL_USART_SetHWFlowCtrl(USART1, LL_USART_HWCONTROL_NONE); LL_USART_SetTransferDirection(USART1, LL_USART_DIRECTION_TX_RX); LL_USART_EnableIT_RXNE(USART1); + NVIC_SetPriority(USART1_IRQn, 0); NVIC_EnableIRQ(USART1_IRQn); - NVIC_SetPriority(USART1_IRQn, 1); LL_USART_Enable(USART1); LL_APB2_GRP1_EnableClock(LL_APB2_GRP1_PERIPH_GPIOA); -- cgit v1.2.3-70-g09d2