Does HAL_GetTick() return ticks or milliseconds? (and how to measure in microseconds)

后端 未结 6 1236
一整个雨季
一整个雨季 2021-02-07 11:56

I\'m new to using HAL functions. The description of the function HAL_GetTick() says that it \"provides a tick value in millisecond

6条回答
  •  [愿得一人]
    2021-02-07 12:43

    It's both. Most of the time the function which increments the HAL tick counter is hooked to SysTick interrupt, which is configured to tick every 1ms. Therefore HAL_GetTick() will return the number of milliseconds since the SysTick interrupt is configured (essentially since the program start). This can also be though of as "the number of times the SysTick interrupt has 'ticked'".

提交回复
热议问题