Rockbox mail archive
Subject: New patch: autopreset of RTC after power-loss
From: Michael Schopferer (michael.schopferer_at_stud.uni-karlsruhe.de)
please forgive my mistakes, for I'm a newuser at sourceforge
(and it's not quite intuitive...).
Unfortunalety, patch #699080 was submitted without login and without file.
So patch #699086 is a little bit the right direction. It's only the file but also
submitted without login :(
Now "in media res":
This patch checks the values of the RTC in settings_load in settings.c
If they are out-of-range, the config_block is checked. If it is valid, these
values are written to the RTC. If the block is invalid, the time and date
are generated from APPSVERSION, the compile-time-value.
This patch also saves the RTC in the config_block:
config_block[0xa1] = /* seconds */
config_block[0xa2] = /* minutes */
config_block[0xa3] = /* hour */
config_block[0xa4] = /* dayofweek */
config_block[0xa5] = /* day */
config_block[0xa6] = /* month */
config_block[0xa7] = /* year */
(no BCD-conversion, just as it).
Up to now, the patch is working fine.
Now I'm working on a DaylightSavingTime-patch (DST).
In the Time/Date-Setting toogles a PLAY-push between summertime/wintertime
(how do you call it in english? summertime or DST active or what?)
The hour-value is changed then also. Now I need a place to store the DST-value.
Either there is space in the disk-config_block or we use a free bit in
the RTC-config_block. Any suggestions?
Michael (uchk at sorceforge, with a little luck)
Michael Schopferer *** Michael.Schopferer_at_stud.uni-karlsruhe.de
Page was last modified "Jan 10 2012" The Rockbox Crew