mirror of
https://github.com/openmv/openmv.git
synced 2025-09-26 23:09:13 +08:00
common/mp_utils: Remove exec_bootscript.
Signed-off-by: iabdalkader <i.abdalkader@gmail.com>
This commit is contained in:
parent
6d5c993904
commit
a73d96b3b9
@ -59,35 +59,6 @@ void __attribute__((weak)) gc_collect(void) {
|
||||
gc_collect_end();
|
||||
}
|
||||
|
||||
bool mp_exec_bootscript(const char *path, bool interruptible) {
|
||||
nlr_buf_t nlr;
|
||||
bool interrupted = false;
|
||||
|
||||
if (nlr_push(&nlr) == 0) {
|
||||
// Enable IDE interrupts if allowed.
|
||||
if (interruptible) {
|
||||
usbdbg_set_irq_enabled(true);
|
||||
usbdbg_set_script_running(true);
|
||||
}
|
||||
|
||||
// Parse, compile and execute the script.
|
||||
pyexec_file_if_exists(path, true);
|
||||
nlr_pop();
|
||||
} else {
|
||||
interrupted = true;
|
||||
}
|
||||
|
||||
// Disable IDE interrupts
|
||||
usbdbg_set_irq_enabled(false);
|
||||
usbdbg_set_script_running(false);
|
||||
|
||||
if (interrupted) {
|
||||
mp_obj_print_exception(&mp_plat_print, (mp_obj_t) nlr.ret_val);
|
||||
}
|
||||
|
||||
return interrupted;
|
||||
}
|
||||
|
||||
void mp_init_gc_stack(void *sstack, void *estack, void *heap_start, void *heap_end, size_t stack_limit) {
|
||||
// Initialize the stack.
|
||||
mp_stack_set_top(estack);
|
||||
|
@ -27,5 +27,4 @@
|
||||
#define __MP_UTILS_H__
|
||||
typedef struct _fs_user_mount_t fs_user_mount_t;
|
||||
void mp_init_gc_stack(void *stack_start, void *stack_end, void *heap_start, void *heap_end, size_t stack_limit);
|
||||
bool mp_exec_bootscript(const char *path, bool interruptible);
|
||||
#endif // __MP_UTILS_H__
|
||||
|
Loading…
Reference in New Issue
Block a user