Fixed brightness for leds

This commit is contained in:
PS 2021-04-26 14:46:07 -10:00
parent 9ebadc543b
commit 965ca7c891
2 changed files with 11 additions and 20 deletions

View File

@ -566,16 +566,6 @@ BlumenLumen_CustomUpdate(gs_data UserData, app_state* State, context* Context)
{
temp_packet Temp = Packet.TempPacket;
BLState->LastTemperatureReceived = Temp.Temperature;
if (Blumen_TempShouldDimLeds(BLState))
{
BLState->BrightnessPercent = HighTemperatureBrightnessPercent;
}
else
{
BLState->BrightnessPercent = FullBrightnessPercent;
}
DEBUG_ReceivedTemperature(Temp, Context->ThreadContext);
BLState->ShouldUpdateLog = true;
}break;
@ -751,15 +741,16 @@ BlumenLumen_CustomUpdate(gs_data UserData, app_state* State, context* Context)
LedOnTimesCount,
&RangeIn))
{
// If we're in one of the specified time ranges,
// play animations and set brightness
//
// The values of BrightnessPercent and TimelineShouldAdvance
// are set according to less strict rules above in this update
// function. All we are doing is saying "If we are in a valid
// time range, keep those values".
OverrideBrightness = BLState->BrightnessPercent;
TimelineShouldAdvance = State->AnimationSystem.TimelineShouldAdvance;
if (Blumen_TempShouldDimLeds(BLState))
{
OverrideBrightness = HighTemperatureBrightnessPercent;
}
else
{
OverrideBrightness = FullBrightnessPercent;
}
TimelineShouldAdvance = true;
}
State->AnimationSystem.TimelineShouldAdvance = TimelineShouldAdvance;

View File

@ -151,7 +151,7 @@ SystemTimeIsAfterTime(system_time SysTime, s32 Hour, s32 Minute)
{
bool Result = false;
if (SysTime.Hour == Hour) {
Result = SysTime.Minute > Minute;
Result = SysTime.Minute >= Minute;
} else {
Result = SysTime.Hour > Hour;
}