@@ -226,7 +226,10 @@ def __init__(self, *, url=None, headers=None, json_path=None, regexp_path=None,
226
226
self .set_backlight (i / 100 )
227
227
time .sleep (0.005 )
228
228
self .set_background (bootscreen )
229
- board .DISPLAY .wait_for_frame ()
229
+ try :
230
+ board .DISPLAY .refresh (target_frames_per_second = 60 )
231
+ except AttributeError :
232
+ board .DISPLAY .wait_for_frame ()
230
233
for i in range (100 ): # dim up
231
234
self .set_backlight (i / 100 )
232
235
time .sleep (0.005 )
@@ -446,9 +449,13 @@ def set_background(self, file_or_color, position=None):
446
449
else :
447
450
raise RuntimeError ("Unknown type of background" )
448
451
self ._bg_group .append (self ._bg_sprite )
449
- board .DISPLAY .refresh_soon ()
450
- gc .collect ()
451
- board .DISPLAY .wait_for_frame ()
452
+ try :
453
+ board .DISPLAY .refresh (target_frames_per_second = 60 )
454
+ gc .collect ()
455
+ except AttributeError :
456
+ board .DISPLAY .refresh_soon ()
457
+ gc .collect ()
458
+ board .DISPLAY .wait_for_frame ()
452
459
453
460
def set_backlight (self , val ):
454
461
"""Adjust the TFT backlight.
@@ -498,8 +505,11 @@ def set_caption(self, caption_text, caption_position, caption_color):
498
505
499
506
if self ._caption :
500
507
self ._caption ._update_text (str (caption_text )) # pylint: disable=protected-access
501
- board .DISPLAY .refresh_soon ()
502
- board .DISPLAY .wait_for_frame ()
508
+ try :
509
+ board .DISPLAY .refresh (target_frames_per_second = 60 )
510
+ except AttributeError :
511
+ board .DISPLAY .refresh_soon ()
512
+ board .DISPLAY .wait_for_frame ()
503
513
return
504
514
505
515
self ._caption = Label (self ._caption_font , text = str (caption_text ))
0 commit comments