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,19 +415,22 @@ soft_reset:
}
}
// Enter REPL
nlr_buf_t nlr;
if (nlr_push(&nlr) == 0) {
// enable IDE interrupt
usbdbg_set_irq_enabled(true);
// If there's no script ready, just re-exec REPL
while (!usbdbg_script_ready()) {
nlr_buf_t nlr;
if (nlr_push(&nlr) == 0) {
// enable IDE interrupt
usbdbg_set_irq_enabled(true);
// run REPL
pyexec_friendly_repl();
// run REPL
pyexec_friendly_repl();
nlr_pop();
nlr_pop();
}
}
if (usbdbg_script_ready()) {
nlr_buf_t nlr;
// execute the script
if (nlr_push(&nlr) == 0) {
// parse, compile and execute script
@ -438,6 +441,7 @@ soft_reset:
}
}
// soft reset
storage_flush();
timer_deinit();