Skip to content

Commit 4613b58

Browse files
committed
Add skip for rgb matrix exception handling
1 parent d47bd55 commit 4613b58

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

main.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -276,7 +276,7 @@ bool run_code_py(safe_mode_t safe_mode) {
276276
}
277277
}
278278

279-
// Wait for connection or character.
279+
// Display a different completion message if the user has no USB attached (cannot save files)
280280
if (!serial_connected_at_start) {
281281
serial_write_compressed(translate("\nCode done running. Waiting for reload.\n"));
282282
}

supervisor/shared/rgb_led_status.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -366,6 +366,11 @@ void prep_rgb_status_animation(const pyexec_result_t* result,
366366
status->safe_mode = safe_mode;
367367
status->found_main = found_main;
368368
status->total_exception_cycle = 0;
369+
status->ok = result->return_code != PYEXEC_EXCEPTION;
370+
if (status->ok) {
371+
// If this isn't an exception, skip exception sorting and handling
372+
return;
373+
}
369374
status->ones = result->exception_line % 10;
370375
status->ones += status->ones > 0 ? 1 : 0;
371376
status->tens = (result->exception_line / 10) % 10;
@@ -383,7 +388,6 @@ void prep_rgb_status_animation(const pyexec_result_t* result,
383388
}
384389
line /= 10;
385390
}
386-
status->ok = result->return_code != PYEXEC_EXCEPTION;
387391
if (!status->ok) {
388392
status->total_exception_cycle = EXCEPTION_TYPE_LENGTH_MS * 3 + LINE_NUMBER_TOGGLE_LENGTH * status->digit_sum + LINE_NUMBER_TOGGLE_LENGTH * num_places;
389393
}

0 commit comments

Comments
 (0)