diff options
| author | hathach <[email protected]> | 2022-03-09 17:51:35 +0700 |
|---|---|---|
| committer | hathach <[email protected]> | 2022-03-09 17:51:35 +0700 |
| commit | 0e5e644d27a722f7a95fcd5f049770094fb02cd6 (patch) | |
| tree | 1166282e43924874dcb918e821f10a6d6a7a6a49 /src/host | |
| parent | d56cde33ef66985b5d3cb087f87cf8bc1a2b111d (diff) | |
minor clean up
Diffstat (limited to 'src/host')
| -rw-r--r-- | src/host/usbh.c | 2 | ||||
| -rw-r--r-- | src/host/usbh_control.c | 8 |
2 files changed, 4 insertions, 6 deletions
diff --git a/src/host/usbh.c b/src/host/usbh.c index 69ec081fd..808ef1299 100644 --- a/src/host/usbh.c +++ b/src/host/usbh.c @@ -561,7 +561,7 @@ void tuh_task(void) else { usbh_device_t* dev = get_device(event.dev_addr); - dev->ep_status[epnum][ep_dir].busy = false; + dev->ep_status[epnum][ep_dir].busy = 0; dev->ep_status[epnum][ep_dir].claimed = 0; if ( 0 == epnum ) diff --git a/src/host/usbh_control.c b/src/host/usbh_control.c index 5f4fcf52f..f311cc257 100644 --- a/src/host/usbh_control.c +++ b/src/host/usbh_control.c @@ -50,9 +50,6 @@ typedef struct static usbh_control_xfer_t _ctrl_xfer; -//CFG_TUSB_MEM_SECTION CFG_TUSB_MEM_ALIGN -//static uint8_t _tuh_ctrl_buf[CFG_TUH_ENUMERATION_BUFSIZE]; - //--------------------------------------------------------------------+ // MACRO TYPEDEF CONSTANT ENUM DECLARATION //--------------------------------------------------------------------+ @@ -76,6 +73,7 @@ bool usbh_control_xfer (uint8_t dev_addr, tusb_control_request_t const* request, static void _xfer_complete(uint8_t dev_addr, xfer_result_t result) { TU_LOG2("\r\n"); + _ctrl_xfer.stage = STAGE_IDLE; if (_ctrl_xfer.complete_cb) _ctrl_xfer.complete_cb(dev_addr, &_ctrl_xfer.request, result); } @@ -90,7 +88,7 @@ bool usbh_control_xfer_cb (uint8_t dev_addr, uint8_t ep_addr, xfer_result_t resu if (XFER_RESULT_SUCCESS != result) { - TU_LOG2("Control failed: result = %d\r\n", result); + TU_LOG2("[%u:%u] Control %s\r\n", rhport, dev_addr, result == XFER_RESULT_STALLED ? "STALLED" : "FAILED"); // terminate transfer if any stage failed _xfer_complete(dev_addr, result); @@ -113,7 +111,7 @@ bool usbh_control_xfer_cb (uint8_t dev_addr, uint8_t ep_addr, xfer_result_t resu if (request->wLength) { - TU_LOG2("Control data (addr = %u):\r\n", dev_addr); + TU_LOG2("[%u:%u] Control data:\r\n", rhport, dev_addr); TU_LOG2_MEM(_ctrl_xfer.buffer, request->wLength, 2); } |
