MFi386: write the correct weekday back to the RTC.
This commit is contained in:
parent
d1b40f007d
commit
4bec58cd70
@ -1248,7 +1248,7 @@ resettodr()
|
|||||||
rtc_outb(bin2bcd(tm%24)); tm /= 24; /* Write back Hours */
|
rtc_outb(bin2bcd(tm%24)); tm /= 24; /* Write back Hours */
|
||||||
|
|
||||||
/* We have now the days since 01-01-1970 in tm */
|
/* We have now the days since 01-01-1970 in tm */
|
||||||
wd = (tm+4)%7;
|
wd = (tm + 4) % 7 + 1); /* Write back Weekday */
|
||||||
for (y = 1970, m = DAYSPERYEAR + LEAPYEAR(y);
|
for (y = 1970, m = DAYSPERYEAR + LEAPYEAR(y);
|
||||||
tm >= m;
|
tm >= m;
|
||||||
y++, m = DAYSPERYEAR + LEAPYEAR(y))
|
y++, m = DAYSPERYEAR + LEAPYEAR(y))
|
||||||
|
@ -1248,7 +1248,7 @@ resettodr()
|
|||||||
rtc_outb(bin2bcd(tm%24)); tm /= 24; /* Write back Hours */
|
rtc_outb(bin2bcd(tm%24)); tm /= 24; /* Write back Hours */
|
||||||
|
|
||||||
/* We have now the days since 01-01-1970 in tm */
|
/* We have now the days since 01-01-1970 in tm */
|
||||||
wd = (tm+4)%7;
|
wd = (tm + 4) % 7 + 1); /* Write back Weekday */
|
||||||
for (y = 1970, m = DAYSPERYEAR + LEAPYEAR(y);
|
for (y = 1970, m = DAYSPERYEAR + LEAPYEAR(y);
|
||||||
tm >= m;
|
tm >= m;
|
||||||
y++, m = DAYSPERYEAR + LEAPYEAR(y))
|
y++, m = DAYSPERYEAR + LEAPYEAR(y))
|
||||||
|
@ -1248,7 +1248,7 @@ resettodr()
|
|||||||
rtc_outb(bin2bcd(tm%24)); tm /= 24; /* Write back Hours */
|
rtc_outb(bin2bcd(tm%24)); tm /= 24; /* Write back Hours */
|
||||||
|
|
||||||
/* We have now the days since 01-01-1970 in tm */
|
/* We have now the days since 01-01-1970 in tm */
|
||||||
wd = (tm+4)%7;
|
wd = (tm + 4) % 7 + 1); /* Write back Weekday */
|
||||||
for (y = 1970, m = DAYSPERYEAR + LEAPYEAR(y);
|
for (y = 1970, m = DAYSPERYEAR + LEAPYEAR(y);
|
||||||
tm >= m;
|
tm >= m;
|
||||||
y++, m = DAYSPERYEAR + LEAPYEAR(y))
|
y++, m = DAYSPERYEAR + LEAPYEAR(y))
|
||||||
|
Loading…
x
Reference in New Issue
Block a user