From 5017aa4e101a7328a0e73b12c19455e00285da1e Mon Sep 17 00:00:00 2001 From: "Peter D. Gray" Date: Thu, 29 Mar 2018 15:03:17 -0400 Subject: [PATCH] stm32/main.c: Enable VCP+MSC in default boot.py if USB enabled for board --- ports/stm32/main.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/ports/stm32/main.c b/ports/stm32/main.c index fb3e843bb..b04d46892 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" -"#pyb.usb_mode('VCP+MSC') # act as a serial and a storage device\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[] =