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