summaryrefslogtreecommitdiffstats
path: root/tmk_core/common
diff options
context:
space:
mode:
Diffstat (limited to 'tmk_core/common')
-rw-r--r--tmk_core/common/chibios/timer.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/tmk_core/common/chibios/timer.c b/tmk_core/common/chibios/timer.c
index 1ce9d1d17c..66c4a6458e 100644
--- a/tmk_core/common/chibios/timer.c
+++ b/tmk_core/common/chibios/timer.c
@@ -28,6 +28,10 @@ uint32_t timer_read32(void) {
return current_time_ms;
}
-uint16_t timer_elapsed(uint16_t last) { return 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_read32() - last; }
+uint32_t timer_elapsed32(uint32_t last) {
+ return TIMER_DIFF_32(timer_read32(), last);
+}