4848import gc
4949import board
5050import busio
51- import microcontroller
5251from digitalio import DigitalInOut
5352import pulseio
5453import adafruit_touchscreen
@@ -182,7 +181,7 @@ def __init__(self, *, url=None, json_path=None, regexp_path=None,
182181
183182 if self ._debug :
184183 print ("Init display" )
185- self .splash = displayio .Group (max_size = 5 )
184+ self .splash = displayio .Group (max_size = 15 )
186185
187186 if self ._debug :
188187 print ("Init background" )
@@ -225,7 +224,7 @@ def __init__(self, *, url=None, json_path=None, regexp_path=None,
225224 esp32_cs = DigitalInOut (board .ESP_CS )
226225 spi = busio .SPI (board .SCK , board .MOSI , board .MISO )
227226
228- if not self ._uselocal :
227+ if url and not self ._uselocal :
229228 self ._esp = adafruit_esp32spi .ESP_SPIcontrol (spi , esp32_cs , esp32_ready ,
230229 esp32_reset , esp32_gpio0 )
231230 #self._esp._debug = 1
@@ -245,6 +244,7 @@ def __init__(self, *, url=None, json_path=None, regexp_path=None,
245244
246245 # set the default background
247246 self .set_background (self ._default_bg )
247+ board .DISPLAY .show (self .splash )
248248
249249 if self ._debug :
250250 print ("Init SD Card" )
@@ -257,7 +257,6 @@ def __init__(self, *, url=None, json_path=None, regexp_path=None,
257257 except OSError as error :
258258 print ("No SD card found:" , error )
259259
260-
261260 self ._qr_group = None
262261
263262 if self ._debug :
@@ -323,10 +322,8 @@ def __init__(self, *, url=None, json_path=None, regexp_path=None,
323322 if self ._debug :
324323 print ("Init touchscreen" )
325324 # pylint: disable=no-member
326- self .touchscreen = adafruit_touchscreen .Touchscreen (microcontroller .pin .PB01 ,
327- microcontroller .pin .PB08 ,
328- microcontroller .pin .PA06 ,
329- microcontroller .pin .PB00 ,
325+ self .touchscreen = adafruit_touchscreen .Touchscreen (board .TOUCH_XL , board .TOUCH_XR ,
326+ board .TOUCH_YD , board .TOUCH_YU ,
330327 calibration = ((5200 , 59000 ),
331328 (5800 , 57000 )),
332329 size = (320 , 240 ))
0 commit comments