diff options
| author | hathach <[email protected]> | 2013-11-21 13:20:46 +0700 |
|---|---|---|
| committer | hathach <[email protected]> | 2013-11-21 13:20:46 +0700 |
| commit | c461c72ac2ddf6f89ba533e98f34bba72f8c1470 (patch) | |
| tree | 7cf88a0b5248e887f549c4fd710aa2af62c77c9a /tinyusb/class | |
| parent | 6887e5e642c71666d622d28b52e1d32fea67982c (diff) | |
clean up
Diffstat (limited to 'tinyusb/class')
| -rw-r--r-- | tinyusb/class/cdc_device.c | 23 | ||||
| -rw-r--r-- | tinyusb/class/cdc_device.h | 2 | ||||
| -rw-r--r-- | tinyusb/class/hid_device.h | 16 | ||||
| -rw-r--r-- | tinyusb/class/msc_device.h | 8 |
4 files changed, 6 insertions, 43 deletions
diff --git a/tinyusb/class/cdc_device.c b/tinyusb/class/cdc_device.c index 29f38c3f5..64b3e1227 100644 --- a/tinyusb/class/cdc_device.c +++ b/tinyusb/class/cdc_device.c @@ -50,10 +50,6 @@ //--------------------------------------------------------------------+
// MACRO CONSTANT TYPEDEF
//--------------------------------------------------------------------+
-enum {
- INTERFACE_INVALID_NUMBER = UINT8_MAX
-};
-
ATTR_USB_MIN_ALIGNMENT
static cdc_line_coding_t cdcd_line_coding[CONTROLLER_DEVICE_NUMBER] TUSB_CFG_ATTR_USBRAM;
@@ -69,20 +65,13 @@ typedef struct { //--------------------------------------------------------------------+
cdcd_data_t cdcd_data[CONTROLLER_DEVICE_NUMBER];
-static inline bool cdcd_is_configured(uint8_t coreid) ATTR_PURE ATTR_ALWAYS_INLINE;
-static inline bool cdcd_is_configured(uint8_t coreid)
-{
- return cdcd_data[coreid].interface_number != INTERFACE_INVALID_NUMBER;
-}
-
static tusb_error_t cdcd_xfer(uint8_t coreid, cdc_pipeid_t pipeid, void * p_buffer, uint32_t length, bool is_notify)
{
- ASSERT(cdcd_is_configured(coreid), TUSB_ERROR_USBD_INTERFACE_NOT_CONFIGURED);
+ ASSERT(tusbd_is_configured(coreid), TUSB_ERROR_USBD_DEVICE_NOT_CONFIGURED);
cdcd_data_t* p_cdc = &cdcd_data[coreid];
- ASSERT_FALSE( dcd_pipe_is_busy(p_cdc->edpt_hdl[pipeid]), TUSB_ERROR_INTERFACE_IS_BUSY);
-
+ ASSERT_FALSE ( dcd_pipe_is_busy(p_cdc->edpt_hdl[pipeid]), TUSB_ERROR_INTERFACE_IS_BUSY);
ASSERT_STATUS( dcd_pipe_xfer(p_cdc->edpt_hdl[pipeid], p_buffer, length, is_notify) );
return TUSB_ERROR_NONE;
@@ -91,15 +80,8 @@ static tusb_error_t cdcd_xfer(uint8_t coreid, cdc_pipeid_t pipeid, void * p_buf //--------------------------------------------------------------------+
// APPLICATION API (Parameters requires validation)
//--------------------------------------------------------------------+
-bool tusbd_cdc_is_configured(uint8_t coreid)
-{
- return cdcd_is_configured(coreid);
-}
-
bool tusbd_cdc_is_busy(uint8_t coreid, cdc_pipeid_t pipeid)
{
- ASSERT(cdcd_is_configured(coreid) && (pipeid < CDC_PIPE_ERROR), false);
-
return dcd_pipe_is_busy( cdcd_data[coreid].edpt_hdl[pipeid] );
}
@@ -198,7 +180,6 @@ void cdcd_close(uint8_t coreid) {
// no need to close opened pipe, dcd bus reset will put controller's endpoints to default state
memclr_(&cdcd_data[coreid], sizeof(cdcd_data_t));
- cdcd_data[coreid].interface_number = INTERFACE_INVALID_NUMBER;
}
tusb_error_t cdcd_control_request(uint8_t coreid, tusb_control_request_t const * p_request)
diff --git a/tinyusb/class/cdc_device.h b/tinyusb/class/cdc_device.h index 03ad676f4..b5135a23c 100644 --- a/tinyusb/class/cdc_device.h +++ b/tinyusb/class/cdc_device.h @@ -57,7 +57,7 @@ //--------------------------------------------------------------------+
// APPLICATION API
//--------------------------------------------------------------------+
-bool tusbd_cdc_is_configured(uint8_t coreid);
+//bool tusbd_cdc_is_configured(uint8_t coreid);
bool tusbd_cdc_is_busy(uint8_t coreid, cdc_pipeid_t pipeid) ATTR_PURE ATTR_WARN_UNUSED_RESULT;
tusb_error_t tusbd_cdc_send(uint8_t coreid, void * p_data, uint32_t length, bool is_notify);
diff --git a/tinyusb/class/hid_device.h b/tinyusb/class/hid_device.h index ed50c8e75..54cdd5e94 100644 --- a/tinyusb/class/hid_device.h +++ b/tinyusb/class/hid_device.h @@ -56,13 +56,7 @@ /** \defgroup Keyboard_Device Device * @{ */ -/** \brief Check if the interface is configured and ready to use - * \param[in] coreid USB Controller ID - * \retval true if the interface is configured - * \retval false if the interface is not configured (e.g device is not attached) - * \note This function should be call frequently or before any xfer attempt to check if device is still attached - */ -bool tusbd_hid_keyboard_is_configured(uint8_t coreid); +//bool tusbd_hid_keyboard_is_configured(uint8_t coreid); /** \brief Check if the interface is currently busy or not * \param[in] coreid USB Controller ID @@ -112,13 +106,7 @@ void tusbd_hid_keyboard_unmounted_cb(uint8_t coreid); /** \defgroup Mouse_Device Device * @{ */ -/** \brief Check if the interface is configured and ready to use - * \param[in] coreid USB Controller ID - * \retval true if the interface is configured - * \retval false if the interface is not configured (e.g device is not attached) - * \note This function should be call frequently or before any xfer attempt to check if device is still attached - */ -bool tusbd_hid_mouse_is_configured(uint8_t coreid); +//bool tusbd_hid_mouse_is_configured(uint8_t coreid); /** \brief Check if the interface is currently busy or not * \param[in] coreid USB Controller ID diff --git a/tinyusb/class/msc_device.h b/tinyusb/class/msc_device.h index 5311a14f0..acbf04ea0 100644 --- a/tinyusb/class/msc_device.h +++ b/tinyusb/class/msc_device.h @@ -50,13 +50,7 @@ //--------------------------------------------------------------------+
// APPLICATION API
//--------------------------------------------------------------------+
-/** \brief Check if the interface is configured and ready to use
- * \param[in] coreid USB Controller ID
- * \retval true if the interface is configured
- * \retval false if the interface is not configured (e.g device is not attached)
- * \note This function should be call frequently or before any xfer attempt to check if device is still attached
- */
-bool tusbd_msc_is_configured(uint8_t coreid);
+//bool tusbd_msc_is_configured(uint8_t coreid);
//--------------------------------------------------------------------+
// APPLICATION CALLBACK API
|
