We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 874beea commit 19d07a2Copy full SHA for 19d07a2
libraries/RTC/src/RTC.cpp
@@ -540,8 +540,13 @@ void set_time(time_t t)
540
}
541
#endif
542
543
+bool isRtcRunning();
544
+
545
bool openRtc() {
546
if(!rtc_ctrl.open && FSP_SUCCESS == R_RTC_Open(&rtc_ctrl, &rtc_cfg)) {
547
+ if(!isRtcRunning()) {
548
+ R_RTC_ClockSourceSet(&rtc_ctrl);
549
+ }
550
return true;
551
552
else {
@@ -551,8 +556,6 @@ bool openRtc() {
556
557
553
558
bool setRtcTime(rtc_time_t time) {
554
- R_RTC_ClockSourceSet(&rtc_ctrl);
555
-
559
if(FSP_SUCCESS == R_RTC_CalendarTimeSet(&rtc_ctrl, &time) ) {
560
561
0 commit comments