Skip to content

Commit 9fd686b

Browse files
committed
wiring_digital: fix interrupts, initialize pins to INPUT on startup
1 parent dbbd047 commit 9fd686b

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

cores/esp8266/core_esp8266_wiring_digital.c

+9-1
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,15 @@ extern void __detachInterrupt(uint8_t pin) {
154154
}
155155

156156
void initPins() {
157-
ETS_GPIO_INTR_ATTACH(interrupt_handlers, &interrupt_reg);
157+
for (int i = 0; i <= 5; ++i) {
158+
pinMode(i, INPUT);
159+
}
160+
// pins 6-11 are used for the SPI flash interface
161+
for (int i = 12; i <= 16; ++i) {
162+
pinMode(i, INPUT);
163+
}
164+
165+
ETS_GPIO_INTR_ATTACH(interrupt_handler, &interrupt_reg);
158166
ETS_GPIO_INTR_ENABLE();
159167
}
160168

0 commit comments

Comments
 (0)