Skip to content

Commit 9a9d55c

Browse files
authored
🩹 Allow M42 S0/1 analogWrite on PWM pins (STM32) (#22631)
1 parent 01d1192 commit 9a9d55c

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Marlin/src/gcode/control/M42.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ void GcodeSuite::M42() {
127127

128128
#ifdef ARDUINO_ARCH_STM32
129129
// A simple I/O will be set to 0 by analogWrite()
130-
if (pin_status <= 1) return;
130+
if (pin_status <= 1 && !PWM_PIN(pin)) return;
131131
#endif
132132
analogWrite(pin, pin_status);
133133
}

0 commit comments

Comments
 (0)