From 7fe6cf5ed6469d6aa528551d59eb994f68fb0e2e Mon Sep 17 00:00:00 2001 From: Melissa LeBlanc-Williams Date: Fri, 1 Sep 2023 15:03:08 -0700 Subject: [PATCH] Set D13 to input with Pulldown --- ports/espressif/boards/arduino_nano_esp32s3/board.c | 5 +++-- .../boards/arduino_nano_esp32s3_inverted_statusled/board.c | 5 +++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/ports/espressif/boards/arduino_nano_esp32s3/board.c b/ports/espressif/boards/arduino_nano_esp32s3/board.c index 0fc5bd1426..8952a19c5d 100644 --- a/ports/espressif/boards/arduino_nano_esp32s3/board.c +++ b/ports/espressif/boards/arduino_nano_esp32s3/board.c @@ -39,8 +39,9 @@ void board_init(void) { bool espressif_board_reset_pin_number(gpio_num_t pin_number) { if (pin_number == 13) { - // Set D13 LED to output by default. - gpio_set_direction(pin_number, GPIO_MODE_DEF_OUTPUT); + // Set D13 LED to input when not in use + gpio_set_direction(pin_number, GPIO_MODE_DEF_INPUT); + gpio_set_pull_mode(pin_number, GPIO_PULLDOWN_ONLY); return true; } diff --git a/ports/espressif/boards/arduino_nano_esp32s3_inverted_statusled/board.c b/ports/espressif/boards/arduino_nano_esp32s3_inverted_statusled/board.c index 0fc5bd1426..8952a19c5d 100644 --- a/ports/espressif/boards/arduino_nano_esp32s3_inverted_statusled/board.c +++ b/ports/espressif/boards/arduino_nano_esp32s3_inverted_statusled/board.c @@ -39,8 +39,9 @@ void board_init(void) { bool espressif_board_reset_pin_number(gpio_num_t pin_number) { if (pin_number == 13) { - // Set D13 LED to output by default. - gpio_set_direction(pin_number, GPIO_MODE_DEF_OUTPUT); + // Set D13 LED to input when not in use + gpio_set_direction(pin_number, GPIO_MODE_DEF_INPUT); + gpio_set_pull_mode(pin_number, GPIO_PULLDOWN_ONLY); return true; }