diff options
| author | Jeff Epler <jeff@adafruit.com> | 2020-10-27 11:47:44 -0500 |
|---|---|---|
| committer | Seon Rozenblum <seon@unexpectedmaker.com> | 2021-01-04 09:52:42 +1100 |
| commit | 2a5f3de1cdec92d412148cabaf605a750d238234 (patch) | |
| tree | 9c187db62ecbec0000b4533c95f4089901f3b5ae /lib/utils/pyexec.c | |
| parent | caca0609bdbc8f5b1b406fad19878505bb5492a5 (diff) | |
| parent | d0e54993e9546249911c2c380c870e6a7f2b9917 (diff) | |
Merge pull request #3608 from adafruit/6.0.x
Update main with latest 6.0.x
Diffstat (limited to 'lib/utils/pyexec.c')
| -rwxr-xr-x | lib/utils/pyexec.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/utils/pyexec.c b/lib/utils/pyexec.c index 378fb6267..68a3710ce 100755 --- a/lib/utils/pyexec.c +++ b/lib/utils/pyexec.c @@ -101,7 +101,7 @@ STATIC int parse_compile_execute(const void *source, mp_parse_input_kind_t input #endif } - // If the code was loaded from a file its likely to be running for a while so we'll long + // If the code was loaded from a file it's likely to be running for a while so we'll long // live it and collect any garbage before running. if (input_kind == MP_PARSE_FILE_INPUT) { module_fun = make_obj_long_lived(module_fun, 6); @@ -132,6 +132,10 @@ STATIC int parse_compile_execute(const void *source, mp_parse_input_kind_t input if (mp_obj_is_subclass_fast(mp_obj_get_type((mp_obj_t)nlr.ret_val), &mp_type_SystemExit)) { // at the moment, the value of SystemExit is unused ret = pyexec_system_exit; +#if CIRCUITPY_ALARM + } else if (mp_obj_is_subclass_fast(mp_obj_get_type((mp_obj_t)nlr.ret_val), &mp_type_DeepSleepRequest)) { + ret = PYEXEC_DEEP_SLEEP; +#endif } else { if ((mp_obj_t) nlr.ret_val != MP_OBJ_FROM_PTR(&MP_STATE_VM(mp_reload_exception))) { mp_obj_print_exception(&mp_plat_print, (mp_obj_t)nlr.ret_val); |
