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
     lastnr++;
535
     lastnr++;
536
 }
536
 }
537
 
537
 
538
-void CardReader::closefile()
538
+void CardReader::closefile(bool store_location)
539
 {
539
 {
540
   file.sync();
540
   file.sync();
541
   file.close();
541
   file.close();
542
   saving = false; 
542
   saving = false; 
543
   logging = false;
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
 void CardReader::getfilename(const uint8_t nr)
555
 void CardReader::getfilename(const uint8_t nr)

+ 1
- 1
Marlin/cardreader.h View File

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

Loading…
Cancel
Save