Merge pull request #123 from FrozenFire/master

Allow running a specifically-named file from SD on startup if found.
This commit is contained in:
kliment 2011-12-05 01:48:36 -08:00
commit 2550e6c566
2 changed files with 13 additions and 2 deletions

View file

@ -49,6 +49,8 @@ const bool Z_ENDSTOP_INVERT = false;
// Comment out (using // at the start of the line) to disable SD support:
#define SDSUPPORT
// Uncomment to make Sprinter run init.g from SD on boot
//#define SDINITFILE
//// ADVANCED SETTINGS - to tweak parameters

View file

@ -176,8 +176,17 @@ unsigned long stepper_inactive_time = 0;
Serial.println("volume.init failed");
else if (!root.openRoot(&volume))
Serial.println("openRoot failed");
else
sdactive = true;
else{
sdactive = true;
#ifdef SDINITFILE
file.close();
if(file.open(&root, "init.g", O_READ)){
sdpos = 0;
filesize = file.fileSize();
sdmode = true;
}
#endif
}
#endif
}