2 Copyright 2017 Fred Sundvik
4 This program is free software: you can redistribute it and/or modify
5 it under the terms of the GNU General Public License as published by
6 the Free Software Foundation, either version 2 of the License, or
7 (at your option) any later version.
9 This program is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 GNU General Public License for more details.
14 You should have received a copy of the GNU General Public License
15 along with this program. If not, see <http://www.gnu.org/licenses/>.
18 #include "simple_visualizer.h"
21 // Copied from keymap.c
29 // Intermediate layers for SuperDuper (Combo keys does not work on Infinity yet)
39 // This function should be implemented by the keymap visualizer
40 // Don't change anything else than state->target_lcd_color and state->layer_text as that's the only thing
41 // that the simple_visualizer assumes that you are updating
42 // Also make sure that the buffer passed to state->layer_text remains valid until the previous animation is
43 // stopped. This can be done by either double buffering it or by using constant strings
44 static void get_visualizer_layer_and_color(visualizer_state_t* state) {
45 uint8_t saturation = 255;
47 uint8_t layer = biton32(state->status.layer);
48 state->target_lcd_color = LCD_COLOR(layer << 2, saturation, 0xFF);
52 state->layer_text = "QWERTY";
55 state->layer_text = "COLEMAK";
58 state->layer_text = "QWERTY on COLEMAK";
61 state->layer_text = "LOWER";
64 state->layer_text = "RAISE";
67 state->layer_text = "PLOVER";
70 state->layer_text = "SUPERDUPER";
73 state->layer_text = "SUPER";
76 state->layer_text = "DUPER";
79 state->layer_text = "MOUSE";
82 state->layer_text = "ADJUST";
85 state->layer_text = "MDIA";
88 state->layer_text = "SYMB";
91 state->layer_text = "NONE";