From 4b601a5d0fd06f8e238c17fb96633100ecc59503 Mon Sep 17 00:00:00 2001 From: Giovanni Di Sirio Date: Fri, 25 Dec 2015 08:59:10 +0000 Subject: USB upgrade. git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@8641 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- testhal/STM32/STM32F4xx/USB_CDC_IAD/usbcfg.c | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) (limited to 'testhal/STM32/STM32F4xx/USB_CDC_IAD/usbcfg.c') diff --git a/testhal/STM32/STM32F4xx/USB_CDC_IAD/usbcfg.c b/testhal/STM32/STM32F4xx/USB_CDC_IAD/usbcfg.c index 873bea31e..14bd5ed32 100644 --- a/testhal/STM32/STM32F4xx/USB_CDC_IAD/usbcfg.c +++ b/testhal/STM32/STM32F4xx/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.*/ @@ -424,6 +430,19 @@ static bool requests_hook(USBDriver *usbp) { return sduRequestsHook(usbp); } +/* + * Handles the USB driver global events. + */ +static void sof_handler(USBDriver *usbp) { + + (void)usbp; + + osalSysLockFromISR(); + sduSOFHookI(&SDU1); + sduSOFHookI(&SDU2); + osalSysUnlockFromISR(); +} + /* * USB driver configuration. */ @@ -431,7 +450,7 @@ const USBConfig usbcfg = { usb_event, get_descriptor, requests_hook, - NULL + sof_handler }; /* -- cgit v1.2.3