xtimer: add support for arbitrary timer tick conversion#4002
Closed
kaspar030 wants to merge 6 commits intoRIOT-OS:masterfrom
Closed
xtimer: add support for arbitrary timer tick conversion#4002kaspar030 wants to merge 6 commits intoRIOT-OS:masterfrom
kaspar030 wants to merge 6 commits intoRIOT-OS:masterfrom
Conversation
Member
|
@kaspar030 Do you want to keep this open while #3990 is still open or can we close this? |
|
|
||
| static inline uint64_t div_u64_by_1000000(uint64_t val) | ||
| { | ||
| return (uint64_t)(val * 0x431bde83) >> (0x12 + 32); |
Member
There was a problem hiding this comment.
should this also be ul for 16-bit and 8-bit platforms?
Member
There was a problem hiding this comment.
I was a little bit unsure how 8-bit or 16-bit platforms would interpret 0x431bde83
Member
There was a problem hiding this comment.
I have been thinking about this and #3990, I think the best solution may be
to convert the xtimer to use timer ticks internally like this PR, but to
use an opaque struct type to make the compiler error out mismatched timer
ticks vs microsecond constants.
I can't prepare a PR right now but after testing and working with #3990 for
some time that PR is beginning to feel unnecessarily convoluted and too
much overhead..
Contributor
Author
There was a problem hiding this comment.
(the div stuff is long merged, btw...)
Member
|
Still WIP => postpone. |
This was referenced Jul 5, 2016
Contributor
|
Very old PR addressing a common issue. @kaspar030 would you like to close it in favor of #5608 ? |
Member
|
Fixes #5237, but needs to be postponed :( |
Contributor
|
Wasn't solved with #5608 ? |
Member
|
Yes, seems so. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
(just an idea)
compare #3990.
This PR basically swaps XTIMER_SHIFT with the possiblity to use any conversion macro.