Use changeUIntScale when scaling brightness

This commit is contained in:
Erik 2021-05-10 20:35:04 +02:00
parent f148221d19
commit 47d1e6f78b
1 changed files with 2 additions and 2 deletions

View File

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