8000 Merge pull request #6898 from dhalbert/espressif-pwmout-reset · litui/circuitpython@14fc4a0 · GitHub
[go: up one dir, main page]

Skip to content

Commit 14fc4a0

Browse files
authored
Merge pull request adafruit#6898 from dhalbert/espressif-pwmout-reset
Espressif pwmout reset fixes
2 parents 87d1206 + 2b25a5d commit 14fc4a0

File tree

12 files changed

+6
-56
lines changed

12 files changed

+6
-56
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 & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -71,12 +71,6 @@ uint8_t display_init_sequence[] = {
7171

7272

7373
void board_init(void) {
74-
// THIS SHOULD BE HANDLED BY espressif_board_reset_pin_number(), but it is not working.
75-
// TEMPORARY FIX UNTIL IT'S DIAGNOSED.
76-
common_hal_never_reset_pin(&pin_GPIO21);
77-
gpio_set_direction(21, GPIO_MODE_DEF_OUTPUT);
78-
gpio_set_level(21, true);
79-
8074
busio_spi_obj_t *spi = common_hal_board_create_spi(0);
8175
displayio_fourwire_obj_t *bus = &displays[0].fourwire_bus;
8276
bus->base.type = &displayio_fourwire_type;
@@ -94,9 +88,6 @@ void board_init(void) {
9488
displayio_display_obj_t *display = &displays[0].display;
9589
display->base.type = &displayio_display_type;
9690

97-
// workaround as board_init() is called before reset_port() in main.c
98-
pwmout_reset();
99-
10091
common_hal_displayio_display_construct(
10192
display,
10293
bus,
@@ -127,8 +118,6 @@ void board_init(void) {
127118
false, // SH1107_addressing
128119
50000 // backlight pwm frequency
129120
);
130-
131-
common_hal_never_reset_pin(&pin_GPIO45); // backlight pin
132121
}
133122

134123
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)
0