Skip to content

Commit a38d894

Browse files
mrmcwethytannewt
authored andcommitted
M4 status LED flashing with no main.py present #447 Initialized stack variable
1 parent d016bcd commit a38d894

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

main.c

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,6 +131,11 @@ bool start_mp(safe_mode_t safe_mode) {
131131
#endif
132132

133133
pyexec_result_t result;
134+
135+
result.return_code = 0;
136+
result.exception_type = NULL;
137+
result.exception_line = 0;
138+
134139
bool found_main = false;
135140

136141
if (safe_mode != NO_SAFE_MODE) {
@@ -166,9 +171,10 @@ bool start_mp(safe_mode_t safe_mode) {
166171
if (reload_next_character) {
167172
return true;
168173
}
174+
169175
if (serial_connected() && serial_bytes_available()) {
170176
// Skip REPL if reload was requested.
171-
return serial_read() == CHAR_CTRL_D;
177+
return (serial_read() == CHAR_CTRL_D);
172178
}
173179

174180
if (!serial_connected_before_animation && serial_connected()) {

supervisor/shared/rgb_led_status.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -207,6 +207,7 @@ void prep_rgb_status_animation(const pyexec_result_t* result,
207207
new_status_color(ALL_DONE);
208208
status->pattern_start = ticks_ms;
209209
status->safe_mode = safe_mode;
210+
status->found_main = found_main;
210211
status->total_exception_cycle = 0;
211212
status->ones = result->exception_line % 10;
212213
status->ones += status->ones > 0 ? 1 : 0;

0 commit comments

Comments
 (0)