summaryrefslogtreecommitdiff
path: root/lib/utils/pyexec.c
diff options
context:
space:
mode:
authorScott Shawcroft <scott@adafruit.com>2020-12-02 12:51:43 -0800
committerGitHub <noreply@github.com>2020-12-02 12:51:43 -0800
commitd7ba641ff646b48e5ad38ff72a2dcfe17bb54624 (patch)
treea0c4f9fb561b2caa38636645ca27f0ddad59f087 /lib/utils/pyexec.c
parent5b3c930e384ef6440f0f7b5167bb54ea68a8be76 (diff)
parent72fa7d88b881d2ed9978c0bd65ce5f8d6eb51703 (diff)
Merge pull request #3767 from dhalbert/sleep
Initial alarm and sleep PR: time alarms with light and deep sleep; PinAlarms not yet implemented
Diffstat (limited to 'lib/utils/pyexec.c')
-rwxr-xr-xlib/utils/pyexec.c6
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);