/* Wait until last write operation on RTC registers has finished */ RTC_WaitForLastTask(); /* Change the current time */ RTC_SetCounter(now); // RTC_SetCounter(0xfffffff0); /* Wait until last write operation on RTC registers has finished */ RTC_WaitForLastTask(); }