diff options
Diffstat (limited to 'Sprinter')
-rw-r--r-- | Sprinter/Configuration.h | 2 | ||||
-rw-r--r-- | Sprinter/Sprinter.pde | 13 |
2 files changed, 13 insertions, 2 deletions
diff --git a/Sprinter/Configuration.h b/Sprinter/Configuration.h index df52a08..d594094 100644 --- a/Sprinter/Configuration.h +++ b/Sprinter/Configuration.h @@ -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 diff --git a/Sprinter/Sprinter.pde b/Sprinter/Sprinter.pde index 657efed..e3126b8 100644 --- a/Sprinter/Sprinter.pde +++ b/Sprinter/Sprinter.pde @@ -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 } |