Fix micros() implementation
This commit is contained in:
parent
b5fa0d8ee4
commit
468a96ca2c
|
@ -21,7 +21,7 @@ inline uint32_t millis() {
|
|||
}
|
||||
|
||||
inline uint32_t micros() {
|
||||
return (HAL_GetTick()*1000) + (SysTick->VAL * 1000 / SysTick->LOAD);
|
||||
return (HAL_GetTick()*1000) + ((SysTick->LOAD - SysTick->VAL) * 1000 / SysTick->LOAD);
|
||||
}
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
|
Loading…
Reference in New Issue