M4 status LED flashing with no main.py present #447 Initialized stack variable

This commit is contained in:
mrmcwethy 2017-11-22 19:56:28 -07:00 committed by Scott Shawcroft
parent d016bcdf82
commit a38d8948b3
2 changed files with 8 additions and 1 deletions

8
main.c
View File

@ -131,6 +131,11 @@ bool start_mp(safe_mode_t safe_mode) {
#endif
pyexec_result_t result;
result.return_code = 0;
result.exception_type = NULL;
result.exception_line = 0;
bool found_main = false;
if (safe_mode != NO_SAFE_MODE) {
@ -166,9 +171,10 @@ bool start_mp(safe_mode_t safe_mode) {
if (reload_next_character) {
return true;
}
if (serial_connected() && serial_bytes_available()) {
// Skip REPL if reload was requested.
return serial_read() == CHAR_CTRL_D;
return (serial_read() == CHAR_CTRL_D);
}
if (!serial_connected_before_animation && serial_connected()) {

View File

@ -207,6 +207,7 @@ void prep_rgb_status_animation(const pyexec_result_t* result,
new_status_color(ALL_DONE);
status->pattern_start = ticks_ms;
status->safe_mode = safe_mode;
status->found_main = found_main;
status->total_exception_cycle = 0;
status->ones = result->exception_line % 10;
status->ones += status->ones > 0 ? 1 : 0;