HELD_TMR_PERIODS = 1, /* Held timer fires every 32.768 msec */
HELD_PERIODS = 16, /* Held this long before held events fire */
COLOR_COUNT = 12,
- COLOR_CANDLE = 0, /* Color index for white */
+ COLOR_CANDLE = 0, /* Color index for the candle color */
COLOR_WHITE = 11, /* Color index for white */
BRIGHT_TOP = 100, /* Bright ramps up to top ... */
BRIGHT_BOTTOM = -5, /* ... then down to bottom */
signed char b;
/* Use correct brightness value, then constrain it */
- if (mode == MODE_SOLID && color == COLOR_CANDLE)
+ if (mode != MODE_PARTY && color != COLOR_WHITE)
b = cbright;
else
b = bright;
wht.value += wht.remainder;
tmr_stop(TMR_CANDLE);
tmr_stop(TMR_FADE);
- if (mode == MODE_CYCLE)
- tmr_start(TMR_INCOLOR, STD_INCOLOR);
- else if (mode == MODE_PARTY)
+ if (mode == MODE_PARTY)
tmr_start(TMR_INCOLOR, PARTY_MIN + (lfsr_get() % PARTY_RANGE));
- else if (mode == MODE_SOLID && color == COLOR_CANDLE) {
- cbright = bright - CBRIGHT_VARIANCE / 2;
- tmr_startPeriodic(TMR_CANDLE, 1);
+ else {
+ if (mode == MODE_CYCLE)
+ tmr_start(TMR_INCOLOR, STD_INCOLOR);
+ if (color != COLOR_WHITE) {
+ cbright = bright - CBRIGHT_VARIANCE / 2;
+ tmr_startPeriodic(TMR_CANDLE, 1);
+ }
}
}
leds_set();