From 61f075e7ecbd46376fb3602918f78e6857ee9fc9 Mon Sep 17 00:00:00 2001 From: Tijl Date: Sun, 15 Jul 2018 10:09:33 +0200 Subject: [PATCH] Removed unnecessary conditional. --- gaugette/switch.py | 5 +---- samples/switch_isr.py | 2 +- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/gaugette/switch.py b/gaugette/switch.py index a983cfe..b2eba64 100755 --- a/gaugette/switch.py +++ b/gaugette/switch.py @@ -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) diff --git a/samples/switch_isr.py b/samples/switch_isr.py index 77080b1..c956628 100755 --- a/samples/switch_isr.py +++ b/samples/switch_isr.py @@ -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: