summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorrobert-hh <robert@hammelrath.com>2022-07-20 08:08:24 +0200
committerDamien George <damien@micropython.org>2022-07-20 17:17:17 +1000
commit2e2fc8f60f68d03a593286a3e946e12c962c9b0c (patch)
tree1431e338ab482b59d349f7bfb0f1e31e68c62a94
parent768cbea507c57891371a428073df9781d410142e (diff)
nrf/main: Call usb_cdc_init() before executing boot.py and main.py.
Otherwise, there is no USB available when running main.py, and main.py cannot be interrupted with Ctrl-C.
-rw-r--r--ports/nrf/main.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/ports/nrf/main.c b/ports/nrf/main.c
index 091aa73f4..83466626f 100644
--- a/ports/nrf/main.c
+++ b/ports/nrf/main.c
@@ -257,16 +257,16 @@ soft_reset:
led_state(1, 0);
+ #if MICROPY_HW_USB_CDC
+ usb_cdc_init();
+ #endif
+
#if MICROPY_VFS || MICROPY_MBFS || MICROPY_MODULE_FROZEN
// run boot.py and main.py if they exist.
pyexec_file_if_exists("boot.py");
pyexec_file_if_exists("main.py");
#endif
- #if MICROPY_HW_USB_CDC
- usb_cdc_init();
- #endif
-
for (;;) {
if (pyexec_mode_kind == PYEXEC_MODE_RAW_REPL) {
if (pyexec_raw_repl() != 0) {