Skip to content
Snippets Groups Projects
Commit dc6fa04f authored by InsanityAutomation's avatar InsanityAutomation Committed by Scott Lahteine
Browse files

Fix single nozzle temp change, do slower extra prime (#14696)

parent e5aa4532
Branches
Tags
No related merge requests found
...@@ -44,10 +44,10 @@ ...@@ -44,10 +44,10 @@
void GcodeSuite::M900() { void GcodeSuite::M900() {
#if EXTRUDERS < 2 #if EXTRUDERS < 2
constexpr uint8_t tmp_extruder = 0; constexpr uint8_t tool_index = 0;
#else #else
const uint8_t tmp_extruder = parser.intval('T', active_extruder); const uint8_t tool_index = parser.intval('T', active_extruder);
if (tmp_extruder >= EXTRUDERS) { if (tool_index >= EXTRUDERS) {
SERIAL_ECHOLNPGM("?T value out of range."); SERIAL_ECHOLNPGM("?T value out of range.");
return; return;
} }
...@@ -55,17 +55,17 @@ void GcodeSuite::M900() { ...@@ -55,17 +55,17 @@ void GcodeSuite::M900() {
#if ENABLED(EXTRA_LIN_ADVANCE_K) #if ENABLED(EXTRA_LIN_ADVANCE_K)
bool ext_slot = TEST(lin_adv_slot, tmp_extruder); bool ext_slot = TEST(lin_adv_slot, tool_index);
if (parser.seenval('S')) { if (parser.seenval('S')) {
const bool slot = parser.value_bool(); const bool slot = parser.value_bool();
if (ext_slot != slot) { if (ext_slot != slot) {
ext_slot = slot; ext_slot = slot;
SET_BIT_TO(lin_adv_slot, tmp_extruder, slot); SET_BIT_TO(lin_adv_slot, tool_index, slot);
planner.synchronize(); planner.synchronize();
const float temp = planner.extruder_advance_K[tmp_extruder]; const float temp = planner.extruder_advance_K[tool_index];
planner.extruder_advance_K[tmp_extruder] = saved_extruder_advance_K[tmp_extruder]; planner.extruder_advance_K[tool_index] = saved_extruder_advance_K[tool_index];
saved_extruder_advance_K[tmp_extruder] = temp; saved_extruder_advance_K[tool_index] = temp;
} }
} }
...@@ -73,10 +73,10 @@ void GcodeSuite::M900() { ...@@ -73,10 +73,10 @@ void GcodeSuite::M900() {
const float newK = parser.value_float(); const float newK = parser.value_float();
if (WITHIN(newK, 0, 10)) { if (WITHIN(newK, 0, 10)) {
if (ext_slot) if (ext_slot)
saved_extruder_advance_K[tmp_extruder] = newK; saved_extruder_advance_K[tool_index] = newK;
else { else {
planner.synchronize(); planner.synchronize();
planner.extruder_advance_K[tmp_extruder] = newK; planner.extruder_advance_K[tool_index] = newK;
} }
} }
else else
...@@ -87,10 +87,10 @@ void GcodeSuite::M900() { ...@@ -87,10 +87,10 @@ void GcodeSuite::M900() {
const float newL = parser.value_float(); const float newL = parser.value_float();
if (WITHIN(newL, 0, 10)) { if (WITHIN(newL, 0, 10)) {
if (!ext_slot) if (!ext_slot)
saved_extruder_advance_K[tmp_extruder] = newL; saved_extruder_advance_K[tool_index] = newL;
else { else {
planner.synchronize(); planner.synchronize();
planner.extruder_advance_K[tmp_extruder] = newL; planner.extruder_advance_K[tool_index] = newL;
} }
} }
else else
...@@ -117,7 +117,7 @@ void GcodeSuite::M900() { ...@@ -117,7 +117,7 @@ void GcodeSuite::M900() {
const float newK = parser.value_float(); const float newK = parser.value_float();
if (WITHIN(newK, 0, 10)) { if (WITHIN(newK, 0, 10)) {
planner.synchronize(); planner.synchronize();
planner.extruder_advance_K[tmp_extruder] = newK; planner.extruder_advance_K[tool_index] = newK;
} }
else else
SERIAL_ECHOLNPGM("?K value out of range (0-10)."); SERIAL_ECHOLNPGM("?K value out of range (0-10).");
... ...
......
This diff is collapsed.
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment