From d673cda325f76364cb26ea43900e1cc885d77b0e Mon Sep 17 00:00:00 2001
From: Pim van Pelt <pim@ipng.nl>
Date: Thu, 1 Nov 2018 14:11:37 +0100
Subject: [PATCH] Remove cooldown check - this is not what we're looking for

---
 .gitignore     | 1 +
 include/main.h | 1 -
 src/channel.c  | 6 ------
 3 files changed, 1 insertion(+), 7 deletions(-)

diff --git a/.gitignore b/.gitignore
index b301f9a..15de6e1 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,3 +1,4 @@
 build/
 deps/
 libs/prometheus-sensors
+*.txt
diff --git a/include/main.h b/include/main.h
index f997ffa..5091a2b 100644
--- a/include/main.h
+++ b/include/main.h
@@ -4,7 +4,6 @@
 #include "mgos.h"
 #include "mgos_gpio.h"
 
-#define CHANNEL_CHANGE_COOLDOWN_SECONDS    0.250
 #define CHANNEL_MAX                        16
 #define GPIO_INVALID                       255
 #define GPIO_MIN                           0
diff --git a/src/channel.c b/src/channel.c
index 6bd026e..482d317 100644
--- a/src/channel.c
+++ b/src/channel.c
@@ -176,7 +176,6 @@ bool channel_get(int idx) {
 
 void channel_handler(int gpio, void *arg) {
   uint8_t idx;
-  double  now = mg_time();
   bool    state;
 
   idx = channel_idx_by_gpio(gpio);
@@ -185,11 +184,6 @@ void channel_handler(int gpio, void *arg) {
     return;
   }
 
-  if (now < s_channels[idx].button_last_change + CHANNEL_CHANGE_COOLDOWN_SECONDS) {
-    LOG(LL_INFO, ("GPIO %d is cooling down -- skipping", gpio));
-    return;
-  }
-
   LOG(LL_INFO, ("GPIO %d triggered button %d", gpio, idx));
   state = channel_get(idx);
   channel_set(idx, !state);