From d69ab26ce85f23a17753a70760bdb5334a3bed8f Mon Sep 17 00:00:00 2001 From: Nicolas Schodet Date: Thu, 29 Sep 2011 00:36:04 +0200 Subject: src/binwatch: use defines for led durations --- src/binwatch/binwatch.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/binwatch/binwatch.c b/src/binwatch/binwatch.c index 6057879..d3e9bfb 100644 --- a/src/binwatch/binwatch.c +++ b/src/binwatch/binwatch.c @@ -27,6 +27,9 @@ #include "common/button.h" #include "common/power.h" +#define BINWATCH_TIME_DISPLAY_DUR (3 * LED_1S) +#define BINWATCH_ANIM_SPEED (LED_100MS / 2) + /** Get time in leds format. */ static uint16_t binwatch_get_time (void) @@ -65,21 +68,22 @@ main (void) /* Initialisation ok, display current time. */ uint16_t time; time = binwatch_get_time (); - led_display (time, 3 * LED_1S); + led_display (time, BINWATCH_TIME_DISPLAY_DUR); /* If low voltage detected, wait user press to let clock go. */ if (init == RTC_LOW_VOLTAGE) { button_wait (); rtc_go (); - led_display (time, 3 * LED_1S); + led_display (time, BINWATCH_TIME_DISPLAY_DUR); } /* Wait user press to display time. */ while (1) { button_wait (); time = binwatch_get_time (); - led_animate (time, LED_ANIMATION_TRACE_CCW, LED_100MS / 2); - led_display (time, 3 * LED_1S); + led_animate (time, LED_ANIMATION_TRACE_CCW, + BINWATCH_ANIM_SPEED); + led_display (time, BINWATCH_TIME_DISPLAY_DUR); } } } -- cgit v1.2.3