Skip to content

Commit

Permalink
preparation for hibernation
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
bkubicek committed Oct 22, 2013
1 parent ab96537 commit 39d88bc
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
11 changes: 10 additions & 1 deletion Marlin/cardreader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -535,12 +535,21 @@ void CardReader::checkautostart(bool force)
lastnr++;
}

void CardReader::closefile()
void CardReader::closefile(bool store_location)
{
file.sync();
file.close();
saving = false;
logging = false;

if(store_location)
{
//future: store printer state, filename and position for continueing a stoped print
// so one can unplug the printer and continue printing the next day.

}


}

void CardReader::getfilename(const uint8_t nr)
Expand Down
2 changes: 1 addition & 1 deletion Marlin/cardreader.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ class CardReader
void openFile(char* name,bool read,bool replace_current=true);
void openLogFile(char* name);
void removeFile(char* name);
void closefile();
void closefile(bool store_location=false);
void release();
void startFileprint();
void pauseSDPrint();
Expand Down

0 comments on commit 39d88bc

Please sign in to comment.