Skip to content

Commit 69f6a7d

Browse files
committed
Moved release_displays to the beginning
1 parent ea31ab1 commit 69f6a7d

File tree

2 files changed

+6
-10
lines changed

2 files changed

+6
-10
lines changed

examples/st7789_320x240_simpletest.py

+3-5
Original file line numberDiff line numberDiff line change
@@ -8,15 +8,13 @@
88
from adafruit_display_text import label
99
from adafruit_st7789 import ST7789
1010

11+
# Release any resources currently in use for the displays
12+
displayio.release_displays()
13+
1114
spi = board.SPI()
12-
while not spi.try_lock():
13-
pass
14-
spi.configure(baudrate=24000000) # Configure SPI for 24MHz
15-
spi.unlock()
1615
tft_cs = board.D5
1716
tft_dc = board.D6
1817

19-
displayio.release_displays()
2018
display_bus = displayio.FourWire(spi, command=tft_dc, chip_select=tft_cs, reset=board.D9)
2119

2220
display = ST7789(display_bus, width=320, height=240, rotation=90)

examples/st7789_simpletest.py

+3-5
Original file line numberDiff line numberDiff line change
@@ -8,15 +8,13 @@
88
from adafruit_display_text import label
99
from adafruit_st7789 import ST7789
1010

11+
# Release any resources currently in use for the displays
12+
displayio.release_displays()
13+
1114
spi = board.SPI()
12-
while not spi.try_lock():
13-
pass
14-
spi.configure(baudrate=24000000) # Configure SPI for 24MHz
15-
spi.unlock()
1615
tft_cs = board.D5
1716
tft_dc = board.D6
1817

19-
displayio.release_displays()
2018
display_bus = displayio.FourWire(spi, command=tft_dc, chip_select=tft_cs, reset=board.D9)
2119

2220
display = ST7789(display_bus, width=240, height=240, rowstart=80)

0 commit comments

Comments
 (0)