Add cycle counter time conversion macros

Use this forum for requesting small changes in ChibiOS. Large changes should be discussed in the development forum. This forum is NOT for support.
faisal
Posts: 374
Joined: Wed Jul 19, 2017 12:44 am
Has thanked: 44 times
Been thanked: 60 times

Add cycle counter time conversion macros

Postby faisal » Fri Aug 03, 2018 6:06 pm

Sometimes we need to use the chPolledDelayX to implement a specific time delay. Since this implements a delay in units of cycles, we need to know what the frequency of the cycle counter is. That differs from device to device. I'm thinking there should be a macro like RT_CNT_FREQ in hal_lld.h (or wherever appropriate) that selects the correct value for it. In the STM32L4xx, that would be STM32_SYSCLK. But on the STM32F7xx, it is the STM32_HCLK ... Other processors would be different as well .

User avatar
Giovanni
Site Admin
Posts: 14444
Joined: Wed May 27, 2009 8:48 am
Location: Salerno, Italy
Has thanked: 1074 times
Been thanked: 921 times
Contact:

Re: Add cycle counter time conversion macros

Postby Giovanni » Sun Jan 06, 2019 5:11 pm

bump


Return to “Small Change Requests”

Who is online

Users browsing this forum: No registered users and 5 guests