diff --git a/src/mgos_gpio.c b/src/mgos_gpio.c index b31e182e8..4700b6d70 100644 --- a/src/mgos_gpio.c +++ b/src/mgos_gpio.c @@ -111,7 +111,8 @@ static void mgos_gpio_int_cb(void *arg) { mgos_runlock(s_lock); s->cb(pin, s->cb_arg); mgos_rlock(s_lock); - s->cnt--; + if(s->cnt > 0) + s->cnt--; } } else { if (s->button.timer_id == MGOS_INVALID_TIMER_ID) {