Browse Source

Parse M905 args in Marlin_main.cpp

Scott Lahteine 8 years ago
parent
commit
8d8180e028
3 changed files with 4 additions and 4 deletions
  1. 1
    1
      Marlin/Marlin_main.cpp
  2. 2
    2
      Marlin/stepper.cpp
  3. 1
    1
      Marlin/stepper.h

+ 1
- 1
Marlin/Marlin_main.cpp View File

6491
    */
6491
    */
6492
   inline void gcode_M905() {
6492
   inline void gcode_M905() {
6493
     stepper.synchronize();
6493
     stepper.synchronize();
6494
-    stepper.advance_M905();
6494
+    stepper.advance_M905(code_seen('K') ? code_value_float() : -1.0);
6495
   }
6495
   }
6496
 #endif
6496
 #endif
6497
 
6497
 

+ 2
- 2
Marlin/stepper.cpp View File

1123
 
1123
 
1124
 #if ENABLED(LIN_ADVANCE)
1124
 #if ENABLED(LIN_ADVANCE)
1125
 
1125
 
1126
-  void Stepper::advance_M905() {
1127
-    if (code_seen('K')) extruder_advance_k = code_value_float();
1126
+  void Stepper::advance_M905(const float &k) {
1127
+    if (k >= 0) extruder_advance_k = k;
1128
     SERIAL_ECHO_START;
1128
     SERIAL_ECHO_START;
1129
     SERIAL_ECHOPAIR("Advance factor: ", extruder_advance_k);
1129
     SERIAL_ECHOPAIR("Advance factor: ", extruder_advance_k);
1130
     SERIAL_EOL;
1130
     SERIAL_EOL;

+ 1
- 1
Marlin/stepper.h View File

256
     }
256
     }
257
 
257
 
258
     #if ENABLED(LIN_ADVANCE)
258
     #if ENABLED(LIN_ADVANCE)
259
-      void advance_M905();
259
+      void advance_M905(const float &k);
260
       FORCE_INLINE int get_advance_k() { return extruder_advance_k; }
260
       FORCE_INLINE int get_advance_k() { return extruder_advance_k; }
261
     #endif
261
     #endif
262
 
262
 

Loading…
Cancel
Save