Skip to content

Commit 6ab0fb8

Browse files
facchinmpennam
authored andcommitted
RTC: fix clock source being misconfigured
1 parent 21662fd commit 6ab0fb8

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

libraries/RTC/src/RTC.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -553,6 +553,10 @@ bool openRtc() {
553553
if(!isRtcRunning()) {
554554
R_RTC_ClockSourceSet(&rtc_ctrl);
555555
}
556+
if (R_RTC->RCR4 != (uint8_t) rtc_ctrl.p_cfg->clock_source) {
557+
R_RTC->RCR4 = (uint8_t) rtc_ctrl.p_cfg->clock_source;
558+
delay(200);
559+
}
556560
return true;
557561
}
558562
else {

0 commit comments

Comments
 (0)