|
|
@ -34,14 +34,19 @@
|
|
|
|
* K<factor> Set advance K factor
|
|
|
|
* K<factor> Set advance K factor
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
void GcodeSuite::M900() {
|
|
|
|
void GcodeSuite::M900() {
|
|
|
|
|
|
|
|
if (parser.seenval('K')) {
|
|
|
|
|
|
|
|
const float newK = parser.floatval('K');
|
|
|
|
|
|
|
|
if (WITHIN(newK, 0, 10)) {
|
|
|
|
stepper.synchronize();
|
|
|
|
stepper.synchronize();
|
|
|
|
|
|
|
|
planner.extruder_advance_K = newK;
|
|
|
|
const float newK = parser.floatval('K', -1);
|
|
|
|
}
|
|
|
|
if (newK >= 0) planner.extruder_advance_K = newK;
|
|
|
|
else
|
|
|
|
|
|
|
|
SERIAL_PROTOCOLLNPGM("?K value out of range (0-10).");
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
else {
|
|
|
|
SERIAL_ECHO_START();
|
|
|
|
SERIAL_ECHO_START();
|
|
|
|
SERIAL_ECHOPAIR("Advance K=", planner.extruder_advance_K);
|
|
|
|
SERIAL_ECHOLNPAIR("Advance K=", planner.extruder_advance_K);
|
|
|
|
SERIAL_EOL();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
#endif // LIN_ADVANCE
|
|
|
|
#endif // LIN_ADVANCE
|
|
|
|