diff options
author | Björn Stenberg <bjorn@haxx.se> | 2003-12-06 23:22:29 +0000 |
---|---|---|
committer | Björn Stenberg <bjorn@haxx.se> | 2003-12-06 23:22:29 +0000 |
commit | 4b9a2672e6bcc916cd342b990a107f4cf661dde2 (patch) | |
tree | 9a5092e37d9687d7452a811aa03546a29590edc9 /apps | |
parent | 12e237a3f16600ee4ea647f082d8b6971c245d7f (diff) | |
download | rockbox-4b9a2672e6bcc916cd342b990a107f4cf661dde2.tar.gz rockbox-4b9a2672e6bcc916cd342b990a107f4cf661dde2.zip |
Re-added analog clock
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@4113 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps')
-rw-r--r-- | apps/plugins/bounce.c | 14 |
1 files changed, 4 insertions, 10 deletions
diff --git a/apps/plugins/bounce.c b/apps/plugins/bounce.c index c731764a63..3d626ca868 100644 --- a/apps/plugins/bounce.c +++ b/apps/plugins/bounce.c | |||
@@ -17,6 +17,7 @@ | |||
17 | * | 17 | * |
18 | **************************************************************************/ | 18 | **************************************************************************/ |
19 | #include "plugin.h" | 19 | #include "plugin.h" |
20 | #include "time.h" | ||
20 | 21 | ||
21 | #ifdef HAVE_LCD_BITMAP | 22 | #ifdef HAVE_LCD_BITMAP |
22 | 23 | ||
@@ -171,7 +172,6 @@ struct counter values[]={ | |||
171 | {"ydistt", -6}, | 172 | {"ydistt", -6}, |
172 | }; | 173 | }; |
173 | 174 | ||
174 | #ifdef USE_CLOCK | ||
175 | static unsigned char yminute[]={ | 175 | static unsigned char yminute[]={ |
176 | 53,53,52,52,51,50,49,47,46,44,42,40,38,36,34,32,29,27,25,23,21,19,17,16,14,13,12,11,11,10,10,10,11,11,12,13,14,16,17,19,21,23,25,27,29,31,34,36,38,40,42,44,46,47,49,50,51,52,52,53, | 176 | 53,53,52,52,51,50,49,47,46,44,42,40,38,36,34,32,29,27,25,23,21,19,17,16,14,13,12,11,11,10,10,10,11,11,12,13,14,16,17,19,21,23,25,27,29,31,34,36,38,40,42,44,46,47,49,50,51,52,52,53, |
177 | }; | 177 | }; |
@@ -193,10 +193,9 @@ static void addclock(void) | |||
193 | int minute; | 193 | int minute; |
194 | int pos; | 194 | int pos; |
195 | 195 | ||
196 | hour = rtc_read(3); | 196 | struct tm* current_time = rb->get_time(); |
197 | hour = (((hour & 0x30) >> 4) * 10 + (hour & 0x0f))%12; | 197 | hour = current_time->tm_hour; |
198 | minute = rtc_read(2); | 198 | minute = current_time->tm_min; |
199 | minute = ((minute & 0x70) >> 4) * 10 + (minute & 0x0f); | ||
200 | 199 | ||
201 | pos = 90-minute; | 200 | pos = 90-minute; |
202 | if(pos >= 60) | 201 | if(pos >= 60) |
@@ -219,7 +218,6 @@ static void addclock(void) | |||
219 | yminute[(i+1)%60]); | 218 | yminute[(i+1)%60]); |
220 | } | 219 | } |
221 | } | 220 | } |
222 | #endif | ||
223 | 221 | ||
224 | static int scrollit(void) | 222 | static int scrollit(void) |
225 | { | 223 | { |
@@ -254,9 +252,7 @@ static int scrollit(void) | |||
254 | yy += YADD; | 252 | yy += YADD; |
255 | xx+= LCD_WIDTH/LETTERS_ON_SCREEN; | 253 | xx+= LCD_WIDTH/LETTERS_ON_SCREEN; |
256 | } | 254 | } |
257 | #ifdef USE_CLOCK | ||
258 | addclock(); | 255 | addclock(); |
259 | #endif | ||
260 | rb->lcd_update(); | 256 | rb->lcd_update(); |
261 | 257 | ||
262 | x-= XSPEED; | 258 | x-= XSPEED; |
@@ -310,9 +306,7 @@ static int loopit(void) | |||
310 | x+= speed[xsanke&15] + values[NUM_XADD].num; | 306 | x+= speed[xsanke&15] + values[NUM_XADD].num; |
311 | 307 | ||
312 | rb->lcd_clear_display(); | 308 | rb->lcd_clear_display(); |
313 | #ifdef USE_CLOCK | ||
314 | addclock(); | 309 | addclock(); |
315 | #endif | ||
316 | if(timeout) { | 310 | if(timeout) { |
317 | switch(b) { | 311 | switch(b) { |
318 | case BUTTON_LEFT: | 312 | case BUTTON_LEFT: |