Re-exec REPL if there's no script to execute.

This commit is contained in:
iabdalkader 2016-03-06 02:39:58 +02:00
parent fe506fa0fb
commit 2ab317063d

View File

@ -415,7 +415,8 @@ soft_reset:
} }
} }
// Enter REPL // If there's no script ready, just re-exec REPL
while (!usbdbg_script_ready()) {
nlr_buf_t nlr; nlr_buf_t nlr;
if (nlr_push(&nlr) == 0) { if (nlr_push(&nlr) == 0) {
// enable IDE interrupt // enable IDE interrupt
@ -426,8 +427,10 @@ soft_reset:
nlr_pop(); nlr_pop();
} }
}
if (usbdbg_script_ready()) { if (usbdbg_script_ready()) {
nlr_buf_t nlr;
// execute the script // execute the script
if (nlr_push(&nlr) == 0) { if (nlr_push(&nlr) == 0) {
// parse, compile and execute script // parse, compile and execute script
@ -438,6 +441,7 @@ soft_reset:
} }
} }
// soft reset // soft reset
storage_flush(); storage_flush();
timer_deinit(); timer_deinit();