diff --git a/demos/host/host_os_none/host_os_none.uvopt b/demos/host/host_os_none/host_os_none.uvopt
index 89f85a6cf..937f1c345 100644
--- a/demos/host/host_os_none/host_os_none.uvopt
+++ b/demos/host/host_os_none/host_os_none.uvopt
@@ -492,7 +492,7 @@
0
25
0
- 153
+ 154
160
0
..\src\main.c
@@ -844,7 +844,7 @@
0
21
0
- 2
+ 3
8
0
..\..\..\tinyusb\host\usbh.c
@@ -1092,7 +1092,7 @@
0
3
0
- 574
+ 575
580
0
..\..\bsp\lpc43xx\CMSIS_LPC43xx_DriverLib\src\lpc43xx_cgu.c
@@ -1148,7 +1148,7 @@
0
10
0
- 145
+ 146
147
0
..\..\bsp\lpc43xx\startup_keil\startup_LPC43xx.s
@@ -1172,7 +1172,7 @@
0
23
0
- 107
+ 108
113
0
..\..\..\vendor\fatfs\diskio.c
@@ -1186,10 +1186,10 @@
1
0
0
- 66
+ 32
0
- 2021
- 2037
+ 2029
+ 2043
0
..\..\..\vendor\fatfs\ff.c
ff.c
diff --git a/demos/host/src/cli.c b/demos/host/src/cli.c
index 31ecbbdf0..8eca90e70 100644
--- a/demos/host/src/cli.c
+++ b/demos/host/src/cli.c
@@ -313,17 +313,17 @@ cli_error_t cli_cmd_changedir(char * p_para)
{
if ( strlen(p_para) == 0 ) return CLI_ERROR_INVALID_PARA;
- if ( (p_para[1] == ':') && (strlen(p_para) == 2) )
- { // change drive
- p_para[0] -= 'E';
- if ( ! ( disk_is_ready(p_para[0]) && FR_OK == f_chdrive(p_para[0]) )) return CLI_ERROR_INVALID_PARA;
- f_getlabel(NULL, volume_label, NULL);
- }else
+ drive_letter2number(p_para);
+
+ if ( FR_OK != f_chdir(p_para) )
{
- if ( FR_OK != f_chdir(p_para) )
- {
- return CLI_ERROR_INVALID_PATH;
- }
+ return CLI_ERROR_INVALID_PATH;
+ }
+
+ if ( p_para[1] == ':')
+ { // path has drive letter --> change drive, update volume label
+ f_chdrive(p_para[0] - '0');
+ f_getlabel(NULL, volume_label, NULL);
}
return CLI_ERROR_NONE;