summaryrefslogtreecommitdiff
path: root/components/drivers/usb
diff options
context:
space:
mode:
authorbernard <[email protected]>2013-09-17 11:07:36 +0800
committerbernard <[email protected]>2013-09-17 11:07:36 +0800
commit0bf7ed76cff8071718f50ebeb68ba3bb2544a7cb (patch)
tree81db6eaa0424dc1c10355b5b4c8fe56c763c1cfd /components/drivers/usb
parent77096894f9d53cb0742adb5330fed4966e956cd1 (diff)
parent47c152ee7fdcf8b101a08bacebbafb52d2c8d3a7 (diff)
Merge branch 'master' of https://github.com/RT-Thread/rt-thread
Diffstat (limited to 'components/drivers/usb')
-rw-r--r--components/drivers/usb/usbdevice/class/cdc_vcom.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/components/drivers/usb/usbdevice/class/cdc_vcom.c b/components/drivers/usb/usbdevice/class/cdc_vcom.c
index 1dee3a4d79..5f284b0294 100644
--- a/components/drivers/usb/usbdevice/class/cdc_vcom.c
+++ b/components/drivers/usb/usbdevice/class/cdc_vcom.c
@@ -188,7 +188,7 @@ static rt_err_t _ep_in_handler(udevice_t device, uclass_t cls, rt_size_t size)
eps = (cdc_eps_t)cls->eps;
level = rt_hw_interrupt_disable();
- remain = RT_RINGBUFFER_SIZE(&tx_ringbuffer);
+ remain = rt_ringbuffer_data_len(&tx_ringbuffer);
if (remain != 0)
{
/* although vcom_in_sending is set in SOF handler in the very
@@ -453,7 +453,7 @@ static rt_err_t _class_sof_handler(udevice_t device, uclass_t cls)
eps = (cdc_eps_t)cls->eps;
- size = RT_RINGBUFFER_SIZE(&tx_ringbuffer);
+ size = rt_ringbuffer_data_len(&tx_ringbuffer);
if (size == 0)
return -RT_EFULL;
@@ -611,7 +611,7 @@ static int _vcom_putc(struct rt_serial_device *serial, char c)
* data out soon. But we cannot rely on that and if we wait to long, just
* return. */
for (cnt = 500;
- RT_RINGBUFFER_EMPTY(&tx_ringbuffer) == 0 && cnt;
+ rt_ringbuffer_space_len(&tx_ringbuffer) == 0 && cnt;
cnt--)
{
/*rt_kprintf("wait for %d\n", cnt);*/
@@ -628,7 +628,7 @@ static int _vcom_putc(struct rt_serial_device *serial, char c)
}
level = rt_hw_interrupt_disable();
- if (RT_RINGBUFFER_EMPTY(&tx_ringbuffer))
+ if (rt_ringbuffer_space_len(&tx_ringbuffer))
{
rt_ringbuffer_putchar(&tx_ringbuffer, c);
}
@@ -646,7 +646,7 @@ static int _vcom_getc(struct rt_serial_device *serial)
result = -1;
level = rt_hw_interrupt_disable();
- if (RT_RINGBUFFER_SIZE(&rx_ringbuffer))
+ if (rt_ringbuffer_data_len(&rx_ringbuffer))
{
rt_ringbuffer_getchar(&rx_ringbuffer, &ch);
result = ch;