remove config-override fil ebefore appending to it
authorJim Morris <morris@wolfman.com>
Wed, 21 Jan 2015 03:51:55 +0000 (19:51 -0800)
committerJim Morris <morris@wolfman.com>
Wed, 21 Jan 2015 03:51:55 +0000 (19:51 -0800)
src/modules/communication/GcodeDispatch.cpp
src/modules/tools/zprobe/ZProbe.cpp
src/modules/utils/simpleshell/SimpleShell.cpp

index c398b8c..b2f8f43 100644 (file)
@@ -178,6 +178,7 @@ try_again:
 
                             case 500: // M500 save volatile settings to config-override
                                 THEKERNEL->conveyor->wait_for_empty_queue(); //just to be safe as it can take a while to run
+                                remove(THEKERNEL->config_override_filename());
                                 // replace stream with one that writes to config-override file
                                 gcode->stream = new AppendFileStream(THEKERNEL->config_override_filename());
                                 // dispatch the M500 here so we can free up the stream when done
index 1e4fe92..faf6413 100644 (file)
@@ -181,7 +181,7 @@ bool ZProbe::run_probe(int& steps, bool fast)
         STEPPER[Y_AXIS]->move(true, maxz * STEPS_PER_MM(Y_AXIS), 0);
     }
 
-    // start acceration processing
+    // start acceleration processing
     this->running = true;
 
     bool r = wait_for_probe(steps);
index f8aeb11..a6a4b9c 100644 (file)
@@ -445,6 +445,7 @@ void SimpleShell::save_command( string parameters, StreamOutput *stream )
         filename = THEKERNEL->config_override_filename();
     }
 
+    remove(filename.c_str());
     // replace stream with one that writes to config-override file
     AppendFileStream *gs = new AppendFileStream(filename.c_str());
     // if(!gs->is_open()) {