File tree 2 files changed +10
-2
lines changed
ports/espressif/boards/adafruit_feather_esp32s2
2 files changed +10
-2
lines changed Original file line number Diff line number Diff line change @@ -41,8 +41,16 @@ bool board_requests_safe_mode(void) {
41
41
42
42
void reset_board (void ) {
43
43
// Turn on I2C power by default.
44
+
45
+ // set pin to input to find 'rest state'
46
+ gpio_set_direction (7 , GPIO_MODE_DEF_INPUT );
47
+ // wait 1 millis for pull to activate
48
+ mp_hal_delay_ms (1 );
49
+ // read rest state (off)
50
+ bool restlevel = gpio_get_level (7 );
44
51
gpio_set_direction (7 , GPIO_MODE_DEF_OUTPUT );
45
- gpio_set_level (7 , false);
52
+ // flip it!
53
+ gpio_set_level (7 , !restlevel );
46
54
}
47
55
48
56
void board_deinit (void ) {
Original file line number Diff line number Diff line change @@ -16,7 +16,7 @@ STATIC const mp_rom_map_elem_t board_module_globals_table[] = {
16
16
{ MP_ROM_QSTR (MP_QSTR_D5 ), MP_ROM_PTR (& pin_GPIO5 ) },
17
17
{ MP_ROM_QSTR (MP_QSTR_D6 ), MP_ROM_PTR (& pin_GPIO6 ) },
18
18
19
- { MP_ROM_QSTR (MP_QSTR_I2C_POWER_INVERTED ), MP_ROM_PTR (& pin_GPIO7 ) },
19
+ { MP_ROM_QSTR (MP_QSTR_I2C_POWER ), MP_ROM_PTR (& pin_GPIO7 ) },
20
20
{ MP_ROM_QSTR (MP_QSTR_D7 ), MP_ROM_PTR (& pin_GPIO7 ) },
21
21
22
22
{ MP_ROM_QSTR (MP_QSTR_A5 ), MP_ROM_PTR (& pin_GPIO8 ) },
You can’t perform that action at this time.
0 commit comments