summaryrefslogtreecommitdiff
path: root/ucoo/hal/usb
diff options
context:
space:
mode:
authorNicolas Schodet2015-04-20 16:31:13 +0200
committerNicolas Schodet2019-10-07 00:44:50 +0200
commit2b6317815bf86c80047c5d3b42602f81b8c21d01 (patch)
tree1dff127e53988fc781357400a024a8de853b9a7f /ucoo/hal/usb
parent9901e49f990b7e1ab9646295999fc5544e388f1d (diff)
Update to new libopencm3 version
- remove f4/ from include directory - rename some SysTick registers - rename APB freq variables
Diffstat (limited to 'ucoo/hal/usb')
-rw-r--r--ucoo/hal/usb/usb.stm32.cc10
1 files changed, 7 insertions, 3 deletions
diff --git a/ucoo/hal/usb/usb.stm32.cc b/ucoo/hal/usb/usb.stm32.cc
index 0410df5..70db92b 100644
--- a/ucoo/hal/usb/usb.stm32.cc
+++ b/ucoo/hal/usb/usb.stm32.cc
@@ -24,14 +24,17 @@
#include "usb.stm32.hh"
#include <algorithm>
-#include <libopencm3/stm32/f4/rcc.h>
-#include <libopencm3/stm32/f4/gpio.h>
+#include <libopencm3/stm32/rcc.h>
+#include <libopencm3/stm32/gpio.h>
#include <libopencm3/cm3/nvic.h>
#include "usb_desc.stm32.h"
static usbd_device *usbdev;
+// Buffer for control requests.
+static uint8_t usb_control_buffer[128];
+
extern "C" {
void
@@ -69,7 +72,8 @@ UsbStreamControl::UsbStreamControl (const char *vendor, const char *product)
GPIO9 | GPIO11 | GPIO12);
gpio_set_af (GPIOA, GPIO_AF10, GPIO9 | GPIO11 | GPIO12);
usbdev = usbd_init (&otgfs_usb_driver, &usb_desc_dev, &usb_desc_config,
- strings, lengthof (strings));
+ strings, lengthof (strings),
+ usb_control_buffer, sizeof (usb_control_buffer));
usbd_register_set_config_callback (usbdev, set_config);
nvic_enable_irq (NVIC_OTG_FS_IRQ);
}