aboutsummaryrefslogtreecommitdiffstats
path: root/demos/STM32/RT-STM32F746G-DISCOVERY-LWIP-FATFS-USB
diff options
context:
space:
mode:
authorGiovanni Di Sirio <gdisirio@gmail.com>2015-12-25 12:45:23 +0000
committerGiovanni Di Sirio <gdisirio@gmail.com>2015-12-25 12:45:23 +0000
commit2fdca55f58f29aa01be6a0b90728c902c20098ef (patch)
tree616b0a91bbf31c7882f292a44fccd99fef1d1151 /demos/STM32/RT-STM32F746G-DISCOVERY-LWIP-FATFS-USB
parent6857f4ff339826e7c5b2f26cf19d6275208631e6 (diff)
downloadChibiOS-2fdca55f58f29aa01be6a0b90728c902c20098ef.tar.gz
ChibiOS-2fdca55f58f29aa01be6a0b90728c902c20098ef.tar.bz2
ChibiOS-2fdca55f58f29aa01be6a0b90728c902c20098ef.zip
Updated all USB demos.
git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@8644 35acf78f-673a-0410-8e92-d51de3d6d3f4
Diffstat (limited to 'demos/STM32/RT-STM32F746G-DISCOVERY-LWIP-FATFS-USB')
-rw-r--r--demos/STM32/RT-STM32F746G-DISCOVERY-LWIP-FATFS-USB/main.c3
-rw-r--r--demos/STM32/RT-STM32F746G-DISCOVERY-LWIP-FATFS-USB/usbcfg.c22
-rw-r--r--demos/STM32/RT-STM32F746G-DISCOVERY-LWIP-FATFS-USB/usbcfg.h1
3 files changed, 19 insertions, 7 deletions
diff --git a/demos/STM32/RT-STM32F746G-DISCOVERY-LWIP-FATFS-USB/main.c b/demos/STM32/RT-STM32F746G-DISCOVERY-LWIP-FATFS-USB/main.c
index 3885ec198..6cad8655d 100644
--- a/demos/STM32/RT-STM32F746G-DISCOVERY-LWIP-FATFS-USB/main.c
+++ b/demos/STM32/RT-STM32F746G-DISCOVERY-LWIP-FATFS-USB/main.c
@@ -31,9 +31,6 @@
#include "usbcfg.h"
-/* Virtual serial port over USB.*/
-SerialUSBDriver SDU2;
-
/*===========================================================================*/
/* Card insertion monitor. */
/*===========================================================================*/
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
};
/*
diff --git a/demos/STM32/RT-STM32F746G-DISCOVERY-LWIP-FATFS-USB/usbcfg.h b/demos/STM32/RT-STM32F746G-DISCOVERY-LWIP-FATFS-USB/usbcfg.h
index 2ffaa17f9..333a5f9d3 100644
--- a/demos/STM32/RT-STM32F746G-DISCOVERY-LWIP-FATFS-USB/usbcfg.h
+++ b/demos/STM32/RT-STM32F746G-DISCOVERY-LWIP-FATFS-USB/usbcfg.h
@@ -19,6 +19,7 @@
extern const USBConfig usbcfg;
extern SerialUSBConfig serusbcfg;
+extern SerialUSBDriver SDU2;
#endif /* _USBCFG_H_ */