diff options
| -rw-r--r-- | keyboards/infinity_ergodox/Makefile | 9 | ||||
| -rw-r--r-- | quantum/visualizer/led_test.c | 4 | ||||
| -rw-r--r-- | quantum/visualizer/visualizer.mk | 8 | ||||
| -rw-r--r-- | tmk_core/common/keyboard.c | 8 | ||||
| -rw-r--r-- | tmk_core/protocol/chibios/main.c | 7 |
5 files changed, 29 insertions, 7 deletions
diff --git a/keyboards/infinity_ergodox/Makefile b/keyboards/infinity_ergodox/Makefile index 8be2f51b1..7edc03d8c 100644 --- a/keyboards/infinity_ergodox/Makefile +++ b/keyboards/infinity_ergodox/Makefile | |||
| @@ -69,8 +69,17 @@ CUSTOM_MATRIX ?= yes # Custom matrix file | |||
| 69 | SERIAL_LINK_ENABLE = yes | 69 | SERIAL_LINK_ENABLE = yes |
| 70 | VISUALIZER_ENABLE ?= yes | 70 | VISUALIZER_ENABLE ?= yes |
| 71 | LCD_ENABLE ?= yes | 71 | LCD_ENABLE ?= yes |
| 72 | LED_ENABLE ?= yes | ||
| 72 | LCD_BACKLIGHT_ENABLE ?= yes | 73 | LCD_BACKLIGHT_ENABLE ?= yes |
| 73 | 74 | ||
| 75 | ifdef LCD_ENABLE | ||
| 76 | include drivers/gdisp/st7565ergodox/driver.mk | ||
| 77 | endif | ||
| 78 | |||
| 79 | ifdef LED_ENABLE | ||
| 80 | include drivers/gdisp/IS31FL3731C/driver.mk | ||
| 81 | endif | ||
| 82 | |||
| 74 | ifndef QUANTUM_DIR | 83 | ifndef QUANTUM_DIR |
| 75 | include ../../Makefile | 84 | include ../../Makefile |
| 76 | endif \ No newline at end of file | 85 | endif \ No newline at end of file |
diff --git a/quantum/visualizer/led_test.c b/quantum/visualizer/led_test.c index c2ea30b55..a9abace8d 100644 --- a/quantum/visualizer/led_test.c +++ b/quantum/visualizer/led_test.c | |||
| @@ -89,8 +89,8 @@ static uint8_t crossfade_start_frame[NUM_ROWS][NUM_COLS]; | |||
| 89 | static uint8_t crossfade_end_frame[NUM_ROWS][NUM_COLS]; | 89 | static uint8_t crossfade_end_frame[NUM_ROWS][NUM_COLS]; |
| 90 | 90 | ||
| 91 | static uint8_t compute_gradient_color(float t, float index, float num) { | 91 | static uint8_t compute_gradient_color(float t, float index, float num) { |
| 92 | const float two_pi = 2.0f * PI; | 92 | const float two_pi = M_2_PI; |
| 93 | float normalized_index = (1.0f - index / (num - 1)) * two_pi; | 93 | float normalized_index = (1.0f - index / (num - 1.0f)) * two_pi; |
| 94 | float x = t * two_pi + normalized_index; | 94 | float x = t * two_pi + normalized_index; |
| 95 | float v = 0.5 * (cosf(x) + 1.0f); | 95 | float v = 0.5 * (cosf(x) + 1.0f); |
| 96 | return (uint8_t)(255.0f * v); | 96 | return (uint8_t)(255.0f * v); |
diff --git a/quantum/visualizer/visualizer.mk b/quantum/visualizer/visualizer.mk index b5dfad8e1..149968de7 100644 --- a/quantum/visualizer/visualizer.mk +++ b/quantum/visualizer/visualizer.mk | |||
| @@ -25,6 +25,8 @@ EXTRAINCDIRS += $(GFXINC) $(VISUALIZER_DIR) | |||
| 25 | GFXLIB = $(LIB_PATH)/ugfx | 25 | GFXLIB = $(LIB_PATH)/ugfx |
| 26 | VPATH += $(VISUALIZER_PATH) | 26 | VPATH += $(VISUALIZER_PATH) |
| 27 | 27 | ||
| 28 | OPT_DEFS += -DVISUALIZER_ENABLE | ||
| 29 | |||
| 28 | ifdef LCD_ENABLE | 30 | ifdef LCD_ENABLE |
| 29 | OPT_DEFS += -DLCD_ENABLE | 31 | OPT_DEFS += -DLCD_ENABLE |
| 30 | ULIBS += -lm | 32 | ULIBS += -lm |
| @@ -44,12 +46,8 @@ UDEFS += -DLED_ENABLE | |||
| 44 | endif | 46 | endif |
| 45 | 47 | ||
| 46 | include $(GFXLIB)/gfx.mk | 48 | include $(GFXLIB)/gfx.mk |
| 47 | #SERIAL_SRC = $(wildcard $(SERIAL_PATH)/protocol/*.c) | 49 | SRC += $(patsubst $(TOP_DIR)/%,%,$(GFXSRC)) |
| 48 | #SERIAL_SRC += $(wildcard $(SERIAL_PATH)/system/*.c) | ||
| 49 | #SRC += $(patsubst $(QUANTUM_PATH)/%,%,$(SERIAL_SRC)) | ||
| 50 | #SRC += $(GFXSRC) | ||
| 51 | OPT_DEFS += $(patsubst %,-D%,$(patsubst -D%,%,$(GFXDEFS))) | 50 | OPT_DEFS += $(patsubst %,-D%,$(patsubst -D%,%,$(GFXDEFS))) |
| 52 | #ULIBS += $(patsubst %,-l%,$(patsubst -l%,%,$(GFXLIBS))) | ||
| 53 | 51 | ||
| 54 | ifndef VISUALIZER_USER | 52 | ifndef VISUALIZER_USER |
| 55 | VISUALIZER_USER = visualizer_user.c | 53 | VISUALIZER_USER = visualizer_user.c |
diff --git a/tmk_core/common/keyboard.c b/tmk_core/common/keyboard.c index 3a1262a9f..c46a701b3 100644 --- a/tmk_core/common/keyboard.c +++ b/tmk_core/common/keyboard.c | |||
| @@ -29,6 +29,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. | |||
| 29 | #include "sendchar.h" | 29 | #include "sendchar.h" |
| 30 | #include "eeconfig.h" | 30 | #include "eeconfig.h" |
| 31 | #include "backlight.h" | 31 | #include "backlight.h" |
| 32 | #include "action_layer.h" | ||
| 32 | #ifdef BOOTMAGIC_ENABLE | 33 | #ifdef BOOTMAGIC_ENABLE |
| 33 | # include "bootmagic.h" | 34 | # include "bootmagic.h" |
| 34 | #else | 35 | #else |
| @@ -52,6 +53,9 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. | |||
| 52 | #ifdef SERIAL_LINK_ENABLE | 53 | #ifdef SERIAL_LINK_ENABLE |
| 53 | # include "serial_link/system/serial_link.h" | 54 | # include "serial_link/system/serial_link.h" |
| 54 | #endif | 55 | #endif |
| 56 | #ifdef VISUALIZER_ENABLE | ||
| 57 | # include "visualizer/visualizer.h" | ||
| 58 | #endif | ||
| 55 | 59 | ||
| 56 | #ifdef MATRIX_HAS_GHOST | 60 | #ifdef MATRIX_HAS_GHOST |
| 57 | static bool has_ghost_in_row(uint8_t row) | 61 | static bool has_ghost_in_row(uint8_t row) |
| @@ -181,6 +185,10 @@ MATRIX_LOOP_END: | |||
| 181 | serial_link_update(); | 185 | serial_link_update(); |
| 182 | #endif | 186 | #endif |
| 183 | 187 | ||
| 188 | #ifdef VISUALIZER_ENABLE | ||
| 189 | visualizer_update(default_layer_state, layer_state, host_keyboard_leds()); | ||
| 190 | #endif | ||
| 191 | |||
| 184 | // update LED | 192 | // update LED |
| 185 | if (led_status != host_keyboard_leds()) { | 193 | if (led_status != host_keyboard_leds()) { |
| 186 | led_status = host_keyboard_leds(); | 194 | led_status = host_keyboard_leds(); |
diff --git a/tmk_core/protocol/chibios/main.c b/tmk_core/protocol/chibios/main.c index aeb11752f..6bf9c1668 100644 --- a/tmk_core/protocol/chibios/main.c +++ b/tmk_core/protocol/chibios/main.c | |||
| @@ -38,6 +38,9 @@ | |||
| 38 | #ifdef SERIAL_LINK_ENABLE | 38 | #ifdef SERIAL_LINK_ENABLE |
| 39 | #include "serial_link/system/serial_link.h" | 39 | #include "serial_link/system/serial_link.h" |
| 40 | #endif | 40 | #endif |
| 41 | #ifdef VISUALIZER_ENABLE | ||
| 42 | #include "visualizer/visualizer.h" | ||
| 43 | #endif | ||
| 41 | #include "suspend.h" | 44 | #include "suspend.h" |
| 42 | 45 | ||
| 43 | 46 | ||
| @@ -101,6 +104,10 @@ int main(void) { | |||
| 101 | /* init printf */ | 104 | /* init printf */ |
| 102 | init_printf(NULL,sendchar_pf); | 105 | init_printf(NULL,sendchar_pf); |
| 103 | 106 | ||
| 107 | #ifdef VISUALIZER_ENABLE | ||
| 108 | visualizer_init(); | ||
| 109 | #endif | ||
| 110 | |||
| 104 | #ifdef SERIAL_LINK_ENABLE | 111 | #ifdef SERIAL_LINK_ENABLE |
| 105 | init_serial_link(); | 112 | init_serial_link(); |
| 106 | #endif | 113 | #endif |
