aboutsummaryrefslogtreecommitdiffstats
path: root/libmaple/usb/usb_config.h
diff options
context:
space:
mode:
authorMarti Bolivar <mbolivar@leaflabs.com>2011-06-15 16:29:19 -0400
committerMarti Bolivar <mbolivar@leaflabs.com>2011-10-18 13:30:17 -0400
commit9e3c80a3ae38c111c138aa9e7c70f1abb5d1424f (patch)
tree9accce7b55bb9b680f4dee2010087eb3b566b248 /libmaple/usb/usb_config.h
parentc023d179fa613f979d50a0d105f08b9b58c7ce6b (diff)
downloadlibrambutan-9e3c80a3ae38c111c138aa9e7c70f1abb5d1424f.tar.gz
librambutan-9e3c80a3ae38c111c138aa9e7c70f1abb5d1424f.zip
usb: Move some board-specific configuration to Wirish.
Create new BOARD_USB_DISC_DEV and BOARD_USB_DISC_BIT board-specific values. Use these as arguments to setupUSB() and disableUSB(). This helps make the USB stack more generic, and goes towards the resolution of an important FIXME. Signed-off-by: Marti Bolivar <mbolivar@leaflabs.com>
Diffstat (limited to 'libmaple/usb/usb_config.h')
-rw-r--r--libmaple/usb/usb_config.h42
1 files changed, 10 insertions, 32 deletions
diff --git a/libmaple/usb/usb_config.h b/libmaple/usb/usb_config.h
index 62a6a71..6eb88a5 100644
--- a/libmaple/usb/usb_config.h
+++ b/libmaple/usb/usb_config.h
@@ -25,42 +25,20 @@
*****************************************************************************/
#define VCOM_ID_VENDOR 0x1EAF
+#define VCOM_ID_PRODUCT 0x0004
#define RESET_DELAY (100000)
#define USB_CONFIG_MAX_POWER (100 >> 1)
-#if defined(BOARD_maple) || defined(BOARD_maple_RET6)
+#if !(defined(BOARD_maple) || defined(BOARD_maple_RET6) || \
+ defined(BOARD_maple_mini) || defined(BOARD_maple_native))
- /* USB Identifier numbers */
- #define VCOM_ID_PRODUCT 0x0004
- #define USB_DISC_DEV GPIOC
- #define USB_DISC_PIN 12
-
-#elif defined(BOARD_maple_mini)
-
- #define VCOM_ID_PRODUCT 0x0004
- #define USB_DISC_DEV GPIOB
- #define USB_DISC_PIN 9
-
-#elif defined(BOARD_maple_native)
-
- #define VCOM_ID_PRODUCT 0x0004
- #define USB_DISC_DEV GPIOB
- #define USB_DISC_PIN 8
-
-#elif defined(BOARD_olimex_stm32_h103)
-
- #define VCOM_ID_PRODUCT 0x0004
- #define USB_DISC_DEV GPIOC
- #define USB_DISC_PIN 11
-
-#else
-
-#error ("Sorry! the USB stack relies on LeafLabs board-specific " \
- "configuration right now. If you want, you can pretend you're one " \
- "of our boards; i.e., #define BOARD_maple, BOARD_maple_mini, or " \
- "BOARD_maple_native according to what matches your MCU best. " \
- "You should also take a look at libmaple/usb/descriptors.c; we make " \
- "some assumptions there that you probably won't like.")
+#warning ("Warning! The USB stack relies on LeafLabs board-specific " \
+ "configuration right now. If you want, you can pretend " \
+ "you're one of our boards; i.e., #define BOARD_maple, " \
+ "BOARD_maple_mini, etc. according to what matches your MCU " \
+ "best. You should also take a look at " \
+ "libmaple/usb/descriptors.c; " \
+ "we make some assumptions there that you probably won't like.")
#endif