Skip to content
This repository has been archived by the owner on Feb 4, 2023. It is now read-only.

Commit

Permalink
Work around M303 E-2 issue by rewriting E-1 to E-2 automatically
Browse files Browse the repository at this point in the history
  • Loading branch information
matthewlloyd committed Jul 4, 2021
1 parent 6bc86d4 commit 12840af
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion lib/Marlin/Marlin/src/gcode/temperature/M303.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ void GcodeSuite::M303() {
#else
#define EI H_BED
#endif
const heater_ind_t e = (heater_ind_t)parser.intval('E');
heater_ind_t e = (heater_ind_t)parser.intval('E');
if (!WITHIN(e, SI, EI)) {
SERIAL_ECHOLNPGM(MSG_PID_BAD_EXTRUDER_NUM);
return;
Expand All @@ -60,6 +60,10 @@ void GcodeSuite::M303() {
KEEPALIVE_STATE(NOT_BUSY);
#endif

// Llama: work around https://github.com/prusa3d/Prusa-Firmware-Buddy/issues/798
if (e == -1)
e = (heater_ind_t) -2;

thermalManager.PID_autotune(temp, e, c, u);
}

Expand Down

0 comments on commit 12840af

Please sign in to comment.