Skip to content

Commit 6061d9b

Browse files
committed
Fix pin change interrupt handling (#322)
1 parent 6e47228 commit 6061d9b

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

Diff for: hardware/esp8266com/esp8266/cores/esp8266/core_esp8266_wiring_digital.c

+5-1
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,11 @@ void interrupt_handler(void *arg) {
121121
while(!(changedbits & (1 << i))) i++;
122122
changedbits &= ~(1 << i);
123123
interrupt_handler_t *handler = &interrupt_handlers[i];
124-
if(((handler->mode & 1) == digitalRead(i)) && handler->fn) handler->fn();
124+
if (handler->fn &&
125+
(handler->mode == CHANGE ||
126+
(handler->mode & 1) == digitalRead(i))) {
127+
handler->fn();
128+
}
125129
}
126130
ETS_GPIO_INTR_ENABLE();
127131
}

0 commit comments

Comments
 (0)