Browse Source

🩹 Allow M42 S0/1 analogWrite on PWM pins (STM32) (#22631)

Tanguy Pruvot 3 years ago
parent
commit
9a9d55ceb0
No account linked to committer's email address
1 changed files with 1 additions and 1 deletions
  1. 1
    1
      Marlin/src/gcode/control/M42.cpp

+ 1
- 1
Marlin/src/gcode/control/M42.cpp View File

127
 
127
 
128
   #ifdef ARDUINO_ARCH_STM32
128
   #ifdef ARDUINO_ARCH_STM32
129
     // A simple I/O will be set to 0 by analogWrite()
129
     // 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;
131
   #endif
131
   #endif
132
   analogWrite(pin, pin_status);
132
   analogWrite(pin, pin_status);
133
 }
133
 }

Loading…
Cancel
Save