diff options
author | gdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4> | 2011-02-12 18:59:34 +0000 |
---|---|---|
committer | gdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4> | 2011-02-12 18:59:34 +0000 |
commit | 95d128420a70587ce2845df383ed9b6a165e58dc (patch) | |
tree | 4621b97f40a3b2c936e5a47c9f42601f28a5b6eb /testhal | |
parent | d749ecc10a40b21a22b3e7ab14ff9861fabe4685 (diff) | |
download | ChibiOS-95d128420a70587ce2845df383ed9b6a165e58dc.tar.gz ChibiOS-95d128420a70587ce2845df383ed9b6a165e58dc.tar.bz2 ChibiOS-95d128420a70587ce2845df383ed9b6a165e58dc.zip |
Fixed a problem in the USB-CDC demo.
git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@2733 35acf78f-673a-0410-8e92-d51de3d6d3f4
Diffstat (limited to 'testhal')
-rw-r--r-- | testhal/STM32/USB_CDC/main.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/testhal/STM32/USB_CDC/main.c b/testhal/STM32/USB_CDC/main.c index 0c2a3ac9d..6af497542 100644 --- a/testhal/STM32/USB_CDC/main.c +++ b/testhal/STM32/USB_CDC/main.c @@ -367,7 +367,8 @@ static msg_t Thread2(void *arg) { uint8_t buffer[0x40];
size_t n = chIQReadTimeout(&sdup->iqueue, buffer,
sizeof(buffer), TIME_IMMEDIATE);
- chOQWriteTimeout(&sdup->oqueue, buffer, n, TIME_IMMEDIATE);
+ if (n > 0)
+ chOQWriteTimeout(&sdup->oqueue, buffer, n, TIME_IMMEDIATE);
}
}
}
|