rename tud_configured() to mounted()
This commit is contained in:
		| @@ -139,7 +139,7 @@ tusb_error_t cdcd_serial_subtask(void) | |||||||
|   osal_semaphore_wait(sem_hdl, OSAL_TIMEOUT_WAIT_FOREVER, &error); |   osal_semaphore_wait(sem_hdl, OSAL_TIMEOUT_WAIT_FOREVER, &error); | ||||||
|   (void) error; // suppress compiler's warnings |   (void) error; // suppress compiler's warnings | ||||||
|  |  | ||||||
|   if ( tud_configured(0) ) |   if ( tud_mounted(0) ) | ||||||
|   { |   { | ||||||
|     // echo back data in the fifo |     // echo back data in the fifo | ||||||
|     if ( !tud_cdc_busy(0, CDC_PIPE_DATA_IN) ) |     if ( !tud_cdc_busy(0, CDC_PIPE_DATA_IN) ) | ||||||
|   | |||||||
| @@ -126,7 +126,7 @@ tusb_error_t keyboard_device_subtask(void) | |||||||
|  |  | ||||||
|   osal_task_delay(50); |   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; |     static uint32_t button_mask = 0; | ||||||
|     uint32_t new_button_mask = board_buttons(); |     uint32_t new_button_mask = board_buttons(); | ||||||
|   | |||||||
| @@ -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) | 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]; |   cdcd_data_t* p_cdc = &cdcd_data[coreid]; | ||||||
|  |  | ||||||
|   | |||||||
| @@ -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) | 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]; |   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) | 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]; |   hidd_interface_t * p_mouse = &moused_data; // TODO &keyboardd_data[coreid]; | ||||||
|  |  | ||||||
|   | |||||||
| @@ -102,7 +102,7 @@ static tusb_error_t get_descriptor(uint8_t coreid, tusb_control_request_t const | |||||||
| //--------------------------------------------------------------------+ | //--------------------------------------------------------------------+ | ||||||
| // APPLICATION INTERFACE | // APPLICATION INTERFACE | ||||||
| //--------------------------------------------------------------------+ | //--------------------------------------------------------------------+ | ||||||
| bool tud_configured(uint8_t coreid) | bool tud_mounted(uint8_t coreid) | ||||||
| { | { | ||||||
|   return usbd_devices[coreid].state == TUSB_DEVICE_STATE_CONFIGURED; |   return usbd_devices[coreid].state == TUSB_DEVICE_STATE_CONFIGURED; | ||||||
| } | } | ||||||
|   | |||||||
| @@ -84,14 +84,15 @@ typedef struct { | |||||||
|   void (* const close) (uint8_t); |   void (* const close) (uint8_t); | ||||||
| } usbd_class_driver_t; | } usbd_class_driver_t; | ||||||
|  |  | ||||||
| //--------------------------------------------------------------------+ |  | ||||||
| // INTERNAL OBJECT & FUNCTION DECLARATION |  | ||||||
| //--------------------------------------------------------------------+ |  | ||||||
|  |  | ||||||
| //--------------------------------------------------------------------+ | //--------------------------------------------------------------------+ | ||||||
| // APPLICATION API | // 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); | //void tud_device_suspended_cb(uint8_t coreid); | ||||||
|  |  | ||||||
| //--------------------------------------------------------------------+ | //--------------------------------------------------------------------+ | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user
	 hathach
					hathach