use hcd_pipe_is_busy instead of hcd_pipe_is_idle
remove hcd_pipe_is_idle
This commit is contained in:
		| @@ -123,7 +123,6 @@ void cdc_serial_app_init(void) | ||||
| //------------- main task -------------// | ||||
| OSAL_TASK_FUNCTION( cdc_serial_app_task ) (void* p_task_para) | ||||
| { | ||||
|   // This task can be separated into 2 Task : sending & receiving. | ||||
|   OSAL_TASK_LOOP_BEGIN | ||||
|  | ||||
|   //------------- send characters got from uart terminal to the first CDC device -------------// | ||||
| @@ -147,14 +146,11 @@ OSAL_TASK_FUNCTION( cdc_serial_app_task ) (void* p_task_para) | ||||
|  | ||||
|   //------------- print out received characters -------------// | ||||
|   tusb_error_t error; | ||||
|   osal_semaphore_wait(sem_hdl, 100, &error); // timeout to allow getchar from uart terminal can be executed | ||||
|   osal_semaphore_wait(sem_hdl, 100, &error); // waiting for incoming data | ||||
|  | ||||
|   if ( TUSB_ERROR_NONE == error) | ||||
|   { | ||||
|     for(uint8_t i=0; i<received_bytes; i++) | ||||
|     { | ||||
|       printf("%c", serial_in_buffer[i]); | ||||
|     } | ||||
|     for(uint8_t i=0; i<received_bytes; i++) printf("%c", serial_in_buffer[i]); | ||||
|  | ||||
|     for(uint8_t dev_addr=1; dev_addr <= TUSB_CFG_HOST_DEVICE_MAX; dev_addr++) | ||||
|     { | ||||
|   | ||||
| @@ -71,8 +71,8 @@ | ||||
| #define TUSB_CFG_HOST_HID_KEYBOARD  0 | ||||
| #define TUSB_CFG_HOST_HID_MOUSE     0 | ||||
| #define TUSB_CFG_HOST_HID_GENERIC   0 | ||||
| #define TUSB_CFG_HOST_MSC           1 | ||||
| #define TUSB_CFG_HOST_CDC           0 | ||||
| #define TUSB_CFG_HOST_MSC           0 | ||||
| #define TUSB_CFG_HOST_CDC           1 | ||||
| #define TUSB_CFG_HOST_CDC_RNDIS     0 | ||||
|  | ||||
| //--------------------------------------------------------------------+ | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 hathach
					hathach