@@ -605,12 +605,12 @@ bool setRtcAlarm(rtc_alarm_time_t alarm_time) {
605
605
return false ;
606
606
}
607
607
608
- RTClock () : is_initialized{false } {
608
+ RTClock::RTClock () : is_initialized{false } {
609
609
}
610
610
611
- ~RTClock () { }
611
+ RTClock:: ~RTClock () { }
612
612
613
- bool begin () {
613
+ bool RTClock:: begin () {
614
614
if (openRtc ()) {
615
615
is_initialized = true ;
616
616
}
@@ -620,7 +620,7 @@ bool begin() {
620
620
return is_initialized;
621
621
}
622
622
623
- bool getTime (RTCTime &t) {
623
+ bool RTClock:: getTime (RTCTime &t) {
624
624
struct tm present;
625
625
if (is_initialized) {
626
626
if ( getRtcTime (present) ) {
@@ -631,7 +631,7 @@ bool getTime(RTCTime &t) {
631
631
return false ;
632
632
}
633
633
634
- bool setPeriodicCallback (rtc_cbk_t fnc, Period p) {
634
+ bool RTClock:: setPeriodicCallback (rtc_cbk_t fnc, Period p) {
635
635
636
636
RTCIrqCfg_t rtc_irq_cfg;
637
637
@@ -649,7 +649,7 @@ bool setPeriodicCallback(rtc_cbk_t fnc, Period p) {
649
649
return false ;
650
650
}
651
651
652
- bool setAlarmCallback (rtc_cbk_t fnc, RTCTime &t, AlarmMatch &m) {
652
+ bool RTClock:: setAlarmCallback (rtc_cbk_t fnc, RTCTime &t, AlarmMatch &m) {
653
653
654
654
RTCIrqCfg_t rtc_irq_cfg;
655
655
rtc_irq_cfg.req = RTC_ALARM;
@@ -693,15 +693,15 @@ bool setAlarmCallback(rtc_cbk_t fnc, RTCTime &t, AlarmMatch &m) {
693
693
return false ;
694
694
}
695
695
696
- bool setAlarm (RTCTime &t, AlarmMatch &m) {
696
+ bool RTClock:: setAlarm (RTCTime &t, AlarmMatch &m) {
697
697
return this ->setAlarmCallback (nullptr , t, m);
698
698
}
699
699
700
- bool isRunning () {
700
+ bool RTClock:: isRunning () {
701
701
return isRtcRunning ();
702
702
}
703
703
704
- bool setTime (RTCTime &t) {
704
+ bool RTClock:: setTime (RTCTime &t) {
705
705
if (is_initialized) {
706
706
if (setRtcTime ((rtc_time_t )t.getTmTime ())) {
707
707
return true ;
@@ -710,7 +710,7 @@ bool setTime(RTCTime &t) {
710
710
return false ;
711
711
}
712
712
713
- bool setTimeIfNotRunning (RTCTime &t) {
713
+ bool RTClock:: setTimeIfNotRunning (RTCTime &t) {
714
714
if (!isRunning ()) {
715
715
return setTime (t);
716
716
}
@@ -721,4 +721,3 @@ bool setTimeIfNotRunning(RTCTime &t) {
721
721
RTClock RTC;
722
722
#endif
723
723
724
-
0 commit comments