Skip to content

Commit 2174722

Browse files
committed
unexpectedmaker_tinywatch_s3: Fix power shutdown pin
1 parent c5c7d11 commit 2174722

File tree

1 file changed

+18
-0
lines changed
  • ports/espressif/boards/unexpectedmaker_tinywatch_s3

1 file changed

+18
-0
lines changed

ports/espressif/boards/unexpectedmaker_tinywatch_s3/board.c

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,5 +25,23 @@
2525
*/
2626

2727
#include "supervisor/board.h"
28+
#include "shared-bindings/microcontroller/Pin.h"
29+
#include "components/driver/include/driver/gpio.h"
30+
31+
bool espressif_board_reset_pin_number(gpio_num_t pin_number) {
32+
// Pull USER_PWR_SHUTDOWN down (pull up shuts down power)
33+
if (pin_number == 21) {
34+
gpio_config_t cfg = {
35+
.pin_bit_mask = BIT64(pin_number),
36+
.mode = GPIO_MODE_DISABLE,
37+
.pull_up_en = false,
38+
.pull_down_en = true,
39+
.intr_type = GPIO_INTR_DISABLE,
40+
};
41+
gpio_config(&cfg);
42+
return true;
43+
}
44+
return false;
45+
}
2846

2947
// Use the MP_WEAK supervisor/shared/board.c versions of routines not defined here.

0 commit comments

Comments
 (0)