Skip to content

Commit 61924cc

Browse files
committed
Fix #4 micros() is going backwards
Signed-off-by: Frederic.Pillon <[email protected]>
1 parent 59436ae commit 61924cc

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Diff for: cores/arduino/stm32/clock.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@
104104
*/
105105
uint32_t GetCurrentMicro(void)
106106
{
107-
return (HAL_GetTick()*1000) + (SysTick->VAL / (SystemCoreClock / 1000000));
107+
return (HAL_GetTick()*1000) + ((SystemCoreClock/1000-SysTick->VAL)/(SystemCoreClock/1000000));
108108
}
109109

110110
/**

0 commit comments

Comments
 (0)