-
Notifications
You must be signed in to change notification settings - Fork 195
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
Async: GPIO #333
Async: GPIO #333
Conversation
b527d71
to
c733731
Compare
c733731
to
0cc61a7
Compare
6a1794a
to
8dd1257
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.
LGTM
Only nit-pick is, there is no explanation of what to expect from the example - we have that for most examples - but not the end of the world and shouldn't keep us from merging
Good point, I added them for both this example and the embassy hello world :) |
Btw what should we do about MSRV? 1.67 is only needed for async? |
4266f84
to
92ea1a3
Compare
Maybe we can keep 1.65 and just say for async it's 1.67 I think I have seen that for other crates, too |
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.
LGTM!
RE the MSRV, I think what @bjoernQ said is probably best, keep it as-is but mention that for async specifically it's 1.67
. Once we've had another toolchain release or two we can re-visit this if needed.
} | ||
|
||
// clear interrupts | ||
Bank0GpioRegisterAccess::write_interrupt_status_clear(!0); |
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.
@MabezDev I'm not entirely sure but I think that set_int_enable
does not implicitly clear interrupt status bits, it is possible for an edge-triggered listener to wake a task twice (in this call, and at a later GPIO interrupt request).
I think it is also possible that we lose GPIO interrupt requests here, because read and clear are not atomic. Probably only those bits should be cleared here that are set in intrs
.
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.
I don't quite understand your first point, but I do agree that we should only clear the interrupts read from the status inside the GPIO interrupt handler.
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.
I am in the process of opening an issue with more data that confirms my suspicions: level-triggered interrupts fire multiple times, it looks like. But I might just have incorrect assumptions here, we'll see :)
Wait
for GpioPinTODO
Blocked on
impl_trait_projections
compiler feature to be available in the Xtensa fork (26th of Jan )future work (probably not going in this PR)