dev builds
themes manual
device status forums
mailing lists
IRC bugs
dev guide

Rockbox mail archive

Subject: New patch: autopreset of RTC after power-loss

New patch: autopreset of RTC after power-loss

From: Michael Schopferer <>
Date: Fri, 7 Mar 2003 01:12:11 +0100

Hello Rockboxer,

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 ***
Received on 2003-03-07

Page template was last modified "Tue Sep 7 00:00:02 2021" The Rockbox Crew -- Privacy Policy