-
Notifications
You must be signed in to change notification settings - Fork 179
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Timer additions: raw access to prescaler and auto-reload #322
Conversation
Hm, seems like it fails to build with I don't understand why it gives me this error for stm32f100, but not for f103.
I could just wrap around an |
I think there are some inconsistencies between the different f1 variants which causes that unsafe thingy, we can probably add an |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the PR and sorry for the review delay. I added a few notes which would be nice if they are addressed
Just to give a update, I've seen your suggestions and will implement them later this week. Thanks for the help :) |
I've implemented your requested changes and merged with the current master. Hopefully everything is fine now :) |
Don't merge master in PRs, you make commit history non-linear. Rebase only. |
ba66fda
to
59bce28
Compare
Thanks for the hint, I've updated my PR. It may be helpful to state "rebase over merge" somewhere in a contibutor's guidelines document, or just under the "Contributing" header of the README, since it is not an obvious thing to do; other projects prefer it the other way round. Or is there such a document which I failed to find? |
Great work! Adding a CONTRIBUTING document stating rebasing is prefered is a pretty good idea. Though I assume that tends to almost always be the case when working on PRs, and the debate is more often about wether or not to do the final "merge" as a rebase or true merge. |
I frequently use timers for precise measurements, and unfortunately,
start_countdown
performs intransparent calculations which can introduce rounding errors.This PR adds the capability to set and read the raw prescaler and auto-reload values, also we can now read the timer's count; this is useful when ARR is set to
0xFFFF
, i.e. the timer is just "free-running".