diff options
Diffstat (limited to 'demos')
| -rw-r--r-- | demos/bsp/boards/embedded_artists/board_ea4357.h | 4 | ||||
| -rw-r--r-- | demos/host/host_os_none/host_os_none.uvopt | 104 | ||||
| -rw-r--r-- | demos/host/src/msc_app.c | 23 | ||||
| -rw-r--r-- | demos/host/src/tusb_config.h | 4 |
4 files changed, 73 insertions, 62 deletions
diff --git a/demos/bsp/boards/embedded_artists/board_ea4357.h b/demos/bsp/boards/embedded_artists/board_ea4357.h index 5858b0496..cb9a7136a 100644 --- a/demos/bsp/boards/embedded_artists/board_ea4357.h +++ b/demos/bsp/boards/embedded_artists/board_ea4357.h @@ -67,8 +67,8 @@ #include "oem_base_board/pca9532.h" // LEDs -//#define CFG_PRINTF_TARGET PRINTF_TARGET_SWO -#define CFG_PRINTF_TARGET PRINTF_TARGET_UART // FIXME keil's cmsis rtx does not work with UART (work with SWO) +#define CFG_PRINTF_TARGET PRINTF_TARGET_SWO +//#define CFG_PRINTF_TARGET PRINTF_TARGET_UART // FIXME keil's cmsis rtx does not work with UART (work with SWO) /*========================================================================= HARDWARE MAC ADDRESS diff --git a/demos/host/host_os_none/host_os_none.uvopt b/demos/host/host_os_none/host_os_none.uvopt index f7043fdc4..6a9661362 100644 --- a/demos/host/host_os_none/host_os_none.uvopt +++ b/demos/host/host_os_none/host_os_none.uvopt @@ -135,7 +135,7 @@ <SetRegEntry> <Number>0</Number> <Key>DLGUARM</Key> - <Name>(106=-1,-1,-1,-1,0)(107=-1,-1,-1,-1,0)</Name> + <Name></Name> </SetRegEntry> <SetRegEntry> <Number>0</Number> @@ -168,27 +168,27 @@ <Ww> <count>1</count> <WinNumber>1</WinNumber> - <ItemText>msch_data</ItemText> + <ItemText>ehci_data</ItemText> </Ww> <Ww> <count>2</count> <WinNumber>1</WinNumber> - <ItemText>mouse_data</ItemText> + <ItemText>ehci_data.device[1]</ItemText> </Ww> <Ww> <count>3</count> <WinNumber>1</WinNumber> - <ItemText>keyboard_data</ItemText> + <ItemText>ehci_data.device[0]</ItemText> </Ww> <Ww> <count>4</count> <WinNumber>1</WinNumber> - <ItemText>ehci_data</ItemText> + <ItemText>hub_data</ItemText> </Ww> <Ww> <count>5</count> <WinNumber>1</WinNumber> - <ItemText>msch_semaphore</ItemText> + <ItemText>disk_state</ItemText> </Ww> </WatchWindow1> <MemoryWindow1> @@ -424,10 +424,10 @@ <FileType>1</FileType> <tvExp>0</tvExp> <Focus>0</Focus> - <ColumnNumber>0</ColumnNumber> + <ColumnNumber>25</ColumnNumber> <tvExpOptDlg>0</tvExpOptDlg> - <TopLine>147</TopLine> - <CurrentLine>159</CurrentLine> + <TopLine>151</TopLine> + <CurrentLine>160</CurrentLine> <bDave2>0</bDave2> <PathWithFileName>..\src\main.c</PathWithFileName> <FilenameWithoutPath>main.c</FilenameWithoutPath> @@ -442,8 +442,8 @@ <Focus>0</Focus> <ColumnNumber>0</ColumnNumber> <tvExpOptDlg>0</tvExpOptDlg> - <TopLine>59</TopLine> - <CurrentLine>75</CurrentLine> + <TopLine>126</TopLine> + <CurrentLine>149</CurrentLine> <bDave2>0</bDave2> <PathWithFileName>..\src\cdc_serial_app.c</PathWithFileName> <FilenameWithoutPath>cdc_serial_app.c</FilenameWithoutPath> @@ -458,7 +458,7 @@ <Focus>0</Focus> <ColumnNumber>0</ColumnNumber> <tvExpOptDlg>0</tvExpOptDlg> - <TopLine>112</TopLine> + <TopLine>127</TopLine> <CurrentLine>135</CurrentLine> <bDave2>0</bDave2> <PathWithFileName>..\src\keyboard_app.c</PathWithFileName> @@ -474,8 +474,8 @@ <Focus>0</Focus> <ColumnNumber>44</ColumnNumber> <tvExpOptDlg>0</tvExpOptDlg> - <TopLine>118</TopLine> - <CurrentLine>127</CurrentLine> + <TopLine>0</TopLine> + <CurrentLine>0</CurrentLine> <bDave2>0</bDave2> <PathWithFileName>..\src\mouse_app.c</PathWithFileName> <FilenameWithoutPath>mouse_app.c</FilenameWithoutPath> @@ -490,8 +490,8 @@ <Focus>0</Focus> <ColumnNumber>1</ColumnNumber> <tvExpOptDlg>0</tvExpOptDlg> - <TopLine>47</TopLine> - <CurrentLine>65</CurrentLine> + <TopLine>53</TopLine> + <CurrentLine>86</CurrentLine> <bDave2>0</bDave2> <PathWithFileName>..\src\rndis_app.c</PathWithFileName> <FilenameWithoutPath>rndis_app.c</FilenameWithoutPath> @@ -520,10 +520,10 @@ <FileType>1</FileType> <tvExp>0</tvExp> <Focus>0</Focus> - <ColumnNumber>18</ColumnNumber> + <ColumnNumber>33</ColumnNumber> <tvExpOptDlg>0</tvExpOptDlg> - <TopLine>8</TopLine> - <CurrentLine>11</CurrentLine> + <TopLine>73</TopLine> + <CurrentLine>77</CurrentLine> <bDave2>0</bDave2> <PathWithFileName>..\src\cli.c</PathWithFileName> <FilenameWithoutPath>cli.c</FilenameWithoutPath> @@ -562,8 +562,8 @@ <Focus>0</Focus> <ColumnNumber>78</ColumnNumber> <tvExpOptDlg>0</tvExpOptDlg> - <TopLine>27</TopLine> - <CurrentLine>31</CurrentLine> + <TopLine>0</TopLine> + <CurrentLine>0</CurrentLine> <bDave2>0</bDave2> <PathWithFileName>..\..\bsp\boards\embedded_artists\board_ea4357.c</PathWithFileName> <FilenameWithoutPath>board_ea4357.c</FilenameWithoutPath> @@ -578,7 +578,7 @@ <Focus>0</Focus> <ColumnNumber>44</ColumnNumber> <tvExpOptDlg>0</tvExpOptDlg> - <TopLine>64</TopLine> + <TopLine>82</TopLine> <CurrentLine>106</CurrentLine> <bDave2>0</bDave2> <PathWithFileName>..\..\bsp\boards\printf_retarget.c</PathWithFileName> @@ -714,8 +714,8 @@ <Focus>0</Focus> <ColumnNumber>64</ColumnNumber> <tvExpOptDlg>0</tvExpOptDlg> - <TopLine>23</TopLine> - <CurrentLine>33</CurrentLine> + <TopLine>0</TopLine> + <CurrentLine>0</CurrentLine> <bDave2>0</bDave2> <PathWithFileName>..\..\..\tinyusb\tusb.c</PathWithFileName> <FilenameWithoutPath>tusb.c</FilenameWithoutPath> @@ -760,10 +760,10 @@ <FileType>1</FileType> <tvExp>0</tvExp> <Focus>0</Focus> - <ColumnNumber>0</ColumnNumber> + <ColumnNumber>1</ColumnNumber> <tvExpOptDlg>0</tvExpOptDlg> - <TopLine>0</TopLine> - <CurrentLine>0</CurrentLine> + <TopLine>114</TopLine> + <CurrentLine>123</CurrentLine> <bDave2>0</bDave2> <PathWithFileName>..\..\..\tinyusb\host\hub.c</PathWithFileName> <FilenameWithoutPath>hub.c</FilenameWithoutPath> @@ -776,10 +776,10 @@ <FileType>1</FileType> <tvExp>0</tvExp> <Focus>0</Focus> - <ColumnNumber>61</ColumnNumber> + <ColumnNumber>0</ColumnNumber> <tvExpOptDlg>0</tvExpOptDlg> - <TopLine>430</TopLine> - <CurrentLine>518</CurrentLine> + <TopLine>337</TopLine> + <CurrentLine>338</CurrentLine> <bDave2>0</bDave2> <PathWithFileName>..\..\..\tinyusb\host\usbh.c</PathWithFileName> <FilenameWithoutPath>usbh.c</FilenameWithoutPath> @@ -794,8 +794,8 @@ <Focus>0</Focus> <ColumnNumber>0</ColumnNumber> <tvExpOptDlg>0</tvExpOptDlg> - <TopLine>2</TopLine> - <CurrentLine>5</CurrentLine> + <TopLine>411</TopLine> + <CurrentLine>419</CurrentLine> <bDave2>0</bDave2> <PathWithFileName>..\..\..\tinyusb\host\ehci\ehci.c</PathWithFileName> <FilenameWithoutPath>ehci.c</FilenameWithoutPath> @@ -938,8 +938,8 @@ <Focus>0</Focus> <ColumnNumber>0</ColumnNumber> <tvExpOptDlg>0</tvExpOptDlg> - <TopLine>1</TopLine> - <CurrentLine>12</CurrentLine> + <TopLine>0</TopLine> + <CurrentLine>0</CurrentLine> <bDave2>0</bDave2> <PathWithFileName>..\..\..\tinyusb\class\hid_host.c</PathWithFileName> <FilenameWithoutPath>hid_host.c</FilenameWithoutPath> @@ -952,10 +952,10 @@ <FileType>1</FileType> <tvExp>0</tvExp> <Focus>0</Focus> - <ColumnNumber>79</ColumnNumber> + <ColumnNumber>0</ColumnNumber> <tvExpOptDlg>0</tvExpOptDlg> - <TopLine>1</TopLine> - <CurrentLine>14</CurrentLine> + <TopLine>240</TopLine> + <CurrentLine>249</CurrentLine> <bDave2>0</bDave2> <PathWithFileName>..\..\..\tinyusb\class\msc_host.c</PathWithFileName> <FilenameWithoutPath>msc_host.c</FilenameWithoutPath> @@ -978,8 +978,8 @@ <Focus>0</Focus> <ColumnNumber>0</ColumnNumber> <tvExpOptDlg>0</tvExpOptDlg> - <TopLine>552</TopLine> - <CurrentLine>553</CurrentLine> + <TopLine>0</TopLine> + <CurrentLine>0</CurrentLine> <bDave2>0</bDave2> <PathWithFileName>..\..\bsp\lpc43xx\CMSIS_LPC43xx_DriverLib\src\lpc43xx_uart.c</PathWithFileName> <FilenameWithoutPath>lpc43xx_uart.c</FilenameWithoutPath> @@ -1024,10 +1024,10 @@ <FileType>1</FileType> <tvExp>0</tvExp> <Focus>0</Focus> - <ColumnNumber>64</ColumnNumber> + <ColumnNumber>3</ColumnNumber> <tvExpOptDlg>0</tvExpOptDlg> - <TopLine>553</TopLine> - <CurrentLine>579</CurrentLine> + <TopLine>572</TopLine> + <CurrentLine>580</CurrentLine> <bDave2>0</bDave2> <PathWithFileName>..\..\bsp\lpc43xx\CMSIS_LPC43xx_DriverLib\src\lpc43xx_cgu.c</PathWithFileName> <FilenameWithoutPath>lpc43xx_cgu.c</FilenameWithoutPath> @@ -1058,8 +1058,8 @@ <Focus>0</Focus> <ColumnNumber>7</ColumnNumber> <tvExpOptDlg>0</tvExpOptDlg> - <TopLine>777</TopLine> - <CurrentLine>782</CurrentLine> + <TopLine>0</TopLine> + <CurrentLine>0</CurrentLine> <bDave2>0</bDave2> <PathWithFileName>..\..\bsp\lpc43xx\CMSIS_LPC43xx_DriverLib\src\lpc43xx_i2c.c</PathWithFileName> <FilenameWithoutPath>lpc43xx_i2c.c</FilenameWithoutPath> @@ -1080,10 +1080,10 @@ <FileType>2</FileType> <tvExp>0</tvExp> <Focus>0</Focus> - <ColumnNumber>0</ColumnNumber> + <ColumnNumber>26</ColumnNumber> <tvExpOptDlg>0</tvExpOptDlg> - <TopLine>139</TopLine> - <CurrentLine>151</CurrentLine> + <TopLine>145</TopLine> + <CurrentLine>154</CurrentLine> <bDave2>0</bDave2> <PathWithFileName>..\..\bsp\lpc43xx\startup_keil\startup_LPC43xx.s</PathWithFileName> <FilenameWithoutPath>startup_LPC43xx.s</FilenameWithoutPath> @@ -1104,10 +1104,10 @@ <FileType>1</FileType> <tvExp>0</tvExp> <Focus>0</Focus> - <ColumnNumber>20</ColumnNumber> + <ColumnNumber>51</ColumnNumber> <tvExpOptDlg>0</tvExpOptDlg> - <TopLine>50</TopLine> - <CurrentLine>62</CurrentLine> + <TopLine>111</TopLine> + <CurrentLine>108</CurrentLine> <bDave2>0</bDave2> <PathWithFileName>..\..\..\vendor\fatfs\diskio.c</PathWithFileName> <FilenameWithoutPath>diskio.c</FilenameWithoutPath> @@ -1122,8 +1122,8 @@ <Focus>0</Focus> <ColumnNumber>0</ColumnNumber> <tvExpOptDlg>0</tvExpOptDlg> - <TopLine>1</TopLine> - <CurrentLine>1</CurrentLine> + <TopLine>0</TopLine> + <CurrentLine>0</CurrentLine> <bDave2>0</bDave2> <PathWithFileName>..\..\..\vendor\fatfs\ff.c</PathWithFileName> <FilenameWithoutPath>ff.c</FilenameWithoutPath> diff --git a/demos/host/src/msc_app.c b/demos/host/src/msc_app.c index 5c3881826..e5101cafa 100644 --- a/demos/host/src/msc_app.c +++ b/demos/host/src/msc_app.c @@ -85,11 +85,12 @@ void tusbh_msc_mounted_cb(uint8_t dev_addr) //------------- file system (only 1 LUN support) -------------// // DSTATUS stat = disk_initialize(0); - disk_state = 0; + uint8_t phy_disk = dev_addr-1; + disk_state[phy_disk] = 0; - if ( disk_is_ready(0) ) + if ( disk_is_ready(phy_disk) ) { - if ( f_mount(0, &fatfs[dev_addr-1]) != FR_OK ) // TODO multiple volume + if ( f_mount(phy_disk, &fatfs[phy_disk]) != FR_OK ) // TODO multiple volume { puts("mount failed"); return; @@ -102,7 +103,7 @@ void tusbh_msc_mounted_cb(uint8_t dev_addr) puts("- THE AUTHOR HAS NO RESPONSIBILITY WITH YOUR DEVICE NOR ITS DATA -"); puts("---------------------------------------------------------------------"); - f_chdrive(dev_addr-1); // change to newly mounted drive + f_chdrive(phy_disk); // change to newly mounted drive f_chdir("/"); // root as current dir cli_init(); @@ -112,7 +113,7 @@ void tusbh_msc_mounted_cb(uint8_t dev_addr) void tusbh_msc_unmounted_isr(uint8_t dev_addr) { // unmount disk - disk_state = STA_NOINIT; + disk_state[dev_addr-1] = STA_NOINIT; puts("--"); } @@ -136,7 +137,17 @@ OSAL_TASK_FUNCTION( msc_app_task ) (void* p_task_para) osal_task_delay(10); - if ( disk_is_ready(0) ) + bool is_any_disk_mounted = false; + for(uint8_t phy_disk=0; phy_disk < TUSB_CFG_HOST_DEVICE_MAX; phy_disk++) + { + if ( disk_is_ready(phy_disk) ) + { + is_any_disk_mounted = true; + break; + } + } + + if ( is_any_disk_mounted ) { int ch = getchar(); if ( ch > 0 ) diff --git a/demos/host/src/tusb_config.h b/demos/host/src/tusb_config.h index 711802fab..3b69dffad 100644 --- a/demos/host/src/tusb_config.h +++ b/demos/host/src/tusb_config.h @@ -65,14 +65,14 @@ //--------------------------------------------------------------------+ // HOST CONFIGURATION //--------------------------------------------------------------------+ -#define TUSB_CFG_HOST_DEVICE_MAX 1 +#define TUSB_CFG_HOST_DEVICE_MAX 3 #define TUSB_CFG_CONFIGURATION_MAX 1 //------------- USBD -------------// #define TUSB_CFG_HOST_ENUM_BUFFER_SIZE 255 //------------- CLASS -------------// -#define TUSB_CFG_HOST_HUB 0 +#define TUSB_CFG_HOST_HUB 1 #define TUSB_CFG_HOST_HID_KEYBOARD 1 #define TUSB_CFG_HOST_HID_MOUSE 1 #define TUSB_CFG_HOST_HID_GENERIC 0 |
