From 99e38c40be66e6e36d05580d80d1bcaf43f71ee6 Mon Sep 17 00:00:00 2001 From: Andrew <18502096+classicrocker883@users.noreply.github.com> Date: Mon, 15 May 2023 17:24:36 -0400 Subject: [PATCH] =?UTF-8?q?=F0=9F=A9=B9=20Ensure=20pin=5Fis=5Fprotected=20?= =?UTF-8?q?is=20defined=20(#25829)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Marlin/src/gcode/config/M43.cpp | 2 +- Marlin/src/gcode/control/M42.cpp | 3 ++- Marlin/src/pins/pinsDebug.h | 2 ++ 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/Marlin/src/gcode/config/M43.cpp b/Marlin/src/gcode/config/M43.cpp index 6bd78c68ff..91db87a1d2 100644 --- a/Marlin/src/gcode/config/M43.cpp +++ b/Marlin/src/gcode/config/M43.cpp @@ -25,7 +25,7 @@ #if ENABLED(PINS_DEBUGGING) #include "../gcode.h" -#include "../../MarlinCore.h" // for pin_is_protected +#include "../../MarlinCore.h" // for pin_is_protected, wait_for_user #include "../../pins/pinsDebug.h" #include "../../module/endstops.h" diff --git a/Marlin/src/gcode/control/M42.cpp b/Marlin/src/gcode/control/M42.cpp index cf2c218e92..6e75ffd4e7 100644 --- a/Marlin/src/gcode/control/M42.cpp +++ b/Marlin/src/gcode/control/M42.cpp @@ -25,7 +25,6 @@ #if ENABLED(DIRECT_PIN_CONTROL) #include "../gcode.h" -#include "../../MarlinCore.h" // for pin_is_protected #if HAS_FAN #include "../../module/temperature.h" @@ -38,6 +37,8 @@ #define OUTPUT_OPEN_DRAIN OUTPUT_OPEN_DRAIN #endif +bool pin_is_protected(const pin_t pin); + void protected_pin_err() { SERIAL_ERROR_MSG(STR_ERR_PROTECTED_PIN); } diff --git a/Marlin/src/pins/pinsDebug.h b/Marlin/src/pins/pinsDebug.h index cce3799981..3219b1b7a2 100644 --- a/Marlin/src/pins/pinsDebug.h +++ b/Marlin/src/pins/pinsDebug.h @@ -174,6 +174,8 @@ const PinInfo pin_array[] PROGMEM = { #define M43_NEVER_TOUCH(Q) false #endif +bool pin_is_protected(const pin_t pin); + static void print_input_or_output(const bool isout) { SERIAL_ECHOF(isout ? F("Output ") : F("Input ")); }