File tree Expand file tree Collapse file tree 2 files changed +7
-3
lines changed Expand file tree Collapse file tree 2 files changed +7
-3
lines changed Original file line number Diff line number Diff line change @@ -112,9 +112,6 @@ namespace pimoroni {
112112
113113 command (reg::INVON); // set inversion mode
114114 command (reg::SLPOUT); // leave sleep mode
115- command (reg::DISPON); // turn display on
116-
117- sleep_ms (100 );
118115
119116 configure_display (rotation);
120117
@@ -314,6 +311,12 @@ namespace pimoroni {
314311
315312 gpio_put (cs, 1 );
316313 }
314+
315+ if (!display_on) {
316+ command (reg::DISPON); // turn display on
317+ sleep_ms (100 );
318+ display_on = true ;
319+ }
317320 }
318321
319322 void ST7789::set_backlight (uint8_t brightness) {
Original file line number Diff line number Diff line change @@ -43,6 +43,7 @@ namespace pimoroni {
4343 PIO parallel_pio;
4444 uint parallel_offset;
4545 uint st_dma;
46+ bool display_on = false ;
4647
4748
4849 // The ST7789 requires 16 ns between SPI rising edges.
You can’t perform that action at this time.
0 commit comments