mirror of
https://github.com/esp8266/Arduino.git
synced 2025-04-21 10:26:06 +03:00
wiring_digital: fix interrupts, initialize pins to INPUT on startup
This commit is contained in:
parent
dbbd047980
commit
9fd686b853
@ -154,7 +154,15 @@ extern void __detachInterrupt(uint8_t pin) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void initPins() {
|
void initPins() {
|
||||||
ETS_GPIO_INTR_ATTACH(interrupt_handlers, &interrupt_reg);
|
for (int i = 0; i <= 5; ++i) {
|
||||||
|
pinMode(i, INPUT);
|
||||||
|
}
|
||||||
|
// pins 6-11 are used for the SPI flash interface
|
||||||
|
for (int i = 12; i <= 16; ++i) {
|
||||||
|
pinMode(i, INPUT);
|
||||||
|
}
|
||||||
|
|
||||||
|
ETS_GPIO_INTR_ATTACH(interrupt_handler, &interrupt_reg);
|
||||||
ETS_GPIO_INTR_ENABLE();
|
ETS_GPIO_INTR_ENABLE();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user