From cc91a73cdc8c6f46adfcae38e4c36d819a49ab01 Mon Sep 17 00:00:00 2001 From: hathach Date: Sun, 22 Sep 2013 18:44:55 +0700 Subject: fix pingstate for highspeed bulk out transfer temp implementation of msc host --> can issue inquiry command --- demos/bsp/boards/printf_retarget.c | 7 +-- demos/host/host_os_none/host_os_none.uvopt | 78 ++++++++++++++++-------------- demos/host/src/main.c | 8 ++- demos/host/src/msc_app.c | 12 +++++ demos/host/src/tusb_config.h | 6 +-- 5 files changed, 64 insertions(+), 47 deletions(-) (limited to 'demos') diff --git a/demos/bsp/boards/printf_retarget.c b/demos/bsp/boards/printf_retarget.c index fc6db7c90..7932ab147 100644 --- a/demos/bsp/boards/printf_retarget.c +++ b/demos/bsp/boards/printf_retarget.c @@ -74,12 +74,7 @@ int __sys_write (int iFileHandle, char *pcBuffer, int iLength) return iLength; #elif CFG_PRINTF_TARGET == PRINTF_TARGET_SWO - uint32_t i; - for (i = 0; i 1 0 - 0 + 1 8 @@ -135,7 +135,7 @@ 0 DLGUARM - + (106=-1,-1,-1,-1,0)(107=-1,-1,-1,-1,0) 0 @@ -170,6 +170,16 @@ 1 msch_data + + 2 + 1 + mouse_data + + + 3 + 1 + keyboard_data + 0 @@ -191,7 +201,7 @@ 0 0 0 - 1 + 0 0 0 0 @@ -202,12 +212,6 @@ - - - System Viewer\USB0 - 35905 - - @@ -264,7 +268,7 @@ 1 0 - 1 + 0 8 @@ -336,7 +340,7 @@ 0 DLGUARM - + (106=-1,-1,-1,-1,0)(107=-1,-1,-1,-1,0) 0 @@ -403,10 +407,10 @@ 1 0 0 - 71 + 0 0 - 166 - 183 + 1 + 1 0 ..\src\main.c main.c @@ -421,8 +425,8 @@ 0 0 0 - 1 - 1 + 95 + 107 0 ..\src\cdc_serial_app.c cdc_serial_app.c @@ -451,10 +455,10 @@ 1 0 0 - 0 + 43 0 - 1 - 1 + 113 + 127 0 ..\src\mouse_app.c mouse_app.c @@ -509,7 +513,7 @@ 0 31 0 - 23 + 33 55 0 ..\..\bsp\boards\board.c @@ -525,7 +529,7 @@ 0 2 0 - 142 + 143 146 0 ..\..\bsp\boards\embedded_artists\board_ea4357.c @@ -541,7 +545,7 @@ 0 1 0 - 97 + 96 106 0 ..\..\bsp\boards\printf_retarget.c @@ -677,7 +681,7 @@ 0 0 0 - 33 + 23 69 0 ..\..\..\tinyusb\tusb.c @@ -755,10 +759,10 @@ 1 0 0 - 25 + 0 0 - 143 - 147 + 1 + 1 0 ..\..\..\tinyusb\host\ehci\ehci.c ehci.c @@ -803,10 +807,10 @@ 1 0 0 - 7 + 8 0 - 77 - 112 + 67 + 77 0 ..\..\..\tinyusb\hal\hal_lpc43xx.c hal_lpc43xx.c @@ -867,10 +871,10 @@ 1 0 0 - 0 + 51 0 1 - 1 + 17 0 ..\..\..\tinyusb\class\cdc_host.c cdc_host.c @@ -899,10 +903,10 @@ 1 0 0 - 0 + 63 0 - 0 - 0 + 264 + 286 0 ..\..\..\tinyusb\class\hid_host.c hid_host.c @@ -1043,10 +1047,10 @@ 2 0 0 - 0 + 25 0 - 145 - 146 + 138 + 161 0 ..\..\bsp\lpc43xx\startup_keil\startup_LPC43xx.s startup_LPC43xx.s diff --git a/demos/host/src/main.c b/demos/host/src/main.c index 6ec9fd795..14cf0b826 100644 --- a/demos/host/src/main.c +++ b/demos/host/src/main.c @@ -112,10 +112,16 @@ void os_none_start_scheduler(void) msc_app_task(NULL); cdc_serial_app_task(NULL); rndis_app_task(NULL); + +// int ch = ITM_ReceiveChar(); +// if ( ch > 0 ) +// { +// printf("%c", ch); +// } } } #endif - +volatile int32_t ITM_RxBuffer; int main(void) { diff --git a/demos/host/src/msc_app.c b/demos/host/src/msc_app.c index 54de0d0cf..e2e5d7e4c 100644 --- a/demos/host/src/msc_app.c +++ b/demos/host/src/msc_app.c @@ -61,6 +61,18 @@ void tusbh_msc_mounted_cb(uint8_t dev_addr) { printf("an msc device is mounted\n"); + + // SCSI VendorID[8] & ProductID[16] from Inquiry Command + uint8_t const* p_vendor = tusbh_msc_get_vendor_name(dev_addr); + uint8_t const* p_product = tusbh_msc_get_product_name(dev_addr); + + printf("Vendor Id: "); + for(uint8_t i=0; i<8; i++) putchar(p_vendor[i]); + + printf("\nProduct Id: "); + for(uint8_t i=0; i<16; i++) putchar(p_product[i]); + + putchar('\n'); } //--------------------------------------------------------------------+ diff --git a/demos/host/src/tusb_config.h b/demos/host/src/tusb_config.h index 30891fcbb..99edfcf7b 100644 --- a/demos/host/src/tusb_config.h +++ b/demos/host/src/tusb_config.h @@ -73,12 +73,12 @@ //------------- CLASS -------------// #define TUSB_CFG_HOST_HUB 0 -#define TUSB_CFG_HOST_HID_KEYBOARD 1 +#define TUSB_CFG_HOST_HID_KEYBOARD 0 #define TUSB_CFG_HOST_HID_MOUSE 1 #define TUSB_CFG_HOST_HID_GENERIC 0 #define TUSB_CFG_HOST_MSC 1 -#define TUSB_CFG_HOST_CDC 1 -#define TUSB_CFG_HOST_CDC_RNDIS 1 +#define TUSB_CFG_HOST_CDC 0 +#define TUSB_CFG_HOST_CDC_RNDIS 0 //--------------------------------------------------------------------+ // DEVICE CONFIGURATION -- cgit v1.3.1