Skip to content

Commit 695a586

Browse files
authored
Merge pull request #3653 from liu2guang/master
调整STM32系列bsp部分外使的中断优先级配置
2 parents 7c33e8d + 6ba3767 commit 695a586

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

bsp/stm32/libraries/HAL_Drivers/drv_common.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ void rt_hw_systick_init(void)
3333
HAL_SYSTICK_Config(HAL_RCC_GetHCLKFreq() / RT_TICK_PER_SECOND);
3434
#endif
3535
HAL_SYSTICK_CLKSourceConfig(SYSTICK_CLKSOURCE_HCLK);
36-
HAL_NVIC_SetPriority(SysTick_IRQn, 0, 0);
36+
NVIC_SetPriority(SysTick_IRQn, 0xFF);
3737
}
3838

3939
/**

bsp/stm32/libraries/HAL_Drivers/drv_usart.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -211,7 +211,8 @@ static rt_err_t stm32_control(struct rt_serial_device *serial, int cmd, void *ar
211211
/* enable interrupt */
212212
case RT_DEVICE_CTRL_SET_INT:
213213
/* enable rx irq */
214-
NVIC_EnableIRQ(uart->config->irq_type);
214+
HAL_NVIC_SetPriority(uart->config->irq_type, 1, 0);
215+
HAL_NVIC_EnableIRQ(uart->config->irq_type);
215216
/* enable interrupt */
216217
__HAL_UART_ENABLE_IT(&(uart->handle), UART_IT_RXNE);
217218
break;

0 commit comments

Comments
 (0)