File tree 1 file changed +5
-8
lines changed
1 file changed +5
-8
lines changed Original file line number Diff line number Diff line change @@ -352,28 +352,26 @@ STATIC bool run_code_py(safe_mode_t safe_mode) {
352
352
if (reload_requested ) {
353
353
next_code_stickiness_situation |= SUPERVISOR_NEXT_CODE_OPT_STICKY_ON_RELOAD ;
354
354
}
355
- else if (result .return_code == 0 ) { //TODO mask out PYEXEC_DEEP_SLEEP?
355
+ else if (result .return_code == 0 ) {
356
356
next_code_stickiness_situation |= SUPERVISOR_NEXT_CODE_OPT_STICKY_ON_SUCCESS ;
357
357
if (next_code_options & SUPERVISOR_NEXT_CODE_OPT_RELOAD_ON_SUCCESS ) {
358
358
skip_repl = true;
359
359
skip_wait = true;
360
- //goto done;
361
360
}
362
361
}
363
362
else {
364
363
next_code_stickiness_situation |= SUPERVISOR_NEXT_CODE_OPT_STICKY_ON_ERROR ;
365
- if (next_code_options & SUPERVISOR_NEXT_CODE_OPT_RELOAD_ON_ERROR ) {
366
- // TODO: in what scenario is this acceptable
364
+ // Deep sleep cannot be skipped
365
+ // TODO: settings in deep sleep should persist, using a new sleep memory API
366
+ if (next_code_options & SUPERVISOR_NEXT_CODE_OPT_RELOAD_ON_ERROR
367
+ && !(result .return_code & PYEXEC_DEEP_SLEEP )) {
367
368
skip_repl = true;
368
369
skip_wait = true;
369
- //goto done;
370
370
}
371
371
}
372
372
if (result .return_code & PYEXEC_FORCED_EXIT ) {
373
- // TODO: what scenario does this describe?
374
373
skip_repl = reload_requested ;
375
374
skip_wait = true;
376
- //goto done;
377
375
}
378
376
379
377
if (reload_requested && result .return_code == PYEXEC_EXCEPTION ) {
@@ -421,7 +419,6 @@ STATIC bool run_code_py(safe_mode_t safe_mode) {
421
419
#if CIRCUITPY_ALARM
422
420
bool fake_sleeping = false;
423
421
#endif
424
- // bool skip_repl = false;
425
422
while (!skip_wait ) {
426
423
RUN_BACKGROUND_TASKS ;
427
424
You can’t perform that action at this time.
0 commit comments