mirror of
https://github.com/eried/portapack-mayhem.git
synced 2025-07-26 08:16:02 -04:00
Daylight Savings Time support (#1793)
* Daylight Savings Time support * Cleanup * Clean-up * Revert ADSB change * Clean-up * Corrected date in comment, ironically
This commit is contained in:
parent
aa5d4ad078
commit
5f8e1ef307
13 changed files with 403 additions and 35 deletions
|
@ -404,7 +404,7 @@ static void cmd_rtcget(BaseSequentialStream* chp, int argc, char* argv[]) {
|
|||
(void)argv;
|
||||
|
||||
rtc::RTC datetime;
|
||||
rtcGetTime(&RTCD1, &datetime);
|
||||
rtc_time::now(datetime);
|
||||
|
||||
chprintf(chp, "Current time: %04d-%02d-%02d %02d:%02d:%02d\r\n", datetime.year(), datetime.month(), datetime.day(), datetime.hour(), datetime.minute(), datetime.second());
|
||||
}
|
||||
|
@ -420,11 +420,12 @@ static void cmd_rtcset(BaseSequentialStream* chp, int argc, char* argv[]) {
|
|||
return;
|
||||
}
|
||||
|
||||
// TODO: additional commands/parameters for DST?
|
||||
rtc::RTC new_datetime{
|
||||
(uint16_t)strtol(argv[0], NULL, 10), (uint8_t)strtol(argv[1], NULL, 10),
|
||||
(uint8_t)strtol(argv[2], NULL, 10), (uint32_t)strtol(argv[3], NULL, 10),
|
||||
(uint32_t)strtol(argv[4], NULL, 10), (uint32_t)strtol(argv[5], NULL, 10)};
|
||||
rtcSetTime(&RTCD1, &new_datetime);
|
||||
rtc_time::set(new_datetime);
|
||||
|
||||
chprintf(chp, "ok\r\n");
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue