Skip to content

Enable RTC support for NANO_RP2040_CONNECT #288

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Nov 29, 2021
Merged
Show file tree
Hide file tree
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
2 changes: 1 addition & 1 deletion src/property/Property.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
#undef min
#include <algorithm>

#if !defined ARDUINO_ARCH_SAMD && !defined TARGET_PORTENTA_H7
#if !defined ARDUINO_ARCH_SAMD && !defined ARDUINO_ARCH_MBED
#pragma message "No RTC available on this architecture - ArduinoIoTCloud will not keep track of local change timestamps ."
#endif

Expand Down
4 changes: 2 additions & 2 deletions src/utility/time/TimeService.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ static time_t const EPOCH_AT_COMPILE_TIME = cvt_time(__DATE__);

TimeService::TimeService()
: _con_hdl(nullptr)
#if defined (ARDUINO_ARCH_SAMD) || defined (TARGET_PORTENTA_H7)
#if defined (ARDUINO_ARCH_SAMD) || defined (ARDUINO_ARCH_MBED)
, _is_rtc_configured(false)
#endif
{
Expand Down Expand Up @@ -79,7 +79,7 @@ unsigned long TimeService::getTime()
_is_rtc_configured = true;
}
return rtc.getEpoch();
#elif TARGET_PORTENTA_H7
#elif ARDUINO_ARCH_MBED
if(!_is_rtc_configured)
{
set_time(getRemoteTime());
Expand Down
4 changes: 2 additions & 2 deletions src/utility/time/TimeService.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
#include <RTCZero.h>
#endif

#ifdef TARGET_PORTENTA_H7
#ifdef ARDUINO_ARCH_MBED
#include <mbed_rtc_time.h>
#endif

Expand All @@ -50,7 +50,7 @@ class TimeService
private:

ConnectionHandler * _con_hdl;
#if defined (ARDUINO_ARCH_SAMD) || defined (TARGET_PORTENTA_H7)
#if defined (ARDUINO_ARCH_SAMD) || defined (ARDUINO_ARCH_MBED)
bool _is_rtc_configured;
#endif

Expand Down