File tree Expand file tree Collapse file tree 3 files changed +7
-1
lines changed
apps/com.micropythonos.camera/assets Expand file tree Collapse file tree 3 files changed +7
-1
lines changed Original file line number Diff line number Diff line change @@ -98,12 +98,16 @@ def onCreate(self):
9898 self .status_label = lv .label (self .status_label_cont )
9999 self .status_label .set_text ("No camera found." )
100100 self .status_label .set_long_mode (lv .label .LONG .WRAP )
101- self .status_label .set_style_text_color (lv .color_white (), 0 )
102101 self .status_label .set_width (lv .pct (100 ))
103102 self .status_label .center ()
104103 self .setContentView (main_screen )
105104
106105 def onResume (self , screen ):
106+ try :
107+ assert (current_hardware == "unix" or current_hardware == "waveshare-esp32-s3-touch-lcd-2" )
108+ except Exception as e : # use an assert in case current_hardware isn't defined for some boards
109+ print ("WARNING: the current_hardware doesn't have support for a camera!" )
110+ return
107111 self .cam = init_internal_cam ()
108112 if self .cam :
109113 self .image .set_rotation (900 ) # internal camera is rotated 90 degrees
Original file line number Diff line number Diff line change 11# Hardware initialization for ESP32-S3-Touch-LCD-2
22# Manufacturer's website at https://www.waveshare.com/wiki/ESP32-S3-Touch-LCD-2
3+ current_hardware = "waveshare-esp32-s3-touch-lcd-2"
34
45from machine import Pin , SPI
56import st7789
Original file line number Diff line number Diff line change 11# Hardware initialization for Unix and MacOS systems
2+ current_hardware = "unix"
23
34import lcd_bus
45import lvgl as lv
You can’t perform that action at this time.
0 commit comments