From 7a77aed8fa67cf6740943cf25a00485d4f288cfb Mon Sep 17 00:00:00 2001 From: hathach Date: Sat, 31 Mar 2018 14:09:48 +0700 Subject: change usbd_control_xfer_st from function to macro to prevent compiler issue with substask --- tinyusb/class/hid/hid_device.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) (limited to 'tinyusb/class/hid') diff --git a/tinyusb/class/hid/hid_device.c b/tinyusb/class/hid/hid_device.c index cd40dd86c..6790ef739 100644 --- a/tinyusb/class/hid/hid_device.c +++ b/tinyusb/class/hid/hid_device.c @@ -192,8 +192,6 @@ tusb_error_t hidd_control_request_st(uint8_t rhport, tusb_control_request_t cons OSAL_SUBTASK_BEGIN - tusb_error_t err; - //------------- STD Request -------------// if (p_request->bmRequestType_bit.type == TUSB_REQ_TYPE_STANDARD) { @@ -209,7 +207,7 @@ tusb_error_t hidd_control_request_st(uint8_t rhport, tusb_control_request_t cons // copy to allow report descriptor not to be in USBRAM memcpy(m_hid_buffer, p_hid->p_report_desc, p_hid->report_length); - STASK_INVOKE( usbd_control_xfer_st(rhport, p_request->bmRequestType_bit.direction, m_hid_buffer, p_hid->report_length), err ); + usbd_control_xfer_st(rhport, p_request->bmRequestType_bit.direction, m_hid_buffer, p_hid->report_length); }else { dcd_control_stall(rhport); @@ -227,14 +225,13 @@ tusb_error_t hidd_control_request_st(uint8_t rhport, tusb_control_request_t cons &p_buffer, p_request->wLength); STASK_ASSERT( p_buffer != NULL && actual_length > 0 ); - STASK_INVOKE( usbd_control_xfer_st(rhport, p_request->bmRequestType_bit.direction, p_buffer, actual_length), err ); + usbd_control_xfer_st(rhport, p_request->bmRequestType_bit.direction, p_buffer, actual_length); } else if ( (HID_REQUEST_CONTROL_SET_REPORT == p_request->bRequest) && (p_driver->set_report_cb != NULL) ) { // return TUSB_ERROR_DCD_CONTROL_REQUEST_NOT_SUPPORT; // TODO test STALL control out endpoint (with mouse+keyboard) // wValue = Report Type | Report ID - STASK_INVOKE( usbd_control_xfer_st(rhport, p_request->bmRequestType_bit.direction, m_hid_buffer, p_request->wLength), err ); - STASK_ASSERT_ERR(err); + usbd_control_xfer_st(rhport, p_request->bmRequestType_bit.direction, m_hid_buffer, p_request->wLength); p_driver->set_report_cb(rhport, u16_high_u8(p_request->wValue), m_hid_buffer, p_request->wLength); } -- cgit v1.3.1