rename tusb_event_t to xfer_result_t
This commit is contained in:
@@ -358,7 +358,7 @@ bool cdcd_control_request(uint8_t rhport, tusb_control_request_t const * request
|
||||
return true;
|
||||
}
|
||||
|
||||
tusb_error_t cdcd_xfer_cb(uint8_t rhport, uint8_t ep_addr, tusb_event_t event, uint32_t xferred_bytes)
|
||||
tusb_error_t cdcd_xfer_cb(uint8_t rhport, uint8_t ep_addr, xfer_result_t event, uint32_t xferred_bytes)
|
||||
{
|
||||
// TODO Support multiple interfaces
|
||||
uint8_t const itf = 0;
|
||||
|
||||
@@ -116,7 +116,7 @@ void cdcd_init (void);
|
||||
tusb_error_t cdcd_open (uint8_t rhport, tusb_desc_interface_t const * p_interface_desc, uint16_t *p_length);
|
||||
bool cdcd_control_request (uint8_t rhport, tusb_control_request_t const * p_request);
|
||||
bool cdcd_control_request_complete (uint8_t rhport, tusb_control_request_t const * p_request);
|
||||
tusb_error_t cdcd_xfer_cb (uint8_t rhport, uint8_t edpt_addr, tusb_event_t event, uint32_t xferred_bytes);
|
||||
tusb_error_t cdcd_xfer_cb (uint8_t rhport, uint8_t edpt_addr, xfer_result_t event, uint32_t xferred_bytes);
|
||||
void cdcd_reset (uint8_t rhport);
|
||||
|
||||
#endif
|
||||
|
||||
@@ -221,7 +221,7 @@ tusb_error_t cdch_open_subtask(uint8_t dev_addr, tusb_desc_interface_t const *p_
|
||||
OSAL_SUBTASK_END
|
||||
}
|
||||
|
||||
void cdch_isr(pipe_handle_t pipe_hdl, tusb_event_t event, uint32_t xferred_bytes)
|
||||
void cdch_isr(pipe_handle_t pipe_hdl, xfer_result_t event, uint32_t xferred_bytes)
|
||||
{
|
||||
tuh_cdc_xfer_isr( pipe_hdl.dev_addr, event, get_app_pipeid(pipe_hdl), xferred_bytes );
|
||||
}
|
||||
|
||||
@@ -118,7 +118,7 @@ void tuh_cdc_unmounted_cb(uint8_t dev_addr);
|
||||
|
||||
/** \brief Callback function that is invoked when an transferring event occurred
|
||||
* \param[in] dev_addr Address of device
|
||||
* \param[in] event an value from \ref tusb_event_t
|
||||
* \param[in] event an value from \ref xfer_result_t
|
||||
* \param[in] pipe_id value from \ref cdc_pipeid_t indicate the pipe
|
||||
* \param[in] xferred_bytes Number of bytes transferred via USB bus
|
||||
* \note event can be one of following
|
||||
@@ -127,7 +127,7 @@ void tuh_cdc_unmounted_cb(uint8_t dev_addr);
|
||||
* - TUSB_EVENT_XFER_STALLED : previously scheduled transfer is stalled by device.
|
||||
* \note
|
||||
*/
|
||||
void tuh_cdc_xfer_isr(uint8_t dev_addr, tusb_event_t event, cdc_pipeid_t pipe_id, uint32_t xferred_bytes);
|
||||
void tuh_cdc_xfer_isr(uint8_t dev_addr, xfer_result_t event, cdc_pipeid_t pipe_id, uint32_t xferred_bytes);
|
||||
|
||||
/// @} // group CDC_Serial_Host
|
||||
/// @}
|
||||
@@ -151,7 +151,7 @@ extern cdch_data_t cdch_data[CFG_TUSB_HOST_DEVICE_MAX]; // TODO consider to move
|
||||
|
||||
void cdch_init(void);
|
||||
tusb_error_t cdch_open_subtask(uint8_t dev_addr, tusb_desc_interface_t const *p_interface_desc, uint16_t *p_length) ATTR_WARN_UNUSED_RESULT;
|
||||
void cdch_isr(pipe_handle_t pipe_hdl, tusb_event_t event, uint32_t xferred_bytes);
|
||||
void cdch_isr(pipe_handle_t pipe_hdl, xfer_result_t event, uint32_t xferred_bytes);
|
||||
void cdch_close(uint8_t dev_addr);
|
||||
|
||||
#endif
|
||||
|
||||
@@ -224,7 +224,7 @@ tusb_error_t rndish_open_subtask(uint8_t dev_addr, cdch_data_t *p_cdc)
|
||||
OSAL_SUBTASK_END
|
||||
}
|
||||
|
||||
void rndish_xfer_isr(cdch_data_t *p_cdc, pipe_handle_t pipe_hdl, tusb_event_t event, uint32_t xferred_bytes)
|
||||
void rndish_xfer_isr(cdch_data_t *p_cdc, pipe_handle_t pipe_hdl, xfer_result_t event, uint32_t xferred_bytes)
|
||||
{
|
||||
if ( pipehandle_is_equal(pipe_hdl, p_cdc->pipe_notification) )
|
||||
{
|
||||
|
||||
@@ -65,7 +65,7 @@ typedef struct {
|
||||
|
||||
void rndish_init(void);
|
||||
tusb_error_t rndish_open_subtask(uint8_t dev_addr, cdch_data_t *p_cdc) ATTR_WARN_UNUSED_RESULT;
|
||||
void rndish_xfer_isr(cdch_data_t *p_cdc, pipe_handle_t pipe_hdl, tusb_event_t event, uint32_t xferred_bytes);
|
||||
void rndish_xfer_isr(cdch_data_t *p_cdc, pipe_handle_t pipe_hdl, xfer_result_t event, uint32_t xferred_bytes);
|
||||
void rndish_close(uint8_t dev_addr);
|
||||
|
||||
#endif
|
||||
|
||||
@@ -94,7 +94,7 @@ bool cusd_control_request(uint8_t rhport, tusb_control_request_t const * p_reque
|
||||
return false;
|
||||
}
|
||||
|
||||
tusb_error_t cusd_xfer_cb(uint8_t rhport, uint8_t edpt_addr, tusb_event_t event, uint32_t xferred_bytes)
|
||||
tusb_error_t cusd_xfer_cb(uint8_t rhport, uint8_t edpt_addr, xfer_result_t event, uint32_t xferred_bytes)
|
||||
{
|
||||
return TUSB_ERROR_NONE;
|
||||
}
|
||||
|
||||
@@ -66,7 +66,7 @@ void cusd_init(void);
|
||||
tusb_error_t cusd_open(uint8_t rhport, tusb_desc_interface_t const * p_interface_desc, uint16_t *p_length);
|
||||
bool cusd_control_request_st(uint8_t rhport, tusb_control_request_t const * p_request);
|
||||
bool cusd_control_request_complete (uint8_t rhport, tusb_control_request_t const * p_request);
|
||||
tusb_error_t cusd_xfer_cb(uint8_t rhport, uint8_t edpt_addr, tusb_event_t event, uint32_t xferred_bytes);
|
||||
tusb_error_t cusd_xfer_cb(uint8_t rhport, uint8_t edpt_addr, xfer_result_t event, uint32_t xferred_bytes);
|
||||
void cusd_reset(uint8_t rhport);
|
||||
#endif
|
||||
|
||||
|
||||
@@ -131,7 +131,7 @@ tusb_error_t cush_open_subtask(uint8_t dev_addr, tusb_desc_interface_t const *p_
|
||||
return TUSB_ERROR_NONE;
|
||||
}
|
||||
|
||||
void cush_isr(pipe_handle_t pipe_hdl, tusb_event_t event)
|
||||
void cush_isr(pipe_handle_t pipe_hdl, xfer_result_t event)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
@@ -73,7 +73,7 @@ tusb_error_t tusbh_custom_write(uint8_t dev_addr, uint16_t vendor_id, uint16_t p
|
||||
|
||||
void cush_init(void);
|
||||
tusb_error_t cush_open_subtask(uint8_t dev_addr, tusb_desc_interface_t const *p_interface_desc, uint16_t *p_length) ATTR_WARN_UNUSED_RESULT;
|
||||
void cush_isr(pipe_handle_t pipe_hdl, tusb_event_t event);
|
||||
void cush_isr(pipe_handle_t pipe_hdl, xfer_result_t event);
|
||||
void cush_close(uint8_t dev_addr);
|
||||
|
||||
#endif
|
||||
|
||||
@@ -510,7 +510,7 @@ bool hidd_control_request_complete(uint8_t rhport, tusb_control_request_t const
|
||||
return true;
|
||||
}
|
||||
|
||||
tusb_error_t hidd_xfer_cb(uint8_t rhport, uint8_t edpt_addr, tusb_event_t event, uint32_t xferred_bytes)
|
||||
tusb_error_t hidd_xfer_cb(uint8_t rhport, uint8_t edpt_addr, xfer_result_t event, uint32_t xferred_bytes)
|
||||
{
|
||||
// nothing to do
|
||||
return TUSB_ERROR_NONE;
|
||||
|
||||
@@ -380,7 +380,7 @@ void hidd_init(void);
|
||||
tusb_error_t hidd_open(uint8_t rhport, tusb_desc_interface_t const * p_interface_desc, uint16_t *p_length);
|
||||
bool hidd_control_request(uint8_t rhport, tusb_control_request_t const * p_request);
|
||||
bool hidd_control_request_complete (uint8_t rhport, tusb_control_request_t const * p_request);
|
||||
tusb_error_t hidd_xfer_cb(uint8_t rhport, uint8_t edpt_addr, tusb_event_t event, uint32_t xferred_bytes);
|
||||
tusb_error_t hidd_xfer_cb(uint8_t rhport, uint8_t edpt_addr, xfer_result_t event, uint32_t xferred_bytes);
|
||||
void hidd_reset(uint8_t rhport);
|
||||
|
||||
#endif
|
||||
|
||||
@@ -251,7 +251,7 @@ tusb_error_t hidh_open_subtask(uint8_t dev_addr, tusb_desc_interface_t const *p_
|
||||
OSAL_SUBTASK_END
|
||||
}
|
||||
|
||||
void hidh_isr(pipe_handle_t pipe_hdl, tusb_event_t event, uint32_t xferred_bytes)
|
||||
void hidh_isr(pipe_handle_t pipe_hdl, xfer_result_t event, uint32_t xferred_bytes)
|
||||
{
|
||||
(void) xferred_bytes; // TODO may need to use this para later
|
||||
|
||||
|
||||
@@ -93,14 +93,14 @@ tusb_error_t tuh_hid_keyboard_get_report(uint8_t dev_addr, void * p_report) /*A
|
||||
//------------- Application Callback -------------//
|
||||
/** \brief Callback function that is invoked when an transferring event occurred
|
||||
* \param[in] dev_addr Address of device
|
||||
* \param[in] event an value from \ref tusb_event_t
|
||||
* \param[in] event an value from \ref xfer_result_t
|
||||
* \note event can be one of following
|
||||
* - TUSB_EVENT_XFER_COMPLETE : previously scheduled transfer completes successfully.
|
||||
* - TUSB_EVENT_XFER_ERROR : previously scheduled transfer encountered a transaction error.
|
||||
* - TUSB_EVENT_XFER_STALLED : previously scheduled transfer is stalled by device.
|
||||
* \note Application should schedule the next report by calling \ref tuh_hid_keyboard_get_report within this callback
|
||||
*/
|
||||
void tuh_hid_keyboard_isr(uint8_t dev_addr, tusb_event_t event);
|
||||
void tuh_hid_keyboard_isr(uint8_t dev_addr, xfer_result_t event);
|
||||
|
||||
/** \brief Callback function that will be invoked when a device with Keyboard interface is mounted
|
||||
* \param[in] dev_addr Address of newly mounted device
|
||||
@@ -158,14 +158,14 @@ tusb_error_t tuh_hid_mouse_get_report(uint8_t dev_addr, void* p_report) /*ATTR_
|
||||
//------------- Application Callback -------------//
|
||||
/** \brief Callback function that is invoked when an transferring event occurred
|
||||
* \param[in] dev_addr Address of device
|
||||
* \param[in] event an value from \ref tusb_event_t
|
||||
* \param[in] event an value from \ref xfer_result_t
|
||||
* \note event can be one of following
|
||||
* - TUSB_EVENT_XFER_COMPLETE : previously scheduled transfer completes successfully.
|
||||
* - TUSB_EVENT_XFER_ERROR : previously scheduled transfer encountered a transaction error.
|
||||
* - TUSB_EVENT_XFER_STALLED : previously scheduled transfer is stalled by device.
|
||||
* \note Application should schedule the next report by calling \ref tuh_hid_mouse_get_report within this callback
|
||||
*/
|
||||
void tuh_hid_mouse_isr(uint8_t dev_addr, tusb_event_t event);
|
||||
void tuh_hid_mouse_isr(uint8_t dev_addr, xfer_result_t event);
|
||||
|
||||
/** \brief Callback function that will be invoked when a device with Mouse interface is mounted
|
||||
* \param[in] dev_addr Address of newly mounted device
|
||||
@@ -199,7 +199,7 @@ tusb_interface_status_t tuh_hid_generic_get_status(uint8_t dev_addr) ATTR_WARN_U
|
||||
tusb_interface_status_t tuh_hid_generic_set_status(uint8_t dev_addr) ATTR_WARN_UNUSED_RESULT;
|
||||
|
||||
//------------- Application Callback -------------//
|
||||
void tuh_hid_generic_isr(uint8_t dev_addr, tusb_event_t event);
|
||||
void tuh_hid_generic_isr(uint8_t dev_addr, xfer_result_t event);
|
||||
|
||||
/** @} */ // Generic_Host
|
||||
/** @} */ // ClassDriver_HID_Generic
|
||||
@@ -217,7 +217,7 @@ typedef struct {
|
||||
|
||||
void hidh_init(void);
|
||||
tusb_error_t hidh_open_subtask(uint8_t dev_addr, tusb_desc_interface_t const *p_interface_desc, uint16_t *p_length) ATTR_WARN_UNUSED_RESULT;
|
||||
void hidh_isr(pipe_handle_t pipe_hdl, tusb_event_t event, uint32_t xferred_bytes);
|
||||
void hidh_isr(pipe_handle_t pipe_hdl, xfer_result_t event, uint32_t xferred_bytes);
|
||||
void hidh_close(uint8_t dev_addr);
|
||||
|
||||
#endif
|
||||
|
||||
@@ -324,7 +324,7 @@ int32_t proc_builtin_scsi(msc_cbw_t const * p_cbw, uint8_t* buffer, uint32_t buf
|
||||
return ret;
|
||||
}
|
||||
|
||||
tusb_error_t mscd_xfer_cb(uint8_t rhport, uint8_t ep_addr, tusb_event_t event, uint32_t xferred_bytes)
|
||||
tusb_error_t mscd_xfer_cb(uint8_t rhport, uint8_t ep_addr, xfer_result_t event, uint32_t xferred_bytes)
|
||||
{
|
||||
mscd_interface_t* p_msc = &_mscd_itf;
|
||||
msc_cbw_t const * p_cbw = &p_msc->cbw;
|
||||
@@ -337,7 +337,7 @@ tusb_error_t mscd_xfer_cb(uint8_t rhport, uint8_t ep_addr, tusb_event_t event, u
|
||||
// Complete IN while waiting for CMD is usually Status of previous SCSI op, ignore it
|
||||
if(ep_addr != p_msc->ep_out) return TUSB_ERROR_NONE;
|
||||
|
||||
TU_ASSERT( event == DCD_XFER_SUCCESS &&
|
||||
TU_ASSERT( ((uint8_t) event) == DCD_XFER_SUCCESS &&
|
||||
xferred_bytes == sizeof(msc_cbw_t) && p_cbw->signature == MSC_CBW_SIGNATURE, TUSB_ERROR_INVALID_PARA );
|
||||
|
||||
p_csw->signature = MSC_CSW_SIGNATURE;
|
||||
|
||||
@@ -180,7 +180,7 @@ void mscd_init(void);
|
||||
tusb_error_t mscd_open(uint8_t rhport, tusb_desc_interface_t const * p_interface_desc, uint16_t *p_length);
|
||||
bool mscd_control_request(uint8_t rhport, tusb_control_request_t const * p_request);
|
||||
bool mscd_control_request_complete (uint8_t rhport, tusb_control_request_t const * p_request);
|
||||
tusb_error_t mscd_xfer_cb(uint8_t rhport, uint8_t edpt_addr, tusb_event_t event, uint32_t xferred_bytes);
|
||||
tusb_error_t mscd_xfer_cb(uint8_t rhport, uint8_t edpt_addr, xfer_result_t event, uint32_t xferred_bytes);
|
||||
void mscd_reset(uint8_t rhport);
|
||||
|
||||
#endif
|
||||
|
||||
@@ -397,7 +397,7 @@ tusb_error_t msch_open_subtask(uint8_t dev_addr, tusb_desc_interface_t const *p_
|
||||
OSAL_SUBTASK_END
|
||||
}
|
||||
|
||||
void msch_isr(pipe_handle_t pipe_hdl, tusb_event_t event, uint32_t xferred_bytes)
|
||||
void msch_isr(pipe_handle_t pipe_hdl, xfer_result_t event, uint32_t xferred_bytes)
|
||||
{
|
||||
if ( pipehandle_is_equal(pipe_hdl, msch_data[pipe_hdl.dev_addr-1].bulk_in) )
|
||||
{
|
||||
|
||||
@@ -171,7 +171,7 @@ void tuh_msc_unmounted_cb(uint8_t dev_addr);
|
||||
|
||||
/** \brief Callback function that is invoked when an transferring event occurred
|
||||
* \param[in] dev_addr Address of device
|
||||
* \param[in] event an value from \ref tusb_event_t
|
||||
* \param[in] event an value from \ref xfer_result_t
|
||||
* \param[in] xferred_bytes Number of bytes transferred via USB bus
|
||||
* \note event can be one of following
|
||||
* - TUSB_EVENT_XFER_COMPLETE : previously scheduled transfer completes successfully.
|
||||
@@ -179,7 +179,7 @@ void tuh_msc_unmounted_cb(uint8_t dev_addr);
|
||||
* - TUSB_EVENT_XFER_STALLED : previously scheduled transfer is stalled by device.
|
||||
* \note
|
||||
*/
|
||||
void tuh_msc_isr(uint8_t dev_addr, tusb_event_t event, uint32_t xferred_bytes);
|
||||
void tuh_msc_isr(uint8_t dev_addr, xfer_result_t event, uint32_t xferred_bytes);
|
||||
|
||||
|
||||
//--------------------------------------------------------------------+
|
||||
@@ -205,7 +205,7 @@ typedef struct {
|
||||
|
||||
void msch_init(void);
|
||||
tusb_error_t msch_open_subtask(uint8_t dev_addr, tusb_desc_interface_t const *p_interface_desc, uint16_t *p_length) ATTR_WARN_UNUSED_RESULT;
|
||||
void msch_isr(pipe_handle_t pipe_hdl, tusb_event_t event, uint32_t xferred_bytes);
|
||||
void msch_isr(pipe_handle_t pipe_hdl, xfer_result_t event, uint32_t xferred_bytes);
|
||||
void msch_close(uint8_t dev_addr);
|
||||
#endif
|
||||
|
||||
|
||||
Reference in New Issue
Block a user