diff options
| author | Dan Halbert <halbert@halwitz.org> | 2017-10-16 18:42:22 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2017-10-16 18:42:22 -0400 |
| commit | 2148211314edd378770286b504195d913723e34b (patch) | |
| tree | 1b0d01edebb0bc510fa24d480e339c4c0118c7ba | |
| parent | 5f6df7f54a06720ff0633639b0c489696f252102 (diff) | |
| parent | c216c2876f46501db62faa133d9ac2c150791814 (diff) | |
Merge pull request #337 from tannewt/fix_pin_reset
esp8266: Actually disable pins when reset on reload.
| -rw-r--r-- | esp8266/common-hal/microcontroller/Pin.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/esp8266/common-hal/microcontroller/Pin.c b/esp8266/common-hal/microcontroller/Pin.c index 417ab0c41..5c90f4f1a 100644 --- a/esp8266/common-hal/microcontroller/Pin.c +++ b/esp8266/common-hal/microcontroller/Pin.c @@ -28,6 +28,8 @@ #include "common-hal/microcontroller/Pin.h" #include "shared-bindings/microcontroller/Pin.h" +#include "py/mphal.h" + #include "eagle_soc.h" extern volatile bool adc_in_use; @@ -48,11 +50,13 @@ bool common_hal_mcu_pin_is_free(const mcu_pin_obj_t* pin) { void reset_pins(void) { for (int i = 0; i < 17; i++) { // 5 is RXD, 6 is TXD - if (i == 0 || (i > 4 && i < 13) || i == 12) { + if ((i > 4 && i < 13) || i == 12) { continue; } uint32_t peripheral = PERIPHS_IO_MUX + i * 4; PIN_FUNC_SELECT(peripheral, 0); PIN_PULLUP_DIS(peripheral); + // Disable the pin. + gpio_output_set(0x0, 0x0, 0x0, 1 << i); } } |
