diff options
author | Markus Braun <markus.braun@krawel.de> | 2002-08-09 13:50:58 +0000 |
---|---|---|
committer | Markus Braun <markus.braun@krawel.de> | 2002-08-09 13:50:58 +0000 |
commit | 2012acf0a805793d970621ec0ab32bdb2b6ebd61 (patch) | |
tree | cc5c47180458aa83df42ba905bcb8dfc9c9f74d0 /apps/settings_menu.c | |
parent | 3181f68eff2951029e56293e6003eff34c499584 (diff) | |
download | rockbox-2012acf0a805793d970621ec0ab32bdb2b6ebd61.tar.gz rockbox-2012acf0a805793d970621ec0ab32bdb2b6ebd61.zip |
changed display format for time/date setting menu
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@1646 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps/settings_menu.c')
-rw-r--r-- | apps/settings_menu.c | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/apps/settings_menu.c b/apps/settings_menu.c index 948f1eb180..b2ca475619 100644 --- a/apps/settings_menu.c +++ b/apps/settings_menu.c | |||
@@ -87,22 +87,22 @@ static void statusbar(void) | |||
87 | #ifdef HAVE_RTC | 87 | #ifdef HAVE_RTC |
88 | static void timedate_set(void) | 88 | static void timedate_set(void) |
89 | { | 89 | { |
90 | int timedate[7]; /* hour,minute,second,day,month,year,dayofweek */ | 90 | int timedate[7]; /* hour,minute,second,year,month,day,dayofweek */ |
91 | 91 | ||
92 | 92 | ||
93 | timedate[0] = rtc_read(0x03); /* hour */ | 93 | timedate[0] = rtc_read(0x03); /* hour */ |
94 | timedate[1] = rtc_read(0x02); /* minute */ | 94 | timedate[1] = rtc_read(0x02); /* minute */ |
95 | timedate[2] = rtc_read(0x01); /* second */ | 95 | timedate[2] = rtc_read(0x01); /* second */ |
96 | timedate[3] = rtc_read(0x05); /* day */ | 96 | timedate[3] = rtc_read(0x07); /* year */ |
97 | timedate[4] = rtc_read(0x06); /* month */ | 97 | timedate[4] = rtc_read(0x06); /* month */ |
98 | timedate[5] = rtc_read(0x07); /* year */ | 98 | timedate[5] = rtc_read(0x05); /* day */ |
99 | /* day of week not read, calculated */ | 99 | /* day of week not read, calculated */ |
100 | timedate[0] = ((timedate[0] & 0x70) >> 4) * 10 + (timedate[0] & 0x0f); /* hour */ | 100 | timedate[0] = ((timedate[0] & 0x70) >> 4) * 10 + (timedate[0] & 0x0f); /* hour */ |
101 | timedate[1] = ((timedate[1] & 0xf0) >> 4) * 10 + (timedate[1] & 0x0f); /* minute */ | 101 | timedate[1] = ((timedate[1] & 0xf0) >> 4) * 10 + (timedate[1] & 0x0f); /* minute */ |
102 | timedate[2] = ((timedate[2] & 0x30) >> 4) * 10 + (timedate[2] & 0x0f); /* second */ | 102 | timedate[2] = ((timedate[2] & 0x30) >> 4) * 10 + (timedate[2] & 0x0f); /* second */ |
103 | timedate[3] = ((timedate[3] & 0x30) >> 4) * 10 + (timedate[3] & 0x0f); /* day */ | 103 | timedate[3] = ((timedate[3] & 0x30) >> 4) * 10 + (timedate[3] & 0x0f); /* year */ |
104 | timedate[4] = ((timedate[4] & 0x30) >> 4) * 10 + (timedate[4] & 0x0f); /* month */ | 104 | timedate[4] = ((timedate[4] & 0x30) >> 4) * 10 + (timedate[4] & 0x0f); /* month */ |
105 | timedate[5] = ((timedate[5] & 0x30) >> 4) * 10 + (timedate[5] & 0x0f); /* year */ | 105 | timedate[5] = ((timedate[5] & 0x30) >> 4) * 10 + (timedate[5] & 0x0f); /* day */ |
106 | 106 | ||
107 | set_time("[Set time/date]",timedate); | 107 | set_time("[Set time/date]",timedate); |
108 | 108 | ||
@@ -110,16 +110,16 @@ static void timedate_set(void) | |||
110 | timedate[0] = ((timedate[0]/10) << 4 | timedate[0]%10) & 0x3f; /* hour */ | 110 | timedate[0] = ((timedate[0]/10) << 4 | timedate[0]%10) & 0x3f; /* hour */ |
111 | timedate[1] = ((timedate[1]/10) << 4 | timedate[1]%10) & 0x7f; /* minute */ | 111 | timedate[1] = ((timedate[1]/10) << 4 | timedate[1]%10) & 0x7f; /* minute */ |
112 | timedate[2] = ((timedate[2]/10) << 4 | timedate[2]%10) & 0x7f; /* second */ | 112 | timedate[2] = ((timedate[2]/10) << 4 | timedate[2]%10) & 0x7f; /* second */ |
113 | timedate[3] = ((timedate[3]/10) << 4 | timedate[3]%10) & 0x3f; /* day */ | 113 | timedate[3] = ((timedate[3]/10) << 4 | timedate[3]%10) & 0xff; /* year */ |
114 | timedate[4] = ((timedate[4]/10) << 4 | timedate[4]%10) & 0x1f; /* month */ | 114 | timedate[4] = ((timedate[4]/10) << 4 | timedate[4]%10) & 0x1f; /* month */ |
115 | timedate[5] = ((timedate[5]/10) << 4 | timedate[5]%10) & 0xff; /* year */ | 115 | timedate[5] = ((timedate[5]/10) << 4 | timedate[5]%10) & 0x3f; /* day */ |
116 | rtc_write(0x03, timedate[0] | (rtc_read(0x03) & 0xc0)); /* hour */ | 116 | rtc_write(0x03, timedate[0] | (rtc_read(0x03) & 0xc0)); /* hour */ |
117 | rtc_write(0x02, timedate[1] | (rtc_read(0x02) & 0x80)); /* minute */ | 117 | rtc_write(0x02, timedate[1] | (rtc_read(0x02) & 0x80)); /* minute */ |
118 | rtc_write(0x01, timedate[2] | (rtc_read(0x01) & 0x80)); /* second */ | 118 | rtc_write(0x01, timedate[2] | (rtc_read(0x01) & 0x80)); /* second */ |
119 | rtc_write(0x05, timedate[3] | (rtc_read(0x05) & 0xc0)); /* day */ | 119 | rtc_write(0x07, timedate[3]); /* year */ |
120 | rtc_write(0x06, timedate[4] | (rtc_read(0x06) & 0xe0)); /* month */ | 120 | rtc_write(0x06, timedate[4] | (rtc_read(0x06) & 0xe0)); /* month */ |
121 | rtc_write(0x07, timedate[5]); /* year */ | 121 | rtc_write(0x05, timedate[5] | (rtc_read(0x05) & 0xc0)); /* day */ |
122 | rtc_write(0x04, timedate[6] | (rtc_read(0x04) & 0x07)); /* dayofweek */ | 122 | rtc_write(0x04, timedate[6] | (rtc_read(0x04) & 0xf8)); /* dayofweek */ |
123 | rtc_write(0x00, 0x00); /* 0.1 + 0.01 seconds */ | 123 | rtc_write(0x00, 0x00); /* 0.1 + 0.01 seconds */ |
124 | } | 124 | } |
125 | } | 125 | } |