Skip to content
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

sys/ztimer: make ztimer_overhead() return signed result #13571

Merged
merged 2 commits into from
Mar 10, 2020

Conversation

kaspar030
Copy link
Contributor

@kaspar030 kaspar030 commented Mar 6, 2020

Contribution description

Current ztimer_overhead() overflows if the timer triggers too early. Fix to return int32_t.
Also updates tests/ztimer_overhead (only user of the function).

Testing procedure

Override the adjust value for building to see an effect with or without this PR:
CFLAGS="-DCONFIG_ZTIMER_USEC_ADJUST=100" make -Ctests/ztimer_overhead.

Without #13570, maybe manually add ZTIMER_USEC->adjust = 100, in main.c before the main loop.

Issues/PRs references

#13549 also works with signed overhead.

@kaspar030 kaspar030 added Type: bug The issue reports a bug / The PR fixes a bug (including spelling errors) CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR Area: timers Area: timer subsystems Area: sys Area: System labels Mar 6, 2020
@kaspar030 kaspar030 requested a review from bergzand March 6, 2020 10:44
@bergzand bergzand added CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR and removed CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR labels Mar 10, 2020
@bergzand bergzand self-assigned this Mar 10, 2020
@kaspar030 kaspar030 force-pushed the ztimer_overhead_signed branch from 9089f1c to 6e5dc78 Compare March 10, 2020 11:19
@kaspar030 kaspar030 force-pushed the ztimer_overhead_signed branch from 6e5dc78 to 90ca4f3 Compare March 10, 2020 11:23
Copy link
Member

@bergzand bergzand left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nothing special, confirmed the issue and the solution works. ACK!

@bergzand bergzand merged commit 0edfce8 into RIOT-OS:master Mar 10, 2020
@leandrolanzieri leandrolanzieri added this to the Release 2020.04 milestone Mar 13, 2020
@leandrolanzieri leandrolanzieri added the Impact: minor The PR is small in size and might only require a quick look of a knowledgeable reviewer label Mar 19, 2020
@kaspar030 kaspar030 deleted the ztimer_overhead_signed branch March 30, 2020 19:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: sys Area: System Area: timers Area: timer subsystems CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR Impact: minor The PR is small in size and might only require a quick look of a knowledgeable reviewer Type: bug The issue reports a bug / The PR fixes a bug (including spelling errors)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants