diff options
| author | hathach <[email protected]> | 2018-12-10 22:19:01 +0700 |
|---|---|---|
| committer | hathach <[email protected]> | 2018-12-10 22:19:01 +0700 |
| commit | 212deaf2f8102208099279562b0c6ce04cb60515 (patch) | |
| tree | df3941f8a4342834451706dadef5844c575dac55 /src/class/cdc | |
| parent | 9c3c782b64d196daf97d12732611fb5e16c80008 (diff) | |
usbh name change
Diffstat (limited to 'src/class/cdc')
| -rw-r--r-- | src/class/cdc/cdc_host.c | 16 | ||||
| -rw-r--r-- | src/class/cdc/cdc_host.h | 4 |
2 files changed, 10 insertions, 10 deletions
diff --git a/src/class/cdc/cdc_host.c b/src/class/cdc/cdc_host.c index c6378e546..a44a0b97c 100644 --- a/src/class/cdc/cdc_host.c +++ b/src/class/cdc/cdc_host.c @@ -106,24 +106,24 @@ bool tuh_cdc_serial_is_mounted(uint8_t dev_addr) (cdch_data[dev_addr-1].itf_protocol <= CDC_COMM_PROTOCOL_ATCOMMAND_CDMA);
}
-tusb_error_t tuh_cdc_send(uint8_t dev_addr, void const * p_data, uint32_t length, bool is_notify)
+bool tuh_cdc_send(uint8_t dev_addr, void const * p_data, uint32_t length, bool is_notify)
{
- TU_ASSERT( tuh_cdc_mounted(dev_addr), TUSB_ERROR_CDCH_DEVICE_NOT_MOUNTED);
- TU_ASSERT( p_data != NULL && length, TUSB_ERROR_INVALID_PARA);
+ TU_VERIFY( tuh_cdc_mounted(dev_addr) );
+ TU_VERIFY( p_data != NULL && length, TUSB_ERROR_INVALID_PARA);
pipe_handle_t pipe_out = cdch_data[dev_addr-1].pipe_out;
- if ( hcd_pipe_is_busy(dev_addr, pipe_out) ) return TUSB_ERROR_INTERFACE_IS_BUSY;
+ if ( hcd_pipe_is_busy(dev_addr, pipe_out) ) return false;
return hcd_pipe_xfer(dev_addr, pipe_out, (void *) p_data, length, is_notify);
}
-tusb_error_t tuh_cdc_receive(uint8_t dev_addr, void * p_buffer, uint32_t length, bool is_notify)
+bool tuh_cdc_receive(uint8_t dev_addr, void * p_buffer, uint32_t length, bool is_notify)
{
- TU_ASSERT( tuh_cdc_mounted(dev_addr), TUSB_ERROR_CDCH_DEVICE_NOT_MOUNTED);
- TU_ASSERT( p_buffer != NULL && length, TUSB_ERROR_INVALID_PARA);
+ TU_VERIFY( tuh_cdc_mounted(dev_addr) );
+ TU_VERIFY( p_buffer != NULL && length, TUSB_ERROR_INVALID_PARA);
pipe_handle_t pipe_in = cdch_data[dev_addr-1].pipe_in;
- if ( hcd_pipe_is_busy(dev_addr, pipe_in) ) return TUSB_ERROR_INTERFACE_IS_BUSY;
+ if ( hcd_pipe_is_busy(dev_addr, pipe_in) ) return false;
return hcd_pipe_xfer(dev_addr, pipe_in, p_buffer, length, is_notify);
}
diff --git a/src/class/cdc/cdc_host.h b/src/class/cdc/cdc_host.h index 192842dfa..5388a8f60 100644 --- a/src/class/cdc/cdc_host.h +++ b/src/class/cdc/cdc_host.h @@ -86,7 +86,7 @@ bool tuh_cdc_is_busy(uint8_t dev_addr, cdc_pipeid_t pipeid); * \note This function is non-blocking and returns immediately. The result of USB transfer will be reported by the
* interface's callback function. \a p_data must be declared with \ref CFG_TUSB_MEM_SECTION.
*/
-tusb_error_t tuh_cdc_send(uint8_t dev_addr, void const * p_data, uint32_t length, bool is_notify);
+bool tuh_cdc_send(uint8_t dev_addr, void const * p_data, uint32_t length, bool is_notify);
/** \brief Perform USB IN transfer to get data from device
* \param[in] dev_addr device address
@@ -99,7 +99,7 @@ tusb_error_t tuh_cdc_send(uint8_t dev_addr, void const * p_data, uint32_t length * \note This function is non-blocking and returns immediately. The result of USB transfer will be reported by the
* interface's callback function. \a p_data must be declared with \ref CFG_TUSB_MEM_SECTION.
*/
-tusb_error_t tuh_cdc_receive(uint8_t dev_addr, void * p_buffer, uint32_t length, bool is_notify);
+bool tuh_cdc_receive(uint8_t dev_addr, void * p_buffer, uint32_t length, bool is_notify);
//--------------------------------------------------------------------+
// CDC APPLICATION CALLBACKS
|
