48
48
import gc
49
49
import board
50
50
import busio
51
- import microcontroller
52
51
from digitalio import DigitalInOut
53
52
import pulseio
54
53
import adafruit_touchscreen
@@ -182,7 +181,7 @@ def __init__(self, *, url=None, json_path=None, regexp_path=None,
182
181
183
182
if self ._debug :
184
183
print ("Init display" )
185
- self .splash = displayio .Group (max_size = 5 )
184
+ self .splash = displayio .Group (max_size = 15 )
186
185
187
186
if self ._debug :
188
187
print ("Init background" )
@@ -225,7 +224,7 @@ def __init__(self, *, url=None, json_path=None, regexp_path=None,
225
224
esp32_cs = DigitalInOut (board .ESP_CS )
226
225
spi = busio .SPI (board .SCK , board .MOSI , board .MISO )
227
226
228
- if not self ._uselocal :
227
+ if url and not self ._uselocal :
229
228
self ._esp = adafruit_esp32spi .ESP_SPIcontrol (spi , esp32_cs , esp32_ready ,
230
229
esp32_reset , esp32_gpio0 )
231
230
#self._esp._debug = 1
@@ -245,6 +244,7 @@ def __init__(self, *, url=None, json_path=None, regexp_path=None,
245
244
246
245
# set the default background
247
246
self .set_background (self ._default_bg )
247
+ board .DISPLAY .show (self .splash )
248
248
249
249
if self ._debug :
250
250
print ("Init SD Card" )
@@ -257,7 +257,6 @@ def __init__(self, *, url=None, json_path=None, regexp_path=None,
257
257
except OSError as error :
258
258
print ("No SD card found:" , error )
259
259
260
-
261
260
self ._qr_group = None
262
261
263
262
if self ._debug :
@@ -323,10 +322,8 @@ def __init__(self, *, url=None, json_path=None, regexp_path=None,
323
322
if self ._debug :
324
323
print ("Init touchscreen" )
325
324
# 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 ,
330
327
calibration = ((5200 , 59000 ),
331
328
(5800 , 57000 )),
332
329
size = (320 , 240 ))
0 commit comments