aboutsummaryrefslogtreecommitdiffstats
path: root/demos/STM32/RT-STM32F746G-DISCOVERY-LWIP-FATFS-USB/usbcfg.c
diff options
context:
space:
mode:
Diffstat (limited to 'demos/STM32/RT-STM32F746G-DISCOVERY-LWIP-FATFS-USB/usbcfg.c')
-rw-r--r--demos/STM32/RT-STM32F746G-DISCOVERY-LWIP-FATFS-USB/usbcfg.c22
1 files changed, 18 insertions, 4 deletions
diff --git a/demos/STM32/RT-STM32F746G-DISCOVERY-LWIP-FATFS-USB/usbcfg.c b/demos/STM32/RT-STM32F746G-DISCOVERY-LWIP-FATFS-USB/usbcfg.c
index 968fd6724..c836f16c1 100644
--- a/demos/STM32/RT-STM32F746G-DISCOVERY-LWIP-FATFS-USB/usbcfg.c
+++ b/demos/STM32/RT-STM32F746G-DISCOVERY-LWIP-FATFS-USB/usbcfg.c
@@ -14,9 +14,11 @@
limitations under the License.
*/
-#include "ch.h"
#include "hal.h"
+/* Virtual serial port over USB.*/
+SerialUSBDriver SDU2;
+
/*
* Endpoints to be used for USBD2.
*/
@@ -28,7 +30,7 @@
* USB Device Descriptor.
*/
static const uint8_t vcom_device_descriptor_data[18] = {
- USB_DESC_DEVICE (0x0110, /* bcdUSB (1.1). */
+ USB_DESC_DEVICE (0x0200, /* bcdUSB (2.0). */
0x02, /* bDeviceClass (CDC). */
0x00, /* bDeviceSubClass. */
0x00, /* bDeviceProtocol. */
@@ -233,7 +235,7 @@ static const USBEndpointConfig ep1config = {
0x0040,
&ep1instate,
&ep1outstate,
- 2,
+ 4,
NULL
};
@@ -300,13 +302,25 @@ static void usb_event(USBDriver *usbp, usbevent_t event) {
}
/*
+ * Handles the USB driver global events.
+ */
+static void sof_handler(USBDriver *usbp) {
+
+ (void)usbp;
+
+ osalSysLockFromISR();
+ sduSOFHookI(&SDU2);
+ osalSysUnlockFromISR();
+}
+
+/*
* USB driver configuration.
*/
const USBConfig usbcfg = {
usb_event,
get_descriptor,
sduRequestsHook,
- NULL
+ sof_handler
};
/*