mirror of
https://github.com/hathach/tinyusb.git
synced 2025-01-17 05:32:55 +08:00
add TUSB_DEVICE_STATE_INVALID_PARAMETER to tusb_device_state_t
This commit is contained in:
parent
439a3134b9
commit
55ce5cc4a2
@ -65,7 +65,7 @@ void test_usbh_status_get_fail(void)
|
||||
{
|
||||
usbh_device_info_pool[dev_addr].state = 0;
|
||||
|
||||
TEST_ASSERT_EQUAL( 0, tusbh_device_get_state(TUSB_CFG_HOST_DEVICE_MAX+1) );
|
||||
TEST_ASSERT_EQUAL( TUSB_DEVICE_STATE_INVALID_PARAMETER, tusbh_device_get_state(TUSB_CFG_HOST_DEVICE_MAX+1) );
|
||||
TEST_ASSERT_EQUAL( TUSB_DEVICE_STATE_UNPLUG, tusbh_device_get_state(dev_addr) );
|
||||
}
|
||||
|
||||
|
@ -162,6 +162,8 @@ typedef enum tusb_device_state_{
|
||||
|
||||
TUSB_DEVICE_STATE_REMOVING ,
|
||||
TUSB_DEVICE_STATE_SAFE_REMOVE ,
|
||||
|
||||
TUSB_DEVICE_STATE_INVALID_PARAMETER
|
||||
}tusb_device_state_t;
|
||||
|
||||
typedef enum {
|
||||
|
@ -100,7 +100,7 @@ static inline uint8_t get_configure_number_for_device(tusb_descriptor_device_t*
|
||||
//--------------------------------------------------------------------+
|
||||
tusb_device_state_t tusbh_device_get_state (uint8_t const dev_addr)
|
||||
{
|
||||
ASSERT(dev_addr <= TUSB_CFG_HOST_DEVICE_MAX, 0);
|
||||
ASSERT(dev_addr <= TUSB_CFG_HOST_DEVICE_MAX, TUSB_DEVICE_STATE_INVALID_PARAMETER);
|
||||
return usbh_device_info_pool[dev_addr].state;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user