/* Waits until the RTC registers (RTC_CNT, RTC_ALR and RTC_PRL) are synchronized with RTC APB clock.  */
void RTC_WaitForSynchro(void)
/* Waits until the RTC registers (RTC_CNT, RTC_ALR and RTC_PRL) are synchronized with RTC APB clock.  */
void RTC_WaitForSynchro(void)
{
    RTC->CSR &= ~RTC_CSR_RSF;
    while (!(RTC->CSR & RTC_CSR_RSF));
}