⚗️ Use pwm_set_duty over analogWrite to set PWM (#23048)
Co-authored-by: Scott Lahteine <thinkyhead@users.noreply.github.com>
This commit is contained in:
@ -126,10 +126,10 @@ void GcodeSuite::M42() {
|
||||
extDigitalWrite(pin, pin_status);
|
||||
|
||||
#ifdef ARDUINO_ARCH_STM32
|
||||
// A simple I/O will be set to 0 by analogWrite()
|
||||
// A simple I/O will be set to 0 by set_pwm_duty()
|
||||
if (pin_status <= 1 && !PWM_PIN(pin)) return;
|
||||
#endif
|
||||
analogWrite(pin, pin_status);
|
||||
set_pwm_duty(pin, pin_status);
|
||||
}
|
||||
|
||||
#endif // DIRECT_PIN_CONTROL
|
||||
|
Reference in New Issue
Block a user