* GPS sensor date/time now kept in UTC (previous conversion to local time was wrong)

* internal GPS sensor can now set RTC clock [Horus]
This commit is contained in:
Damjan Adamic
2016-09-02 22:35:54 +02:00
parent f9a5c99f29
commit 37df6f1968
4 changed files with 47 additions and 28 deletions
+2 -2
View File
@@ -84,7 +84,7 @@ void TelemetryItem::setValue(const TelemetrySensor & sensor, int32_t val, uint32
}
}
else {
datetime.hour = ((uint8_t) ((data & 0xff000000) >> 24) + g_eeGeneral.timezone + 24) % 24;
datetime.hour = (uint8_t) ((data & 0xff000000) >> 24);
datetime.min = (uint8_t) ((data & 0x00ff0000) >> 16);
datetime.sec = (uint16_t) ((data & 0x0000ff00) >> 8);
if (datetime.datestate == 1) {
@@ -131,7 +131,7 @@ void TelemetryItem::setValue(const TelemetrySensor & sensor, int32_t val, uint32
}
else if (unit == UNIT_DATETIME_HOUR_MIN) {
uint32_t data = uint32_t(newVal);
datetime.hour = ((data & 0xFF) + g_eeGeneral.timezone + 24) % 24;
datetime.hour = (data & 0xFF);
datetime.min = data >> 8;
}
else if (unit == UNIT_DATETIME_SEC) {