diff options
| author | tmk <hasu@tmk-kbd.com> | 2015-04-10 01:25:48 +0900 |
|---|---|---|
| committer | tmk <hasu@tmk-kbd.com> | 2015-04-10 01:25:48 +0900 |
| commit | 6746e37088ce8ba03529c1226bd216705edb2b1f (patch) | |
| tree | a256db88ec3e9e8b1b70839fcd9459d972ce26e0 /common/mbed/timer.c | |
| parent | b4e2d325f355a4d083106476393775e75e11f284 (diff) | |
| download | qmk_firmware-6746e37088ce8ba03529c1226bd216705edb2b1f.tar.gz qmk_firmware-6746e37088ce8ba03529c1226bd216705edb2b1f.zip | |
Remove core library and build files
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 c357ceb78..000000000 --- a/common/mbed/timer.c +++ /dev/null | |||
| @@ -1,41 +0,0 @@ | |||
| 1 | #include "cmsis.h" | ||
| 2 | #include "timer.h" | ||
| 3 | |||
| 4 | /* Mill second tick count */ | ||
| 5 | volatile uint32_t timer_count = 0; | ||
| 6 | |||
| 7 | /* Timer interrupt handler */ | ||
| 8 | void SysTick_Handler(void) { | ||
| 9 | timer_count++; | ||
| 10 | } | ||
| 11 | |||
| 12 | void timer_init(void) | ||
| 13 | { | ||
| 14 | timer_count = 0; | ||
| 15 | SysTick_Config(SystemCoreClock / 1000); /* 1ms tick */ | ||
| 16 | } | ||
| 17 | |||
| 18 | void timer_clear(void) | ||
| 19 | { | ||
| 20 | timer_count = 0; | ||
| 21 | } | ||
| 22 | |||
| 23 | uint16_t timer_read(void) | ||
| 24 | { | ||
| 25 | return (uint16_t)(timer_count & 0xFFFF); | ||
| 26 | } | ||
| 27 | |||
| 28 | uint32_t timer_read32(void) | ||
| 29 | { | ||
| 30 | return timer_count; | ||
| 31 | } | ||
| 32 | |||
| 33 | uint16_t timer_elapsed(uint16_t last) | ||
| 34 | { | ||
| 35 | return TIMER_DIFF_16(timer_read(), last); | ||
| 36 | } | ||
| 37 | |||
| 38 | uint32_t timer_elapsed32(uint32_t last) | ||
| 39 | { | ||
| 40 | return TIMER_DIFF_32(timer_read32(), last); | ||
| 41 | } | ||
