简体   繁体   English

STM32 和 HAL function GetTick()

[英]STM32 and HAL function GetTick()

Implicit declaration of function 'HAL_GetTick'. function 'HAL_GetTick' 的隐式声明。 Can you tell me or give me a link for library, where I can find declaration of this function.你能告诉我或给我一个图书馆链接,我可以在哪里找到这个 function 的声明。

The function is nearly the same at every device I am currently working on an F4 so I will provide the definition I have: function 在我目前正在使用 F4 的每个设备上几乎相同,因此我将提供我的定义:

/**
  * @brief Provides a tick value in millisecond.
  * @note This function is declared as __weak to be overwritten in case of other 
  *       implementations in user file.
  * @retval tick value
  */
__weak uint32_t HAL_GetTick(void)
{
  return uwTick;
}

The obvious question is what the hell is uwTick?显而易见的问题是 uwTick 到底是什么? it is just a volatile uint_32 that get incremented whenever the HAL_IncTick is called.它只是一个 volatile uint_32,每当调用HAL_IncTick时都会递增。 The Hal_IncTick is called from the SysTickHandler that is called as an interrupt. Hal_IncTick 从称为中断的SysTickHandler中调用。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM