fixed mode changes (greater than/lesser than), removed unused flameEnabled check

This commit is contained in:
kiu 2011-08-03 00:35:02 +02:00
parent 5a19b970bb
commit 222f491205
1 changed files with 8 additions and 7 deletions

View File

@ -64,8 +64,9 @@ 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();
@ -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;
} }