Update xdrv_04_light.ino

This commit is contained in:
stefanbode 2020-07-07 16:19:26 +02:00 committed by GitHub
parent f2e686ab26
commit debd2b7562
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -2185,10 +2185,12 @@ void LightSetOutputs(const uint16_t *cur_col_10) {
if (!isChannelCT(i)) { // if CT don't use pwm_min and pwm_max if (!isChannelCT(i)) { // if CT don't use pwm_min and pwm_max
cur_col = cur_col > 0 ? changeUIntScale(cur_col, 0, Settings.pwm_range, Light.pwm_min, Light.pwm_max) : 0; // shrink to the range of pwm_min..pwm_max cur_col = cur_col > 0 ? changeUIntScale(cur_col, 0, Settings.pwm_range, Light.pwm_min, Light.pwm_max) : 0; // shrink to the range of pwm_min..pwm_max
} }
if (!Settings.flag4.zerocross_dimmer) {
analogWrite(Pin(GPIO_PWM1, i), bitRead(pwm_inverted, i) ? Settings.pwm_range - cur_col : cur_col); analogWrite(Pin(GPIO_PWM1, i), bitRead(pwm_inverted, i) ? Settings.pwm_range - cur_col : cur_col);
} }
} }
} }
}
// char msg[24]; // char msg[24];
// AddLog_P2(LOG_LEVEL_DEBUG, PSTR("LGT: Channels %s"), ToHex_P((const unsigned char *)cur_col_10, 10, msg, sizeof(msg))); // AddLog_P2(LOG_LEVEL_DEBUG, PSTR("LGT: Channels %s"), ToHex_P((const unsigned char *)cur_col_10, 10, msg, sizeof(msg)));