From d6ea24685bca1607492842d6bb6f842dac37ccc1 Mon Sep 17 00:00:00 2001 From: Martin Brodbeck Date: Wed, 1 Jun 2022 21:14:22 +0200 Subject: [PATCH] Fixed logic error in relais --- src/gbmanager.cpp | 2 +- src/relais.cpp | 8 +------- 2 files changed, 2 insertions(+), 8 deletions(-) diff --git a/src/gbmanager.cpp b/src/gbmanager.cpp index 5b392cb..97da8ea 100644 --- a/src/gbmanager.cpp +++ b/src/gbmanager.cpp @@ -36,7 +36,7 @@ void buttonPressedCallback(uint gpio, uint32_t events) { } else { lastPressed = get_absolute_time(); } - + switch (gpio) { case BUTTON_1_PIN: temp_tgt -= 0.5; diff --git a/src/relais.cpp b/src/relais.cpp index fa5561d..6742c33 100644 --- a/src/relais.cpp +++ b/src/relais.cpp @@ -6,13 +6,7 @@ Relais::Relais(uint gpio) : gpio{gpio} { off(); } -void Relais::activate(bool active) { - if (active) { - gpio_pull_down(gpio); - } else { - gpio_pull_up(gpio); - } -} +void Relais::activate(bool active) { gpio_put(gpio, !active); } void Relais::on() { activate(true); }