summaryrefslogtreecommitdiff
path: root/components/drivers
diff options
context:
space:
mode:
authorbernard.xiong <[email protected]>2012-10-11 23:35:42 +0000
committerbernard.xiong <[email protected]>2012-10-11 23:35:42 +0000
commitf1862e80f76bb21c817e4920abd010077ada0a6a (patch)
tree73b5e40ebac41a2ea638f547142df564c21b5f5b /components/drivers
parentc752d9b09510b62e4ecc76f4fd0343eeba5c1358 (diff)
Fixed _class_sof_handler function return value.
git-svn-id: https://rt-thread.googlecode.com/svn/trunk@2345 bbd45198-f89e-11dd-88c7-29a3b14d5316
Diffstat (limited to 'components/drivers')
-rw-r--r--components/drivers/usb/usbdevice/class/cdc_vcom.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/components/drivers/usb/usbdevice/class/cdc_vcom.c b/components/drivers/usb/usbdevice/class/cdc_vcom.c
index c3f1d992cf..a41493cda4 100644
--- a/components/drivers/usb/usbdevice/class/cdc_vcom.c
+++ b/components/drivers/usb/usbdevice/class/cdc_vcom.c
@@ -336,13 +336,13 @@ static rt_err_t _class_stop(udevice_t device)
*
* @return RT_EOK on successful.
*/
-rt_err_t _class_sof_handler(udevice_t device)
+static rt_err_t _class_sof_handler(udevice_t device)
{
rt_uint32_t level;
rt_size_t size;
static rt_uint32_t frame_count = 0;
- if(vcom_connected != RT_TRUE) return;
+ if(vcom_connected != RT_TRUE) return -RT_ERROR;
if (frame_count ++ == 5)
{
@@ -352,7 +352,7 @@ rt_err_t _class_sof_handler(udevice_t device)
frame_count = 0;
size = RT_RINGBUFFER_SIZE(&tx_ringbuffer);
- if(size == 0) return;
+ if(size == 0) return -RT_EFULL;
size = size > mps ? mps : size;
@@ -363,6 +363,8 @@ rt_err_t _class_sof_handler(udevice_t device)
/* send data to host */
dcd_ep_write(device->dcd, ep_in, ep_in->buffer, size);
}
+
+ return RT_EOK;
}
static struct uclass_ops ops =
@@ -375,7 +377,7 @@ static struct uclass_ops ops =
/**
* This function will configure cdc descriptor.
*
- * @param comm the communcation interface number.
+ * @param comm the communication interface number.
* @param data the data interface number.
*
* @return RT_EOK on successful.