Merge pull request #4036 from thinkyhead/rc_lin_advance_feature
Parse M905 args in Marlin_main.cpp
This commit is contained in:
commit
fc4fb9eba1
3 changed files with 4 additions and 4 deletions
|
@ -6491,7 +6491,7 @@ inline void gcode_M503() {
|
||||||
*/
|
*/
|
||||||
inline void gcode_M905() {
|
inline void gcode_M905() {
|
||||||
stepper.synchronize();
|
stepper.synchronize();
|
||||||
stepper.advance_M905();
|
stepper.advance_M905(code_seen('K') ? code_value_float() : -1.0);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
|
@ -1123,8 +1123,8 @@ void Stepper::microstep_readings() {
|
||||||
|
|
||||||
#if ENABLED(LIN_ADVANCE)
|
#if ENABLED(LIN_ADVANCE)
|
||||||
|
|
||||||
void Stepper::advance_M905() {
|
void Stepper::advance_M905(const float &k) {
|
||||||
if (code_seen('K')) extruder_advance_k = code_value_float();
|
if (k >= 0) extruder_advance_k = k;
|
||||||
SERIAL_ECHO_START;
|
SERIAL_ECHO_START;
|
||||||
SERIAL_ECHOPAIR("Advance factor: ", extruder_advance_k);
|
SERIAL_ECHOPAIR("Advance factor: ", extruder_advance_k);
|
||||||
SERIAL_EOL;
|
SERIAL_EOL;
|
||||||
|
|
|
@ -256,7 +256,7 @@ class Stepper {
|
||||||
}
|
}
|
||||||
|
|
||||||
#if ENABLED(LIN_ADVANCE)
|
#if ENABLED(LIN_ADVANCE)
|
||||||
void advance_M905();
|
void advance_M905(const float &k);
|
||||||
FORCE_INLINE int get_advance_k() { return extruder_advance_k; }
|
FORCE_INLINE int get_advance_k() { return extruder_advance_k; }
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
Reference in a new issue