Merge branch 'master' of gitlab:wintermute/hackover2013-badge-firmware
[hackover2013-badge-firmware.git] / badge / ui / vanity.c
index b2bebbd..af8dbd7 100644 (file)
@@ -15,6 +15,8 @@ void badge_vanity_show(void) {
   FIL fd;
   badge_framebuffer fb;
 
+  unsigned min_ticks = 50;
+
   if(FR_OK == f_open(&fd, VANITY_IMAGE_FILE, FA_OPEN_EXISTING | FA_READ)) {
     badge_vanity_read_from_fd(&fd, &fb);
     f_close(&fd);
@@ -22,10 +24,17 @@ void badge_vanity_show(void) {
     badge_framebuffer_flush(&fb);
 
     badge_event_t ev;
+
     do {
       ev = badge_event_wait();
-    } while(badge_event_type(ev) != BADGE_EVENT_USER_INPUT);
 
-    for(;;);
+      if(badge_event_type(ev) == BADGE_EVENT_GAME_TICK) {
+        --min_ticks;
+      }
+    } while(min_ticks != 0);
+
+    do {
+      ev = badge_event_wait();
+    } while(badge_event_type(ev) != BADGE_EVENT_USER_INPUT);
   }
 }
This page took 0.020951 seconds and 4 git commands to generate.