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

后端 未结 6 1245
一整个雨季
一整个雨季 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:33

    When viewing my debugger, I can see I have available the uwTick global variable which seems to be the same as the result of calling HAL_GetTick() against my own defined global variable.

    As per the docs:

    void HAL_IncTick (void )

    This function is called to increment a global variable "uwTick" used as application time base.

    Note:
    In the default implementation, this variable is incremented each 1ms in Systick ISR.
    This function is declared as __weak to be overwritten in case of other implementations in user file.

提交回复
热议问题