Skip to content

Commit

Permalink
nrf/main: Call usb_cdc_init() before executing boot.py and main.py.
Browse files Browse the repository at this point in the history
Otherwise, there is no USB available when running main.py, and main.py
cannot be interrupted with Ctrl-C.
  • Loading branch information
robert-hh authored and dpgeorge committed Jul 20, 2022
1 parent 768cbea commit 2e2fc8f
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions ports/nrf/main.c
Expand Up @@ -257,16 +257,16 @@ int main(int argc, char **argv) {

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) {
Expand Down

0 comments on commit 2e2fc8f

Please sign in to comment.