summaryrefslogtreecommitdiff
path: root/tmk_core/common/mbed/timer.c
diff options
context:
space:
mode:
Diffstat (limited to 'tmk_core/common/mbed/timer.c')
-rw-r--r--tmk_core/common/mbed/timer.c32
1 files changed, 7 insertions, 25 deletions
diff --git a/tmk_core/common/mbed/timer.c b/tmk_core/common/mbed/timer.c
index c357ceb786..7e4070af29 100644
--- a/tmk_core/common/mbed/timer.c
+++ b/tmk_core/common/mbed/timer.c
@@ -5,37 +5,19 @@
volatile uint32_t timer_count = 0;
/* Timer interrupt handler */
-void SysTick_Handler(void) {
- timer_count++;
-}
+void SysTick_Handler(void) { timer_count++; }
-void timer_init(void)
-{
+void timer_init(void) {
timer_count = 0;
SysTick_Config(SystemCoreClock / 1000); /* 1ms tick */
}
-void timer_clear(void)
-{
- timer_count = 0;
-}
+void timer_clear(void) { timer_count = 0; }
-uint16_t timer_read(void)
-{
- return (uint16_t)(timer_count & 0xFFFF);
-}
+uint16_t timer_read(void) { return (uint16_t)(timer_count & 0xFFFF); }
-uint32_t timer_read32(void)
-{
- return timer_count;
-}
+uint32_t timer_read32(void) { return timer_count; }
-uint16_t timer_elapsed(uint16_t last)
-{
- return TIMER_DIFF_16(timer_read(), last);
-}
+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);
-}
+uint32_t timer_elapsed32(uint32_t last) { return TIMER_DIFF_32(timer_read32(), last); }