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.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'src/device/usbd.c') diff --git a/src/device/usbd.c b/src/device/usbd.c index b79ccae2b..17914fb6c 100644 --- a/src/device/usbd.c +++ b/src/device/usbd.c @@ -104,7 +104,6 @@ static usbd_class_driver_t const usbd_class_drivers[] = }, #endif - #if CFG_TUD_HID { .class_code = TUSB_CLASS_HID, @@ -243,10 +242,12 @@ void tud_task (void) switch ( event.event_id ) { case DCD_EVENT_SETUP_RECEIVED: - // Process control request, if failed control endpoint is stalled + // Process control request if ( !process_control_request(event.rhport, &event.setup_received) ) { - usbd_control_stall(event.rhport); + // Failed -> stall both control endpoint IN and OUT + dcd_edpt_stall(event.rhport, 0); + dcd_edpt_stall(event.rhport, 0 | TUSB_DIR_IN_MASK); } break; -- cgit v1.3.1