summaryrefslogtreecommitdiff
path: root/src/host
diff options
context:
space:
mode:
authorhathach <[email protected]>2021-05-12 21:40:17 +0700
committerhathach <[email protected]>2021-05-18 12:58:24 +0700
commitb7a8b278c83b9b8e03a328e17f4b833f925226a2 (patch)
tree34616a149b0d4d8a0d4ffb8649a2c8ccacb6d980 /src/host
parent69defb5edc34979c9476533ba3bb49e070879ceb (diff)
rename tuh_device_is_configured() to tuh_device_configured()
- remove tuh_device_get_state() - more hid mouse clean up
Diffstat (limited to 'src/host')
-rw-r--r--src/host/usbh.c5
-rw-r--r--src/host/usbh.h6
2 files changed, 3 insertions, 8 deletions
diff --git a/src/host/usbh.c b/src/host/usbh.c
index 7a021c11c..f1c386a4d 100644
--- a/src/host/usbh.c
+++ b/src/host/usbh.c
@@ -152,10 +152,9 @@ uint8_t* usbh_get_enum_buf(void)
//--------------------------------------------------------------------+
// PUBLIC API (Parameter Verification is required)
//--------------------------------------------------------------------+
-tusb_device_state_t tuh_device_get_state (uint8_t const dev_addr)
+bool tuh_device_configured(uint8_t dev_addr)
{
- TU_ASSERT( dev_addr <= CFG_TUSB_HOST_DEVICE_MAX, TUSB_DEVICE_STATE_UNPLUG);
- return (tusb_device_state_t) _usbh_devices[dev_addr].state;
+ return _usbh_devices[dev_addr].configured;
}
tusb_speed_t tuh_device_get_speed (uint8_t const dev_addr)
diff --git a/src/host/usbh.h b/src/host/usbh.h
index 5e7abe868..e503ef8fb 100644
--- a/src/host/usbh.h
+++ b/src/host/usbh.h
@@ -88,13 +88,9 @@ void tuh_task(void);
extern void hcd_int_handler(uint8_t rhport);
#define tuh_int_handler hcd_int_handler
-tusb_device_state_t tuh_device_get_state (uint8_t dev_addr);
tusb_speed_t tuh_device_get_speed (uint8_t dev_addr);
-static inline bool tuh_device_is_configured(uint8_t dev_addr)
-{
- return tuh_device_get_state(dev_addr) == TUSB_DEVICE_STATE_CONFIGURED;
-}
+bool tuh_device_configured(uint8_t dev_addr);
bool tuh_control_xfer (uint8_t dev_addr, tusb_control_request_t const* request, void* buffer, tuh_control_complete_cb_t complete_cb);
//--------------------------------------------------------------------+