summaryrefslogtreecommitdiff
path: root/src/class
diff options
context:
space:
mode:
authorhathach <[email protected]>2024-11-27 11:35:21 +0700
committerhathach <[email protected]>2024-11-27 11:35:21 +0700
commit9e4b855e5309976ead84d6cc65288e0e03f27ba5 (patch)
treeffafa08ced0e49dfb3930ef9b96a8c4f8fd5208b /src/class
parent453d69517b8f7f019ac855531e9e433d9d158f37 (diff)
minor clean up
Diffstat (limited to 'src/class')
-rw-r--r--src/class/cdc/cdc_host.c8
-rw-r--r--src/class/hid/hid_host.c18
2 files changed, 13 insertions, 13 deletions
diff --git a/src/class/cdc/cdc_host.c b/src/class/cdc/cdc_host.c
index d92fd875d..e817ebc7e 100644
--- a/src/class/cdc/cdc_host.c
+++ b/src/class/cdc/cdc_host.c
@@ -78,8 +78,8 @@ typedef struct {
} cdch_interface_t;
typedef struct {
- TUH_EPBUF_DEF(tx_ep_buf, CFG_TUH_CDC_TX_EPSIZE);
- TUH_EPBUF_DEF(rx_ep_buf, CFG_TUH_CDC_TX_EPSIZE);
+ TUH_EPBUF_DEF(tx, CFG_TUH_CDC_TX_EPSIZE);
+ TUH_EPBUF_DEF(rx, CFG_TUH_CDC_TX_EPSIZE);
} cdch_epbuf_t;
static cdch_interface_t cdch_data[CFG_TUH_CDC];
@@ -631,11 +631,11 @@ bool cdch_init(void) {
cdch_epbuf_t* epbuf = &cdch_epbuf[i];
tu_edpt_stream_init(&p_cdc->stream.tx, true, true, false,
p_cdc->stream.tx_ff_buf, CFG_TUH_CDC_TX_BUFSIZE,
- epbuf->tx_ep_buf, CFG_TUH_CDC_TX_EPSIZE);
+ epbuf->tx, CFG_TUH_CDC_TX_EPSIZE);
tu_edpt_stream_init(&p_cdc->stream.rx, true, false, false,
p_cdc->stream.rx_ff_buf, CFG_TUH_CDC_RX_BUFSIZE,
- epbuf->rx_ep_buf, CFG_TUH_CDC_RX_EPSIZE);
+ epbuf->rx, CFG_TUH_CDC_RX_EPSIZE);
}
return true;
diff --git a/src/class/hid/hid_host.c b/src/class/hid/hid_host.c
index 5ce47606d..eef584d74 100644
--- a/src/class/hid/hid_host.c
+++ b/src/class/hid/hid_host.c
@@ -61,8 +61,8 @@ typedef struct {
} hidh_interface_t;
typedef struct {
- TUH_EPBUF_DEF(epin_buf, CFG_TUH_HID_EPIN_BUFSIZE);
- TUH_EPBUF_DEF(epout_buf, CFG_TUH_HID_EPOUT_BUFSIZE);
+ TUH_EPBUF_DEF(epin, CFG_TUH_HID_EPIN_BUFSIZE);
+ TUH_EPBUF_DEF(epout, CFG_TUH_HID_EPOUT_BUFSIZE);
} hidh_epbuf_t;
static hidh_interface_t _hidh_itf[CFG_TUH_HID];
@@ -363,7 +363,7 @@ bool tuh_hid_receive_report(uint8_t daddr, uint8_t idx) {
// claim endpoint
TU_VERIFY(usbh_edpt_claim(daddr, p_hid->ep_in));
- if (!usbh_edpt_xfer(daddr, p_hid->ep_in, epbuf->epin_buf, p_hid->epin_size)) {
+ if (!usbh_edpt_xfer(daddr, p_hid->ep_in, epbuf->epin, p_hid->epin_size)) {
usbh_edpt_release(daddr, p_hid->ep_in);
return false;
}
@@ -403,16 +403,16 @@ bool tuh_hid_send_report(uint8_t daddr, uint8_t idx, uint8_t report_id, const vo
if (report_id == 0) {
// No report ID in transmission
- memcpy(&epbuf->epout_buf[0], report, len);
+ memcpy(&epbuf->epout[0], report, len);
} else {
- epbuf->epout_buf[0] = report_id;
- memcpy(&epbuf->epout_buf[1], report, len);
+ epbuf->epout[0] = report_id;
+ memcpy(&epbuf->epout[1], report, len);
++len; // 1 more byte for report_id
}
TU_LOG3_MEM(p_hid->epout_buf, len, 2);
- if (!usbh_edpt_xfer(daddr, p_hid->ep_out, epbuf->epout_buf, len)) {
+ if (!usbh_edpt_xfer(daddr, p_hid->ep_out, epbuf->epout, len)) {
usbh_edpt_release(daddr, p_hid->ep_out);
return false;
}
@@ -446,10 +446,10 @@ bool hidh_xfer_cb(uint8_t daddr, uint8_t ep_addr, xfer_result_t result, uint32_t
if (dir == TUSB_DIR_IN) {
TU_LOG_DRV(" Get Report callback (%u, %u)\r\n", daddr, idx);
TU_LOG3_MEM(p_hid->epin_buf, xferred_bytes, 2);
- tuh_hid_report_received_cb(daddr, idx, epbuf->epin_buf, (uint16_t) xferred_bytes);
+ tuh_hid_report_received_cb(daddr, idx, epbuf->epin, (uint16_t) xferred_bytes);
} else {
if (tuh_hid_report_sent_cb) {
- tuh_hid_report_sent_cb(daddr, idx, epbuf->epout_buf, (uint16_t) xferred_bytes);
+ tuh_hid_report_sent_cb(daddr, idx, epbuf->epout, (uint16_t) xferred_bytes);
}
}