program 2 works in preview mode
This commit is contained in:
parent
196a2b8301
commit
184c466c3b
|
@ -281,11 +281,20 @@ void led_rgb_2_twinkle(uint8_t preview, uint8_t tick)
|
|||
uint32_t rnd;
|
||||
uint8_t sat;
|
||||
|
||||
uint8_t show;
|
||||
|
||||
// set
|
||||
if ((tick & 3) == 0) {
|
||||
rnd = prng_get8();
|
||||
if (preview && (preview & 0xf) != 2) {
|
||||
// possibly increase chances to flash for top icon
|
||||
rnd >>= 2;
|
||||
}
|
||||
|
||||
if (rnd < userconf.ledprog_setting[2][1]) {
|
||||
// yup, we're doing it
|
||||
show = 1;
|
||||
|
||||
rnd = prng_get16();
|
||||
rnd *= 1536;
|
||||
rnd >>= 16;
|
||||
|
@ -299,6 +308,15 @@ void led_rgb_2_twinkle(uint8_t preview, uint8_t tick)
|
|||
rnd = prng_get16() & 0xfff;
|
||||
rnd /= 455;
|
||||
|
||||
if (preview) {
|
||||
show = 0;
|
||||
if (rnd == 2) show = 1;
|
||||
else if (((preview & 0xf) == 2) && (rnd >= 5)) {
|
||||
show = 1;
|
||||
}
|
||||
}
|
||||
|
||||
if (show) {
|
||||
rgb[rnd][0] = prog_rgb[0];
|
||||
rgb[rnd][1] = prog_rgb[1];
|
||||
rgb[rnd][2] = prog_rgb[2];
|
||||
|
@ -306,10 +324,22 @@ void led_rgb_2_twinkle(uint8_t preview, uint8_t tick)
|
|||
}
|
||||
}
|
||||
|
||||
// decay
|
||||
|
||||
for (i = 0; i < 9; i++) {
|
||||
twinkle_set[i]--;
|
||||
for (j = 0; j < 2; j++) {
|
||||
show = 1;
|
||||
|
||||
// kinda bad but no fucking time to finish this code
|
||||
if (preview) {
|
||||
show = 0;
|
||||
if (i == 2) show = 1;
|
||||
else if (((preview & 0xf) == 2) && (i >= 5)) {
|
||||
show = 1;
|
||||
}
|
||||
}
|
||||
|
||||
if (show) {
|
||||
if (twinkle_set[i]) twinkle_set[i]--;
|
||||
for (j = 0; j < 3; j++) {
|
||||
if (twinkle_set[i]) rgb[i][j]--;
|
||||
else rgb[i][j] >>= 1;
|
||||
}
|
||||
|
@ -317,6 +347,8 @@ void led_rgb_2_twinkle(uint8_t preview, uint8_t tick)
|
|||
|
||||
led_is_updated();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* alternates flashing the words between two colors.
|
||||
|
|
Loading…
Reference in New Issue