esp8266: Actually disable pins when reset on reload.
This commit is contained in:
parent
5f6df7f54a
commit
c216c2876f
@ -28,6 +28,8 @@
|
|||||||
#include "common-hal/microcontroller/Pin.h"
|
#include "common-hal/microcontroller/Pin.h"
|
||||||
#include "shared-bindings/microcontroller/Pin.h"
|
#include "shared-bindings/microcontroller/Pin.h"
|
||||||
|
|
||||||
|
#include "py/mphal.h"
|
||||||
|
|
||||||
#include "eagle_soc.h"
|
#include "eagle_soc.h"
|
||||||
|
|
||||||
extern volatile bool adc_in_use;
|
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) {
|
void reset_pins(void) {
|
||||||
for (int i = 0; i < 17; i++) {
|
for (int i = 0; i < 17; i++) {
|
||||||
// 5 is RXD, 6 is TXD
|
// 5 is RXD, 6 is TXD
|
||||||
if (i == 0 || (i > 4 && i < 13) || i == 12) {
|
if ((i > 4 && i < 13) || i == 12) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
uint32_t peripheral = PERIPHS_IO_MUX + i * 4;
|
uint32_t peripheral = PERIPHS_IO_MUX + i * 4;
|
||||||
PIN_FUNC_SELECT(peripheral, 0);
|
PIN_FUNC_SELECT(peripheral, 0);
|
||||||
PIN_PULLUP_DIS(peripheral);
|
PIN_PULLUP_DIS(peripheral);
|
||||||
|
// Disable the pin.
|
||||||
|
gpio_output_set(0x0, 0x0, 0x0, 1 << i);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user