Fix micros() implementation

This commit is contained in:
Daniel Fekete 2017-04-13 06:04:47 +02:00
parent b5fa0d8ee4
commit 468a96ca2c
1 changed files with 1 additions and 1 deletions

View File

@ -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