summaryrefslogtreecommitdiff
path: root/src/class/cdc
diff options
context:
space:
mode:
authorhathach <[email protected]>2025-11-26 15:26:42 +0700
committerhathach <[email protected]>2025-11-26 15:26:42 +0700
commitc925277e24e6743b311199d87461befe8b590187 (patch)
tree9b8970f281f42767aa359416eadb074e08758592 /src/class/cdc
parent1a51a7e159a0db42279b971b5e460a270fa26750 (diff)
change tu_fifo_buffer_info_t layout
Diffstat (limited to 'src/class/cdc')
-rw-r--r--src/class/cdc/cdc_device.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/class/cdc/cdc_device.c b/src/class/cdc/cdc_device.c
index 2ab592bca..fbca5b574 100644
--- a/src/class/cdc/cdc_device.c
+++ b/src/class/cdc/cdc_device.c
@@ -501,10 +501,10 @@ bool cdcd_xfer_cb(uint8_t rhport, uint8_t ep_addr, xfer_result_t result, uint32_
// find backward
uint8_t *ptr;
- if (buf_info.len_wrap > 0) {
- ptr = buf_info.ptr_wrap + buf_info.len_wrap - 1; // last byte of wrap buffer
- } else if (buf_info.len_lin > 0) {
- ptr = buf_info.ptr_lin + buf_info.len_lin - 1; // last byte of linear buffer
+ if (buf_info.wrapped.len > 0) {
+ ptr = buf_info.wrapped.ptr + buf_info.wrapped.len - 1; // last byte of wrap buffer
+ } else if (buf_info.linear.len > 0) {
+ ptr = buf_info.linear.ptr + buf_info.linear.len - 1; // last byte of linear buffer
} else {
ptr = NULL; // no data
}
@@ -516,9 +516,9 @@ bool cdcd_xfer_cb(uint8_t rhport, uint8_t ep_addr, xfer_result_t result, uint32_
break; // only invoke once per transfer, even if multiple wanted chars are present
}
- if (ptr == buf_info.ptr_wrap) {
- ptr = buf_info.ptr_lin + buf_info.len_lin - 1; // last byte of linear buffer
- } else if (ptr == buf_info.ptr_lin) {
+ if (ptr == buf_info.wrapped.ptr) {
+ ptr = buf_info.linear.ptr + buf_info.linear.len - 1; // last byte of linear buffer
+ } else if (ptr == buf_info.linear.ptr) {
break; // reached the beginning
} else {
ptr--;