Skip to content

Commit 98010c4

Browse files
adding R_RTC_ClockSourceSet during open, if not running
1 parent e306a7a commit 98010c4

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

libraries/RTC/src/RTC.cpp

+5
Original file line numberDiff line numberDiff line change
@@ -540,8 +540,13 @@ void set_time(time_t t)
540540
}
541541
#endif
542542

543+
bool isRtcRunning();
544+
543545
bool openRtc() {
544546
if(!rtc_ctrl.open && FSP_SUCCESS == R_RTC_Open(&rtc_ctrl, &rtc_cfg)) {
547+
if(!isRtcRunning()) {
548+
R_RTC_ClockSourceSet(&rtc_ctrl);
549+
}
545550
return true;
546551
}
547552
else {

0 commit comments

Comments
 (0)