Commit 46901642 authored by Rahix's avatar Rahix
Browse files

feat(pycardium): Return to menu when a script ends cleanly

Instead of dropping to REPL and silently requiring the user to return to
menu via button-press, directly call epic_exit(0) when a script
terminates execution normally (i.e. not via exception).
Signed-off-by: Rahix's avatarRahix <>
parent 2b725986
......@@ -64,10 +64,22 @@ int main(void)
mp_obj_list_append(mp_sys_path, MP_OBJ_NEW_QSTR(MP_QSTR__slash_apps));
if (cnt > 0) {
int ret = pyexec_file_if_exists(script_name);
if (ret == 0) {
* The script was aborted via uncaught exception; Sadly
* we can't find out what happened so let's hope it was
* a KeyboardInterrupt and drop to REPL.
* In the future it might be interesting to rework this
* so any other exception will lead to epic_exit(1).
/* Drop to REPL by reloading Pycardium */
/* The script ended execution normally; return to menu */
for (;;) {
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment