summaryrefslogtreecommitdiff
path: root/src/device
diff options
context:
space:
mode:
Diffstat (limited to 'src/device')
-rw-r--r--src/device/usbd.c3
-rw-r--r--src/device/usbd_control.c9
2 files changed, 10 insertions, 2 deletions
diff --git a/src/device/usbd.c b/src/device/usbd.c
index 02f631dea..dbe11d380 100644
--- a/src/device/usbd.c
+++ b/src/device/usbd.c
@@ -97,8 +97,7 @@ static usbd_class_driver_t const _usbd_driver[] =
.init = cdcd_init,
.reset = cdcd_reset,
.open = cdcd_open,
- .control_xfer_cb = cdcd_control_request,
- .control_complete = cdcd_control_complete,
+ .control_xfer_cb = cdcd_control_xfer_cb,
.xfer_cb = cdcd_xfer_cb,
.sof = NULL
},
diff --git a/src/device/usbd_control.c b/src/device/usbd_control.c
index f1edad376..bb631320a 100644
--- a/src/device/usbd_control.c
+++ b/src/device/usbd_control.c
@@ -171,7 +171,16 @@ bool usbd_control_xfer_cb (uint8_t rhport, uint8_t ep_addr, xfer_result_t result
if ( tu_edpt_dir(ep_addr) != _ctrl_xfer.request.bmRequestType_bit.direction )
{
TU_ASSERT(0 == xferred_bytes);
+
+ // invoke optional dcd hook if available
if (dcd_edpt0_status_complete) dcd_edpt0_status_complete(rhport, &_ctrl_xfer.request);
+
+ if (_ctrl_xfer.complete_cb)
+ {
+ // TODO refactor with usbd_driver_print_control_complete_name
+ _ctrl_xfer.complete_cb(rhport, CONTROL_STAGE_ACK, &_ctrl_xfer.request);
+ }
+
return true;
}