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>
This commit is contained in:
Angus Gratton 2024-03-13 12:17:20 +11:00 committed by Damien George
parent 47e84751fb
commit 43904acea8
2 changed files with 4 additions and 0 deletions

View File

@ -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;

View File

@ -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)