diff options
Diffstat (limited to 'app/ticker.c')
-rw-r--r-- | app/ticker.c | 21 |
1 files changed, 11 insertions, 10 deletions
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) } - - |