summaryrefslogtreecommitdiff
path: root/components/drivers/usb
diff options
context:
space:
mode:
authorBernard Xiong <[email protected]>2013-08-19 02:39:56 -0700
committerBernard Xiong <[email protected]>2013-08-19 02:39:56 -0700
commita8f9f85f66e42bc5b97d0892a6ee8eca77efa928 (patch)
tree0f8bf36fd8674b74f7b6a809ec45f634ada66ea7 /components/drivers/usb
parent6f75988cee4c0e7bfd77211c56c40681cbc4710e (diff)
parent0340300f89a924b30fd8042b76686a236720d3d7 (diff)
Merge pull request #143 from grissiom/ringbuffer-pipe
Ringbuffer and Pipe
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;