⚗️ 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:
Andrei M
2021-11-02 01:47:16 -04:00
committed by Scott Lahteine
parent b033da1782
commit 0d91b07797
26 changed files with 159 additions and 126 deletions

View File

@ -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