summaryrefslogtreecommitdiffstatshomepage
path: root/stmhal/stm32f4xx_it.c
diff options
context:
space:
mode:
Diffstat (limited to 'stmhal/stm32f4xx_it.c')
-rw-r--r--stmhal/stm32f4xx_it.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/stmhal/stm32f4xx_it.c b/stmhal/stm32f4xx_it.c
index 5fa7f8289d..4bd13c05cb 100644
--- a/stmhal/stm32f4xx_it.c
+++ b/stmhal/stm32f4xx_it.c
@@ -174,6 +174,11 @@ void PendSV_Handler(void) {
*/
void SysTick_Handler(void) {
HAL_IncTick();
+
+ // Read the systick control regster. This has the side effect of clearing
+ // the COUNTFLAG bit, which makes the logic in sys_tick_get_microseconds
+ // work properly.
+ SysTick->CTRL;
}
/******************************************************************************/