fixed mode changes (greater than/lesser than), removed unused flameEnabled check
This commit is contained in:
parent
5a19b970bb
commit
222f491205
|
@ -64,8 +64,9 @@ void setFlamePWM() {
|
|||
void tick_flame(void) { // every 10ms
|
||||
static char night=0;
|
||||
|
||||
if(!flameEnabled)
|
||||
if (!flameEnabled) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (night != isNight()) {
|
||||
night = isNight();
|
||||
|
@ -86,7 +87,7 @@ void tick_flame(void) { // every 10ms
|
|||
}
|
||||
|
||||
if (flameMode == FLAME_OFF) {
|
||||
if (isNight() && flameEnabled) {
|
||||
if (isNight()) {
|
||||
flameTicks = 0;
|
||||
flameMode = FLAME_UP;
|
||||
}
|
||||
|
@ -99,7 +100,7 @@ void tick_flame(void) { // every 10ms
|
|||
flameI2Cpwm = 0xFF;
|
||||
}
|
||||
push_queue(&setFlamePWM);
|
||||
if (flameI2Cpwm == flameBrightnessMax) {
|
||||
if (flameI2Cpwm => flameBrightnessMax) {
|
||||
flameMode = FLAME_UP_WAIT;
|
||||
flameTicks = 0;
|
||||
}
|
||||
|
@ -118,7 +119,7 @@ void tick_flame(void) { // every 10ms
|
|||
flameI2Cpwm = 0x00;
|
||||
}
|
||||
push_queue(&setFlamePWM);
|
||||
if (flameI2Cpwm == flameBrightnessMin) {
|
||||
if (flameI2Cpwm <= flameBrightnessMin) {
|
||||
flameMode = FLAME_DOWN_WAIT;
|
||||
flameTicks = 0;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue