summaryrefslogtreecommitdiff
path: root/tinyusb/class
diff options
context:
space:
mode:
authorhathach <[email protected]>2018-03-22 17:52:39 +0700
committerhathach <[email protected]>2018-03-22 17:52:39 +0700
commit16aa3eb4370019214535ce480e0490652fdd3b17 (patch)
treec8b7f8285dca1445bd9c0dfb9d293312710abc09 /tinyusb/class
parent0cb160468603a38284955316d84463995d3e2eff (diff)
simplify tusb_dcd_edpt_xfer API
Diffstat (limited to 'tinyusb/class')
-rw-r--r--tinyusb/class/cdc/cdc_device.c7
-rw-r--r--tinyusb/class/hid/hid_device.c4
-rw-r--r--tinyusb/class/msc/msc_device.c8
3 files changed, 9 insertions, 10 deletions
diff --git a/tinyusb/class/cdc/cdc_device.c b/tinyusb/class/cdc/cdc_device.c
index 29f9f588b..84b3fa867 100644
--- a/tinyusb/class/cdc/cdc_device.c
+++ b/tinyusb/class/cdc/cdc_device.c
@@ -199,7 +199,7 @@ tusb_error_t cdcd_open(uint8_t port, tusb_descriptor_interface_t const * p_inter
p_cdc->interface_number = p_interface_desc->bInterfaceNumber;
// Prepare for incoming data
- TU_ASSERT( tusb_dcd_edpt_xfer(port, p_cdc->ep_out, _tmp_rx_buf, sizeof(_tmp_rx_buf), true), TUSB_ERROR_DCD_EDPT_XFER);
+ TU_ASSERT( tusb_dcd_edpt_xfer(port, p_cdc->ep_out, _tmp_rx_buf, sizeof(_tmp_rx_buf)), TUSB_ERROR_DCD_EDPT_XFER);
return TUSB_ERROR_NONE;
@@ -277,7 +277,7 @@ tusb_error_t cdcd_xfer_cb(uint8_t port, uint8_t ep_addr, tusb_event_t event, uin
fifo_write_n(&_rx_ff, _tmp_rx_buf, xferred_bytes);
// preparing for next
- TU_ASSERT(tusb_dcd_edpt_xfer(port, p_cdc->ep_out, _tmp_rx_buf, sizeof(_tmp_rx_buf), true), TUSB_ERROR_DCD_EDPT_XFER);
+ TU_ASSERT(tusb_dcd_edpt_xfer(port, p_cdc->ep_out, _tmp_rx_buf, sizeof(_tmp_rx_buf)), TUSB_ERROR_DCD_EDPT_XFER);
// fire callback
tud_cdc_rx_cb(port);
@@ -294,9 +294,8 @@ bool tud_n_cdc_flush (uint8_t port)
VERIFY( !tusb_dcd_edpt_busy(port, edpt) );
-
uint16_t count = fifo_read_n(&_tx_ff, _tmp_tx_buf, sizeof(_tmp_tx_buf));
- TU_ASSERT( tusb_dcd_edpt_xfer(port, edpt, _tmp_tx_buf, count, false) );
+ TU_ASSERT( tusb_dcd_edpt_xfer(port, edpt, _tmp_tx_buf, count) );
return true;
}
diff --git a/tinyusb/class/hid/hid_device.c b/tinyusb/class/hid/hid_device.c
index c142feb13..f498b2adb 100644
--- a/tinyusb/class/hid/hid_device.c
+++ b/tinyusb/class/hid/hid_device.c
@@ -119,7 +119,7 @@ tusb_error_t tud_hid_keyboard_send(uint8_t port, hid_keyboard_report_t const *p_
hidd_interface_t * p_kbd = &keyboardd_data; // TODO &keyboardd_data[port];
- TU_ASSERT( tusb_dcd_edpt_xfer(port, p_kbd->edpt_addr, (void*) p_report, sizeof(hid_keyboard_report_t), true), TUSB_ERROR_DCD_EDPT_XFER ) ;
+ TU_ASSERT( tusb_dcd_edpt_xfer(port, p_kbd->edpt_addr, (void*) p_report, sizeof(hid_keyboard_report_t)), TUSB_ERROR_DCD_EDPT_XFER ) ;
return TUSB_ERROR_NONE;
}
@@ -142,7 +142,7 @@ tusb_error_t tud_hid_mouse_send(uint8_t port, hid_mouse_report_t const *p_report
hidd_interface_t * p_mouse = &moused_data; // TODO &keyboardd_data[port];
- TU_ASSERT( tusb_dcd_edpt_xfer(port, p_mouse->edpt_addr, (void*) p_report, sizeof(hid_mouse_report_t), true), TUSB_ERROR_DCD_EDPT_XFER ) ;
+ TU_ASSERT( tusb_dcd_edpt_xfer(port, p_mouse->edpt_addr, (void*) p_report, sizeof(hid_mouse_report_t)), TUSB_ERROR_DCD_EDPT_XFER ) ;
return TUSB_ERROR_NONE;
}
diff --git a/tinyusb/class/msc/msc_device.c b/tinyusb/class/msc/msc_device.c
index 0fe69e861..75a730a48 100644
--- a/tinyusb/class/msc/msc_device.c
+++ b/tinyusb/class/msc/msc_device.c
@@ -126,7 +126,7 @@ tusb_error_t mscd_open(uint8_t port, tusb_descriptor_interface_t const * p_inter
(*p_length) += sizeof(tusb_descriptor_interface_t) + 2*sizeof(tusb_descriptor_endpoint_t);
//------------- Queue Endpoint OUT for Command Block Wrapper -------------//
- TU_ASSERT( tusb_dcd_edpt_xfer(port, p_msc->ep_out, (uint8_t*) &p_msc->cbw, sizeof(msc_cbw_t), true), TUSB_ERROR_DCD_EDPT_XFER );
+ TU_ASSERT( tusb_dcd_edpt_xfer(port, p_msc->ep_out, (uint8_t*) &p_msc->cbw, sizeof(msc_cbw_t)), TUSB_ERROR_DCD_EDPT_XFER );
return TUSB_ERROR_NONE;
}
@@ -251,10 +251,10 @@ tusb_error_t mscd_xfer_cb(uint8_t port, uint8_t ep_addr, tusb_event_t event, uin
// Move to default CMD stage after sending status
p_msc->stage = MSC_STAGE_CMD;
- TU_ASSERT( tusb_dcd_edpt_xfer(port, p_msc->ep_in , (uint8_t*) &p_msc->csw, sizeof(msc_csw_t), true) );
+ TU_ASSERT( tusb_dcd_edpt_xfer(port, p_msc->ep_in , (uint8_t*) &p_msc->csw, sizeof(msc_csw_t)) );
//------------- Queue the next CBW -------------//
- TU_ASSERT( tusb_dcd_edpt_xfer(port, p_msc->ep_out, (uint8_t*) &p_msc->cbw, sizeof(msc_cbw_t), true) );
+ TU_ASSERT( tusb_dcd_edpt_xfer(port, p_msc->ep_out, (uint8_t*) &p_msc->cbw, sizeof(msc_cbw_t)) );
}
return TUSB_ERROR_NONE;
@@ -300,7 +300,7 @@ static bool read10_write10_data_xfer(uint8_t port, mscd_interface_t* p_msc)
return true;
} else if (xfer_block < block_count)
{
- TU_ASSERT( tusb_dcd_edpt_xfer(port, ep_addr, p_buffer, xfer_byte, true), TUSB_ERROR_DCD_EDPT_XFER );
+ TU_ASSERT( tusb_dcd_edpt_xfer(port, ep_addr, p_buffer, xfer_byte), TUSB_ERROR_DCD_EDPT_XFER );
// adjust lba, block_count, xfer_bytes for the next call
p_readwrite->lba = __n2be(lba+xfer_block);