aboutsummaryrefslogtreecommitdiffstats
path: root/testhal/STM32/STM32F3xx/USB_CDC_IAD/usbcfg.c
diff options
context:
space:
mode:
Diffstat (limited to 'testhal/STM32/STM32F3xx/USB_CDC_IAD/usbcfg.c')
-rw-r--r--testhal/STM32/STM32F3xx/USB_CDC_IAD/usbcfg.c21
1 files changed, 20 insertions, 1 deletions
diff --git a/testhal/STM32/STM32F3xx/USB_CDC_IAD/usbcfg.c b/testhal/STM32/STM32F3xx/USB_CDC_IAD/usbcfg.c
index 70e55dbba..e7029ade4 100644
--- a/testhal/STM32/STM32F3xx/USB_CDC_IAD/usbcfg.c
+++ b/testhal/STM32/STM32F3xx/USB_CDC_IAD/usbcfg.c
@@ -16,6 +16,12 @@
#include "hal.h"
+/*
+ * Virtual serial ports over USB.
+ */
+SerialUSBDriver SDU1;
+SerialUSBDriver SDU2;
+
#define USB_DEVICE_VID 0xF055 /* You MUST change this.*/
#define USB_DEVICE_PID 0xE063 /* You MUST change this.*/
@@ -425,13 +431,26 @@ static bool requests_hook(USBDriver *usbp) {
}
/*
+ * Handles the USB driver global events.
+ */
+static void sof_handler(USBDriver *usbp) {
+
+ (void)usbp;
+
+ osalSysLockFromISR();
+ sduSOFHookI(&SDU1);
+ sduSOFHookI(&SDU2);
+ osalSysUnlockFromISR();
+}
+
+/*
* USB driver configuration.
*/
const USBConfig usbcfg = {
usb_event,
get_descriptor,
requests_hook,
- NULL
+ sof_handler
};
/*