mirror of
https://github.com/openmv/openmv.git
synced 2025-11-04 14:49:50 +08:00
ports/rp2: Improve script execution and exception handling.
This commit is contained in:
parent
edcdd634f9
commit
a9e52acdf1
@ -267,15 +267,23 @@ soft_reset:
|
||||
usbdbg_set_irq_enabled(true);
|
||||
// Execute the script.
|
||||
pyexec_str(usbdbg_get_script(), true);
|
||||
// Disable IDE interrupts
|
||||
usbdbg_set_irq_enabled(false);
|
||||
nlr_pop();
|
||||
} else {
|
||||
mp_obj_print_exception(&mp_plat_print, (mp_obj_t)nlr.ret_val);
|
||||
}
|
||||
}
|
||||
|
||||
if (usbdbg_is_busy() && nlr_push(&nlr) == 0) {
|
||||
// Enable IDE interrupt
|
||||
usbdbg_set_irq_enabled(true);
|
||||
// Wait for the current command to finish.
|
||||
usbdbg_wait_for_command(1000);
|
||||
|
||||
// Disable IDE interrupts
|
||||
usbdbg_set_irq_enabled(false);
|
||||
nlr_pop();
|
||||
}
|
||||
}
|
||||
|
||||
mp_printf(MP_PYTHON_PRINTER, "MPY: soft reboot\n");
|
||||
#if MICROPY_PY_AUDIO
|
||||
|
||||
Loading…
Reference in New Issue
Block a user