diff options
| author | hathach <[email protected]> | 2018-03-23 11:53:49 +0700 |
|---|---|---|
| committer | hathach <[email protected]> | 2018-03-23 11:56:52 +0700 |
| commit | 98d6ec1ef540b431c249dc5e01d3311c83c4cd54 (patch) | |
| tree | ad0a3335a0cca8efcee57cc241c4caa59506b498 /hw | |
| parent | 16aa3eb4370019214535ce480e0490652fdd3b17 (diff) | |
remove DCD API dependency tusb_dcd_edpt_queue_xfer
improve MSC driver
Diffstat (limited to 'hw')
| -rw-r--r-- | hw/mcu/nordic/nrf52/tusb_port/dcd_nrf52.c | 5 | ||||
| -rw-r--r-- | hw/mcu/nxp/lpc43xx/tusb_port/dcd_lpc43xx.c | 12 |
2 files changed, 4 insertions, 13 deletions
diff --git a/hw/mcu/nordic/nrf52/tusb_port/dcd_nrf52.c b/hw/mcu/nordic/nrf52/tusb_port/dcd_nrf52.c index 9032ed93b..379061e2f 100644 --- a/hw/mcu/nordic/nrf52/tusb_port/dcd_nrf52.c +++ b/hw/mcu/nordic/nrf52/tusb_port/dcd_nrf52.c @@ -436,11 +436,6 @@ bool tusb_dcd_edpt_xfer (uint8_t port, uint8_t ep_addr, uint8_t * buffer, uint16 return true; } -bool tusb_dcd_edpt_queue_xfer (uint8_t port, uint8_t ep_addr, uint8_t * buffer, uint16_t total_bytes) -{ - return true; -} - void tusb_dcd_edpt_stall (uint8_t port, uint8_t ep_addr) { (void) port; diff --git a/hw/mcu/nxp/lpc43xx/tusb_port/dcd_lpc43xx.c b/hw/mcu/nxp/lpc43xx/tusb_port/dcd_lpc43xx.c index cb0483d77..ec4dfa2f0 100644 --- a/hw/mcu/nxp/lpc43xx/tusb_port/dcd_lpc43xx.c +++ b/hw/mcu/nxp/lpc43xx/tusb_port/dcd_lpc43xx.c @@ -219,8 +219,9 @@ static void qtd_init(dcd_qtd_t* p_qtd, void * data_ptr, uint16_t total_bytes) // retval 0: invalid
static inline uint8_t qtd_find_free(uint8_t port)
{
- for(uint8_t i=2; i<DCD_QTD_MAX; i++)
- { // exclude control's qtd
+ // QTD0 is reserved for control transfer
+ for(uint8_t i=1; i<DCD_QTD_MAX; i++)
+ {
if ( dcd_data_ptr[port]->qtd[i].used == 0) return i;
}
@@ -331,6 +332,7 @@ bool tusb_dcd_edpt_busy(uint8_t port, uint8_t ep_addr) }
// add only, controller virtually cannot know
+// TODO remove and merge to tusb_dcd_edpt_xfer
static bool pipe_add_xfer(uint8_t port, uint8_t ed_idx, void * buffer, uint16_t total_bytes, bool int_on_complete)
{
uint8_t qtd_idx = qtd_find_free(port);
@@ -359,12 +361,6 @@ static bool pipe_add_xfer(uint8_t port, uint8_t ed_idx, void * buffer, uint16_t return true;
}
-bool tusb_dcd_edpt_queue_xfer(uint8_t port, uint8_t ep_addr, uint8_t * buffer, uint16_t total_bytes)
-{
- uint8_t ep_idx = edpt_addr2phy(ep_addr);
- return pipe_add_xfer(port, ep_idx, buffer, total_bytes, false);
-}
-
bool tusb_dcd_edpt_xfer(uint8_t port, uint8_t ep_addr, uint8_t * buffer, uint16_t total_bytes)
{
uint8_t ep_idx = edpt_addr2phy(ep_addr);
|
