-
Notifications
You must be signed in to change notification settings - Fork 594
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
Add event handling methods #2140
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 all up.
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!
… setup If an interrupt happens while the pin is still being configured, undefined behavior could occur.
Allows us to trigger on pins where we lost the interrupt, at least in most cases (obviously, very short pulses on multiple inputs will still lose some)
@@ -315,37 +326,55 @@ protected PinValue InternalReadInterrupt(Port port) | |||
/// </returns> | |||
public PinValue ReadInterrupt() => InternalReadInterrupt(Port.PortA); | |||
|
|||
private byte SetBit(byte data, int bitNumber) => (byte)(data | (1 << bitNumber)); |
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.
nit: can be static
Fixes #2134
I had the
EnableInterruptOnChange
written long ago already, but apparently forgot to write a PR for it. Now that's done, together with the support for event handling using the "normal" GpioDriver methods.Microsoft Reviewers: Open in CodeFlow