Skip to content

Commit

Permalink
Improve GpioControllerValueChanged (#9)
Browse files Browse the repository at this point in the history
  • Loading branch information
josesimoes authored Oct 22, 2020
1 parent 74a317a commit 871666a
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions System.Device.Gpio/GpioController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -269,16 +269,16 @@ private void GpioControllerValueChanged(
// sanity check
if(gpioPin != null)
{
if (((gpioPin.GpioEvents & PinEventTypes.Falling) == PinEventTypes.Falling)
&& ((e.ChangeType & PinEventTypes.Falling) == PinEventTypes.Falling))
if (gpioPin.GpioEvents.HasFlag(PinEventTypes.Falling)
&& e.ChangeType.HasFlag(PinEventTypes.Falling))
{
gpioPin.GpioPinChange.Invoke(
this,
new PinValueChangedEventArgs(PinEventTypes.Falling, gpioPin.PinNumber));
}

if (((gpioPin.GpioEvents & PinEventTypes.Rising) == PinEventTypes.Rising)
&& ((e.ChangeType & PinEventTypes.Rising) == PinEventTypes.Rising))
if (gpioPin.GpioEvents.HasFlag(PinEventTypes.Rising)
&& e.ChangeType.HasFlag(PinEventTypes.Rising))
{
gpioPin.GpioPinChange.Invoke(
this,
Expand Down

0 comments on commit 871666a

Please sign in to comment.