Skip to content

Commit 2919dcd

Browse files
committed
reset the tft just once
.. because resetting it will also reset the IO expander and that's bad
1 parent b2c3e32 commit 2919dcd

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

adafruit_pycamera/adafruit_pycamera.py renamed to adafruit_pycamera/__init__.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -531,15 +531,15 @@ def resolution(self, res):
531531
self._res_label.text = self.resolutions[res]
532532
self.display.refresh()
533533

534-
def init_display(self):
534+
def init_display(self, reset=board.TFT_RESET):
535535
"""Initialize the TFT display"""
536536
# construct displayio by hand
537537
displayio.release_displays()
538538
self._display_bus = displayio.FourWire(
539539
self._spi,
540540
command=board.TFT_DC,
541541
chip_select=board.TFT_CS,
542-
reset=board.TFT_RESET,
542+
reset=reset,
543543
baudrate=60_000_000,
544544
)
545545
self.display = board.DISPLAY
@@ -567,7 +567,7 @@ def display_message(self, message, color=0xFF0000, scale=3):
567567
text_area = label.Label(terminalio.FONT, text=message, color=color, scale=scale)
568568
text_area.anchor_point = (0.5, 0.5)
569569
if not self.display:
570-
self.init_display()
570+
self.init_display(None)
571571
text_area.anchored_position = (self.display.width / 2, self.display.height / 2)
572572

573573
# Show it
@@ -611,7 +611,7 @@ def mount_sd_card(self):
611611
vfs = storage.VfsFat(self.sdcard)
612612
print("mount vfs @", time.monotonic() - self._timestamp)
613613
storage.mount(vfs, "/sd")
614-
self.init_display()
614+
self.init_display(None)
615615
self._image_counter = 0
616616
self._sd_label.text = "SD OK"
617617
self._sd_label.color = 0x00FF00

0 commit comments

Comments
 (0)