From d559f63c85b80abbc9a84047ea61a04a24460b5c Mon Sep 17 00:00:00 2001 From: Ry Date: Fri, 24 Mar 2023 23:34:04 -0700 Subject: [PATCH] Add RTC port for checking if DST is active --- src/bus.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/bus.c b/src/bus.c index 83c1f20..272496d 100644 --- a/src/bus.c +++ b/src/bus.c @@ -94,7 +94,7 @@ int bus_io_read(void *user, uint32_t *value, uint32_t port) { break; } - case 0x80000700 ... 0x80000706: { // RTC port + case 0x80000700 ... 0x80000707: { // RTC port uint8_t setting = port & 0x000000FF; struct tm *now = localtime(&rtc_time); switch (setting) { @@ -126,6 +126,10 @@ int bus_io_read(void *user, uint32_t *value, uint32_t port) { *value = rtc_uptime; break; } + case 0x07: { // daylight savings time active + *value = now->tm_isdst; + break; + } } break;