Fade would fail when the difference between start and target would be too small (#19246)

This commit is contained in:
s-hadinger 2023-08-02 17:48:12 +02:00 committed by GitHub
parent 58fce33312
commit df50a56c25
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 1 deletions

View File

@ -23,6 +23,7 @@ All notable changes to this project will be documented in this file.
### Fixed ### Fixed
- Initial battery level percentage (#19160) - Initial battery level percentage (#19160)
- Berry SK6812_GRBW crash (#19166) - Berry SK6812_GRBW crash (#19166)
- Fade would fail when the difference between start and target would be too small
### Removed ### Removed

View File

@ -2080,7 +2080,7 @@ bool LightApplyFade(void) { // did the value chanegd and needs to be applied
Light.fade_duration = LightGetSpeedSetting() * 500; Light.fade_duration = LightGetSpeedSetting() * 500;
Light.speed_once_enabled = false; // The once off speed value has been read, reset it Light.speed_once_enabled = false; // The once off speed value has been read, reset it
if (!Settings->flag5.fade_fixed_duration) { if (!Settings->flag5.fade_fixed_duration) {
Light.fade_duration = (distance * Light.fade_duration) / 1023; // time is proportional to distance, except with SO117 Light.fade_duration = (distance * Light.fade_duration) / 1023 + 1 /* make sure value is not zero */; // time is proportional to distance, except with SO117
} }
if (Settings->save_data) { if (Settings->save_data) {
// Also postpone the save_data for the duration of the Fade (in seconds) // Also postpone the save_data for the duration of the Fade (in seconds)