diff options
author | lokher <lokher@gmail.com> | 2022-09-13 11:24:05 +0800 |
---|---|---|
committer | lokher <lokher@gmail.com> | 2022-09-13 11:24:05 +0800 |
commit | 9581289745736ce068a1040f44cec37a2ca8830d (patch) | |
tree | 24f644715a5fd6cc4d804d9604fb094307808b1b /keyboards/terrazzo/terrazzo_effects | |
parent | fe13cedf8c09fa34d5cec4e4c624738095176625 (diff) |
Remove non-Keychron keyboards
Diffstat (limited to 'keyboards/terrazzo/terrazzo_effects')
-rw-r--r-- | keyboards/terrazzo/terrazzo_effects/dino.h | 162 | ||||
-rw-r--r-- | keyboards/terrazzo/terrazzo_effects/dot.h | 27 | ||||
-rw-r--r-- | keyboards/terrazzo/terrazzo_effects/heart.h | 99 | ||||
-rw-r--r-- | keyboards/terrazzo/terrazzo_effects/outrun.h | 127 | ||||
-rw-r--r-- | keyboards/terrazzo/terrazzo_effects/pac_dude.h | 67 | ||||
-rw-r--r-- | keyboards/terrazzo/terrazzo_effects/stripes.h | 35 | ||||
-rw-r--r-- | keyboards/terrazzo/terrazzo_effects/terrazzo_effects.inc | 7 | ||||
-rw-r--r-- | keyboards/terrazzo/terrazzo_effects/wpm_chart.h | 111 |
8 files changed, 0 insertions, 635 deletions
diff --git a/keyboards/terrazzo/terrazzo_effects/dino.h b/keyboards/terrazzo/terrazzo_effects/dino.h deleted file mode 100644 index 18c629f414..0000000000 --- a/keyboards/terrazzo/terrazzo_effects/dino.h +++ /dev/null @@ -1,162 +0,0 @@ -/* Copyright 2020 ademey "MsMustard" - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. - */ - -#ifndef DISABLE_TERRAZZO_EFFECT_DINO -TERRAZZO_EFFECT(DINO) -# ifdef TERRAZZO_EFFECT_IMPLS - -static uint8_t dino_frames[2][56] = { -{ - 0, 0, 0, 9, 9, 9, 9, - 0, 0, 0, 9, 0, 9, 9, - 9, 0, 0, 9, 9, 9, 9, - 9, 9, 9, 9, 9, 0, 0, - 9, 9, 9, 9, 9, 0, 0, - 0, 9, 9, 9, 0, 0, 0, - 0, 9, 0, 9, 9, 0, 0, - 0, 9, 9, 0, 0, 0, 0 -}, -{ - 0, 0, 0, 9, 9, 9, 9, - 0, 0, 0, 9, 0, 9, 9, - 9, 0, 0, 9, 9, 9, 9, - 9, 9, 9, 9, 9, 0, 0, - 9, 9, 9, 9, 9, 0, 0, - 0, 9, 9, 9, 0, 0, 0, - 0, 9, 0, 9, 0, 0, 0, - 0, 0, 0, 9, 9, 0, 0 -} -}; - -static uint8_t dino_reverse[2][56] = { -{ - 9, 9, 9, 9, 0, 0, 0, - 9, 9, 0, 9, 0, 0, 0, - 9, 9, 9, 9, 0, 0, 9, - 0, 0, 9, 9, 9, 9, 9, - 0, 0, 9, 9, 9, 9, 9, - 0, 0, 0, 9, 9, 9, 0, - 0, 0, 9, 9, 0, 9, 0, - 0, 0, 0, 0, 9, 9, 0 -}, -{ - 9, 9, 9, 9, 0, 0, 0, - 9, 9, 0, 9, 0, 0, 0, - 9, 9, 9, 9, 0, 0, 9, - 0, 0, 9, 9, 9, 9, 9, - 0, 0, 9, 9, 9, 9, 9, - 0, 0, 0, 9, 9, 9, 0, - 0, 0, 0, 9, 0, 9, 0, - 0, 0, 9, 9, 0, 0, 0 -} -}; - -static uint8_t dino_bg[10][42] = { -{ - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 4, 0, - 0, 0, 0, 0, 0, 4, 0, - 0, 1, 1, 0, 0, 0, 4, - 1, 0, 0, 1, 1, 1, 1, - 0, 0, 0, 0, 0, 0, 0 -}, -{ - 0, 0, 0, 0, 0, 0, 4, - 0, 0, 0, 0, 4, 0, 4, - 0, 0, 0, 0, 4, 0, 4, - 1, 1, 0, 0, 0, 4, 4, - 0, 0, 1, 1, 1, 1, 4, - 0, 0, 0, 0, 0, 0, 4 -}, -{ - 0, 0, 0, 0, 0, 4, 0, - 0, 0, 0, 4, 0, 4, 0, - 0, 0, 0, 4, 0, 4, 4, - 1, 0, 0, 0, 4, 4, 0, - 0, 1, 1, 1, 1, 4, 0, - 0, 0, 0, 0, 0, 4, 0 -}, -{ - 0, 0, 0, 0, 4, 0, 0, - 0, 0, 4, 0, 4, 0, 4, - 0, 0, 4, 0, 4, 4, 4, - 0, 0, 0, 4, 4, 0, 0, - 1, 1, 1, 1, 4, 1, 1, - 0, 0, 0, 0, 4, 0, 0 -}, -{ - 0, 0, 0, 4, 0, 0, 0, - 0, 4, 0, 4, 0, 4, 0, - 0, 4, 0, 4, 4, 4, 0, - 0, 0, 4, 4, 0, 0, 0, - 1, 1, 1, 4, 1, 1, 1, - 0, 0, 0, 4, 0, 0, 0 -}, -{ - 0, 0, 4, 0, 0, 0, 0, - 4, 0, 4, 0, 4, 0, 0, - 4, 0, 4, 4, 4, 0, 0, - 0, 4, 4, 0, 0, 0, 1, - 1, 1, 4, 1, 1, 1, 0, - 0, 0, 4, 0, 0, 0, 0 -}, -{ - 0, 4, 0, 0, 0, 0, 0, - 0, 4, 0, 4, 0, 0, 0, - 0, 4, 4, 4, 0, 0, 0, - 4, 4, 0, 0, 0, 1, 1, - 1, 4, 1, 1, 1, 0, 0, - 0, 4, 0, 0, 0, 0, 0 -}, -{ - 4, 0, 0, 0, 0, 0, 0, - 4, 0, 4, 0, 0, 0, 0, - 4, 4, 4, 0, 0, 0, 0, - 4, 0, 0, 0, 1, 1, 0, - 4, 1, 1, 1, 0, 0, 1, - 4, 0, 0, 0, 0, 0, 0 -}, -{ - 0, 0, 0, 0, 0, 0, 0, - 0, 4, 0, 0, 0, 0, 0, - 4, 4, 0, 0, 0, 0, 0, - 0, 0, 0, 1, 1, 0, 0, - 1, 1, 1, 0, 0, 1, 1, - 0, 0, 0, 0, 0, 0, 0 -}, -{ - 0, 0, 0, 0, 0, 0, 0, - 4, 0, 0, 0, 0, 0, 4, - 4, 0, 0, 0, 0, 0, 4, - 0, 0, 1, 1, 0, 0, 0, - 1, 1, 0, 0, 1, 1, 1, - 0, 0, 0, 0, 0, 0, 0 -} -}; - -void DINO(uint8_t i, bool dir) { - led_matrix_set_value_all(0); - if (dir) { - terrazzo_draw_at(0, 7, 7, 8, dino_frames[i % 2]); - } else { - terrazzo_draw_at(0, 7, 7, 8, dino_reverse[i % 2]); - - } - terrazzo_draw_at(0, 0, 7, 6, dino_bg[i % 10]); -} - -# endif -#endif
\ No newline at end of file diff --git a/keyboards/terrazzo/terrazzo_effects/dot.h b/keyboards/terrazzo/terrazzo_effects/dot.h deleted file mode 100644 index 07c4621c26..0000000000 --- a/keyboards/terrazzo/terrazzo_effects/dot.h +++ /dev/null @@ -1,27 +0,0 @@ -/* Copyright 2020 ademey "MsMustard" - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. - */ - -#ifndef DISABLE_TERRAZZO_EFFECT_DOT -TERRAZZO_EFFECT(DOT) -# ifdef TERRAZZO_EFFECT_IMPLS -// Animation for debugging. Lights one pixel according to animation index -void DOT(uint8_t i, bool dir) { - led_matrix_set_value_all(0); - led_matrix_set_value(i, 10); -} - -# endif -#endif
\ No newline at end of file diff --git a/keyboards/terrazzo/terrazzo_effects/heart.h b/keyboards/terrazzo/terrazzo_effects/heart.h deleted file mode 100644 index bfbd6acc38..0000000000 --- a/keyboards/terrazzo/terrazzo_effects/heart.h +++ /dev/null @@ -1,99 +0,0 @@ -/* Copyright 2020 ademey "MsMustard" - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. - */ - -#ifndef DISABLE_TERRAZZO_EFFECT_HEART -TERRAZZO_EFFECT(HEART) -# ifdef TERRAZZO_EFFECT_IMPLS - -static uint8_t heart_frames[4][105] = { -{ - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 5, 5, 0, 5, 5, 0, - 5, 0, 0, 5, 0, 0, 5, - 5, 0, 0, 0, 0, 0, 5, - 0, 5, 0, 0, 0, 5, 0, - 0, 0, 5, 0, 5, 0, 0, - 0, 0, 0, 5, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0 -}, -{ - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 5, 5, 0, 5, 5, 0, - 5, 5, 5, 5, 5, 5, 5, - 5, 5, 5, 5, 5, 5, 5, - 0, 5, 5, 5, 5, 5, 0, - 0, 0, 5, 5, 5, 0, 0, - 0, 0, 0, 5, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0 -}, -{ - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 1, 1, 0, 1, 1, 0, - 1, 0, 0, 5, 0, 0, 1, - 0, 5, 5, 0, 5, 5, 0, - 5, 5, 5, 5, 5, 5, 5, - 5, 5, 5, 5, 5, 5, 5, - 0, 5, 5, 5, 5, 5, 0, - 0, 0, 5, 5, 5, 0, 0, - 1, 0, 0, 5, 0, 0, 1, - 0, 1, 0, 0, 0, 1, 0, - 0, 0, 1, 0, 1, 0, 0, - 0, 0, 0, 1, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0 -}, -{ - 0, 1, 1, 0, 1, 1, 0, - 1, 0, 0, 1, 0, 0, 1, - 0, 5, 5, 0, 5, 5, 0, - 5, 0, 0, 5, 0, 0, 5, - 0, 5, 5, 0, 5, 5, 0, - 5, 5, 5, 5, 5, 5, 5, - 5, 5, 5, 5, 5, 5, 5, - 0, 5, 5, 5, 5, 5, 0, - 0, 0, 5, 5, 5, 0, 0, - 5, 0, 0, 5, 0, 0, 5, - 0, 5, 0, 0, 0, 5, 0, - 1, 0, 5, 0, 5, 0, 1, - 0, 1, 0, 5, 0, 1, 0, - 0, 0, 1, 0, 1, 0, 0, - 0, 0, 0, 1, 0, 0, 0 -} -}; - - -void HEART(uint8_t i, bool dir) { - led_matrix_set_value_all(0); - terrazzo_draw_at(0, 0, 7, 15, heart_frames[i % 4]); -} - -# endif -#endif
\ No newline at end of file diff --git a/keyboards/terrazzo/terrazzo_effects/outrun.h b/keyboards/terrazzo/terrazzo_effects/outrun.h deleted file mode 100644 index 127e714b2f..0000000000 --- a/keyboards/terrazzo/terrazzo_effects/outrun.h +++ /dev/null @@ -1,127 +0,0 @@ -/* Copyright 2020 ademey "MsMustard" - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. - */ - -#ifndef DISABLE_TERRAZZO_EFFECT_OUTRUN -TERRAZZO_EFFECT(OUTRUN) -# ifdef TERRAZZO_EFFECT_IMPLS - -static uint8_t outrun_sun[25] = { - 0, 9, 9, 9, 0, - 7, 7, 7, 7, 7, - 4, 4, 4, 4, 4, - 2, 2, 2, 2, 2, - 0, 1, 1, 1, 0 -}; - -static uint8_t outrun_ground[63] = { - 0, 0, 1, 1, 1, 0, 0, - 0, 2, 0, 2, 0, 2, 0, - 0, 2, 0, 2, 0, 2, 0, - 0, 2, 0, 4, 0, 2, 0, - 2, 0, 0, 5, 0, 0, 2, - 2, 0, 0, 5, 0, 0, 2, - 2, 0, 0, 6, 0, 0, 2, - 0, 0, 0, 7, 0, 0, 0, - 0, 0, 0, 8, 0, 0, 0 -}; - -static uint8_t outrun_rows[4][63] = { -{ - 1, 1, 1, 1, 1, 1, 1, - 0, 0, 0, 0, 0, 0, 0, - 2, 2, 2, 2, 2, 2, 2, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 4, 4, 4, 4, 4, 4, 4, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0 -}, -{ - 0, 0, 0, 0, 0, 0, 0, - 1, 1, 1, 1, 1, 1, 1, - 0, 0, 0, 0, 0, 0, 0, - 2, 2, 2, 2, 2, 2, 2, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 4, 4, 4, 4, 4, 4, 4, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0 -}, -{ - 1, 1, 1, 1, 1, 1, 1, - 0, 0, 0, 0, 0, 0, 0, - 2, 2, 2, 2, 2, 2, 2, - 0, 0, 0, 0, 0, 0, 0, - 4, 4, 4, 4, 4, 4, 4, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 9, 9, 9, 9, 9, 9, 9, - 0, 0, 0, 0, 0, 0, 0 -}, -{ - 0, 0, 0, 0, 0, 0, 0, - 1, 1, 1, 1, 1, 1, 1, - 0, 0, 0, 0, 0, 0, 0, - 2, 2, 2, 2, 2, 2, 2, - 0, 0, 0, 0, 0, 0, 0, - 4, 4, 4, 4, 4, 4, 4, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 9, 9, 9, 9, 9, 9, 9 -} -}; - -bool last_dir; -uint8_t change_index = 0; - -void OUTRUN(uint8_t i, bool dir) { - led_matrix_set_value_all(0); - - if(dir != last_dir) { - change_index = i; - } - - uint8_t change_diff = abs(i - change_index); - uint8_t horz_bright = 9; - - if(change_diff < 4) { - if (dir) { - terrazzo_draw_at(1, 4 - change_diff, 5, 1 + change_diff, outrun_sun); - horz_bright = 3 + change_diff; - } else { - terrazzo_draw_at(1, 0 + change_diff, 5, 5 - change_diff, outrun_sun); - horz_bright = 5 - change_diff; - } - } else { - if (dir) { - terrazzo_draw_at(1, 0, 5, 5, outrun_sun); - } else { - horz_bright = 1; - } - } - - for(int x = 0; x < 7; x++){ - terrazzo_set_pixel(x, 5, horz_bright); - } - // Sun is larger but render the top 3 rows only - terrazzo_draw_at(0, 6, 7, 10, outrun_ground); - terrazzo_draw_at(0, 6, 7, 10, outrun_rows[i % 4]); - last_dir = dir; -} - -# endif -#endif
\ No newline at end of file diff --git a/keyboards/terrazzo/terrazzo_effects/pac_dude.h b/keyboards/terrazzo/terrazzo_effects/pac_dude.h deleted file mode 100644 index aaf0c55457..0000000000 --- a/keyboards/terrazzo/terrazzo_effects/pac_dude.h +++ /dev/null @@ -1,67 +0,0 @@ -/* Copyright 2020 ademey "MsMustard" - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. - */ - -#ifndef DISABLE_TERRAZZO_EFFECT_PAC_DUDE -TERRAZZO_EFFECT(PAC_DUDE) -# ifdef TERRAZZO_EFFECT_IMPLS - -static uint8_t pac_frames[3][25] = { -{ // up - 0, 0, 0, 0, 0, - 9, 0, 0, 0, 9, - 9, 9, 0, 9, 9, - 9, 9, 9, 9, 9, - 0, 9, 9, 9, 0 -}, -{ // closed - 0, 9, 9, 9, 0, - 9, 9, 9, 9, 9, - 9, 9, 9, 9, 9, - 9, 9, 9, 9, 9, - 0, 9, 9, 9, 0 -}, -{ // down - 0, 9, 9, 9, 0, - 9, 9, 9, 9, 9, - 9, 9, 0, 9, 9, - 9, 0, 0, 0, 9, - 0, 0, 0, 0, 0 -} -}; - -static uint8_t pac_ghost[20] = { - 0, 4, 4, 4, 0, - 4, 0, 4, 0, 4, - 4, 4, 4, 4, 4, - 4, 0, 4, 0, 4 -}; - - -void PAC_DUDE(uint8_t i, bool dir) { - led_matrix_set_value_all(0); - if (dir) { - terrazzo_draw_at(1, 4, 5, 5, pac_frames[i % 2]); - terrazzo_set_pixel(3, 0 + i % 3, 5); - terrazzo_set_pixel(3, 3 + i % 3, 5); - } else { - terrazzo_draw_at(1, 4, 5, 5, pac_frames[1 + i % 2]); - terrazzo_draw_at(1, 8 + i % 8, 5, 4, pac_ghost); - } - -} - -# endif -#endif
\ No newline at end of file diff --git a/keyboards/terrazzo/terrazzo_effects/stripes.h b/keyboards/terrazzo/terrazzo_effects/stripes.h deleted file mode 100644 index 4e1238cdc4..0000000000 --- a/keyboards/terrazzo/terrazzo_effects/stripes.h +++ /dev/null @@ -1,35 +0,0 @@ -/* Copyright 2020 ademey "MsMustard" - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. - */ - -#ifndef DISABLE_TERRAZZO_EFFECT_STRIPES -TERRAZZO_EFFECT(STRIPES) -# ifdef TERRAZZO_EFFECT_IMPLS - -void STRIPES(uint8_t i, bool dir) { - uint8_t sweep[] = {1, 2, 3, 4, 6, 8, 10, 15, 20, 30, 40, 60}; - uint8_t levels = 12; - float soften = 5; - - for (int y = 0; y < LED_MATRIX_ROWS; y++) { - for (int x = 0; x < LED_MATRIX_COLS; x++) { - uint8_t target = (x+y+i)%levels; - terrazzo_set_pixel(x, y, floor(sweep[target] / soften)); - } - } -} - -# endif -#endif
\ No newline at end of file diff --git a/keyboards/terrazzo/terrazzo_effects/terrazzo_effects.inc b/keyboards/terrazzo/terrazzo_effects/terrazzo_effects.inc deleted file mode 100644 index c5271db1b4..0000000000 --- a/keyboards/terrazzo/terrazzo_effects/terrazzo_effects.inc +++ /dev/null @@ -1,7 +0,0 @@ -#include "terrazzo_effects/stripes.h" -#include "terrazzo_effects/dino.h" -#include "terrazzo_effects/outrun.h" -#include "terrazzo_effects/pac_dude.h" -#include "terrazzo_effects/heart.h" -#include "terrazzo_effects/wpm_chart.h" -#include "terrazzo_effects/dot.h" diff --git a/keyboards/terrazzo/terrazzo_effects/wpm_chart.h b/keyboards/terrazzo/terrazzo_effects/wpm_chart.h deleted file mode 100644 index b80b604d26..0000000000 --- a/keyboards/terrazzo/terrazzo_effects/wpm_chart.h +++ /dev/null @@ -1,111 +0,0 @@ -/* Copyright 2020 ademey "MsMustard" - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. - */ - -#ifndef DISABLE_TERRAZZO_EFFECT_WPM_CHART -TERRAZZO_EFFECT(WPM_CHART) -# ifdef TERRAZZO_EFFECT_IMPLS - -static uint8_t number_3_4[10][12] = { -{ // 0 - 9, 9, 9, - 9, 0, 9, - 9, 0, 9, - 9, 9, 9 -}, -{ // 1 - 0, 9, 0, - 9, 9, 0, - 0, 9, 0, - 9, 9, 9 -}, -{ // 2 - 9, 9, 0, - 0, 0, 9, - 0, 9, 0, - 9, 9, 9 -}, -{ // 3 - 9, 9, 9, - 0, 9, 0, - 0, 0, 9, - 9, 9, 0 -}, -{ // 4 - 9, 0, 9, - 9, 0, 9, - 9, 9, 9, - 0, 0, 9 -}, -{ // 5 - 9, 9, 9, - 9, 9, 0, - 0, 0, 9, - 9, 9, 9 -}, -{ // 6 - 0, 0, 9, - 0, 9, 0, - 9, 0, 9, - 0, 9, 0 -}, -{ // 7 - 9, 9, 9, - 0, 0, 9, - 0, 9, 0, - 9, 0, 0 -}, -{ // 8 - 9, 9, 9, - 9, 0, 9, - 9, 4, 9, - 9, 9, 9 -}, -{ // 9 - 9, 9, 9, - 9, 0, 9, - 9, 9, 9, - 0, 0, 9 -} -}; - -/* Reference to create a gradient effect */ -uint8_t wpm_levels[10] = {20, 9, 8, 7, 6, 5, 4, 3, 2, 1}; - -void WPM_CHART(uint8_t i, bool dir) { - led_matrix_set_value_all(0); - uint8_t c_wpm = get_current_wpm(); - uint8_t half_wpm = floor(c_wpm / 2); - uint8_t max_rows = 10; - /* Turn on LED for current WPM. Each pixel is 2 wpm. */ - for (int k = 0; k < half_wpm && k < 70; k++) { - uint8_t current_row = (int)floor(k / 7); - led_matrix_set_value(k, wpm_levels[max_rows - current_row]); - }; - uint8_t d1 = (int)floor(c_wpm / 10); - /* There is only room to print 2 digits. If the WPM is greater than - 99 then the last 2 digits will show, ie 120 = 20. */ - if (c_wpm > 99) { - uint8_t tens_place = d1 % 10; - terrazzo_draw_at(0, 11, 3, 4, number_3_4[tens_place]); - } else { - terrazzo_draw_at(0, 11, 3, 4, number_3_4[d1]); - } - - terrazzo_draw_at(4, 11, 3, 4, number_3_4[c_wpm % 10]); -} - -# endif -#endif
\ No newline at end of file |