Clang-format PWM fix
This commit is contained in:
parent
486422c821
commit
bb0d40644a
1 changed files with 2 additions and 2 deletions
|
|
@ -54,8 +54,8 @@ bool ws_ledc::analogWrite(uint8_t pin, int value) {
|
|||
|
||||
// Calculate duty cycle for the `value` passed in
|
||||
// (assumes 12-bit resolution, 2^12)
|
||||
//uint32_t dutyCycle = (4095 / 255) * min(value, 255);
|
||||
uint32_t dutyCycle =(uint32_t)(((double)4095 / 255.0) * min((uint32_t)value, (uint32_t)255));
|
||||
uint32_t dutyCycle =
|
||||
(uint32_t)(((double)4095 / 255.0) * min((uint32_t)value, (uint32_t)255));
|
||||
|
||||
// Call duty cycle write
|
||||
return setDuty(pin, dutyCycle);
|
||||
|
|
|
|||
Loading…
Reference in a new issue