例如:
STM32F1中
#define configLIBRARY_LOWEST_INTERRUPT_PRIORITY 15 //最低优先级
#define configLIBRARY_MAX_SYSCALL_INTERRUPT_PRIORITY 0x01 //系统可管理的最高中断优先级
NVIC_PriorityGroupConfig(NVIC_PriorityGroup_4);
void RTC_NVIC_Config(void)
{
NVIC_InitTypeDef NVIC_InitStructure;
NVIC_InitStructure.NVIC_IRQChannel = RTC_IRQn;
NVIC_InitStructure.NVIC_IRQChannelPreemptionPriority = 0;//最高优先级,不受管理
NVIC_InitStructure.NVIC_IRQChannelSubPriority = 0;
NVIC_InitStructure.NVIC_IRQChannelCmd = ENABLE;
NVIC_Init(&NVIC_InitStructure);
}
void RTC_IRQHandler(void)
{
portBASE_TYPE xHigherPriorityTaskWoken = pdFALSE;
if (RTC_GetITStatus(RTC_IT_SEC) != RESET)
{
#ifdef BEACON_RTC
xSemaphoreGiveFromISR(Semaphore,&xHigherPriorityTaskWoken);//调用系统函数
#endif
}
if (RTC_GetITStatus(RTC_IT_ALR) != RESET)
{
RTC_ClearITPendingBit(RTC_IT_ALR);
RTC_Get();
}
RTC_ClearITPendingBit(RTC_IT_SEC | RTC_IT_OW);
RTC_WaitForLastTask();
}
task1等待信号量同步,task1运行几天后死机。求解答
|