diff options
| author | hathach <[email protected]> | 2018-03-29 13:07:27 +0700 |
|---|---|---|
| committer | hathach <[email protected]> | 2018-03-29 13:07:27 +0700 |
| commit | c50da4962e47ee9139d66478a8c4809f4761e47b (patch) | |
| tree | 8769a3f91e1d95525085abc6e61252a807b93434 /tinyusb/class | |
| parent | ccf6f03817daf860173a41d72454ae23b2eab974 (diff) | |
clean up assert and verify
Diffstat (limited to 'tinyusb/class')
| -rw-r--r-- | tinyusb/class/cdc/cdc_host.c | 4 | ||||
| -rw-r--r-- | tinyusb/class/custom_class_host.c | 2 | ||||
| -rw-r--r-- | tinyusb/class/hid/hid_device.c | 4 | ||||
| -rw-r--r-- | tinyusb/class/hid/hid_host.c | 6 |
4 files changed, 8 insertions, 8 deletions
diff --git a/tinyusb/class/cdc/cdc_host.c b/tinyusb/class/cdc/cdc_host.c index 25abda277..56f36aedb 100644 --- a/tinyusb/class/cdc/cdc_host.c +++ b/tinyusb/class/cdc/cdc_host.c @@ -199,8 +199,8 @@ tusb_error_t cdch_open_subtask(uint8_t dev_addr, tusb_desc_interface_t const *p_ for(uint32_t i=0; i<2; i++)
{
tusb_desc_endpoint_t const *p_endpoint = (tusb_desc_endpoint_t const *) p_desc;
- ASSERT_INT(TUSB_DESC_ENDPOINT, p_endpoint->bDescriptorType, TUSB_ERROR_USBH_DESCRIPTOR_CORRUPTED);
- ASSERT_INT(TUSB_XFER_BULK, p_endpoint->bmAttributes.xfer, TUSB_ERROR_USBH_DESCRIPTOR_CORRUPTED);
+ TU_ASSERT(TUSB_DESC_ENDPOINT == p_endpoint->bDescriptorType, TUSB_ERROR_USBH_DESCRIPTOR_CORRUPTED);
+ TU_ASSERT(TUSB_XFER_BULK == p_endpoint->bmAttributes.xfer, TUSB_ERROR_USBH_DESCRIPTOR_CORRUPTED);
pipe_handle_t * p_pipe_hdl = ( p_endpoint->bEndpointAddress & TUSB_DIR_IN_MASK ) ?
&p_cdc->pipe_in : &p_cdc->pipe_out;
diff --git a/tinyusb/class/custom_class_host.c b/tinyusb/class/custom_class_host.c index 318813f4b..0d24c01b7 100644 --- a/tinyusb/class/custom_class_host.c +++ b/tinyusb/class/custom_class_host.c @@ -117,7 +117,7 @@ tusb_error_t cush_open_subtask(uint8_t dev_addr, tusb_desc_interface_t const *p_ for(uint32_t i=0; i<2; i++) { tusb_desc_endpoint_t const *p_endpoint = (tusb_desc_endpoint_t const *) p_desc; - ASSERT_INT(TUSB_DESC_ENDPOINT, p_endpoint->bDescriptorType, TUSB_ERROR_INVALID_PARA); + TU_ASSERT(TUSB_DESC_ENDPOINT == p_endpoint->bDescriptorType, TUSB_ERROR_INVALID_PARA); pipe_handle_t * p_pipe_hdl = ( p_endpoint->bEndpointAddress & TUSB_DIR_IN_MASK ) ? &custom_interface[dev_addr-1].pipe_in : &custom_interface[dev_addr-1].pipe_out; diff --git a/tinyusb/class/hid/hid_device.c b/tinyusb/class/hid/hid_device.c index 8bad4cbbe..47aa55abf 100644 --- a/tinyusb/class/hid/hid_device.c +++ b/tinyusb/class/hid/hid_device.c @@ -264,12 +264,12 @@ tusb_error_t hidd_open(uint8_t rhport, tusb_desc_interface_t const * p_interface //------------- HID descriptor -------------//
p_desc += p_desc[DESCRIPTOR_OFFSET_LENGTH];
tusb_hid_descriptor_hid_t const *p_desc_hid = (tusb_hid_descriptor_hid_t const *) p_desc;
- ASSERT_INT(HID_DESC_TYPE_HID, p_desc_hid->bDescriptorType, TUSB_ERROR_HIDD_DESCRIPTOR_INTERFACE);
+ TU_ASSERT(HID_DESC_TYPE_HID == p_desc_hid->bDescriptorType, TUSB_ERROR_HIDD_DESCRIPTOR_INTERFACE);
//------------- Endpoint Descriptor -------------//
p_desc += p_desc[DESCRIPTOR_OFFSET_LENGTH];
tusb_desc_endpoint_t const *p_desc_endpoint = (tusb_desc_endpoint_t const *) p_desc;
- ASSERT_INT(TUSB_DESC_ENDPOINT, p_desc_endpoint->bDescriptorType, TUSB_ERROR_HIDD_DESCRIPTOR_INTERFACE);
+ TU_ASSERT(TUSB_DESC_ENDPOINT == p_desc_endpoint->bDescriptorType, TUSB_ERROR_HIDD_DESCRIPTOR_INTERFACE);
if (p_interface_desc->bInterfaceSubClass == HID_SUBCLASS_BOOT)
{
diff --git a/tinyusb/class/hid/hid_host.c b/tinyusb/class/hid/hid_host.c index 43acddcf2..b0537875a 100644 --- a/tinyusb/class/hid/hid_host.c +++ b/tinyusb/class/hid/hid_host.c @@ -76,7 +76,7 @@ tusb_error_t hidh_interface_get_report(uint8_t dev_addr, void * report, hidh_int {
//------------- parameters validation -------------//
// TODO change to use is configured function
- ASSERT_INT (TUSB_DEVICE_STATE_CONFIGURED, tuh_device_get_state(dev_addr), TUSB_ERROR_DEVICE_NOT_READY);
+ TU_ASSERT (TUSB_DEVICE_STATE_CONFIGURED == tuh_device_get_state(dev_addr), TUSB_ERROR_DEVICE_NOT_READY);
VERIFY (report, TUSB_ERROR_INVALID_PARA);
TU_ASSSERT (!hcd_pipe_is_busy(p_hid->pipe_hdl), TUSB_ERROR_INTERFACE_IS_BUSY);
@@ -188,12 +188,12 @@ tusb_error_t hidh_open_subtask(uint8_t dev_addr, tusb_desc_interface_t const *p_ //------------- HID descriptor -------------//
p_desc += p_desc[DESCRIPTOR_OFFSET_LENGTH];
tusb_hid_descriptor_hid_t const *p_desc_hid = (tusb_hid_descriptor_hid_t const *) p_desc;
- ASSERT_INT(HID_DESC_TYPE_HID, p_desc_hid->bDescriptorType, TUSB_ERROR_INVALID_PARA);
+ TU_ASSERT(HID_DESC_TYPE_HID == p_desc_hid->bDescriptorType, TUSB_ERROR_INVALID_PARA);
//------------- Endpoint Descriptor -------------//
p_desc += p_desc[DESCRIPTOR_OFFSET_LENGTH];
tusb_desc_endpoint_t const * p_endpoint_desc = (tusb_desc_endpoint_t const *) p_desc;
- ASSERT_INT(TUSB_DESC_ENDPOINT, p_endpoint_desc->bDescriptorType, TUSB_ERROR_INVALID_PARA);
+ TU_ASSERT(TUSB_DESC_ENDPOINT == p_endpoint_desc->bDescriptorType, TUSB_ERROR_INVALID_PARA);
OSAL_SUBTASK_BEGIN
|
