fixed timezone compile error (issue #256)

This commit is contained in:
Klaus K Wilting committed 2019-01-28 11:46:18 +01:00
1 parent ebefd5d234
commit 954687fe61
8 files changed
+12 -12

No files matched your search

+1 -1
View File
@@ -132,10 +132,10 @@ void do_timesync() {
#ifdef HAS_RTC
if (!set_rtctime(RtcDateTime(now())))
ESP_LOGE(TAG, "RTC set time failure");
#endif
time_t tt = myTZ.toLocal(now());
ESP_LOGI(TAG, "GPS has set system time to %02d/%02d/%d %02d:%02d:%02d",
month(tt), day(tt), year(tt), hour(tt), minute(tt), second(tt));
#endif
return;
} else {
ESP_LOGI(TAG, "No valid GPS time");
+1 -1
View File
@@ -458,9 +458,9 @@ void user_request_network_time_callback(void *pVoidUserUTCTime,
#ifdef HAS_RTC
if (!set_rtctime(*pUserUTCTime))
ESP_LOGE(TAG, "RTC set time failure");
#endif
time_t t = myTZ.toLocal(now());
ESP_LOGI(TAG,
"LORA Network has set system time to %02d/%02d/%d %02d:%02d:%02d",
month(t), day(t), year(t), hour(t), minute(t), second(t));
#endif
}
+5
View File
@@ -77,6 +77,11 @@ std::set<uint16_t, std::less<uint16_t>, Mallocator<uint16_t>> macs;
// initialize payload encoder
PayloadConvert payload(PAYLOAD_BUFFER_SIZE);
// set Time Zone, fetch user setting from paxcounter.conf
TimeChangeRule myDST = DAYLIGHT_TIME;
TimeChangeRule mySTD = STANDARD_TIME;
Timezone myTZ(myDST, mySTD);
// local Tag for logging
static const char TAG[] = "main";
-5
View File
@@ -7,11 +7,6 @@ static const char TAG[] = "main";
RtcDS3231<TwoWire> Rtc(Wire); // RTC hardware i2c interface
// set Time Zone, fetch user setting from paxcounter.conf
TimeChangeRule myDST = DAYLIGHT_TIME;
TimeChangeRule mySTD = STANDARD_TIME;
Timezone myTZ(myDST, mySTD);
// initialize RTC
int rtc_init(void) {