From f26fbaf404c772c0ce4e48d36d94c2743f3a8aee Mon Sep 17 00:00:00 2001 From: hathach Date: Wed, 27 Mar 2019 16:26:52 +0700 Subject: clean up remove usbd_control_stall() --- src/device/usbd_control.c | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) (limited to 'src/device/usbd_control.c') diff --git a/src/device/usbd_control.c b/src/device/usbd_control.c index 094d2fb44..d907aca3b 100644 --- a/src/device/usbd_control.c +++ b/src/device/usbd_control.c @@ -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 -- cgit v1.3.1