camera_app.py: only try for supported hardware

This commit is contained in:
Thomas Farstrike
2025-10-07 22:40:38 +02:00
parent 2660ef1adc
commit 093da7b423
3 changed files with 7 additions and 1 deletions
@@ -98,12 +98,16 @@ class CameraApp(Activity):
self.status_label = lv.label(self.status_label_cont)
self.status_label.set_text("No camera found.")
self.status_label.set_long_mode(lv.label.LONG.WRAP)
self.status_label.set_style_text_color(lv.color_white(), 0)
self.status_label.set_width(lv.pct(100))
self.status_label.center()
self.setContentView(main_screen)
def onResume(self, screen):
try:
assert(current_hardware == "unix" or current_hardware == "waveshare-esp32-s3-touch-lcd-2")
except Exception as e: # use an assert in case current_hardware isn't defined for some boards
print("WARNING: the current_hardware doesn't have support for a camera!")
return
self.cam = init_internal_cam()
if self.cam:
self.image.set_rotation(900) # internal camera is rotated 90 degrees
+1
View File
@@ -1,5 +1,6 @@
# Hardware initialization for ESP32-S3-Touch-LCD-2
# Manufacturer's website at https://www.waveshare.com/wiki/ESP32-S3-Touch-LCD-2
current_hardware = "waveshare-esp32-s3-touch-lcd-2"
from machine import Pin, SPI
import st7789
+1
View File
@@ -1,4 +1,5 @@
# Hardware initialization for Unix and MacOS systems
current_hardware = "unix"
import lcd_bus
import lvgl as lv