clean up remove usbd_control_stall()

This commit is contained in:
hathach
2019-03-27 16:26:52 +07:00
parent 1e9848d917
commit f26fbaf404
4 changed files with 9 additions and 18 deletions

View File

@@ -60,13 +60,6 @@ void usbd_control_reset (uint8_t rhport)
tu_varclr(&_control_state);
}
void usbd_control_stall(uint8_t rhport)
{
// when stalling control endpoint both IN and OUt will be stalled
dcd_edpt_stall(rhport, EDPT_CTRL_OUT);
dcd_edpt_stall(rhport, EDPT_CTRL_IN);
}
bool usbd_control_status(uint8_t rhport, tusb_control_request_t const * request)
{
// status direction is reversed to one in the setup packet
@@ -147,8 +140,9 @@ bool usbd_control_xfer_cb (uint8_t rhport, uint8_t ep_addr, xfer_result_t result
TU_ASSERT( usbd_control_status(rhport, &_control_state.request) );
}else
{
// stall due to callback
usbd_control_stall(rhport);
// Stall both IN and OUT control endpoint
dcd_edpt_stall(rhport, EDPT_CTRL_OUT);
dcd_edpt_stall(rhport, EDPT_CTRL_IN);
}
}
else