Remove cooldown check - this is not what we're looking for
This commit is contained in:
1
.gitignore
vendored
1
.gitignore
vendored
@ -1,3 +1,4 @@
|
|||||||
build/
|
build/
|
||||||
deps/
|
deps/
|
||||||
libs/prometheus-sensors
|
libs/prometheus-sensors
|
||||||
|
*.txt
|
||||||
|
@ -4,7 +4,6 @@
|
|||||||
#include "mgos.h"
|
#include "mgos.h"
|
||||||
#include "mgos_gpio.h"
|
#include "mgos_gpio.h"
|
||||||
|
|
||||||
#define CHANNEL_CHANGE_COOLDOWN_SECONDS 0.250
|
|
||||||
#define CHANNEL_MAX 16
|
#define CHANNEL_MAX 16
|
||||||
#define GPIO_INVALID 255
|
#define GPIO_INVALID 255
|
||||||
#define GPIO_MIN 0
|
#define GPIO_MIN 0
|
||||||
|
@ -176,7 +176,6 @@ bool channel_get(int idx) {
|
|||||||
|
|
||||||
void channel_handler(int gpio, void *arg) {
|
void channel_handler(int gpio, void *arg) {
|
||||||
uint8_t idx;
|
uint8_t idx;
|
||||||
double now = mg_time();
|
|
||||||
bool state;
|
bool state;
|
||||||
|
|
||||||
idx = channel_idx_by_gpio(gpio);
|
idx = channel_idx_by_gpio(gpio);
|
||||||
@ -185,11 +184,6 @@ void channel_handler(int gpio, void *arg) {
|
|||||||
return;
|
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));
|
LOG(LL_INFO, ("GPIO %d triggered button %d", gpio, idx));
|
||||||
state = channel_get(idx);
|
state = channel_get(idx);
|
||||||
channel_set(idx, !state);
|
channel_set(idx, !state);
|
||||||
|
Reference in New Issue
Block a user