xtimer: allow initialisation of XTIMER to any ticks value#5592
xtimer: allow initialisation of XTIMER to any ticks value#5592kYc0o wants to merge 1 commit intoRIOT-OS:masterfrom
Conversation
|
PR created also to satisfy the clock configuration on #5301 |
| * @brief Define default ticks initialisation if none is defined | ||
| */ | ||
| #ifndef XTIMER_TICKS_INIT | ||
| #define XTIMER_TICKS_INIT 1000000ul |
|
ACK once comment is addressed. |
|
NACK, It seems wrong that the ticks count should be passed through the usec to ticks macro. Why not modify the usec to ticks scaling instead of introducing another related definition? |
|
I may have been a little too harsh and unreasonable in my previous comment. What I meant to say was that what this PR is doing is changing the definition of 1 second in the xtimer subsystem, which will make all timings wrong in the system. Instead of changing the number of microseconds in 1 second, what should be done is to change the number of hardware timer ticks in 1 second. The scaling from usec to ticks is done with the |
|
Ok now it's very clear to me. Don't worry, it was me who didn't see the whole problem and trying something just too simple. Even if the initialisation that I proposed for my specific case on the waspmote is near to 1000000 (921600), which is actually then shifted by 2, I think we should analyse a way to reduce the timing errors as much as possible. Can we know what's the actual introduced error using values near to 1sec? I think that even initialising XTIMER at 1sec we are not 100% accurate, so maybe we can try to correct the inaccuracy by some other means. |
|
Closed by #5608 |
This PR allows to the user to initialise the XTIMER to any ticks value. This is useful when on-board clocks are not compatible with the previous initialisation value (1000000).