aboutsummaryrefslogtreecommitdiffstats
path: root/testhal/STM32/STM32F7xx/USB_CDC/usbcfg.c
diff options
context:
space:
mode:
authorGiovanni Di Sirio <gdisirio@gmail.com>2015-12-24 07:53:33 +0000
committerGiovanni Di Sirio <gdisirio@gmail.com>2015-12-24 07:53:33 +0000
commit2296afaa34c8f4c19750a410e336b6f565918bcc (patch)
tree5867173aa747d12989d551a2eadf7c746c87160d /testhal/STM32/STM32F7xx/USB_CDC/usbcfg.c
parentd9973ea126e8eb0a740312e70b8b41efe12f1112 (diff)
downloadChibiOS-2296afaa34c8f4c19750a410e336b6f565918bcc.tar.gz
ChibiOS-2296afaa34c8f4c19750a410e336b6f565918bcc.tar.bz2
ChibiOS-2296afaa34c8f4c19750a410e336b6f565918bcc.zip
git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@8637 35acf78f-673a-0410-8e92-d51de3d6d3f4
Diffstat (limited to 'testhal/STM32/STM32F7xx/USB_CDC/usbcfg.c')
-rw-r--r--testhal/STM32/STM32F7xx/USB_CDC/usbcfg.c18
1 files changed, 16 insertions, 2 deletions
diff --git a/testhal/STM32/STM32F7xx/USB_CDC/usbcfg.c b/testhal/STM32/STM32F7xx/USB_CDC/usbcfg.c
index 968fd6724..6d1e45865 100644
--- a/testhal/STM32/STM32F7xx/USB_CDC/usbcfg.c
+++ b/testhal/STM32/STM32F7xx/USB_CDC/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.
*/
@@ -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
};
/*