-
Notifications
You must be signed in to change notification settings - Fork 2k
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
tests/periph_rtt: Fix for tick conversion test #19522
Conversation
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.
looks good!
Just one thing: please change the commit message to match the PR title (prefix with the affected module)
78f3fb7
to
6c94491
Compare
@benpicco is it better now? |
Yes, thank you! |
6c94491
to
7c3186d
Compare
7c3186d
to
a6ad25c
Compare
Signed-off-by: chudov <[email protected]>
a6ad25c
to
8803944
Compare
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.
bors merge
Build succeeded! The publicly hosted instance of bors-ng is deprecated and will go away soon. If you want to self-host your own instance, instructions are here. If you want to switch to GitHub's built-in merge queue, visit their help page. |
Contribution description
Type casting and
printf
formatting for theRTT_MAX_VALUE
andRTT_FREQUENCY
are fixed so 32-bit value is properly handled by 'avr-libc'.The original tick conversion test assumes that
RTT_FREQUENCY
is power of 2 so forward and backward ticks to seconds conversion results in the original ticks value. To fix it the result of the forward-backward conversion is compared withticktest / RTT_FREQUENCY * RTT_FREQUENCY
that considers rounding errors.Changes were tested on deRFmega256 and nrf52840dongle.
Testing procedure
tests/periph_rtt on a board with ATmega256RFR2 shall:
Issues/PRs references
Fixes #15940