File tree Expand file tree Collapse file tree 1 file changed +10
-2
lines changed Expand file tree Collapse file tree 1 file changed +10
-2
lines changed Original file line number Diff line number Diff line change @@ -185,6 +185,7 @@ int main()
185
185
// Reset chip
186
186
reset_chip ();
187
187
188
+ int attempts = 0 ;
188
189
189
190
while (true) {
190
191
char splash [] = "RP2350" ;
@@ -204,13 +205,20 @@ int main()
204
205
if (ptr && strncmp (ptr , splash , sizeof (splash ) - 1 ) == 0 ) {
205
206
printf ("Splash found\n" );
206
207
uart_boot ();
208
+ attempts = 0 ;
207
209
} else {
208
210
ptr = memchr (buf , hello [0 ], sizeof (buf ));
209
211
if (ptr && strncmp (ptr , hello , sizeof (hello ) - 1 ) == 0 ) {
210
212
printf ("Device is running\n" );
211
213
} else {
212
- printf ("Device not running - attempting reset\n" );
213
- reset_chip ();
214
+ if (attempts > 3 ) {
215
+ printf ("Device not running - attempting reset\n" );
216
+ reset_chip ();
217
+ attempts = 0 ;
218
+ } else {
219
+ printf ("Device not running - waiting\n" );
220
+ attempts ++ ;
221
+ }
214
222
}
215
223
}
216
224
sleep_ms (1000 );
You can’t perform that action at this time.
0 commit comments