Skip to content
This repository was archived by the owner on Aug 18, 2020. It is now read-only.

Removal of hidden dependency to RTCZero which is used to retrieve a epoch type timestamp #56

Merged
merged 1 commit into from
Mar 9, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 2 additions & 14 deletions src/ArduinoCloudProperty.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,20 +17,10 @@

#include "ArduinoCloudProperty.h"

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

static unsigned long getTimestamp() {
#ifdef ARDUINO_ARCH_SAMD
return rtc.getEpoch();
#else
#pragma message "No RTC available on this architecture - ArduinoIoTCloud will not keep track of local change timestamps ."
return 0;
#endif
}

/******************************************************************************
CTOR/DTOR
******************************************************************************/
Expand Down Expand Up @@ -263,8 +253,6 @@ void ArduinoCloudProperty::updateLocalTimestamp() {
if (isReadableByCloud()) {
if (_get_time_func) {
_last_local_change_timestamp = _get_time_func();
} else {
_last_local_change_timestamp = getTimestamp();
}
}
}
Expand Down