aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--visualizer.c18
-rw-r--r--visualizer.h5
2 files changed, 20 insertions, 3 deletions
diff --git a/visualizer.c b/visualizer.c
index ff99e960f..bbb00debc 100644
--- a/visualizer.c
+++ b/visualizer.c
@@ -85,6 +85,15 @@ static remote_object_t* remote_objects[] = {
85GDisplay* LCD_DISPLAY = 0; 85GDisplay* LCD_DISPLAY = 0;
86GDisplay* LED_DISPLAY = 0; 86GDisplay* LED_DISPLAY = 0;
87 87
88__attribute__((weak))
89GDisplay* get_lcd_display(void) {
90 return gdispGetDisplay(0);
91}
92
93__attribute__((weak))
94GDisplay* get_led_display(void) {
95 return gdispGetDisplay(1);
96}
88 97
89void start_keyframe_animation(keyframe_animation_t* animation) { 98void start_keyframe_animation(keyframe_animation_t* animation) {
90 animation->current_frame = -1; 99 animation->current_frame = -1;
@@ -444,10 +453,13 @@ void visualizer_init(void) {
444#ifdef USE_SERIAL_LINK 453#ifdef USE_SERIAL_LINK
445 add_remote_objects(remote_objects, sizeof(remote_objects) / sizeof(remote_object_t*) ); 454 add_remote_objects(remote_objects, sizeof(remote_objects) / sizeof(remote_object_t*) );
446#endif 455#endif
447 // TODO: Make sure these works when either of these are disabled
448 LCD_DISPLAY = gdispGetDisplay(0);
449 LED_DISPLAY = gdispGetDisplay(1);
450 456
457#ifdef LCD_ENABLE
458 LCD_DISPLAY = get_lcd_display();
459#endif
460#ifdef LED_ENABLE
461 LED_DISPLAY = get_led_display();
462#endif
451 463
452 // We are using a low priority thread, the idea is to have it run only 464 // We are using a low priority thread, the idea is to have it run only
453 // when the main thread is sleeping during the matrix scanning 465 // when the main thread is sleeping during the matrix scanning
diff --git a/visualizer.h b/visualizer.h
index 8a2772c6d..4d6a61dda 100644
--- a/visualizer.h
+++ b/visualizer.h
@@ -45,6 +45,11 @@ void visualizer_suspend(void);
45// This should be called when the keyboard wakes up from suspend state 45// This should be called when the keyboard wakes up from suspend state
46void visualizer_resume(void); 46void visualizer_resume(void);
47 47
48// These functions are week, so they can be overridden by the keyboard
49// if needed
50GDisplay* get_lcd_display(void);
51GDisplay* get_led_display(void);
52
48// If you need support for more than 16 keyframes per animation, you can change this 53// If you need support for more than 16 keyframes per animation, you can change this
49#define MAX_VISUALIZER_KEY_FRAMES 16 54#define MAX_VISUALIZER_KEY_FRAMES 16
50 55