diff options
| author | hathach <[email protected]> | 2013-09-22 18:44:55 +0700 |
|---|---|---|
| committer | hathach <[email protected]> | 2013-09-22 18:44:55 +0700 |
| commit | cc91a73cdc8c6f46adfcae38e4c36d819a49ab01 (patch) | |
| tree | 829f83c189fd25b2eb28374ec4392a1860f2d8ca /demos | |
| parent | 57088638598ccd0ea185debb8ca0fc7cbb404587 (diff) | |
fix pingstate for highspeed bulk out transfer
temp implementation of msc host --> can issue inquiry command
Diffstat (limited to 'demos')
| -rw-r--r-- | demos/bsp/boards/printf_retarget.c | 7 | ||||
| -rw-r--r-- | demos/host/host_os_none/host_os_none.uvopt | 78 | ||||
| -rw-r--r-- | demos/host/src/main.c | 8 | ||||
| -rw-r--r-- | demos/host/src/msc_app.c | 12 | ||||
| -rw-r--r-- | demos/host/src/tusb_config.h | 6 |
5 files changed, 64 insertions, 47 deletions
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<iLength; i++) - { - ITM_SendChar(pcBuffer[i]); // print each character - } - return iLength; + #error author does not know how to retarget SWO with lpcxpresso/red-suite #else #error Thach, did you forget something #endif diff --git a/demos/host/host_os_none/host_os_none.uvopt b/demos/host/host_os_none/host_os_none.uvopt index b2adbd490..45e4c5025 100644 --- a/demos/host/host_os_none/host_os_none.uvopt +++ b/demos/host/host_os_none/host_os_none.uvopt @@ -73,7 +73,7 @@ <OPTFL> <tvExp>1</tvExp> <tvExpOptDlg>0</tvExpOptDlg> - <IsCurrentTarget>0</IsCurrentTarget> + <IsCurrentTarget>1</IsCurrentTarget> </OPTFL> <CpuCode>8</CpuCode> <Books> @@ -135,7 +135,7 @@ <SetRegEntry> <Number>0</Number> <Key>DLGUARM</Key> - <Name></Name> + <Name>(106=-1,-1,-1,-1,0)(107=-1,-1,-1,-1,0)</Name> </SetRegEntry> <SetRegEntry> <Number>0</Number> @@ -170,6 +170,16 @@ <WinNumber>1</WinNumber> <ItemText>msch_data</ItemText> </Ww> + <Ww> + <count>2</count> + <WinNumber>1</WinNumber> + <ItemText>mouse_data</ItemText> + </Ww> + <Ww> + <count>3</count> + <WinNumber>1</WinNumber> + <ItemText>keyboard_data</ItemText> + </Ww> </WatchWindow1> <DebugFlag> <trace>0</trace> @@ -191,7 +201,7 @@ <aLa>0</aLa> <aPa1>0</aPa1> <AscS4>0</AscS4> - <aSer4>1</aSer4> + <aSer4>0</aSer4> <StkLoc>0</StkLoc> <TrcWin>0</TrcWin> <newCpu>0</newCpu> @@ -202,12 +212,6 @@ </Tracepoint> <LintExecutable></LintExecutable> <LintConfigFile></LintConfigFile> - <SystemViewers> - <Entry> - <Name>System Viewer\USB0</Name> - <WinId>35905</WinId> - </Entry> - </SystemViewers> </TargetOption> </Target> @@ -264,7 +268,7 @@ <OPTFL> <tvExp>1</tvExp> <tvExpOptDlg>0</tvExpOptDlg> - <IsCurrentTarget>1</IsCurrentTarget> + <IsCurrentTarget>0</IsCurrentTarget> </OPTFL> <CpuCode>8</CpuCode> <Books> @@ -336,7 +340,7 @@ <SetRegEntry> <Number>0</Number> <Key>DLGUARM</Key> - <Name></Name> + <Name>(106=-1,-1,-1,-1,0)(107=-1,-1,-1,-1,0)</Name> </SetRegEntry> <SetRegEntry> <Number>0</Number> @@ -403,10 +407,10 @@ <FileType>1</FileType> <tvExp>0</tvExp> <Focus>0</Focus> - <ColumnNumber>71</ColumnNumber> + <ColumnNumber>0</ColumnNumber> <tvExpOptDlg>0</tvExpOptDlg> - <TopLine>166</TopLine> - <CurrentLine>183</CurrentLine> + <TopLine>1</TopLine> + <CurrentLine>1</CurrentLine> <bDave2>0</bDave2> <PathWithFileName>..\src\main.c</PathWithFileName> <FilenameWithoutPath>main.c</FilenameWithoutPath> @@ -421,8 +425,8 @@ <Focus>0</Focus> <ColumnNumber>0</ColumnNumber> <tvExpOptDlg>0</tvExpOptDlg> - <TopLine>1</TopLine> - <CurrentLine>1</CurrentLine> + <TopLine>95</TopLine> + <CurrentLine>107</CurrentLine> <bDave2>0</bDave2> <PathWithFileName>..\src\cdc_serial_app.c</PathWithFileName> <FilenameWithoutPath>cdc_serial_app.c</FilenameWithoutPath> @@ -451,10 +455,10 @@ <FileType>1</FileType> <tvExp>0</tvExp> <Focus>0</Focus> - <ColumnNumber>0</ColumnNumber> + <ColumnNumber>43</ColumnNumber> <tvExpOptDlg>0</tvExpOptDlg> - <TopLine>1</TopLine> - <CurrentLine>1</CurrentLine> + <TopLine>113</TopLine> + <CurrentLine>127</CurrentLine> <bDave2>0</bDave2> <PathWithFileName>..\src\mouse_app.c</PathWithFileName> <FilenameWithoutPath>mouse_app.c</FilenameWithoutPath> @@ -509,7 +513,7 @@ <Focus>0</Focus> <ColumnNumber>31</ColumnNumber> <tvExpOptDlg>0</tvExpOptDlg> - <TopLine>23</TopLine> + <TopLine>33</TopLine> <CurrentLine>55</CurrentLine> <bDave2>0</bDave2> <PathWithFileName>..\..\bsp\boards\board.c</PathWithFileName> @@ -525,7 +529,7 @@ <Focus>0</Focus> <ColumnNumber>2</ColumnNumber> <tvExpOptDlg>0</tvExpOptDlg> - <TopLine>142</TopLine> + <TopLine>143</TopLine> <CurrentLine>146</CurrentLine> <bDave2>0</bDave2> <PathWithFileName>..\..\bsp\boards\embedded_artists\board_ea4357.c</PathWithFileName> @@ -541,7 +545,7 @@ <Focus>0</Focus> <ColumnNumber>1</ColumnNumber> <tvExpOptDlg>0</tvExpOptDlg> - <TopLine>97</TopLine> + <TopLine>96</TopLine> <CurrentLine>106</CurrentLine> <bDave2>0</bDave2> <PathWithFileName>..\..\bsp\boards\printf_retarget.c</PathWithFileName> @@ -677,7 +681,7 @@ <Focus>0</Focus> <ColumnNumber>0</ColumnNumber> <tvExpOptDlg>0</tvExpOptDlg> - <TopLine>33</TopLine> + <TopLine>23</TopLine> <CurrentLine>69</CurrentLine> <bDave2>0</bDave2> <PathWithFileName>..\..\..\tinyusb\tusb.c</PathWithFileName> @@ -755,10 +759,10 @@ <FileType>1</FileType> <tvExp>0</tvExp> <Focus>0</Focus> - <ColumnNumber>25</ColumnNumber> + <ColumnNumber>0</ColumnNumber> <tvExpOptDlg>0</tvExpOptDlg> - <TopLine>143</TopLine> - <CurrentLine>147</CurrentLine> + <TopLine>1</TopLine> + <CurrentLine>1</CurrentLine> <bDave2>0</bDave2> <PathWithFileName>..\..\..\tinyusb\host\ehci\ehci.c</PathWithFileName> <FilenameWithoutPath>ehci.c</FilenameWithoutPath> @@ -803,10 +807,10 @@ <FileType>1</FileType> <tvExp>0</tvExp> <Focus>0</Focus> - <ColumnNumber>7</ColumnNumber> + <ColumnNumber>8</ColumnNumber> <tvExpOptDlg>0</tvExpOptDlg> - <TopLine>77</TopLine> - <CurrentLine>112</CurrentLine> + <TopLine>67</TopLine> + <CurrentLine>77</CurrentLine> <bDave2>0</bDave2> <PathWithFileName>..\..\..\tinyusb\hal\hal_lpc43xx.c</PathWithFileName> <FilenameWithoutPath>hal_lpc43xx.c</FilenameWithoutPath> @@ -867,10 +871,10 @@ <FileType>1</FileType> <tvExp>0</tvExp> <Focus>0</Focus> - <ColumnNumber>0</ColumnNumber> + <ColumnNumber>51</ColumnNumber> <tvExpOptDlg>0</tvExpOptDlg> <TopLine>1</TopLine> - <CurrentLine>1</CurrentLine> + <CurrentLine>17</CurrentLine> <bDave2>0</bDave2> <PathWithFileName>..\..\..\tinyusb\class\cdc_host.c</PathWithFileName> <FilenameWithoutPath>cdc_host.c</FilenameWithoutPath> @@ -899,10 +903,10 @@ <FileType>1</FileType> <tvExp>0</tvExp> <Focus>0</Focus> - <ColumnNumber>0</ColumnNumber> + <ColumnNumber>63</ColumnNumber> <tvExpOptDlg>0</tvExpOptDlg> - <TopLine>0</TopLine> - <CurrentLine>0</CurrentLine> + <TopLine>264</TopLine> + <CurrentLine>286</CurrentLine> <bDave2>0</bDave2> <PathWithFileName>..\..\..\tinyusb\class\hid_host.c</PathWithFileName> <FilenameWithoutPath>hid_host.c</FilenameWithoutPath> @@ -1043,10 +1047,10 @@ <FileType>2</FileType> <tvExp>0</tvExp> <Focus>0</Focus> - <ColumnNumber>0</ColumnNumber> + <ColumnNumber>25</ColumnNumber> <tvExpOptDlg>0</tvExpOptDlg> - <TopLine>145</TopLine> - <CurrentLine>146</CurrentLine> + <TopLine>138</TopLine> + <CurrentLine>161</CurrentLine> <bDave2>0</bDave2> <PathWithFileName>..\..\bsp\lpc43xx\startup_keil\startup_LPC43xx.s</PathWithFileName> <FilenameWithoutPath>startup_LPC43xx.s</FilenameWithoutPath> 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 |
