Merge pull request #7579 from s-hadinger/fix_rgbwwtable

Fix ``RGBWWTable`` ignored (#7572)
This commit is contained in:
Theo Arends 2020-01-22 22:05:02 +01:00 committed by GitHub
commit 4a44b9fc5f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 9 additions and 0 deletions

View File

@ -9,6 +9,7 @@
- Add most SetOptions as defines to my_user_config.h
- Add SoftwareSerial to CSE7766 driver allowing different GPIOs (#7563)
- Add optional parameter <startcolor> to command ``Scheme <scheme>, <startcolor>`` to control initial start color
- Fix ``RGBWWTable`` ignored (#7572)
### 8.1.0.3 20200106

View File

@ -1799,6 +1799,14 @@ void LightAnimate(void)
}
}
// Apply RGBWWTable only if Settings.rgbwwTable[4] != 0
if (0 != Settings.rgbwwTable[4]) {
for (uint32_t i = 0; i<Light.subtype; i++) {
uint32_t adjust = change8to10(Settings.rgbwwTable[i]);
cur_col_10[i] = changeUIntScale(cur_col_10[i], 0, 1023, 0, adjust);
}
}
// final adjusments for PMW, post-gamma correction
for (uint32_t i = 0; i < LST_MAX; i++) {
// scale from 0..1023 to 0..pwm_range, but keep any non-zero value to at least 1