Skip to content

Commit c9fa680

Browse files
committed
🐛 Fix Anycubic / Trigorilla pins, etc. (MarlinFirmware#24971)
1 parent 379d388 commit c9fa680

File tree

9 files changed

+606
-540
lines changed

9 files changed

+606
-540
lines changed

Marlin/src/feature/powerloss.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -153,6 +153,9 @@ class PrintJobRecovery {
153153
static void prepare();
154154

155155
static void setup() {
156+
#if PIN_EXISTS(OUTAGECON)
157+
OUT_WRITE(OUTAGECON_PIN, HIGH);
158+
#endif
156159
#if PIN_EXISTS(POWER_LOSS)
157160
#if ENABLED(POWER_LOSS_PULLUP)
158161
SET_INPUT_PULLUP(POWER_LOSS_PIN);

Marlin/src/gcode/config/M43.cpp

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -313,9 +313,16 @@ void GcodeSuite::M43() {
313313

314314
// 'P' Get the range of pins to test or watch
315315
uint8_t first_pin = PARSED_PIN_INDEX('P', 0),
316-
last_pin = parser.seenval('P') ? first_pin : (NUMBER_PINS_TOTAL) - 1;
316+
last_pin = parser.seenval('L') ? PARSED_PIN_INDEX('L', 0) : parser.seenval('P') ? first_pin : (NUMBER_PINS_TOTAL) - 1;
317317

318-
if (first_pin > last_pin) return;
318+
NOMORE(first_pin, (NUMBER_PINS_TOTAL) - 1);
319+
NOMORE(last_pin, (NUMBER_PINS_TOTAL) - 1);
320+
321+
if (first_pin > last_pin) {
322+
const uint8_t f = first_pin;
323+
first_pin = last_pin;
324+
last_pin = f;
325+
}
319326

320327
// 'I' to ignore protected pins
321328
const bool ignore_protection = parser.boolval('I');

Marlin/src/gcode/feature/advance/M900.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ void GcodeSuite::M900() {
5050

5151
#if EXTRUDERS < 2
5252
constexpr uint8_t tool_index = 0;
53+
UNUSED(tool_index);
5354
#else
5455
const uint8_t tool_index = parser.intval('T', active_extruder);
5556
if (tool_index >= EXTRUDERS) {

0 commit comments

Comments
 (0)