|
22 | 22 | #include <string.h> |
23 | 23 |
|
24 | 24 | #include "tsrb.h" |
25 | | -#include "usb/descriptor.h" |
| 25 | +#include "turb.h" |
26 | 26 | #include "usb/cdc.h" |
27 | 27 | #include "usb/descriptor.h" |
28 | 28 | #include "usb/usbus.h" |
@@ -154,20 +154,20 @@ size_t usbus_cdc_acm_submit(usbus_cdcacm_device_t *cdcacm, const uint8_t *buf, s |
154 | 154 | unsigned old; |
155 | 155 | if (cdcacm->state != USBUS_CDC_ACM_LINE_STATE_DISCONNECTED) { |
156 | 156 | old = irq_disable(); |
157 | | - n = tsrb_add(&cdcacm->tsrb, buf, len); |
| 157 | + n = turb_add(&cdcacm->tsrb, buf, len); |
158 | 158 | irq_restore(old); |
159 | 159 | return n; |
160 | 160 | } |
161 | 161 | /* stuff as much data as possible into tsrb, discarding the oldest */ |
162 | 162 | old = irq_disable(); |
163 | | - n = tsrb_free(&cdcacm->tsrb); |
| 163 | + n = turb_free(&cdcacm->tsrb); |
164 | 164 | if (len > n) { |
165 | | - n += tsrb_drop(&cdcacm->tsrb, len - n); |
| 165 | + n += turb_drop(&cdcacm->tsrb, len - n); |
166 | 166 | buf += len - n; |
167 | 167 | } else { |
168 | 168 | n = len; |
169 | 169 | } |
170 | | - tsrb_add(&cdcacm->tsrb, buf, n); |
| 170 | + turb_add(&cdcacm->tsrb, buf, n); |
171 | 171 | /* behave as if everything has been written correctly */ |
172 | 172 | irq_restore(old); |
173 | 173 | return len; |
@@ -341,8 +341,8 @@ static void _handle_in(usbus_cdcacm_device_t *cdcacm, |
341 | 341 | } |
342 | 342 | /* copy at most CONFIG_USBUS_CDC_ACM_BULK_EP_SIZE chars from input into ep->buf */ |
343 | 343 | 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); |
346 | 346 | cdcacm->in_buf[cdcacm->occupied++] = (uint8_t)c; |
347 | 347 | if (cdcacm->occupied >= CONFIG_USBUS_CDC_ACM_BULK_EP_SIZE) { |
348 | 348 | break; |
|
0 commit comments