This is the bug/patch tracker for Rockbox. Click here for more information.
Quick links: Bugs · Patches · Rockbox frontpage
FS#10569 - RTC driver cleanup
Attached to Project:
Rockbox
Opened by Nils Wallménius (nls) - Saturday, 29 August 2009, 18:59 GMT+2
Last edited by Nils Wallménius (nls) - Saturday, 26 September 2009, 17:33 GMT+2
Opened by Nils Wallménius (nls) - Saturday, 29 August 2009, 18:59 GMT+2
Last edited by Nils Wallménius (nls) - Saturday, 26 September 2009, 17:33 GMT+2
|
DetailsThis patch moves the handling of the tm struct into the rtc drivers' rtc_(read|write)_datetime functions to avoid the rtc drivers having to encode the data into the same format used natively in some old archos rtc chip. Also a macro is now used for conversion to and from bcd in the drivers that use it, and a few random cleanups and a bit of useless whitespace changes that can be ignored ;)
This removes a lot of target specific code and all sim specific code from timerfuncs.c -- less #ifdef hell, yay :) I've test built most of the drivers but have only tested on the gigabeast. The best test i could come up with was to install a patched build and see if time is read correctly then change it and go back to an unpatched build and see if that can read the new time. there is one comment in the ds1339.... driver that mentions something about century and OR's the month value with 0x80 that i have no idea if it's correct but i tried to keep it as it was. |
This task depends upon
Closed by Nils Wallménius (nls)
Saturday, 26 September 2009, 17:33 GMT+2
Reason for closing: Accepted
Additional comments about closing: commited
Saturday, 26 September 2009, 17:33 GMT+2
Reason for closing: Accepted
Additional comments about closing: commited
mrobe 100: setting time and date works, calendar plugin is correct.
Ipod Mini2G: works as mrobe 100.
Note that I haven't tried alarms.
Hopefully time setting on ds1339_ds3231 should also be fixed.
This version also replaced the literal address constant in the e8564 driver with a #defined constant and uses the BCD macros in more places.
To summarise the status:
Confirmed working: as3514, mrobe100, mc13783, pcf50605, pcf50606
Broken but hopefully fixed in this version: ds1339_ds3231 and e8564
Not tested: m41st84w, jz4740, rx5x348ab, s3c2440, s35390a
all of these except jz4740 use internal bcd representation so it's very possible they need the same fix as ds1339_ds3231 and e8564.
CC firmware/drivers/rtc/rtc_ds1339_ds3231.c
/home/dom/projects/rockbox/firmware/drivers/rtc/rtc_ds1339_ds3231.c: In function `rtc_read_datetime':
/home/dom/projects/rockbox/firmware/drivers/rtc/rtc_ds1339_ds3231.c:129: warning: statement with no effect
Also fix a stupid typo preventing the e8564 driver from building...