diff options
Diffstat (limited to 'app/ticker.c')
-rw-r--r-- | app/ticker.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/app/ticker.c b/app/ticker.c index e3ff474..2c0d532 100644 --- a/app/ticker.c +++ b/app/ticker.c @@ -43,6 +43,17 @@ timed_out (uint32_t then, unsigned int ms) return 0; } +int +timed_out_cycles (uint32_t then, unsigned int cycles) +{ + then = dwt_read_cycle_counter () - then; + + if (then > cycles) + return 1; + return 0; +} + + void ticker_init (void) |