fixed 1bit mode duty (#7079)

This commit is contained in:
Jan Procházka 2022-08-08 17:26:41 +02:00 committed by GitHub
parent 236e8f31ee
commit 285e898604
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -89,7 +89,7 @@ void ledcWrite(uint8_t chan, uint32_t duty)
//Fixing if all bits in resolution is set = LEDC FULL ON //Fixing if all bits in resolution is set = LEDC FULL ON
uint32_t max_duty = (1 << channels_resolution[chan]) - 1; uint32_t max_duty = (1 << channels_resolution[chan]) - 1;
if(duty == max_duty){ if((duty == max_duty) && (max_duty != 1)){
duty = max_duty + 1; duty = max_duty + 1;
} }