Browse Source

preparation for hibernation

If a print is stopped, it would be nice in the future to write a file with the printer state, the filename of the print, and the position within the print.
this file could be read, to continue a previously stopped print.
not finished yet.
bkubicek 11 years ago
parent
commit
39d88bcccb
2 changed files with 11 additions and 2 deletions
  1. 10
    1
      Marlin/cardreader.cpp
  2. 1
    1
      Marlin/cardreader.h

+ 10
- 1
Marlin/cardreader.cpp View File

@@ -535,12 +535,21 @@ void CardReader::checkautostart(bool force)
535 535
     lastnr++;
536 536
 }
537 537
 
538
-void CardReader::closefile()
538
+void CardReader::closefile(bool store_location)
539 539
 {
540 540
   file.sync();
541 541
   file.close();
542 542
   saving = false; 
543 543
   logging = false;
544
+  
545
+  if(store_location)
546
+  {
547
+    //future: store printer state, filename and position for continueing a stoped print
548
+    // so one can unplug the printer and continue printing the next day.
549
+    
550
+  }
551
+
552
+  
544 553
 }
545 554
 
546 555
 void CardReader::getfilename(const uint8_t nr)

+ 1
- 1
Marlin/cardreader.h View File

@@ -21,7 +21,7 @@ public:
21 21
   void openFile(char* name,bool read,bool replace_current=true);
22 22
   void openLogFile(char* name);
23 23
   void removeFile(char* name);
24
-  void closefile();
24
+  void closefile(bool store_location=false);
25 25
   void release();
26 26
   void startFileprint();
27 27
   void pauseSDPrint();

Loading…
Cancel
Save