minor performance fixups for program 4

This commit is contained in:
true 2024-08-03 11:39:07 -07:00
parent 5d722f41e8
commit 8fb1368e0a
1 changed files with 12 additions and 8 deletions

View File

@ -408,12 +408,12 @@ void led_rgb_4_typing(uint8_t preview, uint8_t tick)
if ((i < typing_idx) || ((i == typing_idx) && typing_flash_state)) {
// these are on
rgb[i][j] = typing[color][j];
}
} else
if (i > typing_idx) { // || ((i == typing_idx) && !typing_flash_state)) {
// these are idle
rgb[i][j] = idle_glow[j];
}
} else
// flashing cursor fadeout
if ((i == typing_idx) && !typing_flash_state) {
@ -443,12 +443,16 @@ void led_rgb_4_typing(uint8_t preview, uint8_t tick)
if (typing_fadeout >= 3) typing_fadeout--;
else typing_fadeout = 0;
for (i = 0; i < 9; i++) {
for (j = 0; j < 3; j++) {
s = rgb[i][j];
s *= typing_fadeout;
rgb[i][j] = s >> 8;
}
for (j = 0; j < 3; j++) {
s = rgb[0][j];
s *= typing_fadeout;
rgb[0][j] = s >> 8;
}
for (i = 1; i < 9; i++) {
rgb[i][0] = rgb[0][0];
rgb[i][1] = rgb[0][1];
rgb[i][2] = rgb[0][2];
}
s = cursor[color];