You've already forked MicroPythonOS
mirror of
https://github.com/m5stack/MicroPythonOS.git
synced 2026-05-20 11:51:27 -07:00
camera_app.py: only try for supported hardware
This commit is contained in:
@@ -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,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,4 +1,5 @@
|
||||
# Hardware initialization for Unix and MacOS systems
|
||||
current_hardware = "unix"
|
||||
|
||||
import lcd_bus
|
||||
import lvgl as lv
|
||||
|
||||
Reference in New Issue
Block a user