From 3accd8fcee87299b51de0abde3c8d9c83368d871 Mon Sep 17 00:00:00 2001 From: root Date: Sun, 7 Jun 2015 01:34:12 +0100 Subject: tidyup --- app/ticker.c | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) (limited to 'app/ticker.c') diff --git a/app/ticker.c b/app/ticker.c index 0f7d856..37884a6 100644 --- a/app/ticker.c +++ b/app/ticker.c @@ -3,7 +3,7 @@ static volatile uint32_t delay_ms_count; volatile uint32_t ticks; -static uint32_t scale=10; +static uint32_t scale = 10; void delay_us (uint32_t d) @@ -33,20 +33,23 @@ delay_ms (uint32_t d) while (delay_ms_count); } -int timed_out(uint32_t then,unsigned int ms) +int +timed_out (uint32_t then, unsigned int ms) { -then=ticks-then; + then = ticks - then; -if (then>ms) return 1; -return 0; + if (then > ms) + return 1; + return 0; } -void ticker_init(void) +void +ticker_init (void) { - uint32_t v,w; + uint32_t v, w; - /*Start periodic timer*/ + /*Start periodic timer */ systick_set_clocksource (STK_CSR_CLKSOURCE_AHB_DIV8); /* 48MHz / 8 = > 6Mhz */ @@ -72,5 +75,3 @@ void ticker_init(void) } - - -- cgit v1.2.3