Browse Source

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 <angus@redyak.com.au>
pull/9497/head
Angus Gratton 8 months ago
committed by Damien George
parent
commit
43904acea8
  1. 2
      ports/mimxrt/main.c
  2. 2
      ports/mimxrt/mpconfigport.h

2
ports/mimxrt/main.c

@ -115,7 +115,9 @@ int main(void) {
// Execute user scripts.
int ret = pyexec_file_if_exists("boot.py");
#if MICROPY_HW_ENABLE_USBDEV
mp_usbd_init();
#endif
if (ret & PYEXEC_FORCED_EXIT) {
goto soft_reset_exit;

2
ports/mimxrt/mpconfigport.h

@ -147,6 +147,8 @@ uint32_t trng_random_u32(void);
#define MICROPY_PY_NETWORK_HOSTNAME_DEFAULT "mpy-mimxrt"
#endif
#define MICROPY_HW_ENABLE_USBDEV (1)
// Hooks to add builtins
#if defined(IOMUX_TABLE_ENET)

Loading…
Cancel
Save