File tree Expand file tree Collapse file tree 2 files changed +46
-0
lines changed Expand file tree Collapse file tree 2 files changed +46
-0
lines changed Original file line number Diff line number Diff line change 28
28
#include "shared-bindings/microcontroller/Pin.h"
29
29
#include "supervisor/board.h"
30
30
31
+ #include "components/driver/include/driver/gpio.h"
32
+ #include "soc/usb_serial_jtag_struct.h"
33
+
31
34
void board_init (void ) {
32
35
// Debug UART
33
36
#ifdef DEBUG
34
37
common_hal_never_reset_pin (& pin_GPIO20 );
35
38
common_hal_never_reset_pin (& pin_GPIO21 );
36
39
#endif
40
+
41
+ // This board has LEDs connected to the USB pins
42
+ USB_SERIAL_JTAG .conf0 .usb_pad_enable = 0 ;
43
+ USB_SERIAL_JTAG .conf0 .dp_pullup = 0 ;
37
44
}
38
45
39
46
bool board_requests_safe_mode (void ) {
40
47
return false;
41
48
}
42
49
50
+ bool espressif_board_reset_pin_number (gpio_num_t pin_number ) {
51
+ // Pull LEDs down on reset rather than the default up
52
+ if (pin_number == 3 || pin_number == 4 || pin_number == 5 || pin_number == 18 || pin_number == 19 ) {
53
+ gpio_config_t cfg = {
54
+ .pin_bit_mask = BIT64 (pin_number ),
55
+ .mode = GPIO_MODE_DISABLE ,
56
+ .pull_up_en = false,
57
+ .pull_down_en = true,
58
+ .intr_type = GPIO_INTR_DISABLE ,
59
+ };
60
+ gpio_config (& cfg );
61
+ return true;
62
+ }
63
+ return false;
64
+ }
65
+
43
66
void reset_board (void ) {
44
67
}
45
68
Original file line number Diff line number Diff line change 28
28
#include "shared-bindings/microcontroller/Pin.h"
29
29
#include "supervisor/board.h"
30
30
31
+ #include "components/driver/include/driver/gpio.h"
32
+ #include "soc/usb_serial_jtag_struct.h"
33
+
31
34
void board_init (void ) {
32
35
// Debug UART
33
36
#ifdef DEBUG
34
37
common_hal_never_reset_pin (& pin_GPIO20 );
35
38
common_hal_never_reset_pin (& pin_GPIO21 );
36
39
#endif
40
+
41
+ // This board has LEDs connected to the USB pins
42
+ USB_SERIAL_JTAG .conf0 .usb_pad_enable = 0 ;
43
+ USB_SERIAL_JTAG .conf0 .dp_pullup = 0 ;
37
44
}
38
45
39
46
bool board_requests_safe_mode (void ) {
40
47
return false;
41
48
}
42
49
50
+ bool espressif_board_reset_pin_number (gpio_num_t pin_number ) {
51
+ // Pull LEDs down on reset rather than the default up
52
+ if (pin_number == 3 || pin_number == 4 || pin_number == 5 || pin_number == 18 || pin_number == 19 ) {
53
+ gpio_config_t cfg = {
54
+ .pin_bit_mask = BIT64 (pin_number ),
55
+ .mode = GPIO_MODE_DISABLE ,
56
+ .pull_up_en = false,
57
+ .pull_down_en = true,
58
+ .intr_type = GPIO_INTR_DISABLE ,
59
+ };
60
+ gpio_config (& cfg );
61
+ return true;
62
+ }
63
+ return false;
64
+ }
65
+
43
66
void reset_board (void ) {
44
67
}
45
68
You can’t perform that action at this time.
0 commit comments