summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNicolas Schodet2011-09-29 00:36:04 +0200
committerNicolas Schodet2011-09-29 00:36:04 +0200
commitd69ab26ce85f23a17753a70760bdb5334a3bed8f (patch)
treeff5c99ea96198ffeff2febb4ad700d224051c20d
parente345f3cac98d35fdf9b7bd81629c2598db8ee0fc (diff)
src/binwatch: use defines for led durations
-rw-r--r--src/binwatch/binwatch.c12
1 files 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);
}
}
}