初级会员
- 积分
- 196
- 金钱
- 196
- 注册时间
- 2014-7-3
- 在线时间
- 38 小时
|
1金钱
freertos的中断管理一直是一个比较棘手的问题,freertos配置的可管理中断优先级外是不得调用freeRTOS的任何接口的,也不知道这样设计是为啥,
然后我看有个F103的freertos教程里的USB例程这样写
NVIC_PriorityGroupConfig(NVIC_PriorityGroup_1);
NVIC_InitStructure.NVIC_IRQChannel = USB_LP_CAN1_RX0_IRQn;
NVIC_InitStructure.NVIC_IRQChannelPreemptionPriority = 1;
NVIC_InitStructure.NVIC_IRQChannelSubPriority = 1;
NVIC_InitStructure.NVIC_IRQChannelCmd = ENABLE;
NVIC_Init(&NVIC_InitStructure);
NVIC_InitStructure.NVIC_IRQChannel = USB_HP_CAN1_TX_IRQn;
NVIC_InitStructure.NVIC_IRQChannelPreemptionPriority = 1;
NVIC_InitStructure.NVIC_IRQChannelSubPriority = 0;
NVIC_InitStructure.NVIC_IRQChannelCmd = ENABLE;
NVIC_Init(&NVIC_InitStructure);
而freertosconfig.h文件的中断配置是这样的
#define configLIBRARY_LOWEST_INTERRUPT_PRIORITY 15
#define configLIBRARY_MAX_SYSCALL_INTERRUPT_PRIORITY 5
那按理说是不是不应该在USB中断里调用RTOS的任何接口,但是我看他的USB中断里居然调用了,是不是他写错了呢
|
|