rename osal SUBSTASK to STASK

This commit is contained in:
hathach
2018-03-22 16:25:24 +07:00
parent 57a09b2fce
commit 90ba1e67d9
11 changed files with 121 additions and 121 deletions

View File

@@ -204,12 +204,12 @@ tusb_error_t hidd_control_request_subtask(uint8_t port, tusb_control_request_t c
if (p_request->bRequest == TUSB_REQ_GET_DESCRIPTOR && desc_type == HID_DESC_TYPE_REPORT)
{
SUBTASK_ASSERT ( p_hid->report_length <= HIDD_BUFFER_SIZE );
STASK_ASSERT ( p_hid->report_length <= HIDD_BUFFER_SIZE );
// copy to allow report descriptor not to be in USBRAM
memcpy(m_hid_buffer, p_hid->p_report_desc, p_hid->report_length);
SUBTASK_INVOKE( usbd_control_xfer_stask(port, p_request->bmRequestType_bit.direction, m_hid_buffer, p_hid->report_length), err );
STASK_INVOKE( usbd_control_xfer_stask(port, p_request->bmRequestType_bit.direction, m_hid_buffer, p_hid->report_length), err );
}else
{
usbd_control_stall(port);
@@ -225,16 +225,16 @@ tusb_error_t hidd_control_request_subtask(uint8_t port, tusb_control_request_t c
uint16_t actual_length = p_driver->get_report_cb(port, (hid_request_report_type_t) u16_high_u8(p_request->wValue),
&p_buffer, p_request->wLength);
SUBTASK_ASSERT( p_buffer != NULL && actual_length > 0 );
STASK_ASSERT( p_buffer != NULL && actual_length > 0 );
SUBTASK_INVOKE( usbd_control_xfer_stask(port, p_request->bmRequestType_bit.direction, p_buffer, actual_length), err );
STASK_INVOKE( usbd_control_xfer_stask(port, p_request->bmRequestType_bit.direction, p_buffer, actual_length), err );
}
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
SUBTASK_INVOKE( usbd_control_xfer_stask(port, p_request->bmRequestType_bit.direction, m_hid_buffer, p_request->wLength), err );
SUBTASK_ASSERT_STATUS(err);
STASK_INVOKE( usbd_control_xfer_stask(port, p_request->bmRequestType_bit.direction, m_hid_buffer, p_request->wLength), err );
STASK_ASSERT_STATUS(err);
p_driver->set_report_cb(port, u16_high_u8(p_request->wValue), m_hid_buffer, p_request->wLength);
}

View File

@@ -198,7 +198,7 @@ tusb_error_t hidh_open_subtask(uint8_t dev_addr, tusb_descriptor_interface_t con
OSAL_SUBTASK_BEGIN
//------------- SET IDLE (0) request -------------//
SUBTASK_INVOKE(
STASK_INVOKE(
usbh_control_xfer_subtask( dev_addr, bm_request_type(TUSB_DIR_OUT, TUSB_REQ_TYPE_CLASS, TUSB_REQ_RCPT_INTERFACE),
HID_REQUEST_CONTROL_SET_IDLE, 0, p_interface_desc->bInterfaceNumber,
0, NULL ),
@@ -210,7 +210,7 @@ tusb_error_t hidh_open_subtask(uint8_t dev_addr, tusb_descriptor_interface_t con
//------------- Get Report Descriptor TODO HID parser -------------//
if ( p_desc_hid->bNumDescriptors )
{
SUBTASK_INVOKE(
STASK_INVOKE(
usbh_control_xfer_subtask( dev_addr, bm_request_type(TUSB_DIR_IN, TUSB_REQ_TYPE_STANDARD, TUSB_REQ_RCPT_INTERFACE),
TUSB_REQ_GET_DESCRIPTOR, (p_desc_hid->bReportType << 8), 0,
p_desc_hid->wReportLength, report_descriptor ),
@@ -225,7 +225,7 @@ tusb_error_t hidh_open_subtask(uint8_t dev_addr, tusb_descriptor_interface_t con
#if TUSB_CFG_HOST_HID_KEYBOARD
if ( HID_PROTOCOL_KEYBOARD == p_interface_desc->bInterfaceProtocol)
{
SUBTASK_ASSERT_STATUS ( hidh_interface_open(dev_addr, p_interface_desc->bInterfaceNumber, p_endpoint_desc, &keyboardh_data[dev_addr-1]) );
STASK_ASSERT_STATUS ( hidh_interface_open(dev_addr, p_interface_desc->bInterfaceNumber, p_endpoint_desc, &keyboardh_data[dev_addr-1]) );
tuh_hid_keyboard_mounted_cb(dev_addr);
} else
#endif
@@ -233,17 +233,17 @@ tusb_error_t hidh_open_subtask(uint8_t dev_addr, tusb_descriptor_interface_t con
#if TUSB_CFG_HOST_HID_MOUSE
if ( HID_PROTOCOL_MOUSE == p_interface_desc->bInterfaceProtocol)
{
SUBTASK_ASSERT_STATUS ( hidh_interface_open(dev_addr, p_interface_desc->bInterfaceNumber, p_endpoint_desc, &mouseh_data[dev_addr-1]) );
STASK_ASSERT_STATUS ( hidh_interface_open(dev_addr, p_interface_desc->bInterfaceNumber, p_endpoint_desc, &mouseh_data[dev_addr-1]) );
tuh_hid_mouse_mounted_cb(dev_addr);
} else
#endif
{
SUBTASK_RETURN(TUSB_ERROR_HIDH_NOT_SUPPORTED_PROTOCOL); // exit & restart task
STASK_RETURN(TUSB_ERROR_HIDH_NOT_SUPPORTED_PROTOCOL); // exit & restart task
}
}else
{
SUBTASK_RETURN(TUSB_ERROR_HIDH_NOT_SUPPORTED_SUBCLASS); // exit & restart task
STASK_RETURN(TUSB_ERROR_HIDH_NOT_SUPPORTED_SUBCLASS); // exit & restart task
}
*p_length = sizeof(tusb_descriptor_interface_t) + sizeof(tusb_hid_descriptor_hid_t) + sizeof(tusb_descriptor_endpoint_t);