Add RTC port for checking if DST is active

This commit is contained in:
Ry 2023-03-24 23:34:04 -07:00
parent c422bfc271
commit d559f63c85

View File

@ -94,7 +94,7 @@ int bus_io_read(void *user, uint32_t *value, uint32_t port) {
break; break;
} }
case 0x80000700 ... 0x80000706: { // RTC port case 0x80000700 ... 0x80000707: { // RTC port
uint8_t setting = port & 0x000000FF; uint8_t setting = port & 0x000000FF;
struct tm *now = localtime(&rtc_time); struct tm *now = localtime(&rtc_time);
switch (setting) { switch (setting) {
@ -126,6 +126,10 @@ int bus_io_read(void *user, uint32_t *value, uint32_t port) {
*value = rtc_uptime; *value = rtc_uptime;
break; break;
} }
case 0x07: { // daylight savings time active
*value = now->tm_isdst;
break;
}
} }
break; break;