Skip to content
This repository was archived by the owner on Feb 21, 2020. It is now read-only.

Commit 4d917ee

Browse files
committed
micros() is going backwards
Signed-off-by: Frederic.Pillon <frederic.pillon@st.com>
1 parent 8825214 commit 4d917ee

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

cores/arduino/stm32/clock.c

Lines changed: 1 addition & 1 deletion
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)