Bladeren bron

Change openFile default to "not-push" instead of "do-replace"

Scott Lahteine 9 jaren geleden
bovenliggende
commit
27d70599d4
3 gewijzigde bestanden met toevoegingen van 4 en 4 verwijderingen
  1. 1
    1
      Marlin/Marlin_main.cpp
  2. 2
    2
      Marlin/cardreader.cpp
  3. 1
    1
      Marlin/cardreader.h

+ 1
- 1
Marlin/Marlin_main.cpp Bestand weergeven

@@ -3704,7 +3704,7 @@ inline void gcode_M31() {
3704 3704
     bool call_procedure = code_seen('P') && (seen_pointer < namestartpos);
3705 3705
 
3706 3706
     if (card.cardOK) {
3707
-      card.openFile(namestartpos, true, !call_procedure);
3707
+      card.openFile(namestartpos, true, call_procedure);
3708 3708
 
3709 3709
       if (code_seen('S') && seen_pointer < namestartpos) // "S" (must occur _before_ the filename!)
3710 3710
         card.setIndex(code_value_short());

+ 2
- 2
Marlin/cardreader.cpp Bestand weergeven

@@ -300,10 +300,10 @@ void CardReader::getAbsFilename(char *t) {
300 300
     t[0] = 0;
301 301
 }
302 302
 
303
-void CardReader::openFile(char* name, bool read, bool replace_current/*=true*/) {
303
+void CardReader::openFile(char* name, bool read, bool push_current/*=false*/) {
304 304
   if (!cardOK) return;
305 305
   if (file.isOpen()) { //replacing current file by new file, or subfile call
306
-    if (!replace_current) {
306
+    if (push_current) {
307 307
       if (file_subcall_ctr > SD_PROCEDURE_DEPTH - 1) {
308 308
         SERIAL_ERROR_START;
309 309
         SERIAL_ERRORPGM("trying to call sub-gcode files with too many levels. MAX level is:");

+ 1
- 1
Marlin/cardreader.h Bestand weergeven

@@ -40,7 +40,7 @@ public:
40 40
   //this is to delay autostart and hence the initialisaiton of the sd card to some seconds after the normal init, so the device is available quick after a reset
41 41
 
42 42
   void checkautostart(bool x);
43
-  void openFile(char* name,bool read,bool replace_current=true);
43
+  void openFile(char* name, bool read, bool push_current=false);
44 44
   void openLogFile(char* name);
45 45
   void removeFile(char* name);
46 46
   void closefile(bool store_location=false);

Laden…
Annuleren
Opslaan