@@ -71,14 +71,6 @@ uint8_t display_init_sequence[] = {
71
71
72
72
73
73
void board_init (void ) {
74
- // Never reset the I2C/TFT power pin because doing so will reset the display.
75
- // Instead, on reset set the default value and free the pin for user use.
76
- // Relying on the normal pin reset would briefly float/pull the pin that
77
- // could lead to a power brownout.
78
- common_hal_never_reset_pin (& pin_GPIO21 );
79
-
80
- reset_board ();
81
-
82
74
busio_spi_obj_t * spi = common_hal_board_create_spi (0 );
83
75
displayio_fourwire_obj_t * bus = & displays [0 ].fourwire_bus ;
84
76
bus -> base .type = & displayio_fourwire_type ;
@@ -99,7 +91,6 @@ void board_init(void) {
99
91
// workaround as board_init() is called before reset_port() in main.c
100
92
pwmout_reset ();
101
93
102
-
103
94
common_hal_displayio_display_construct (
104
95
display ,
105
96
bus ,
@@ -138,12 +129,18 @@ bool board_requests_safe_mode(void) {
138
129
return false;
139
130
}
140
131
141
- void reset_board (void ) {
142
- // Turn on TFT and I2C
143
- gpio_set_direction (21 , GPIO_MODE_DEF_OUTPUT );
144
- gpio_set_level (21 , true);
132
+ bool espressif_board_reset_pin_number (gpio_num_t pin_number ) {
133
+ // Override the I2C/TFT power pin reset to prevent resetting the display.
134
+ if (pin_number == 21 ) {
135
+ // Turn on TFT and I2C
136
+ gpio_set_direction (21 , GPIO_MODE_DEF_OUTPUT );
137
+ gpio_set_level (21 , true);
138
+ return true;
139
+ }
140
+ return false;
141
+ }
145
142
146
- free_pin_number ( 21 );
143
+ void reset_board ( void ) {
147
144
}
148
145
149
146
void board_deinit (void ) {
0 commit comments