improve RTC accuracy

This commit is contained in:
cyberman54 committed 2022-01-26 16:21:44 +01:00
1 parent 43e6ec0cb6
commit af01537a95
6 files changed
+59 -53

No files matched your search

-1
View File
@@ -111,6 +111,5 @@ typedef struct {
} sdsStatus_t;
extern char clientId[20]; // unique clientID
extern time_t _COMPILETIME; // epoch build time
#endif
+1 -1
View File
@@ -12,7 +12,7 @@ extern RtcDS3231<TwoWire> Rtc; // make RTC instance globally available
uint8_t rtc_init(void);
uint8_t set_rtctime(time_t t);
void sync_rtctime(void);
time_t get_rtctime(void);
time_t get_rtctime(uint16_t *msec);
float get_rtctemp(void);
#endif // _RTCTIME_H
+3 -3
View File
@@ -10,8 +10,8 @@
#include "dcf77.h"
#include "esp_sntp.h"
#define SECS_YR_2000 (946684800UL) // the time at the start of y2k
#define GPS_UTC_DIFF 315964800UL // seconds diff between gps and utc epoch
#define SECS_YR_2000 (946684800UL) // the time at the start of y2k
#define GPS_UTC_DIFF 315964800UL // seconds diff between gps and utc epoch
#define LEAP_SECS_SINCE_GPSEPOCH 18UL // state of 2021
enum timesource_t { _gps, _rtc, _lora, _unsynced, _set };
@@ -33,7 +33,7 @@ bool timeIsValid(time_t const t);
void calibrateTime(void);
void IRAM_ATTR setMyTime(uint32_t t_sec, uint16_t t_msec,
timesource_t mytimesource);
time_t compileTime(const String compile_date);
time_t compileTime(void);
time_t mkgmtime(const struct tm *ptm);
TickType_t tx_Ticks(uint32_t framesize, unsigned long baud, uint32_t config,
int8_t rxPin, int8_t txPins);