Skip to content

Commit 02e1827

Browse files
committed
sys/usb/cdc_acm: replace tsrb with turb
1 parent 57fa755 commit 02e1827

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

sys/usb/usbus/cdc/acm/cdc_acm.c

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
#include <string.h>
2323

2424
#include "tsrb.h"
25-
#include "usb/descriptor.h"
25+
#include "turb.h"
2626
#include "usb/cdc.h"
2727
#include "usb/descriptor.h"
2828
#include "usb/usbus.h"
@@ -154,20 +154,20 @@ size_t usbus_cdc_acm_submit(usbus_cdcacm_device_t *cdcacm, const uint8_t *buf, s
154154
unsigned old;
155155
if (cdcacm->state != USBUS_CDC_ACM_LINE_STATE_DISCONNECTED) {
156156
old = irq_disable();
157-
n = tsrb_add(&cdcacm->tsrb, buf, len);
157+
n = turb_add(&cdcacm->tsrb, buf, len);
158158
irq_restore(old);
159159
return n;
160160
}
161161
/* stuff as much data as possible into tsrb, discarding the oldest */
162162
old = irq_disable();
163-
n = tsrb_free(&cdcacm->tsrb);
163+
n = turb_free(&cdcacm->tsrb);
164164
if (len > n) {
165-
n += tsrb_drop(&cdcacm->tsrb, len - n);
165+
n += turb_drop(&cdcacm->tsrb, len - n);
166166
buf += len - n;
167167
} else {
168168
n = len;
169169
}
170-
tsrb_add(&cdcacm->tsrb, buf, n);
170+
turb_add(&cdcacm->tsrb, buf, n);
171171
/* behave as if everything has been written correctly */
172172
irq_restore(old);
173173
return len;
@@ -341,8 +341,8 @@ static void _handle_in(usbus_cdcacm_device_t *cdcacm,
341341
}
342342
/* copy at most CONFIG_USBUS_CDC_ACM_BULK_EP_SIZE chars from input into ep->buf */
343343
unsigned old = irq_disable();
344-
while (!tsrb_empty(&cdcacm->tsrb)) {
345-
int c = tsrb_get_one(&cdcacm->tsrb);
344+
while (!turb_empty(&cdcacm->tsrb)) {
345+
int c = turb_get_one(&cdcacm->tsrb);
346346
cdcacm->in_buf[cdcacm->occupied++] = (uint8_t)c;
347347
if (cdcacm->occupied >= CONFIG_USBUS_CDC_ACM_BULK_EP_SIZE) {
348348
break;

0 commit comments

Comments
 (0)