RT.现在在做一个小模块.RTC生成时间作为日志的一部分保存在SD卡上.可是...中断好像冲突了.不能1s生成一个文件.1s中断不执行..咋办呢
具体如下:
主函数中
void InterruptConfig(void)
{
/* Deinitializes the NVIC */
NVIC_DeInit();
NVIC_Configuration();
/* Configure the Priority Group to 2 bits */
// NVIC_PriorityGroupConfig(NVIC_PriorityGroup_2);
/* Configure the SysTick handler priority */
//为了使用SDIO中断,下面的中断优先级被我改低了
NVIC_SystemHandlerPriorityConfig(SystemHandler_SysTick, 1, 1);
}
RTC中断如下.为什么就不行了呢...
void RTC_IRQHandler(void)
{
if(RTC_GetITStatus(RTC_IT_SEC) != RESET)
{
/* Clear the RTC Second interrupt */
RTC_ClearITPendingBit(RTC_IT_SEC);
/* Toggle led connected to PC.06 pin each 1s */
GPIO_WriteBit(GPIOC, GPIO_Pin_6, (BitAction)(1-GPIO_ReadOutputDataBit(GPIOC, GPIO_Pin_6)));
/* Enable time update */
TimeDisplay = 1;
/* Wait until last write operation on RTC registers has finished */
RTC_WaitForLastTask();
/* Reset RTC Counter when Time is 23:59:59 */
if(RTC_GetCounter() == 0x00015180)
{
RTC_SetCounter(0x0);
/* Wait until last write operation on RTC registers has finished */
RTC_WaitForLastTask();
}
}
}
此帖出自
小平头技术问答
一周热门 更多>