From 105fd73c2868132ae687d5fd6b6102a0fc235e3c Mon Sep 17 00:00:00 2001 From: Tanguy Pruvot Date: Thu, 2 Sep 2021 01:45:17 +0200 Subject: [PATCH] =?UTF-8?q?=F0=9F=A9=B9=20Allow=20M42=20S0/1=20analogWrite?= =?UTF-8?q?=20on=20PWM=20pins=20(STM32)=20(#22631)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Marlin/src/gcode/control/M42.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Marlin/src/gcode/control/M42.cpp b/Marlin/src/gcode/control/M42.cpp index 908260ed25..eead971a01 100644 --- a/Marlin/src/gcode/control/M42.cpp +++ b/Marlin/src/gcode/control/M42.cpp @@ -127,7 +127,7 @@ void GcodeSuite::M42() { #ifdef ARDUINO_ARCH_STM32 // A simple I/O will be set to 0 by analogWrite() - if (pin_status <= 1) return; + if (pin_status <= 1 && !PWM_PIN(pin)) return; #endif analogWrite(pin, pin_status); }