Skip to content

unexpectedmaker_tinywatch_s3: Fix power shutdown pin #8716

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Dec 12, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions ports/espressif/boards/unexpectedmaker_tinywatch_s3/board.c
Original file line number Diff line number Diff line change
Expand Up @@ -25,5 +25,23 @@
*/

#include "supervisor/board.h"
#include "shared-bindings/microcontroller/Pin.h"
#include "components/driver/include/driver/gpio.h"

bool espressif_board_reset_pin_number(gpio_num_t pin_number) {
// Pull USER_PWR_SHUTDOWN down (pull up shuts down power)
if (pin_number == 21) {
gpio_config_t cfg = {
.pin_bit_mask = BIT64(pin_number),
.mode = GPIO_MODE_DISABLE,
.pull_up_en = false,
.pull_down_en = true,
.intr_type = GPIO_INTR_DISABLE,
};
gpio_config(&cfg);
return true;
}
return false;
}

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