Arduino millis() in stm32

user6064424 picture user6064424 · May 22, 2016 · Viewed 12.6k times · Source

I am trying to port some Arduino library to stm32. In Arduino, millis() returns the number of milliseconds since boot. Is there an equivalent function in stm32? I am using stm32f0 MCU.

Answer

nbout picture nbout · May 23, 2016

You could use HAL_GetTick(): this function gets current SysTick counter value (incremented in SysTick interrupt) used by peripherals drivers to handle timeouts.