ESP8266_new_pwm
ESP8266_new_pwm copied to clipboard
Fix conversion when COMPAT_MODE is set
The conversion was just backwards. In COMPAT_MODE, period value of 1000 corresponds to 1kHz, while, without COMPAT_MODE, 5000 corresponds to the same period. So when SDK_PWM_PERIOD_COMPAT_MODE is set, period should be multiplied by 5. For the same reason, duty needs to be divided by 5.