Skip to content

Conversation

maribu
Copy link
Member

@maribu maribu commented Jan 3, 2023

Contribution description

This fixes test failures in tests/periph_timer_short_relative_set.

Note: This differs a bit from the implementation in e.g. nRF5x or STM32 in that it always briefly pauses the timer. The issue is that when running the timer can take a few ticks to actually react to the new compare target. So even if the previously written target is still in the future, the timer may not fire anyway. Pausing the timer while setting and setting the target at least one higher than the current count reliably triggers the IRQ.

Testing procedure

Run tests/periph_timer_short_relative_set at least a few dozen times (or use #19030 to have a few dozen repetitions of the test case in a single run of the test application). It should now succeed.

Issues/PRs references

None

This fixes test failures in tests/periph_timer_short_relative_set.

Note: This differs a bit from the implementation in e.g. nRF5x or STM32
in that it always briefly pauses the timer. The issue is that when
running the timer can take a few ticks to actually react to the new
compare target. So even if the previously written target is still in
the future, the timer may not fire anyway. Pausing the timer while
setting and setting the target at least one higher than the current
count reliably triggers the IRQ.
@maribu maribu 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: cpu Area: CPU/MCU ports labels Jan 3, 2023
@maribu maribu requested a review from benpicco January 3, 2023 21:41
@github-actions github-actions bot added the Platform: ARM Platform: This PR/issue effects ARM-based platforms label Jan 3, 2023
Copy link
Contributor

@benpicco benpicco left a comment

Choose a reason for hiding this comment

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

bors merge

@bors
Copy link
Contributor

bors bot commented Jan 3, 2023

🕐 Waiting for PR status (GitHub check) to be set, probably by CI. Bors will automatically try to run when all required PR statuses are set.

@riot-ci
Copy link

riot-ci commented Jan 3, 2023

Murdock results

✔️ PASSED

94f9a56 cpu/qn908x/periph_timer: Implement timer_set()

Success Failures Total Runtime
6770 0 6770 13m:51s

Artifacts

@kaspar030
Copy link
Contributor

bors merge

@bors
Copy link
Contributor

bors bot commented Jan 4, 2023

Build succeeded:

@bors bors bot merged commit 9f396d1 into RIOT-OS:master Jan 4, 2023
@maribu maribu deleted the cpu/qn908x/periph_timer branch January 4, 2023 15:38
@maribu
Copy link
Member Author

maribu commented Jan 4, 2023

Thx :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: cpu Area: CPU/MCU ports CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR Platform: ARM Platform: This PR/issue effects ARM-based platforms 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.

4 participants