diff --git a/src/nvr.c b/src/nvr.c index a98bc0059..2abd3bfe2 100644 --- a/src/nvr.c +++ b/src/nvr.c @@ -8,7 +8,7 @@ * * Implement a generic NVRAM/CMOS/RTC device. * - * Version: @(#)nvr.c 1.0.7 2018/04/29 + * Version: @(#)nvr.c 1.0.8 2018/04/29 * * Author: Fred N. van Kempen, * @@ -334,6 +334,7 @@ nvr_time_set(struct tm *tm) intclk.tm_sec = tm->tm_sec; intclk.tm_min = tm->tm_min; intclk.tm_hour = tm->tm_hour; + intclk.tm_wday = tm->tm_wday; intclk.tm_mday = tm->tm_mday; intclk.tm_mon = (tm->tm_mon + 1); intclk.tm_year = (tm->tm_year + 1900); diff --git a/src/nvr_at.c b/src/nvr_at.c index 6dfac26f4..26b65ea50 100644 --- a/src/nvr_at.c +++ b/src/nvr_at.c @@ -189,7 +189,7 @@ * including the later update (DS12887A) which implemented a * "century" register to be compatible with Y2K. * - * Version: @(#)nvr_at.c 1.0.7 2018/04/28 + * Version: @(#)nvr_at.c 1.0.8 2018/04/29 * * Authors: Fred N. van Kempen, * Miran Grca, @@ -362,9 +362,9 @@ time_set(nvr_t *nvr, struct tm *tm) /* NVR is in BCD data mode. */ nvr->regs[RTC_SECONDS] = RTC_BCD(tm->tm_sec); nvr->regs[RTC_MINUTES] = RTC_BCD(tm->tm_min); - nvr->regs[RTC_DOW] = (RTC_BCD(tm->tm_wday + 1)); + nvr->regs[RTC_DOW] = RTC_BCD(tm->tm_wday + 1); nvr->regs[RTC_DOM] = RTC_BCD(tm->tm_mday); - nvr->regs[RTC_MONTH] = (RTC_BCD(tm->tm_mon + 1)); + nvr->regs[RTC_MONTH] = RTC_BCD(tm->tm_mon + 1); nvr->regs[RTC_YEAR] = RTC_BCD(year % 100); nvr->regs[local->cent] = RTC_BCD(year / 100);