bug in HAL_GetTickFreq
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2022-12-12 2:21 PM
The description for HAL_GetTickFreq says
/**
* @brief Return tick frequency.
* @retval tick period in Hz
*/
It returns 1 when the tick frequency is 1kHz. The period would be .001 seconds and the frequency would be 1000 Hz. Based on the typedef below, I'm not even sure what the units really are, but the description is clearly wrong.
typedef enum
{
HAL_TICK_FREQ_10HZ = 100U,
HAL_TICK_FREQ_100HZ = 10U,
HAL_TICK_FREQ_1KHZ = 1U,
HAL_TICK_FREQ_DEFAULT = HAL_TICK_FREQ_1KHZ
} HAL_TickFreqTypeDef;
Solved! Go to Solution.
Accepted Solutions
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2022-12-12 4:09 PM
It should be tick period in ms.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2022-12-12 4:09 PM
It should be tick period in ms.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2022-12-12 7:36 PM
Alas, the coder missed the intuitive and flexible way of coding a frequency.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2022-12-14 5:32 AM
Hello @MScha.8​,
I confirm the issue and I reported internally.
Internal ticket number: 141253(This is an internal tracking number and is not accessible or usable by customers).
Thank you.
Kaouthar
To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2023-01-08 8:43 AM
Thank you Kaouthar.
It appears that both the enum and the function should be named something like TickPeriodInMilliseconds as suggested by Pavel A.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2023-01-08 11:57 AM
Maybe HAL_TICK_FREQ_nnnHZ can be memorized as HAL tick [period in ms] at frequency nnn HZ
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2023-01-08 2:23 PM
period in Hz
This one is a pure gold! Actually shows the level of understanding of the developers...
Also I wonder whether the designers stopped for a minute and looked around. There are reasons why every other system from small schedulers to large desktop OS counts ticks, not milliseconds!
