Skip to content

Commit f9b5a13

Browse files
committed
Removal of hidden dependency to RTCZero which is used to retrieve a epoch type timestamp
In arduino-libraries/ArduinoCloudThing#55 the possibility for retrieving a epoch type timestamp via a registered callback function has been introduced, the changes in #93 register such a function which allows us to to remove the hidden dependency to RTCZero altogether
1 parent 8fe1fac commit f9b5a13

File tree

1 file changed

+2
-14
lines changed

1 file changed

+2
-14
lines changed

ArduinoCloudProperty.cpp

+2-14
Original file line numberDiff line numberDiff line change
@@ -17,20 +17,10 @@
1717

1818
#include "ArduinoCloudProperty.h"
1919

20-
#ifdef ARDUINO_ARCH_SAMD
21-
#include <RTCZero.h>
22-
extern RTCZero rtc;
20+
#ifndef ARDUINO_ARCH_SAMD
21+
#pragma message "No RTC available on this architecture - ArduinoIoTCloud will not keep track of local change timestamps ."
2322
#endif
2423

25-
static unsigned long getTimestamp() {
26-
#ifdef ARDUINO_ARCH_SAMD
27-
return rtc.getEpoch();
28-
#else
29-
#pragma message "No RTC available on this architecture - ArduinoIoTCloud will not keep track of local change timestamps ."
30-
return 0;
31-
#endif
32-
}
33-
3424
/******************************************************************************
3525
CTOR/DTOR
3626
******************************************************************************/
@@ -263,8 +253,6 @@ void ArduinoCloudProperty::updateLocalTimestamp() {
263253
if (isReadableByCloud()) {
264254
if (_get_time_func) {
265255
_last_local_change_timestamp = _get_time_func();
266-
} else {
267-
_last_local_change_timestamp = getTimestamp();
268256
}
269257
}
270258
}

0 commit comments

Comments
 (0)