add CTS local time characteristic and use it to provide UTC in DateTimeController
This commit is contained in:
@@ -36,6 +36,7 @@ void DateTime::SetTime(uint16_t year,
|
||||
/* .tm_mon = */ month - 1,
|
||||
/* .tm_year = */ year - 1900,
|
||||
};
|
||||
|
||||
tm.tm_isdst = -1; // Use DST value from local time zone
|
||||
currentDateTime = std::chrono::system_clock::from_time_t(std::mktime(&tm));
|
||||
|
||||
@@ -50,6 +51,11 @@ void DateTime::SetTime(uint16_t year,
|
||||
systemTask->PushMessage(System::Messages::OnNewTime);
|
||||
}
|
||||
|
||||
void DateTime::SetTimeZone(uint8_t timezone, uint8_t dst) {
|
||||
tzOffset = timezone;
|
||||
dstOffset = dst;
|
||||
}
|
||||
|
||||
void DateTime::UpdateTime(uint32_t systickCounter) {
|
||||
// Handle systick counter overflow
|
||||
uint32_t systickDelta = 0;
|
||||
|
||||
Reference in New Issue
Block a user