aboutsummaryrefslogtreecommitdiff
path: root/wirish/stm32f1
diff options
context:
space:
mode:
authorMarti Bolivar <mbolivar@leaflabs.com>2012-06-03 06:00:41 -0400
committerMarti Bolivar <mbolivar@leaflabs.com>2012-06-03 22:40:39 -0400
commit8796a81efc61a7406625ee278125a52c62e626f4 (patch)
tree0d2853cf5d739cdba5a596387e8709eb1969e185 /wirish/stm32f1
parent34c238a7687c0030b3e38be3bbd6fd5ec6a94a46 (diff)
Slightly improve and generify the USB infrastructure.
The good news is that <libmaple/usb.h> and <libmaple/usb_cdcacm.h> did turn out generic enough in what they specify to go on unchanged. However, we can't just go on assuming that there's USB just because we're on an F1. Now that there's value line in the tree, we need to be more careful (value line F1s don't have USB peripherals). To that end, make all the F1 board-includes/*.mk files specify what line their MCU is with an MCU_F1_LINE variable. Use that to hack libmaple/usb/rules.mk so we only try to build the USB module under appropriate circumstances. While we're at it, add a vector_symbols.inc for value line MCUs under support/ld/. We need this to get the target-config.mk modifications implied by the addition of MCU_F1_LINE. We'll fix up some other performance-line-isms under libmaple/stm32f1 in a separate commit. Also in libmaple/usb/: - Move everything into a new stm32f1 directory. Due to aforementioned rules.mk hacks, there is no immediate need for an stm32f2 directory (USB support doesn't exist there). - Update the README for style and content. Signed-off-by: Marti Bolivar <mbolivar@leaflabs.com>
Diffstat (limited to 'wirish/stm32f1')
-rw-r--r--wirish/stm32f1/boards_setup.cpp10
1 files changed, 4 insertions, 6 deletions
diff --git a/wirish/stm32f1/boards_setup.cpp b/wirish/stm32f1/boards_setup.cpp
index 423e5ec..1dec579 100644
--- a/wirish/stm32f1/boards_setup.cpp
+++ b/wirish/stm32f1/boards_setup.cpp
@@ -38,9 +38,9 @@
#include <libmaple/gpio.h>
#include <libmaple/timer.h>
-#include <libmaple/usb_cdcacm.h>
-#include <board/board.h>
+#include <wirish/boards.h>
+#include <wirish/usb_serial.h>
// Allow boards to provide a PLL multiplier. This is useful for
// e.g. STM32F100 value line MCUs, which use slower multipliers.
@@ -80,10 +80,8 @@ namespace wirish {
}
void board_setup_usb(void) {
-#if 0
-# if STM32_HAVE_USB
- usb_cdcacm_enable(BOARD_USB_DISC_DEV, BOARD_USB_DISC_BIT);
-# endif
+#if BOARD_HAVE_SERIALUSB
+ SerialUSB.begin();
#endif
}
}