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 2024-03-13 12:17:20 +11:00 zatwierdzone przez Damien George
rodzic 47e84751fb
commit 43904acea8
2 zmienionych plików z 4 dodań i 0 usunięć

Wyświetl plik

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

Wyświetl plik

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