File tree Expand file tree Collapse file tree 2 files changed +9
-2
lines changed Expand file tree Collapse file tree 2 files changed +9
-2
lines changed Original file line number Diff line number Diff line change @@ -51,7 +51,7 @@ static time_t const EPOCH_AT_COMPILE_TIME = cvt_time(__DATE__);
51
51
52
52
TimeService::TimeService ()
53
53
: _con_hdl(nullptr )
54
- #ifdef ARDUINO_ARCH_SAMD
54
+ #if defined ( ARDUINO_ARCH_SAMD) || defined (ARDUINO_ARCH_MBED)
55
55
, _is_rtc_configured(false )
56
56
#endif
57
57
{
@@ -79,6 +79,13 @@ unsigned long TimeService::getTime()
79
79
_is_rtc_configured = true ;
80
80
}
81
81
return rtc.getEpoch ();
82
+ #elif ARDUINO_ARCH_MBED
83
+ if (!_is_rtc_configured)
84
+ {
85
+ set_time (getRemoteTime ());
86
+ _is_rtc_configured = true ;
87
+ }
88
+ return time (NULL );
82
89
#else
83
90
return getRemoteTime ();
84
91
#endif
Original file line number Diff line number Diff line change @@ -46,7 +46,7 @@ class TimeService
46
46
private:
47
47
48
48
ConnectionHandler * _con_hdl;
49
- #ifdef ARDUINO_ARCH_SAMD
49
+ #if defined ( ARDUINO_ARCH_SAMD) || defined (ARDUINO_ARCH_MBED)
50
50
bool _is_rtc_configured;
51
51
#endif
52
52
You can’t perform that action at this time.
0 commit comments