diff options
author | Giovanni Di Sirio <gdisirio@gmail.com> | 2015-12-25 08:59:10 +0000 |
---|---|---|
committer | Giovanni Di Sirio <gdisirio@gmail.com> | 2015-12-25 08:59:10 +0000 |
commit | 4b601a5d0fd06f8e238c17fb96633100ecc59503 (patch) | |
tree | 0ed28cfc2e87f0a346850c49a9343df30604f218 /testhal/STM32/STM32F7xx/USB_CDC | |
parent | 6a20a7107a016a4cb43c3f98362b447f883db8c8 (diff) | |
download | ChibiOS-4b601a5d0fd06f8e238c17fb96633100ecc59503.tar.gz ChibiOS-4b601a5d0fd06f8e238c17fb96633100ecc59503.tar.bz2 ChibiOS-4b601a5d0fd06f8e238c17fb96633100ecc59503.zip |
USB upgrade.
git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@8641 35acf78f-673a-0410-8e92-d51de3d6d3f4
Diffstat (limited to 'testhal/STM32/STM32F7xx/USB_CDC')
-rw-r--r-- | testhal/STM32/STM32F7xx/USB_CDC/Makefile | 2 | ||||
-rw-r--r-- | testhal/STM32/STM32F7xx/USB_CDC/main.c | 12 | ||||
-rw-r--r-- | testhal/STM32/STM32F7xx/USB_CDC/usbcfg.c | 4 |
3 files changed, 9 insertions, 9 deletions
diff --git a/testhal/STM32/STM32F7xx/USB_CDC/Makefile b/testhal/STM32/STM32F7xx/USB_CDC/Makefile index 447b52ca4..77a055825 100644 --- a/testhal/STM32/STM32F7xx/USB_CDC/Makefile +++ b/testhal/STM32/STM32F7xx/USB_CDC/Makefile @@ -5,7 +5,7 @@ # Compiler options here.
ifeq ($(USE_OPT),)
- USE_OPT = -O0 -ggdb -fomit-frame-pointer -falign-functions=16
+ USE_OPT = -O2 -ggdb -fomit-frame-pointer -falign-functions=16
endif
# C specific options here (added to USE_OPT).
diff --git a/testhal/STM32/STM32F7xx/USB_CDC/main.c b/testhal/STM32/STM32F7xx/USB_CDC/main.c index 5b25210be..4a15108d7 100644 --- a/testhal/STM32/STM32F7xx/USB_CDC/main.c +++ b/testhal/STM32/STM32F7xx/USB_CDC/main.c @@ -111,14 +111,14 @@ static void cmd_write(BaseSequentialStream *chp, int argc, char *argv[]) { }
while (chnGetTimeout((BaseChannel *)chp, TIME_IMMEDIATE) == Q_TIMEOUT) {
-#if 0
- /* Writing in stream mode.*/
- streamWrite(&SDU2, buf, sizeof buf - 1);
+#if 1
+ /* Writing in channel mode.*/
+ chnWrite(&SDU1, buf, sizeof buf - 1);
#else
/* Writing in buffer mode.*/
- (void) obqGetEmptyBufferTimeout(&SDU2.obqueue, TIME_INFINITE);
- memcpy(SDU2.obqueue.ptr, buf, SERIAL_USB_BUFFERS_SIZE);
- obqPostFullBuffer(&SDU2.obqueue, SERIAL_USB_BUFFERS_SIZE);
+ (void) obqGetEmptyBufferTimeout(&SDU1.obqueue, TIME_INFINITE);
+ memcpy(SDU1.obqueue.ptr, buf, SERIAL_USB_BUFFERS_SIZE);
+ obqPostFullBuffer(&SDU1.obqueue, SERIAL_USB_BUFFERS_SIZE);
#endif
}
chprintf(chp, "\r\n\nstopped\r\n");
diff --git a/testhal/STM32/STM32F7xx/USB_CDC/usbcfg.c b/testhal/STM32/STM32F7xx/USB_CDC/usbcfg.c index 6d1e45865..c836f16c1 100644 --- a/testhal/STM32/STM32F7xx/USB_CDC/usbcfg.c +++ b/testhal/STM32/STM32F7xx/USB_CDC/usbcfg.c @@ -30,7 +30,7 @@ SerialUSBDriver SDU2; * 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. */
@@ -235,7 +235,7 @@ static const USBEndpointConfig ep1config = { 0x0040,
&ep1instate,
&ep1outstate,
- 2,
+ 4,
NULL
};
|