made prepare->autostart independent of current folder.

This commit is contained in:
Bernhard 2012-03-19 20:24:40 +01:00
parent 1532200435
commit 0183e6332a

View File

@ -95,9 +95,11 @@ void CardReader::lsDive(const char *prepend,SdFile parent)
if ( p.name[1] != '.') if ( p.name[1] != '.')
continue; continue;
} }
if (!DIR_IS_FILE_OR_SUBDIR(&p)) continue; if (!DIR_IS_FILE_OR_SUBDIR(&p)) continue;
filenameIsDir=DIR_IS_SUBDIR(&p); filenameIsDir=DIR_IS_SUBDIR(&p);
if(!filenameIsDir) if(!filenameIsDir)
{ {
if(p.name[8]!='G') continue; if(p.name[8]!='G') continue;
@ -163,20 +165,26 @@ void CardReader::initsd()
SERIAL_ECHO_START; SERIAL_ECHO_START;
SERIAL_ECHOLNPGM(MSG_SD_CARD_OK); SERIAL_ECHOLNPGM(MSG_SD_CARD_OK);
} }
workDir=root;
curDir=&root; curDir=&root;
/*
if(!workDir.openRoot(&volume)) if(!workDir.openRoot(&volume))
{ {
SERIAL_ECHOLNPGM(MSG_SD_WORKDIR_FAIL); SERIAL_ECHOLNPGM(MSG_SD_WORKDIR_FAIL);
} }
*/
} }
void CardReader::setroot() void CardReader::setroot()
{ {
curDir=&root; /*if(!workDir.openRoot(&volume))
if(!workDir.openRoot(&volume))
{ {
SERIAL_ECHOLNPGM(MSG_SD_WORKDIR_FAIL); SERIAL_ECHOLNPGM(MSG_SD_WORKDIR_FAIL);
} }*/
workDir=root;
curDir=&workDir;
} }
void CardReader::release() void CardReader::release()
{ {