Allow full power PWM

This commit is contained in:
Stephan Hadinger 2019-05-02 23:08:31 +02:00
parent ae3d7e0122
commit bdd522c7d2
2 changed files with 6 additions and 1 deletions

View File

@ -191,6 +191,11 @@ extern void __analogWrite(uint8_t pin, int value)
prep_pwm_steps();
return;
}
if(value == pwm_range) {
digitalWrite(pin, HIGH);
prep_pwm_steps();
return;
}
if((pwm_mask & (1 << pin)) == 0) {
if(pwm_mask == 0) {
memset(&_pwm_isr_data, 0, sizeof(_pwm_isr_data));

View File

@ -1640,7 +1640,7 @@ void LightAnimate(void)
if (light_type < LT_PWM6) { // only for direct PWM lights, not for Tuya, Armtronix...
for (uint8_t i = 0; i < light_subtype; i++) {
if (pin[GPIO_PWM1 +i] < 99) {
if ((cur_col_10bits[i] > 1008) && (cur_col_10bits[i] < 1023) {
if ((cur_col_10bits[i] > 1008) && (cur_col_10bits[i] < 1023)) {
cur_col_10bits[i] = 1008; // Fix unwanted blinking and PWM watchdog errors for values close to pwm_range (H801, Arilux and BN-SZ01)
// if (cur_col_10bits[i] > 0xFC*4) {
// cur_col_10bits[i] = 0xFC*4; // Fix unwanted blinking and PWM watchdog errors for values close to pwm_range (H801, Arilux and BN-SZ01)