From 69cb10f51321a2443a3314c40fb2b8556aa804c0 Mon Sep 17 00:00:00 2001 From: Lars-Dominik Braun Date: Tue, 16 Sep 2014 17:22:55 +0200 Subject: timer: Support timeouts > 8s --- ui.c | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) (limited to 'ui.c') diff --git a/ui.c b/ui.c index 3f3179f..7bd393d 100644 --- a/ui.c +++ b/ui.c @@ -298,6 +298,35 @@ void uiLoop () { } #endif +#if 0 + /* timer test mode */ + timerStart ((uint32_t) 10*1000*1000); + while (1) { + uint32_t t; + while (1) { + t = timerHit (); + if (t > 0) { + break; + } + cpuSleep (); + } + puts ("on"); + fwrite (&t, sizeof (t), 1, stdout); + pwmSet (horizonLed (0), PWM_ON); + + while (1) { + t = timerHit (); + if (t > 0) { + break; + } + cpuSleep (); + } + puts ("off"); + fwrite (&t, sizeof (t), 1, stdout); + pwmSet (horizonLed (0), PWM_OFF); + } +#endif + while (1) { processSensors (); -- cgit v1.2.3