Skip to content

Commit

Permalink
Removed unnecessary conditional.
Browse files Browse the repository at this point in the history
  • Loading branch information
cpu20 committed Jul 15, 2018
1 parent d7dc7a8 commit 61f075e
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 5 deletions.
5 changes: 1 addition & 4 deletions gaugette/switch.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,7 @@ def __init__(self, gpio, pin, pull_up=True):
# edge = gpio.EDGE_FALLING or gpio.EDGE_RISING
# isr = interrupt service routine
def enable_isr(self, edge, isr):
if edge:
self.gpio.trigger(self.pin, edge, isr)
else:
self.gpio.trigger(self.pin, edge, isr)
self.gpio.trigger(self.pin, edge, isr)

def get_state(self):
state = self.gpio.input(self.pin)
Expand Down
2 changes: 1 addition & 1 deletion samples/switch_isr.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ def pushed():

gpio = gaugette.gpio.GPIO()
sw = gaugette.switch.Switch(gpio, SW_PIN)
# Calls pushed() on a rising edge
# Calls pushed() on a falling edge
sw.enable_isr(gpio.EDGE_FALLING, pushed)

while True:
Expand Down

0 comments on commit 61f075e

Please sign in to comment.