Skip to content

Commit 43904ac

Browse files
projectgusdpgeorge
authored andcommitted
mimxrt: Define the MICROPY_HW_ENABLE_USBDEV macro.
Previously USB was always enabled, but this created some conflicts when adding guards to other files on other ports. Note the configuration with USB disabled hasn't been tested and probably won't build or run without further work. Signed-off-by: Angus Gratton <[email protected]>
1 parent 47e8475 commit 43904ac

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed

ports/mimxrt/main.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,9 @@ int main(void) {
115115
// Execute user scripts.
116116
int ret = pyexec_file_if_exists("boot.py");
117117

118+
#if MICROPY_HW_ENABLE_USBDEV
118119
mp_usbd_init();
120+
#endif
119121

120122
if (ret & PYEXEC_FORCED_EXIT) {
121123
goto soft_reset_exit;

ports/mimxrt/mpconfigport.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -147,6 +147,8 @@ uint32_t trng_random_u32(void);
147147
#define MICROPY_PY_NETWORK_HOSTNAME_DEFAULT "mpy-mimxrt"
148148
#endif
149149

150+
#define MICROPY_HW_ENABLE_USBDEV (1)
151+
150152
// Hooks to add builtins
151153

152154
#if defined(IOMUX_TABLE_ENET)

0 commit comments

Comments
 (0)