diff options
| author | hathach <[email protected]> | 2018-03-01 12:51:19 +0700 |
|---|---|---|
| committer | hathach <[email protected]> | 2018-03-01 12:51:19 +0700 |
| commit | 9a2924fb366d87f583ea57efd0b58381a5bba3fb (patch) | |
| tree | cbf774aa1d3963c51064b36c5c7054dccdc06b23 /demos/device/src/cdc_device_app.c | |
| parent | 8bb35e26042ccb6b191bc0279c053451db6b4b01 (diff) | |
device API rename
Diffstat (limited to 'demos/device/src/cdc_device_app.c')
| -rw-r--r-- | demos/device/src/cdc_device_app.c | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/demos/device/src/cdc_device_app.c b/demos/device/src/cdc_device_app.c index 0a54ffc3c..8059b938d 100644 --- a/demos/device/src/cdc_device_app.c +++ b/demos/device/src/cdc_device_app.c @@ -64,19 +64,19 @@ FIFO_DEF(fifo_serial, SERIAL_BUFFER_SIZE, uint8_t, true); //--------------------------------------------------------------------+
// tinyusb callbacks
//--------------------------------------------------------------------+
-void tusbd_cdc_mounted_cb(uint8_t coreid)
+void tud_cdc_mounted_cb(uint8_t coreid)
{
osal_semaphore_reset(sem_hdl);
- tusbd_cdc_receive(coreid, serial_rx_buffer, SERIAL_BUFFER_SIZE, true);
+ tud_cdc_receive(coreid, serial_rx_buffer, SERIAL_BUFFER_SIZE, true);
}
-void tusbd_cdc_unmounted_cb(uint8_t coreid)
+void tud_cdc_unmounted_cb(uint8_t coreid)
{
}
-void tusbd_cdc_xfer_cb(uint8_t coreid, tusb_event_t event, cdc_pipeid_t pipe_id, uint32_t xferred_bytes)
+void tud_cdc_xfer_cb(uint8_t coreid, tusb_event_t event, cdc_pipeid_t pipe_id, uint32_t xferred_bytes)
{
switch ( pipe_id )
{
@@ -92,7 +92,7 @@ void tusbd_cdc_xfer_cb(uint8_t coreid, tusb_event_t event, cdc_pipeid_t pipe_id, break;
case TUSB_EVENT_XFER_ERROR:
- tusbd_cdc_receive(0, serial_rx_buffer, SERIAL_BUFFER_SIZE, true); // ignore, queue transfer again
+ tud_cdc_receive(0, serial_rx_buffer, SERIAL_BUFFER_SIZE, true); // ignore, queue transfer again
break;
case TUSB_EVENT_XFER_STALLED:
@@ -139,10 +139,10 @@ tusb_error_t cdcd_serial_subtask(void) osal_semaphore_wait(sem_hdl, OSAL_TIMEOUT_WAIT_FOREVER, &error);
(void) error; // suppress compiler's warnings
- if ( tusbd_is_configured(0) )
+ if ( tud_configured(0) )
{
// echo back data in the fifo
- if ( !tusbd_cdc_is_busy(0, CDC_PIPE_DATA_IN) )
+ if ( !tud_cdc_busy(0, CDC_PIPE_DATA_IN) )
{
uint16_t count=0;
while( fifo_read(&fifo_serial, &serial_tx_buffer[count]) )
@@ -152,12 +152,12 @@ tusb_error_t cdcd_serial_subtask(void) if (count)
{
- tusbd_cdc_send(0, serial_tx_buffer, count, false);
+ tud_cdc_send(0, serial_tx_buffer, count, false);
}
}
// getting more data from host
- tusbd_cdc_receive(0, serial_rx_buffer, SERIAL_BUFFER_SIZE, true);
+ tud_cdc_receive(0, serial_rx_buffer, SERIAL_BUFFER_SIZE, true);
}
OSAL_SUBTASK_END
|
