mirror of
https://github.com/qmk/qmk_firmware.git
synced 2024-11-25 12:46:41 +00:00
Makefile fixes and update of Visualizer
This commit is contained in:
parent
9772e697a0
commit
07d0d5cbe4
@ -69,8 +69,17 @@ CUSTOM_MATRIX ?= yes # Custom matrix file
|
||||
SERIAL_LINK_ENABLE = yes
|
||||
VISUALIZER_ENABLE ?= yes
|
||||
LCD_ENABLE ?= yes
|
||||
LED_ENABLE ?= yes
|
||||
LCD_BACKLIGHT_ENABLE ?= yes
|
||||
|
||||
ifdef LCD_ENABLE
|
||||
include drivers/gdisp/st7565ergodox/driver.mk
|
||||
endif
|
||||
|
||||
ifdef LED_ENABLE
|
||||
include drivers/gdisp/IS31FL3731C/driver.mk
|
||||
endif
|
||||
|
||||
ifndef QUANTUM_DIR
|
||||
include ../../Makefile
|
||||
endif
|
@ -89,8 +89,8 @@ static uint8_t crossfade_start_frame[NUM_ROWS][NUM_COLS];
|
||||
static uint8_t crossfade_end_frame[NUM_ROWS][NUM_COLS];
|
||||
|
||||
static uint8_t compute_gradient_color(float t, float index, float num) {
|
||||
const float two_pi = 2.0f * PI;
|
||||
float normalized_index = (1.0f - index / (num - 1)) * two_pi;
|
||||
const float two_pi = M_2_PI;
|
||||
float normalized_index = (1.0f - index / (num - 1.0f)) * two_pi;
|
||||
float x = t * two_pi + normalized_index;
|
||||
float v = 0.5 * (cosf(x) + 1.0f);
|
||||
return (uint8_t)(255.0f * v);
|
||||
|
@ -25,6 +25,8 @@ EXTRAINCDIRS += $(GFXINC) $(VISUALIZER_DIR)
|
||||
GFXLIB = $(LIB_PATH)/ugfx
|
||||
VPATH += $(VISUALIZER_PATH)
|
||||
|
||||
OPT_DEFS += -DVISUALIZER_ENABLE
|
||||
|
||||
ifdef LCD_ENABLE
|
||||
OPT_DEFS += -DLCD_ENABLE
|
||||
ULIBS += -lm
|
||||
@ -44,12 +46,8 @@ UDEFS += -DLED_ENABLE
|
||||
endif
|
||||
|
||||
include $(GFXLIB)/gfx.mk
|
||||
#SERIAL_SRC = $(wildcard $(SERIAL_PATH)/protocol/*.c)
|
||||
#SERIAL_SRC += $(wildcard $(SERIAL_PATH)/system/*.c)
|
||||
#SRC += $(patsubst $(QUANTUM_PATH)/%,%,$(SERIAL_SRC))
|
||||
#SRC += $(GFXSRC)
|
||||
SRC += $(patsubst $(TOP_DIR)/%,%,$(GFXSRC))
|
||||
OPT_DEFS += $(patsubst %,-D%,$(patsubst -D%,%,$(GFXDEFS)))
|
||||
#ULIBS += $(patsubst %,-l%,$(patsubst -l%,%,$(GFXLIBS)))
|
||||
|
||||
ifndef VISUALIZER_USER
|
||||
VISUALIZER_USER = visualizer_user.c
|
||||
|
@ -29,6 +29,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
#include "sendchar.h"
|
||||
#include "eeconfig.h"
|
||||
#include "backlight.h"
|
||||
#include "action_layer.h"
|
||||
#ifdef BOOTMAGIC_ENABLE
|
||||
# include "bootmagic.h"
|
||||
#else
|
||||
@ -52,6 +53,9 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
#ifdef SERIAL_LINK_ENABLE
|
||||
# include "serial_link/system/serial_link.h"
|
||||
#endif
|
||||
#ifdef VISUALIZER_ENABLE
|
||||
# include "visualizer/visualizer.h"
|
||||
#endif
|
||||
|
||||
#ifdef MATRIX_HAS_GHOST
|
||||
static bool has_ghost_in_row(uint8_t row)
|
||||
@ -181,6 +185,10 @@ MATRIX_LOOP_END:
|
||||
serial_link_update();
|
||||
#endif
|
||||
|
||||
#ifdef VISUALIZER_ENABLE
|
||||
visualizer_update(default_layer_state, layer_state, host_keyboard_leds());
|
||||
#endif
|
||||
|
||||
// update LED
|
||||
if (led_status != host_keyboard_leds()) {
|
||||
led_status = host_keyboard_leds();
|
||||
|
@ -38,6 +38,9 @@
|
||||
#ifdef SERIAL_LINK_ENABLE
|
||||
#include "serial_link/system/serial_link.h"
|
||||
#endif
|
||||
#ifdef VISUALIZER_ENABLE
|
||||
#include "visualizer/visualizer.h"
|
||||
#endif
|
||||
#include "suspend.h"
|
||||
|
||||
|
||||
@ -101,6 +104,10 @@ int main(void) {
|
||||
/* init printf */
|
||||
init_printf(NULL,sendchar_pf);
|
||||
|
||||
#ifdef VISUALIZER_ENABLE
|
||||
visualizer_init();
|
||||
#endif
|
||||
|
||||
#ifdef SERIAL_LINK_ENABLE
|
||||
init_serial_link();
|
||||
#endif
|
||||
|
Loading…
Reference in New Issue
Block a user