Revert "STM32 RTC : skip rtc_write if possible"

`rtc_write` must start the RTC. `time()` uses `rtc_write(0)` to start
the RTC if it is not already enabled, but this check made that not
work.

There's no point trying to optimise this case in a HAL - if we wanted
`set_time()` to protect against users making pointless adjustments, the
implementation should be there. But even then, you might want different
levels of hysteresis depending on application, so it's probably best
left to applications.

This reverts commit 9da5e48941.
pull/9180/head
Kevin Bracey 2018-12-21 13:12:34 +02:00
parent ac361d6a4b
commit 535b439362
1 changed files with 0 additions and 5 deletions

View File

@ -217,11 +217,6 @@ void rtc_write(time_t t)
RTC_DateTypeDef dateStruct = {0};
RTC_TimeTypeDef timeStruct = {0};
/* if the requested time is the current time, no need to continue */
if (t == rtc_read()) {
return;
}
core_util_critical_section_enter();
RtcHandle.Instance = RTC;