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 | |
| parent | 8bb35e26042ccb6b191bc0279c053451db6b4b01 (diff) | |
device API rename
Diffstat (limited to 'demos')
| -rw-r--r-- | demos/device/src/cdc_device_app.c | 18 | ||||
| -rw-r--r-- | demos/device/src/keyboard_device_app.c | 14 | ||||
| -rw-r--r-- | demos/device/src/msc_device_app.c | 6 | ||||
| -rw-r--r-- | demos/device/src/msc_device_ramdisk.c | 4 |
4 files changed, 21 insertions, 21 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
diff --git a/demos/device/src/keyboard_device_app.c b/demos/device/src/keyboard_device_app.c index 3ada9ee96..14f0611fa 100644 --- a/demos/device/src/keyboard_device_app.c +++ b/demos/device/src/keyboard_device_app.c @@ -56,17 +56,17 @@ TUSB_CFG_ATTR_USBRAM hid_keyboard_report_t keyboard_report; //--------------------------------------------------------------------+
// tinyusb callbacks
//--------------------------------------------------------------------+
-void tusbd_hid_keyboard_mounted_cb(uint8_t coreid)
+void tud_hid_keyboard_mounted_cb(uint8_t coreid)
{
}
-void tusbd_hid_keyboard_unmounted_cb(uint8_t coreid)
+void tud_hid_keyboard_unmounted_cb(uint8_t coreid)
{
}
-void tusbd_hid_keyboard_cb(uint8_t coreid, tusb_event_t event, uint32_t xferred_bytes)
+void tud_hid_keyboard_cb(uint8_t coreid, tusb_event_t event, uint32_t xferred_bytes)
{
switch(event)
{
@@ -77,7 +77,7 @@ void tusbd_hid_keyboard_cb(uint8_t coreid, tusb_event_t event, uint32_t xferred_ }
}
-uint16_t tusbd_hid_keyboard_get_report_cb(uint8_t coreid, hid_request_report_type_t report_type, void** pp_report, uint16_t requested_length)
+uint16_t tud_hid_keyboard_get_report_cb(uint8_t coreid, hid_request_report_type_t report_type, void** pp_report, uint16_t requested_length)
{
// get other than input report is not supported by this keyboard demo
if ( report_type != HID_REQUEST_REPORT_INPUT ) return 0;
@@ -86,7 +86,7 @@ uint16_t tusbd_hid_keyboard_get_report_cb(uint8_t coreid, hid_request_report_typ return requested_length;
}
-void tusbd_hid_keyboard_set_report_cb(uint8_t coreid, hid_request_report_type_t report_type, uint8_t p_report_data[], uint16_t length)
+void tud_hid_keyboard_set_report_cb(uint8_t coreid, hid_request_report_type_t report_type, uint8_t p_report_data[], uint16_t length)
{
// set other than output report is not supported by this keyboard demo
if ( report_type != HID_REQUEST_REPORT_OUTPUT ) return;
@@ -126,7 +126,7 @@ tusb_error_t keyboard_device_subtask(void) osal_task_delay(50);
- if ( tusbd_is_configured(0) && !tusbd_hid_keyboard_is_busy(0) )
+ if ( tud_configured(0) && !tud_hid_keyboard_busy(0) )
{
static uint32_t button_mask = 0;
uint32_t new_button_mask = board_buttons();
@@ -141,7 +141,7 @@ tusb_error_t keyboard_device_subtask(void) keyboard_report.keycode[i] = BIT_TEST_(button_mask, i) ? (0x04+i) : 0;
}
- tusbd_hid_keyboard_send(0, &keyboard_report );
+ tud_hid_keyboard_send(0, &keyboard_report );
}
}
diff --git a/demos/device/src/msc_device_app.c b/demos/device/src/msc_device_app.c index adbd95b65..0ae193e4b 100644 --- a/demos/device/src/msc_device_app.c +++ b/demos/device/src/msc_device_app.c @@ -89,17 +89,17 @@ static scsi_mode_parameters_t const msc_dev_mode_para = //--------------------------------------------------------------------+
// tinyusb callbacks
//--------------------------------------------------------------------+
-void tusbd_msc_mounted_cb(uint8_t coreid)
+void tud_msc_mounted_cb(uint8_t coreid)
{
}
-void tusbd_msc_unmounted_cb(uint8_t coreid)
+void tud_msc_unmounted_cb(uint8_t coreid)
{
}
-msc_csw_status_t tusbd_msc_scsi_cb (uint8_t coreid, uint8_t lun, uint8_t scsi_cmd[16], void const ** pp_buffer, uint16_t* p_length)
+msc_csw_status_t tud_msc_scsi_cb (uint8_t coreid, uint8_t lun, uint8_t scsi_cmd[16], void const ** pp_buffer, uint16_t* p_length)
{
// read10 & write10 has their own callback and MUST not be handled here
switch (scsi_cmd[0])
diff --git a/demos/device/src/msc_device_ramdisk.c b/demos/device/src/msc_device_ramdisk.c index b835b37d4..a048526ed 100644 --- a/demos/device/src/msc_device_ramdisk.c +++ b/demos/device/src/msc_device_ramdisk.c @@ -91,13 +91,13 @@ uint8_t msc_device_ramdisk[DISK_BLOCK_NUM][DISK_BLOCK_SIZE] = //--------------------------------------------------------------------+
// IMPLEMENTATION
//--------------------------------------------------------------------+
-uint16_t tusbd_msc_read10_cb (uint8_t coreid, uint8_t lun, void** pp_buffer, uint32_t lba, uint16_t block_count)
+uint16_t tud_msc_read10_cb (uint8_t coreid, uint8_t lun, void** pp_buffer, uint32_t lba, uint16_t block_count)
{
(*pp_buffer) = msc_device_ramdisk[lba];
return min16_of(block_count, DISK_BLOCK_NUM);
}
-uint16_t tusbd_msc_write10_cb(uint8_t coreid, uint8_t lun, void** pp_buffer, uint32_t lba, uint16_t block_count)
+uint16_t tud_msc_write10_cb(uint8_t coreid, uint8_t lun, void** pp_buffer, uint32_t lba, uint16_t block_count)
{
(*pp_buffer) = msc_device_ramdisk[lba];
|
