summaryrefslogtreecommitdiff
path: root/apps/plugins/bounce.c
diff options
context:
space:
mode:
Diffstat (limited to 'apps/plugins/bounce.c')
-rw-r--r--apps/plugins/bounce.c14
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
175static unsigned char yminute[]={ 175static unsigned char yminute[]={
17653,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, 17653,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
224static int scrollit(void) 222static 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: