Skip to content

Commit 24f2e4f

Browse files
committed
Add support for Ai Thinker ESP32-CAM boards (default flashlight to off)
1 parent 2396f8b commit 24f2e4f

File tree

1 file changed

+26
-0
lines changed
  • ports/espressif/boards/ai-thinker-esp32-cam

1 file changed

+26
-0
lines changed

ports/espressif/boards/ai-thinker-esp32-cam/board.c

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,3 +25,29 @@
2525
*/
2626

2727
#include "supervisor/board.h"
28+
29+
#include "mpconfigboard.h"
30+
#include "shared-bindings/microcontroller/Pin.h"
31+
#include "components/driver/gpio/include/driver/gpio.h"
32+
#include "components/hal/include/hal/gpio_hal.h"
33+
#include "common-hal/microcontroller/Pin.h"
34+
35+
void board_init(void) {
36+
reset_board();
37+
}
38+
39+
bool espressif_board_reset_pin_number(gpio_num_t pin_number) {
40+
// Pull one LED down on reset rather than the default up
41+
if (pin_number == 4) { // This is the flashlight LED - very bright
42+
gpio_config_t cfg = {
43+
.pin_bit_mask = BIT64(pin_number),
44+
.mode = GPIO_MODE_DISABLE,
45+
.pull_up_en = false,
46+
.pull_down_en = true,
47+
.intr_type = GPIO_INTR_DISABLE,
48+
};
49+
gpio_config(&cfg);
50+
return true;
51+
}
52+
return false;
53+
}

0 commit comments

Comments
 (0)