HCoop
/
jackhill
/
qmk
/
firmware.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
1858c3e
)
Fix timer_elapsed() overflow issue for STM32F103 and other ChibiOS boards (#7595)
author
Pavel Župa
<pavel.zupa@gmail.com>
Sat, 1 Feb 2020 09:17:28 +0000
(10:17 +0100)
committer
GitHub
<noreply@github.com>
Sat, 1 Feb 2020 09:17:28 +0000
(20:17 +1100)
* fixed strange space cadet timer owerflow on STM32F103
* Moved elapsed time fix to timer.c
tmk_core/common/chibios/timer.c
patch
|
blob
|
blame
|
history
diff --git
a/tmk_core/common/chibios/timer.c
b/tmk_core/common/chibios/timer.c
index
1ce9d1d
..
66c4a64
100644
(file)
--- 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);
+}