8000 Fix pin change interrupt handling (#322) · raydtang/esp8266-arduino-master@6061d9b · GitHub
[go: up one dir, main page]

Skip to content

Commit 6061d9b

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

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

hardware/esp8266com/esp8266/cores/esp8266/core_esp8266_wiring_digital.c

Lines changed: 5 additions & 1 deletion
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)
0