********** RTC_TimeTypeDef RTC_TimeStructure; RTC_AlarmTypeDef RTC_AlarmStructure; RTC_GetTime(RTC_Format_BIN, &RTC_TimeStructure); sec = RTC_TimeStructure.RTC_Seconds; min = RTC_TimeStructure.RTC_Minutes; hour = RTC_TimeStructure.RTC_Hours; Alarm_Init(); /* Alarm A */ RTC_GetAlarm(RTC_Format_BIN, RTC_Alarm_A, &RTC_AlarmStructure); RTC_AlarmCmd(RTC_Alarm_A, DISABLE); /* Disable the RTC Alarm A Interrupt */ RTC_ITConfig(RTC_IT_ALRA, DISABLE); RTC_AlarmStructure.RTC_AlarmTime.RTC_Seconds = (sec+0X01); RTC_AlarmStructure.RTC_AlarmTime.RTC_Minutes = (min+0X01); RTC_AlarmStructure.RTC_AlarmTime.RTC_Hours = (hour+0X00); RTC_AlarmStructure.RTC_AlarmDateWeekDaySel = RTC_AlarmDateWeekDaySel_Date; RTC_AlarmStructure.RTC_AlarmDateWeekDay = day; RTC_SetAlarm(RTC_Format_BIN, RTC_Alarm_A, &RTC_AlarmStructure); /* Enable the RTC Alarm A Interrupt */ RTC_ITConfig(RTC_IT_ALRA, ENABLE); /* Enable the alarm A */ RTC_AlarmCmd(RTC_Alarm_A, ENABLE); /* Alarm B */ RTC_GetAlarm(RTC_Format_BIN, RTC_Alarm_B, &RTC_AlarmStructure); RTC_AlarmCmd(RTC_Alarm_B, DISABLE); /* Disable the RTC Alarm B Interrupt */ RTC_ITConfig(RTC_IT_ALRB, DISABLE); RTC_AlarmStructure.RTC_AlarmTime.RTC_Seconds = (sec+0X01); RTC_AlarmStructure.RTC_AlarmTime.RTC_Minutes = (min+0X00); RTC_AlarmStructure.RTC_AlarmTime.RTC_Hours = (hour+0X00); RTC_AlarmStructure.RTC_AlarmDateWeekDaySel = RTC_AlarmDateWeekDaySel_Date; RTC_AlarmStructure.RTC_AlarmDateWeekDay = day; RTC_SetAlarm(RTC_Format_BIN, RTC_Alarm_B, &RTC_AlarmStructure); /* Enable the RTC Alarm B Interrupt */ RTC_ITConfig(RTC_IT_ALRB, ENABLE); /* Enable the alarm B */ RTC_AlarmCmd(RTC_Alarm_B, ENABLE); ***************** void RTC_Alarm_IRQHandler(void) { /* Clear the EXTIL line 17 */ EXTI_ClearITPendingBit(EXTI_Line17); /* Check on the AlarmA falg and on the number of interrupts per Second (60*8) */ if (RTC_GetITStatus(RTC_IT_ALRA) != RESET) { // STM_EVAL_LEDOn(LED4); alarm_now2 = 0; /* Clear RTC AlarmA Flags */ RTC_ClearITPendingBit(RTC_IT_ALRA); RTC_HandlerFlag = ENABLE; } if (RTC_GetITStatus(RTC_IT_ALRB) != RESET) { // STM_EVAL_LEDOn(LED4); alarm_now = 0; /* Clear RTC AlarmA Flags */ RTC_ClearITPendingBit(RTC_IT_ALRB); RTC_HandlerFlag = ENABLE; } } ~~~~~~~~~~~~~~~~~~~~~~ 错在哪里? |
|
我的STM32L496,也是运行模式Alarm可以进中断,休眠模式Alarm可以唤醒,但是无法进入中断 |
STM32F407 定时器触发DMA 求助大神
【MCU实战经验】基于STM32F407的音频播放器设计
盘古UE-STM32F407工控板原理图
【STM32F429心得\疑问】+STM32F4之FSMC和FMC
STM32F429读取IO口传输的数据速率
STM32F407ZGT6 手摸芯片背部重启
STM32F4 SPI 动作时,软件片选信号被拉高,IO口程序逻辑失控
STM32F401RE NUCLEO求助,串口一直不能进中断
读取STM32F407内部温度传感器值错误
STM32F429多路内部ADC独立采集的办法