From: Don Armstrong Date: Thu, 27 Apr 2017 22:39:01 +0000 (-0700) Subject: switch to the user visualizer from Fred X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=af9559eef176c4ecb365db23bc3bc2ba098a4163;p=qmk_firmware.git switch to the user visualizer from Fred --- diff --git a/keyboards/ergodox/keymaps/don/visualizer.c b/keyboards/ergodox/keymaps/don/visualizer.c index f011b5b5f..253325c56 100644 --- a/keyboards/ergodox/keymaps/don/visualizer.c +++ b/keyboards/ergodox/keymaps/don/visualizer.c @@ -1,5 +1,5 @@ /* -Copyright 2016 Fred Sundvik +Copyright 2017 Fred Sundvik 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 @@ -130,47 +130,27 @@ void update_user_visualizer_state(visualizer_state_t* state) { // state->status.default_layer // state->status.leds (see led.h for available statuses) if (state->status.layer & 0x20) { - state->target_lcd_color = LCD_COLOR(0xB0, 0xFF, 0xFF); - state->layer_text = "Plover"; + state->target_lcd_color = LCD_COLOR(0xB0, saturation, 0xFF); + state->layer_text = "Plover"; } else if (state->status.layer & 0x10) { - state->target_lcd_color = LCD_COLOR(0x90, 0xFF, 0xFF); - state->layer_text = "Numpad"; + state->target_lcd_color = LCD_COLOR(0x90, saturation, 0xFF); + state->layer_text = "Numpad"; } else if (state->status.layer & 0x8) { - state->target_lcd_color = LCD_COLOR(0x60, 0xFF, 0xFF); - state->layer_text = "KBD FXNs"; + state->target_lcd_color = LCD_COLOR(0x60, saturation, 0xFF); + state->layer_text = "KBD FXNs"; } else if (state->status.layer & 0x4) { - state->target_lcd_color = LCD_COLOR(0x30, 0xFF, 0xFF); + state->target_lcd_color = LCD_COLOR(0x30, saturation, 0xFF); state->layer_text = "Mouse"; } else if (state->status.layer & 0x2) { - state->target_lcd_color = LCD_COLOR(0x00, 0xFF, 0xFF); + state->target_lcd_color = LCD_COLOR(0x00, saturation, 0xFF); state->layer_text = "FXN/Symbols"; } else { - state->target_lcd_color = LCD_COLOR(0x00, 0x80, 0x80); - state->layer_text = "Default"; + state->target_lcd_color = LCD_COLOR(0x00, saturation, 0x80); + state->layer_text = "Default"; } - // You can also stop existing animations, and start your custom ones here - // remember that you should normally have only one animation for the LCD - // and one for the background. But you can also combine them if you want. - start_keyframe_animation(&lcd_animation); - start_keyframe_animation(&color_animation); -} - -void user_visualizer_suspend(visualizer_state_t* state) { - state->layer_text = "Suspending..."; - uint8_t hue = LCD_HUE(state->current_lcd_color); - uint8_t sat = LCD_SAT(state->current_lcd_color); - state->target_lcd_color = LCD_COLOR(hue, sat, 0); - start_keyframe_animation(&suspend_animation); -} - -void user_visualizer_resume(visualizer_state_t* state) { - state->current_lcd_color = LCD_COLOR(0x00, 0x00, 0x00); - state->target_lcd_color = LCD_COLOR(0x10, 0xFF, 0xFF); - start_keyframe_animation(&resume_animation); - // start_keyframe_animation(&led_test_animation); }