Skip to content

Commit 14adfb1

Browse files
committed
avoid pwmout_reset() workaround by reordering in main(); remove unnecessary never-resets
1 parent d0d1017 commit 14adfb1

File tree

11 files changed

+4
-46
lines changed

11 files changed

+4
-46
lines changed

main.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -967,15 +967,15 @@ int __attribute__((used)) main(void) {
967967
safe_mode = NO_CIRCUITPY;
968968
}
969969

970-
// displays init after filesystem, since they could share the flash SPI
971-
board_init();
972-
973970
// Reset everything and prep MicroPython to run boot.py.
974971
reset_port();
975972
// Port-independent devices, like CIRCUITPY_BLEIO_HCI.
976973
reset_devices();
977974
reset_board();
978975

976+
// displays init after filesystem, since they could share the flash SPI
977+
board_init();
978+
979979
// This is first time we are running CircuitPython after a reset or power-up.
980980
supervisor_set_run_reason(RUN_REASON_STARTUP);
981981

ports/espressif/boards/adafruit_esp32s2_camera/board.c

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -63,9 +63,6 @@ void board_init(void) {
6363
0, // Polarity
6464
0); // Phase
6565

66-
// workaround as board_init() is called before reset_port() in main.c
67-
pwmout_reset();
68-
6966
displayio_display_obj_t *display = &displays[0].display;
7067
display->base.type = &displayio_display_type;
7168
common_hal_displayio_display_construct(

ports/espressif/boards/adafruit_feather_esp32s3_tft/board.c

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -88,11 +88,6 @@ void board_init(void) {
8888
displayio_display_obj_t *display = &displays[0].display;
8989
display->base.type = &displayio_display_type;
9090

91-
// workaround as board_init() is called before reset_port() in main.c
92-
#if CIRCUITPY_PWMIO
93-
pwmout_reset();
94-
#endif
95-
9691
common_hal_displayio_display_construct(
9792
display,
9893
bus,
@@ -123,8 +118,6 @@ void board_init(void) {
123118
false, // SH1107_addressing
124119
50000 // backlight pwm frequency
125120
);
126-
127-
common_hal_never_reset_pin(&pin_GPIO45); // backlight pin
128121
}
129122

130123
bool espressif_board_reset_pin_number(gpio_num_t pin_number) {

ports/espressif/boards/adafruit_funhouse/board.c

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -71,9 +71,6 @@ void board_init(void) {
7171
0, // Polarity
7272
0); // Phase
7373

74-
// workaround as board_init() is called before reset_port() in main.c
75-
pwmout_reset();
76-
7774
displayio_display_obj_t *display = &displays[0].display;
7875
display->base.type = &displayio_display_type;
7976
common_hal_displayio_display_construct(

ports/espressif/boards/espressif_esp32s3_eye/board.c

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -87,9 +87,6 @@ void board_init(void) {
8787
displayio_display_obj_t *display = &displays[0].display;
8888
display->base.type = &displayio_display_type;
8989

90-
// workaround as board_init() is called before reset_port() in main.c
91-
pwmout_reset();
92-
9390
common_hal_displayio_display_construct(
9491
display,
9592
bus,
@@ -120,9 +117,6 @@ void board_init(void) {
120117
false, // SH1107_addressing
121118
50000 // backlight pwm frequency
122119
);
123-
124-
common_hal_never_reset_pin(&pin_GPIO48); // backlight pin
125-
// Debug UART
126120
}
127121

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

ports/espressif/boards/hexky_s2/board.c

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -88,9 +88,6 @@ void board_init(void) {
8888
displayio_display_obj_t *display = &displays[0].display;
8989
display->base.type = &displayio_display_type;
9090

91-
// workaround as board_init() is called before reset_port() in main.c
92-
pwmout_reset();
93-
9491
common_hal_displayio_display_construct(
9592
display,
9693
bus,
@@ -121,8 +118,6 @@ void board_init(void) {
121118
false, // SH1107_addressing
122119
50000 // backlight pwm frequency
123120
);
124-
125-
common_hal_never_reset_pin(&pin_GPIO45); // backlight pin
126121
}
127122

128123
bool espressif_board_reset_pin_number(gpio_num_t pin_number) {

ports/espressif/boards/hiibot_iots2/board.c

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -93,9 +93,6 @@ static void display_init(void) {
9393
displayio_display_obj_t *display = &displays[0].display;
9494
display->base.type = &displayio_display_type;
9595

96-
// workaround as board_init() is called before reset_port() in main.c
97-
pwmout_reset();
98-
9996
common_hal_displayio_display_construct(
10097
display,
10198
bus,
@@ -126,8 +123,6 @@ static void display_init(void) {
126123
false, // SH1107_addressing
127124
50000 // backlight pwm frequency
128125
);
129-
130-
common_hal_never_reset_pin(&pin_GPIO38); // backlight pin
131126
}
132127

133128
void board_init(void) {

ports/espressif/boards/lilygo_ttgo_t8_s2_st7789/board.c

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -93,9 +93,6 @@ static void display_init(void) {
9393
displayio_display_obj_t *display = &displays[0].display;
9494
display->base.type = &displayio_display_type;
9595

96-
// workaround as board_init() is called before reset_port() in main.c
97-
pwmout_reset();
98-
9996
common_hal_displayio_display_construct(
10097
display,
10198
bus,
@@ -126,8 +123,6 @@ static void display_init(void) {
126123
false, // SH1107_addressing
127124
50000 // backlight pwm frequency
128125
);
129-
130-
common_hal_never_reset_pin(&pin_GPIO33); // backlight pin
131126
}
132127

133128
void board_init(void) {

ports/espressif/boards/morpheans_morphesp-240/board.c

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -172,9 +172,6 @@ void board_init(void) {
172172
0 // phase
173173
);
174174

175-
// workaround as board_init() is called before reset_port() in main.c
176-
pwmout_reset();
177-
178175
displayio_display_obj_t *display = &displays[0].display;
179176
display->base.type = &displayio_display_type;
180177
common_hal_displayio_display_construct(

ports/espressif/boards/waveshare_esp32_s2_pico_lcd/board.c

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -92,9 +92,6 @@ static void display_init(void) {
9292
displayio_display_obj_t *display = &displays[0].display;
9393
display->base.type = &displayio_display_type;
9494

95-
// workaround as board_init() is called before reset_port() in main.c
96-
pwmout_reset();
97-
9895
common_hal_displayio_display_construct(
9996
display,
10097
bus,
@@ -125,8 +122,6 @@ static void display_init(void) {
125122
false, // SH1107_addressing
126123
50000 // backlight pwm frequency
127124
);
128-
129-
common_hal_never_reset_pin(&pin_GPIO45); // backlight pin
130125
}
131126

132127

0 commit comments

Comments
 (0)