Added an option to make init.g on SD run on boot.
This commit is contained in:
parent
67199da509
commit
f201ccb55b
2 changed files with 13 additions and 2 deletions
|
|
@ -49,6 +49,8 @@ const bool Z_ENDSTOP_INVERT = false;
|
||||||
|
|
||||||
// Comment out (using // at the start of the line) to disable SD support:
|
// Comment out (using // at the start of the line) to disable SD support:
|
||||||
#define SDSUPPORT
|
#define SDSUPPORT
|
||||||
|
// Uncomment to make Sprinter run init.g from SD on boot
|
||||||
|
//#define SDINITFILE
|
||||||
|
|
||||||
|
|
||||||
//// ADVANCED SETTINGS - to tweak parameters
|
//// ADVANCED SETTINGS - to tweak parameters
|
||||||
|
|
|
||||||
|
|
@ -176,8 +176,17 @@ unsigned long stepper_inactive_time = 0;
|
||||||
Serial.println("volume.init failed");
|
Serial.println("volume.init failed");
|
||||||
else if (!root.openRoot(&volume))
|
else if (!root.openRoot(&volume))
|
||||||
Serial.println("openRoot failed");
|
Serial.println("openRoot failed");
|
||||||
else
|
else{
|
||||||
sdactive = true;
|
sdactive = true;
|
||||||
|
#ifdef SDINITFILE
|
||||||
|
file.close();
|
||||||
|
if(file.open(&root, "init.g", O_READ)){
|
||||||
|
sdpos = 0;
|
||||||
|
filesize = file.fileSize();
|
||||||
|
sdmode = true;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
}
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue