File tree Expand file tree Collapse file tree 1 file changed +8
-4
lines changed
CircuitPython_Day_2024_Projects/Qualia_820x320_IO_Countdown Expand file tree Collapse file tree 1 file changed +8
-4
lines changed Original file line number Diff line number Diff line change 8
8
import wifi
9
9
import board
10
10
import displayio
11
- import microcontroller
11
+ import supervisor
12
12
import adafruit_connection_manager
13
13
import adafruit_requests
14
14
from adafruit_io .adafruit_io import IO_HTTP
113
113
total_seconds = time .mktime (now )
114
114
refresh_clock = ticks_add (refresh_clock , refresh_timer )
115
115
except Exception as e : # pylint: disable=broad-except
116
- print ("Some error occured, retrying via reset in 15seconds! -" , e )
117
- time .sleep (15 )
118
- microcontroller .reset ()
116
+ print ("Some error occured, retrying via supervisor.reload in 5seconds! -" , e )
117
+ time .sleep (5 )
118
+ # Normally calling microcontroller.reset() would be the way to go, but due to
119
+ # a bug causing a reset into tinyUF2 bootloader mode we're instead going to
120
+ # disconnect wifi to ensure fresh connection + use supervisor.reload()
121
+ wifi .radio .enabled = False
122
+ supervisor .reload ()
119
123
120
124
if ticks_diff (ticks_ms (), clock_clock ) >= clock_timer :
121
125
remaining = time .mktime (event_time ) - total_seconds
You can’t perform that action at this time.
0 commit comments