File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -105,7 +105,7 @@ def _spi_select(self):
105105 self ._cs .value = False # the actual select
106106 times = time .monotonic ()
107107 while (time .monotonic () - times ) < 1 : # wait up to 1000ms
108- if self ._ready .value :
108+ if self ._ready .value : # ok ready to send!
109109 return
110110 # some failure
111111 self ._cs .value = True
@@ -119,10 +119,16 @@ def _spi_deselect(self):
119119 def wait_for_ready (self ):
120120 if self ._debug :
121121 print ("Wait for ESP32 ready" , end = '' )
122- while self ._ready .value == True :
122+ times = time .monotonic ()
123+ while (time .monotonic () - times ) < 10 : # wait up to 10 seconds
124+ if self ._ready .value == False : # we're ready!
125+ break
123126 if self ._debug :
124127 print ('.' , end = '' )
125128 time .sleep (0.01 )
129+ else :
130+ raise RuntimeError ("ESP32 not responding" )
131+
126132 if self ._debug :
127133 print ()
128134
You can’t perform that action at this time.
0 commit comments