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

Fix race condition in RTC event handling #243

Merged
merged 3 commits into from
Oct 7, 2020

Conversation

timokroeger
Copy link
Contributor

Also add a minimal RTC example to show how to use compare events.

Previously there was a race condition:
1. read() to event register happens, event not set
2. event is being set by hardware
3. write(0) clears the event without the user noticing

The new API is modelled after the GPIOE API.

Thanks to @Dirbaio for helping to investigate on Matrix.
Copy link
Contributor

@Yatekii Yatekii left a comment

Choose a reason for hiding this comment

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

Hey, I added a suggestion to remove most of the Embed.toml

It is enough to just add the bits that deviate from the default configuration, which is basically just enabling RTT :) The rest will be merged in from the default config inside cargo-embed :)

examples/rtc-demo/Embed.toml Outdated Show resolved Hide resolved
Co-authored-by: Yatekii <Yatekii@users.noreply.github.com>
@jonas-schievink
Copy link
Contributor

Thanks!

@jonas-schievink jonas-schievink merged commit 52e5f2b into nrf-rs:master Oct 7, 2020
@timokroeger timokroeger deleted the fix-rtc-event branch October 9, 2020 08:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants