Merge branch 'master' into development

This commit is contained in:
Verkehrsrot authored and GitHub committed 2023-04-28 17:26:31 +02:00
commit edf29e03c9
4 files changed
+7 -7

No files matched your search

+1 -1
View File
@@ -456,7 +456,7 @@ void setup() {
#endif // HAS_BUTTON
// only if we have a timesource we do timesync
#if ((HAS_LORA_TIME) || (HAS_GPS) || (HAS_RTC))
#if ((HAS_LORA_TIME) || (HAS_GPS) || defined HAS_RTC)
time_init();
strcat_P(features, " TIME");
#endif // timesync
+3 -3
View File
@@ -8,7 +8,7 @@ RtcDS3231<TwoWire> Rtc(Wire); // RTC hardware i2c interface
// initialize RTC
uint8_t rtc_init(void) {
Wire.begin(HAS_RTC);
Rtc.Begin(MY_DISPLAY_SDA, MY_DISPLAY_SCL);
Rtc.Begin(HAS_RTC);
// configure RTC chip
Rtc.Enable32kHzPin(false);
@@ -22,7 +22,7 @@ uint8_t rtc_init(void) {
#if (TIME_SYNC_COMPILEDATE)
// initialize a blank RTC without battery backup with build time
RtcDateTime tt = Rtc.GetDateTime();
time_t t = tt.Epoch32Time(); // sec2000 -> epoch
time_t t = tt.Unix32Time(); // sec2000 -> epoch
if (!Rtc.IsDateTimeValid() || !timeIsValid(t)) {
ESP_LOGW(TAG, "RTC has no recent time, setting to compiletime");
@@ -53,7 +53,7 @@ time_t get_rtctime(uint16_t *msec) {
*msec = 0;
if (Rtc.IsDateTimeValid() && Rtc.GetIsRunning()) {
RtcDateTime tt = Rtc.GetDateTime();
t = tt.Epoch32Time(); // sec2000 -> epoch
t = tt.Unix32Time(); // sec2000 -> epoch
}
// if we have a RTC pulse, we calculate msec
+1 -1
View File
@@ -82,7 +82,7 @@ void calibrateTime(void) {
return;
#endif
#if ((HAS_GPS) || (HAS_RTC))
#if ((HAS_GPS) || defined HAS_RTC)
time_t t = 0;
uint16_t t_msec = 0;