Merge pull request #11786 from barbudor/esp32_pwm_full

Demo of PWM 100% problem on ESP32 (for discussion)
This commit is contained in:
Theo Arends 2021-04-20 08:42:23 +02:00 committed by GitHub
commit 33dcbb4363
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -89,6 +89,7 @@ inline void analogAttach(uint32_t pin, uint32_t channel) {
inline void analogWrite(uint8_t pin, int val)
{
uint32_t channel = _analog_pin2chan(pin);
if ( val >> (_pwm_bit_num-1) ) ++val;
ledcWrite(channel + PWM_CHANNEL_OFFSET, val);
// Serial.printf("write %d - %d\n",channel,val);
}