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 88import wifi
99import board
1010import displayio
11- import microcontroller
11+ import supervisor
1212import adafruit_connection_manager
1313import adafruit_requests
1414from adafruit_io .adafruit_io import IO_HTTP
113113 total_seconds = time .mktime (now )
114114 refresh_clock = ticks_add (refresh_clock , refresh_timer )
115115 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 ()
119123
120124 if ticks_diff (ticks_ms (), clock_clock ) >= clock_timer :
121125 remaining = time .mktime (event_time ) - total_seconds
You can’t perform that action at this time.
0 commit comments