as3514 RTC driver: correct calculation, fixes FS#10625

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@23037 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
Michael Chicoine 2009-10-09 09:44:55 +00:00
parent 30ea0b6368
commit a4d62bd329

View file

@ -149,7 +149,7 @@ int rtc_write_datetime(const struct tm *tm)
} }
/* Number of days in years gone by since 1-Jan-1980 */ /* Number of days in years gone by since 1-Jan-1980 */
year_days = 365*(tm->tm_year+20) + (tm->tm_year-1)/4 + 6; year_days = 365*(tm->tm_year-100+20) + (tm->tm_year-100-1)/4 + 6;
/* Convert to seconds since 1-Jan-1980 */ /* Convert to seconds since 1-Jan-1980 */
seconds = tm->tm_sec seconds = tm->tm_sec