mirror of https://github.com/ARMmbed/mbed-os.git
STM32 RTC : skip rtc_write if possible
parent
5047ea4f42
commit
9da5e48941
|
@ -207,6 +207,11 @@ 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;
|
||||
|
||||
|
|
Loading…
Reference in New Issue