Compare commits

..

1 Commits

Author SHA1 Message Date
Ford Jones
cf15e782f2
Merge 4dfcd61d46 into 4a669032dc 2025-08-30 14:33:58 +12:00
5 changed files with 9 additions and 15 deletions

View File

@ -26,10 +26,10 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#include <Arduino.h>
#if __has_include("Melopero_RV3028.h")
#ifdef RV3028_RTC
#include "Melopero_RV3028.h"
#endif
#if __has_include("pcf8563.h")
#ifdef PCF8563_RTC
#include "pcf8563.h"
#endif

View File

@ -55,9 +55,9 @@ RTCSetResult readFromRTC()
LOG_DEBUG("Read RTC time from RV3028 getTime as %02d-%02d-%02d %02d:%02d:%02d (%ld)", t.tm_year + 1900, t.tm_mon + 1,
t.tm_mday, t.tm_hour, t.tm_min, t.tm_sec, printableEpoch);
timeStartMsec = now;
zeroOffsetSecs = tv.tv_sec;
if (currentQuality == RTCQualityNone) {
timeStartMsec = now;
zeroOffsetSecs = tv.tv_sec;
currentQuality = RTCQualityDevice;
}
return RTCSetResultSuccess;
@ -94,9 +94,9 @@ RTCSetResult readFromRTC()
LOG_DEBUG("Read RTC time from PCF8563 getDateTime as %02d-%02d-%02d %02d:%02d:%02d (%ld)", t.tm_year + 1900, t.tm_mon + 1,
t.tm_mday, t.tm_hour, t.tm_min, t.tm_sec, printableEpoch);
timeStartMsec = now;
zeroOffsetSecs = tv.tv_sec;
if (currentQuality == RTCQualityNone) {
timeStartMsec = now;
zeroOffsetSecs = tv.tv_sec;
currentQuality = RTCQualityDevice;
}
return RTCSetResultSuccess;

View File

@ -421,7 +421,7 @@ void setup()
struct timeval tv;
tv.tv_sec = time(NULL);
tv.tv_usec = 0;
perhapsSetRTC(RTCQualityDevice, &tv);
perhapsSetRTC(RTCQualityNTP, &tv);
#endif
powerMonInit();

View File

@ -3,10 +3,7 @@ extends = portduino_base
build_flags = ${portduino_base.build_flags} -I variants/native/portduino
-I /usr/include
board = cross_platform
lib_deps =
${portduino_base.lib_deps}
melopero/Melopero RV3028@^1.1.0
lib_deps = ${portduino_base.lib_deps}
build_src_filter = ${portduino_base.build_src_filter}
[env:native]

View File

@ -4,7 +4,4 @@
#define CANNED_MESSAGE_MODULE_ENABLE 1
#define HAS_GPS 1
#define MAX_RX_TOPHONE settingsMap[maxtophone]
#define MAX_NUM_NODES settingsMap[maxnodes]
// RAK12002 RTC Module
#define RV3028_RTC (uint8_t)0b1010010
#define MAX_NUM_NODES settingsMap[maxnodes]