summaryrefslogtreecommitdiff
path: root/src/device/usbd.c
diff options
context:
space:
mode:
authorhathach <[email protected]>2022-06-02 16:51:17 +0700
committerhathach <[email protected]>2022-06-02 16:51:17 +0700
commit8b9cf152a0dedda573fb3374d8c873dce4b883d1 (patch)
tree1e6236685627b6fdd960e70da54e89aa37fe9fb1 /src/device/usbd.c
parent99c1585ed215cb5ee2e27a41c54310d144e0ee6c (diff)
rhport argument in usbd_ API() is not used (always use the initialized port)
remove the usage of TUD_OPT_RHPORT in class driver
Diffstat (limited to 'src/device/usbd.c')
-rw-r--r--src/device/usbd.c14
1 files changed, 13 insertions, 1 deletions
diff --git a/src/device/usbd.c b/src/device/usbd.c
index fa75c0214..55e478a4e 100644
--- a/src/device/usbd.c
+++ b/src/device/usbd.c
@@ -428,7 +428,6 @@ bool tud_init (uint8_t rhport)
dcd_init(rhport);
dcd_int_enable(rhport);
-
return true;
}
@@ -1199,6 +1198,8 @@ void usbd_defer_func(osal_task_func_t func, void* param, bool in_isr)
bool usbd_edpt_open(uint8_t rhport, tusb_desc_endpoint_t const * desc_ep)
{
+ rhport = _usbd_rhport;
+
TU_ASSERT(tu_edpt_number(desc_ep->bEndpointAddress) < CFG_TUD_ENDPPOINT_MAX);
TU_ASSERT(tu_edpt_validate(desc_ep, (tusb_speed_t) _usbd_dev.speed));
@@ -1240,6 +1241,8 @@ bool usbd_edpt_release(uint8_t rhport, uint8_t ep_addr)
bool usbd_edpt_xfer(uint8_t rhport, uint8_t ep_addr, uint8_t * buffer, uint16_t total_bytes)
{
+ rhport = _usbd_rhport;
+
uint8_t const epnum = tu_edpt_number(ep_addr);
uint8_t const dir = tu_edpt_dir(ep_addr);
@@ -1275,6 +1278,8 @@ bool usbd_edpt_xfer(uint8_t rhport, uint8_t ep_addr, uint8_t * buffer, uint16_t
// into the USB buffer!
bool usbd_edpt_xfer_fifo(uint8_t rhport, uint8_t ep_addr, tu_fifo_t * ff, uint16_t total_bytes)
{
+ rhport = _usbd_rhport;
+
uint8_t const epnum = tu_edpt_number(ep_addr);
uint8_t const dir = tu_edpt_dir(ep_addr);
@@ -1314,6 +1319,7 @@ bool usbd_edpt_busy(uint8_t rhport, uint8_t ep_addr)
void usbd_edpt_stall(uint8_t rhport, uint8_t ep_addr)
{
+ rhport = _usbd_rhport;
uint8_t const epnum = tu_edpt_number(ep_addr);
uint8_t const dir = tu_edpt_dir(ep_addr);
@@ -1330,6 +1336,8 @@ void usbd_edpt_stall(uint8_t rhport, uint8_t ep_addr)
void usbd_edpt_clear_stall(uint8_t rhport, uint8_t ep_addr)
{
+ rhport = _usbd_rhport;
+
uint8_t const epnum = tu_edpt_number(ep_addr);
uint8_t const dir = tu_edpt_dir(ep_addr);
@@ -1361,6 +1369,8 @@ bool usbd_edpt_stalled(uint8_t rhport, uint8_t ep_addr)
*/
void usbd_edpt_close(uint8_t rhport, uint8_t ep_addr)
{
+ rhport = _usbd_rhport;
+
TU_ASSERT(dcd_edpt_close, /**/);
TU_LOG2(" CLOSING Endpoint: 0x%02X\r\n", ep_addr);
@@ -1377,6 +1387,8 @@ void usbd_edpt_close(uint8_t rhport, uint8_t ep_addr)
void usbd_sof_enable(uint8_t rhport, bool en)
{
+ rhport = _usbd_rhport;
+
// TODO: Check needed if all drivers including the user sof_cb does not need an active SOF ISR any more.
// Only if all drivers switched off SOF calls the SOF interrupt may be disabled
dcd_sof_enable(rhport, en);