summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter D. Gray <peter@conalgo.com>2018-03-29 15:03:17 -0400
committerDamien George <damien.p.george@gmail.com>2018-04-10 23:52:51 +1000
commit59dda7103855e2f85822f83ecbb835d66f12183d (patch)
tree75448c853df0548fe3613cd7134cf0e5fdcb8d7d
parent4ff05ae4e9b1f46a9bdf9322391e3b3599a1ad3e (diff)
stm32/main: Guard usb_mode lines in default boot.py by relevant #if.
-rw-r--r--ports/stm32/main.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/ports/stm32/main.c b/ports/stm32/main.c
index fb3e843bb..120ab5b67 100644
--- a/ports/stm32/main.c
+++ b/ports/stm32/main.c
@@ -136,8 +136,10 @@ static const char fresh_boot_py[] =
"import machine\r\n"
"import pyb\r\n"
"#pyb.main('main.py') # main script to run after this one\r\n"
+#if MICROPY_HW_ENABLE_USB
"#pyb.usb_mode('VCP+MSC') # act as a serial and a storage device\r\n"
"#pyb.usb_mode('VCP+HID') # act as a serial device and a mouse\r\n"
+#endif
;
static const char fresh_main_py[] =