Use changeUIntScale when scaling brightness

This commit is contained in:
Erik 2021-05-10 20:35:04 +02:00 committed by Yves De Muyter
parent c0a1ad7393
commit 0c33ec1772
1 changed files with 2 additions and 2 deletions

View File

@ -1269,8 +1269,8 @@ void LightSetBriScaled(uint8_t bri) {
bri_rgb = bri;
bri_ct = bri;
} else {
bri_rgb = bri * bri_rgb / max_bri;
bri_ct = bri * bri_ct / max_bri;
bri_rgb = changeUIntScale(bri_rgb, 0, max_bri, 0, bri);
bri_ct = changeUIntScale(bri_ct, 0, max_bri, 0, bri);
}
#ifdef DEBUG_LIGHT
AddLog(LOG_LEVEL_DEBUG, "LightSetBri new bri_rgb:%d, new bri_ct: %d", bri_rgb, bri_ct);