enhance cd command

This commit is contained in:
hathach 2013-10-01 16:36:52 +07:00
parent 18b3179bc6
commit fffd613897
2 changed files with 18 additions and 18 deletions

View File

@ -492,7 +492,7 @@
<Focus>0</Focus>
<ColumnNumber>25</ColumnNumber>
<tvExpOptDlg>0</tvExpOptDlg>
<TopLine>153</TopLine>
<TopLine>154</TopLine>
<CurrentLine>160</CurrentLine>
<bDave2>0</bDave2>
<PathWithFileName>..\src\main.c</PathWithFileName>
@ -844,7 +844,7 @@
<Focus>0</Focus>
<ColumnNumber>21</ColumnNumber>
<tvExpOptDlg>0</tvExpOptDlg>
<TopLine>2</TopLine>
<TopLine>3</TopLine>
<CurrentLine>8</CurrentLine>
<bDave2>0</bDave2>
<PathWithFileName>..\..\..\tinyusb\host\usbh.c</PathWithFileName>
@ -1092,7 +1092,7 @@
<Focus>0</Focus>
<ColumnNumber>3</ColumnNumber>
<tvExpOptDlg>0</tvExpOptDlg>
<TopLine>574</TopLine>
<TopLine>575</TopLine>
<CurrentLine>580</CurrentLine>
<bDave2>0</bDave2>
<PathWithFileName>..\..\bsp\lpc43xx\CMSIS_LPC43xx_DriverLib\src\lpc43xx_cgu.c</PathWithFileName>
@ -1148,7 +1148,7 @@
<Focus>0</Focus>
<ColumnNumber>10</ColumnNumber>
<tvExpOptDlg>0</tvExpOptDlg>
<TopLine>145</TopLine>
<TopLine>146</TopLine>
<CurrentLine>147</CurrentLine>
<bDave2>0</bDave2>
<PathWithFileName>..\..\bsp\lpc43xx\startup_keil\startup_LPC43xx.s</PathWithFileName>
@ -1172,7 +1172,7 @@
<Focus>0</Focus>
<ColumnNumber>23</ColumnNumber>
<tvExpOptDlg>0</tvExpOptDlg>
<TopLine>107</TopLine>
<TopLine>108</TopLine>
<CurrentLine>113</CurrentLine>
<bDave2>0</bDave2>
<PathWithFileName>..\..\..\vendor\fatfs\diskio.c</PathWithFileName>
@ -1186,10 +1186,10 @@
<FileType>1</FileType>
<tvExp>0</tvExp>
<Focus>0</Focus>
<ColumnNumber>66</ColumnNumber>
<ColumnNumber>32</ColumnNumber>
<tvExpOptDlg>0</tvExpOptDlg>
<TopLine>2021</TopLine>
<CurrentLine>2037</CurrentLine>
<TopLine>2029</TopLine>
<CurrentLine>2043</CurrentLine>
<bDave2>0</bDave2>
<PathWithFileName>..\..\..\vendor\fatfs\ff.c</PathWithFileName>
<FilenameWithoutPath>ff.c</FilenameWithoutPath>

View File

@ -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;