/* Check if the Wake-Up flag is set */
if(PWR_GetFlagStatus(PWR_FLAG_WU) != RESET)
{
/* Clear Wake Up flag */
PWR_ClearFlag(PWR_FLAG_WU);
}
/* Clear the RTC Second interrupt */
RTC_ClearITPendingBit(RTC_IT_ALR);
/* 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();
}
}