diff options
| author | hathach <[email protected]> | 2018-03-01 23:43:03 +0700 |
|---|---|---|
| committer | hathach <[email protected]> | 2018-03-01 23:43:03 +0700 |
| commit | 0afa0ce4ccf493e7684c753ab0af2411eb198f14 (patch) | |
| tree | 00ffd94382e06383cd5d71a20701fcb27a62016f | |
| parent | 04cace7619596377b38914c375b424b9884e4baa (diff) | |
rename tud_configured() to mounted()
| -rw-r--r-- | demos/device/src/cdc_device_app.c | 2 | ||||
| -rw-r--r-- | demos/device/src/keyboard_device_app.c | 2 | ||||
| -rw-r--r-- | tinyusb/class/cdc_device.c | 2 | ||||
| -rw-r--r-- | tinyusb/class/hid_device.c | 4 | ||||
| -rw-r--r-- | tinyusb/device/usbd.c | 2 | ||||
| -rw-r--r-- | tinyusb/device/usbd.h | 11 |
6 files changed, 12 insertions, 11 deletions
diff --git a/demos/device/src/cdc_device_app.c b/demos/device/src/cdc_device_app.c index 8059b938d..d8491d87b 100644 --- a/demos/device/src/cdc_device_app.c +++ b/demos/device/src/cdc_device_app.c @@ -139,7 +139,7 @@ tusb_error_t cdcd_serial_subtask(void) osal_semaphore_wait(sem_hdl, OSAL_TIMEOUT_WAIT_FOREVER, &error);
(void) error; // suppress compiler's warnings
- if ( tud_configured(0) )
+ if ( tud_mounted(0) )
{
// echo back data in the fifo
if ( !tud_cdc_busy(0, CDC_PIPE_DATA_IN) )
diff --git a/demos/device/src/keyboard_device_app.c b/demos/device/src/keyboard_device_app.c index 14f0611fa..61e42f99d 100644 --- a/demos/device/src/keyboard_device_app.c +++ b/demos/device/src/keyboard_device_app.c @@ -126,7 +126,7 @@ tusb_error_t keyboard_device_subtask(void) osal_task_delay(50);
- if ( tud_configured(0) && !tud_hid_keyboard_busy(0) )
+ if ( tud_mounted(0) && !tud_hid_keyboard_busy(0) )
{
static uint32_t button_mask = 0;
uint32_t new_button_mask = board_buttons();
diff --git a/tinyusb/class/cdc_device.c b/tinyusb/class/cdc_device.c index 6b64e56a7..455c04339 100644 --- a/tinyusb/class/cdc_device.c +++ b/tinyusb/class/cdc_device.c @@ -66,7 +66,7 @@ STATIC_VAR cdcd_data_t cdcd_data[CONTROLLER_DEVICE_NUMBER]; static tusb_error_t cdcd_xfer(uint8_t coreid, cdc_pipeid_t pipeid, void * p_buffer, uint32_t length, bool is_notify)
{
- ASSERT(tud_configured(coreid), TUSB_ERROR_USBD_DEVICE_NOT_CONFIGURED);
+ ASSERT(tud_mounted(coreid), TUSB_ERROR_USBD_DEVICE_NOT_CONFIGURED);
cdcd_data_t* p_cdc = &cdcd_data[coreid];
diff --git a/tinyusb/class/hid_device.c b/tinyusb/class/hid_device.c index 5f8d9b53f..d06f71925 100644 --- a/tinyusb/class/hid_device.c +++ b/tinyusb/class/hid_device.c @@ -120,7 +120,7 @@ bool tud_hid_keyboard_busy(uint8_t coreid) tusb_error_t tud_hid_keyboard_send(uint8_t coreid, hid_keyboard_report_t const *p_report)
{
- ASSERT(tud_configured(coreid), TUSB_ERROR_USBD_DEVICE_NOT_CONFIGURED);
+ ASSERT(tud_mounted(coreid), TUSB_ERROR_USBD_DEVICE_NOT_CONFIGURED);
hidd_interface_t * p_kbd = &keyboardd_data; // TODO &keyboardd_data[coreid];
@@ -143,7 +143,7 @@ bool tusbd_hid_mouse_is_busy(uint8_t coreid) tusb_error_t tusbd_hid_mouse_send(uint8_t coreid, hid_mouse_report_t const *p_report)
{
- ASSERT(tud_configured(coreid), TUSB_ERROR_USBD_DEVICE_NOT_CONFIGURED);
+ ASSERT(tud_mounted(coreid), TUSB_ERROR_USBD_DEVICE_NOT_CONFIGURED);
hidd_interface_t * p_mouse = &moused_data; // TODO &keyboardd_data[coreid];
diff --git a/tinyusb/device/usbd.c b/tinyusb/device/usbd.c index d10135151..0f7931f93 100644 --- a/tinyusb/device/usbd.c +++ b/tinyusb/device/usbd.c @@ -102,7 +102,7 @@ static tusb_error_t get_descriptor(uint8_t coreid, tusb_control_request_t const //--------------------------------------------------------------------+
// APPLICATION INTERFACE
//--------------------------------------------------------------------+
-bool tud_configured(uint8_t coreid)
+bool tud_mounted(uint8_t coreid)
{
return usbd_devices[coreid].state == TUSB_DEVICE_STATE_CONFIGURED;
}
diff --git a/tinyusb/device/usbd.h b/tinyusb/device/usbd.h index 55aad312a..59128db84 100644 --- a/tinyusb/device/usbd.h +++ b/tinyusb/device/usbd.h @@ -85,13 +85,14 @@ typedef struct { } usbd_class_driver_t;
//--------------------------------------------------------------------+
-// INTERNAL OBJECT & FUNCTION DECLARATION
-//--------------------------------------------------------------------+
-
-//--------------------------------------------------------------------+
// APPLICATION API
//--------------------------------------------------------------------+
-bool tud_configured(uint8_t coreid);
+bool tud_mounted(uint8_t coreid);
+
+/*------------- Callback -------------*/
+void tud_mount_cb(uint8_t coreid);
+void tud_umount_cb(uint8_t coreid);
+
//void tud_device_suspended_cb(uint8_t coreid);
//--------------------------------------------------------------------+
|
