diff options
author | Jack Humbert <jack.humb@gmail.com> | 2015-10-27 12:42:30 -0400 |
---|---|---|
committer | Jack Humbert <jack.humb@gmail.com> | 2015-10-27 12:42:30 -0400 |
commit | 547da78335298df6666200c6063ac6f1aba312fd (patch) | |
tree | 47df0252ee24b1ecc27b9dd0458c51f20bf088c3 /common/mbed/timer.c | |
parent | a766918d5c48204375f4c207b30bbbf1389df14f (diff) | |
parent | fa33719adab1393753312d298b8c365e04e844b9 (diff) |
merging tmk
Diffstat (limited to 'common/mbed/timer.c')
-rw-r--r-- | common/mbed/timer.c | 41 |
1 files changed, 0 insertions, 41 deletions
diff --git a/common/mbed/timer.c b/common/mbed/timer.c deleted file mode 100644 index c357ceb786..0000000000 --- a/common/mbed/timer.c +++ /dev/null @@ -1,41 +0,0 @@ -#include "cmsis.h" -#include "timer.h" - -/* Mill second tick count */ -volatile uint32_t timer_count = 0; - -/* Timer interrupt handler */ -void SysTick_Handler(void) { - timer_count++; -} - -void timer_init(void) -{ - timer_count = 0; - SysTick_Config(SystemCoreClock / 1000); /* 1ms tick */ -} - -void timer_clear(void) -{ - timer_count = 0; -} - -uint16_t timer_read(void) -{ - return (uint16_t)(timer_count & 0xFFFF); -} - -uint32_t timer_read32(void) -{ - return timer_count; -} - -uint16_t timer_elapsed(uint16_t last) -{ - return TIMER_DIFF_16(timer_read(), last); -} - -uint32_t timer_elapsed32(uint32_t last) -{ - return TIMER_DIFF_32(timer_read32(), last); -} |