Ver Fonte

在配置设备中断前先配置系统的优先级为16个抢占优先级,1个子优先级

Signed-off-by: huhui <huhui@sharkgulf.com>
huhui há 3 anos atrás
pai
commit
b0bb565944
2 ficheiros alterados com 2 adições e 2 exclusões
  1. 1 0
      Applications/bsp/gd32/bsp.c
  2. 1 2
      Applications/bsp/gd32/can.c

+ 1 - 0
Applications/bsp/gd32/bsp.c

@@ -11,6 +11,7 @@ void bsp_init(void){
 	gd32_bkp_init();
 	dbg_periph_enable(DBG_TIMER0_HOLD);
 	dbg_periph_enable(DBG_TIMER1_HOLD);
+	nvic_priority_group_set(NVIC_PRIGROUP_PRE4_SUB0);
 	systick_open();
 	task_ticks_enable();
 	gpio_pin_init();

+ 1 - 2
Applications/bsp/gd32/can.c

@@ -123,8 +123,7 @@ static void shark_can0_config(void)
     
     /* recv my can ID, use fifo0 */
     can_filter_mask_mode_init(CAN_MY_ADDRESS, CAN_FILTER_DEST_MASK, CAN_EXTENDED_FIFO0, 0);
-
-  	nvic_priority_group_set(NVIC_PRIGROUP_PRE4_SUB0);  
+ 
   	nvic_irq_enable(CAN_IRQ0,CAN_IRQ_PRIORITY,0);	
     /* enable can receive FIFO0 not empty interrupt */
     can_interrupt_enable(CAN0, CAN_INTEN_RFNEIE0);