summaryrefslogtreecommitdiff
path: root/teensy/main.c
diff options
context:
space:
mode:
Diffstat (limited to 'teensy/main.c')
-rw-r--r--teensy/main.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/teensy/main.c b/teensy/main.c
index c31be6e01..417bde78b 100644
--- a/teensy/main.c
+++ b/teensy/main.c
@@ -22,6 +22,10 @@
#include "uart.h"
#include "pin.h"
+#if MICROPY_MODULE_FROZEN
+#include "py/compile.h"
+#include "py/frozenmod.h"
+#endif
extern uint32_t _heap_start;
@@ -301,14 +305,27 @@ soft_reset:
}
#endif
+#if MICROPY_MODULE_FROZEN
+ {
+ mp_lexer_t *lex = mp_find_frozen_module("boot", 4);
+ mp_parse_compile_execute(lex, MP_PARSE_FILE_INPUT, mp_globals_get(), mp_locals_get());
+ }
+#else
if (!pyexec_file("/boot.py")) {
flash_error(4);
}
+#endif
// Turn bootup LED off
led_state(PYB_LED_BUILTIN, 0);
// run main script
+#if MICROPY_MODULE_FROZEN
+ {
+ mp_lexer_t *lex = mp_find_frozen_module("main", 4);
+ mp_parse_compile_execute(lex, MP_PARSE_FILE_INPUT, mp_globals_get(), mp_locals_get());
+ }
+#else
{
vstr_t *vstr = vstr_new();
vstr_add_str(vstr, "/");
@@ -322,6 +339,7 @@ soft_reset:
}
vstr_free(vstr);
}
+#endif
// enter REPL
// REPL mode can change, or it can request a soft reset