aboutsummaryrefslogtreecommitdiff
path: root/ports/stm32/usbd_conf.h
diff options
context:
space:
mode:
authorDamien George2019-01-27 13:52:43 +1100
committerDamien George2019-01-27 13:52:43 +1100
commit7d8db42d17958560ccf56bbbae83ad795329aa43 (patch)
tree685771473eb0d1a194ca9ce484d009de45f76125 /ports/stm32/usbd_conf.h
parentc2886868b9ccbe8580f57135bb29779a5d36c1e8 (diff)
stm32/usbdev: Add USB config option for board being self powered.
The new compile-time option is MICROPY_HW_USB_SELF_POWERED. Set this option to 1 in the board configuration file to indicate that the USB device is self powered. This option is disabled by default (previous behaviour).
Diffstat (limited to 'ports/stm32/usbd_conf.h')
-rw-r--r--ports/stm32/usbd_conf.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/ports/stm32/usbd_conf.h b/ports/stm32/usbd_conf.h
index 1f8e754a2..c5faf6c8c 100644
--- a/ports/stm32/usbd_conf.h
+++ b/ports/stm32/usbd_conf.h
@@ -37,10 +37,16 @@
#include <stdlib.h>
#include <string.h>
+#include "py/mpconfig.h"
+
#define USBD_MAX_NUM_INTERFACES 4
#define USBD_MAX_NUM_CONFIGURATION 1
#define USBD_MAX_STR_DESC_SIZ 0x100
+#if MICROPY_HW_USB_SELF_POWERED
+#define USBD_SELF_POWERED 1
+#else
#define USBD_SELF_POWERED 0
+#endif
#define USBD_DEBUG_LEVEL 0
#endif // MICROPY_INCLUDED_STM32_USBD_CONF_H