Added an option to make init.g on SD run on boot.

This commit is contained in:
Nathan Zadoks 2011-12-04 13:03:20 +01:00
parent 67199da509
commit f201ccb55b
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
}