Skip to content

Commit 7a4edfa

Browse files
committed
Override D13 pin
1 parent ab638d4 commit 7a4edfa

File tree

2 files changed

+22
-0
lines changed
  • ports/espressif/boards
    • arduino_nano_esp32s3_inverted_statusled
    • arduino_nano_esp32s3

2 files changed

+22
-0
lines changed

ports/espressif/boards/arduino_nano_esp32s3/board.c

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
#include "supervisor/board.h"
2828
#include "mpconfigboard.h"
2929
#include "shared-bindings/microcontroller/Pin.h"
30+
#include "components/driver/include/driver/gpio.h"
3031

3132
void board_init(void) {
3233
// Debug UART
@@ -36,4 +37,14 @@ void board_init(void) {
3637
#endif
3738
}
3839

40+
bool espressif_board_reset_pin_number(gpio_num_t pin_number) {
41+
if (pin_number == 13) {
42+
// Set D13 LED to output by default.
43+
gpio_set_direction(pin_number, GPIO_MODE_DEF_OUTPUT);
44+
return true;
45+
}
46+
47+
return false;
48+
}
49+
3950
// Use the MP_WEAK supervisor/shared/board.c versions of routines not defined here.

ports/espressif/boards/arduino_nano_esp32s3_inverted_statusled/board.c

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
#include "supervisor/board.h"
2828
#include "mpconfigboard.h"
2929
#include "shared-bindings/microcontroller/Pin.h"
30+
#include "components/driver/include/driver/gpio.h"
3031

3132
void board_init(void) {
3233
// Debug UART
@@ -36,4 +37,14 @@ void board_init(void) {
3637
#endif
3738
}
3839

40+
bool espressif_board_reset_pin_number(gpio_num_t pin_number) {
41+
if (pin_number == 13) {
42+
// Set D13 LED to output by default.
43+
gpio_set_direction(pin_number, GPIO_MODE_DEF_OUTPUT);
44+
return true;
45+
}
46+
47+
return false;
48+
}
49+
3950
// Use the MP_WEAK supervisor/shared/board.c versions of routines not defined here.

0 commit comments

Comments
 (0)