From 0183e6332a11547641d2029a7df435ab83db924b Mon Sep 17 00:00:00 2001 From: Bernhard Date: Mon, 19 Mar 2012 20:24:40 +0100 Subject: [PATCH] made prepare->autostart independent of current folder. --- Marlin/cardreader.cpp | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/Marlin/cardreader.cpp b/Marlin/cardreader.cpp index c3ee3e212..222632f55 100644 --- a/Marlin/cardreader.cpp +++ b/Marlin/cardreader.cpp @@ -95,9 +95,11 @@ void CardReader::lsDive(const char *prepend,SdFile parent) if ( p.name[1] != '.') continue; } + if (!DIR_IS_FILE_OR_SUBDIR(&p)) continue; filenameIsDir=DIR_IS_SUBDIR(&p); + if(!filenameIsDir) { if(p.name[8]!='G') continue; @@ -163,20 +165,26 @@ void CardReader::initsd() SERIAL_ECHO_START; SERIAL_ECHOLNPGM(MSG_SD_CARD_OK); } + workDir=root; curDir=&root; + /* if(!workDir.openRoot(&volume)) { SERIAL_ECHOLNPGM(MSG_SD_WORKDIR_FAIL); } + */ + } void CardReader::setroot() { - curDir=&root; - if(!workDir.openRoot(&volume)) + /*if(!workDir.openRoot(&volume)) { SERIAL_ECHOLNPGM(MSG_SD_WORKDIR_FAIL); - } + }*/ + workDir=root; + + curDir=&workDir; } void CardReader::release() {