From 2b2a3cd6862d9b1668249b4f8e428d83c493662e Mon Sep 17 00:00:00 2001 From: Wintermate Date: Wed, 23 Oct 2013 02:11:15 +0200 Subject: [PATCH] Vanity-Screen: Klickschutz. --- badge/ui/vanity.c | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/badge/ui/vanity.c b/badge/ui/vanity.c index b2bebbd..4c486d1 100644 --- a/badge/ui/vanity.c +++ b/badge/ui/vanity.c @@ -15,6 +15,8 @@ void badge_vanity_show(void) { FIL fd; badge_framebuffer fb; + unsigned min_ticks = 75; + 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); } } -- 2.20.1