diff options
author | Fred Sundvik <fsundvik@gmail.com> | 2016-05-18 08:40:36 +0300 |
---|---|---|
committer | Fred Sundvik <fsundvik@gmail.com> | 2016-05-18 08:40:36 +0300 |
commit | fa8feb21a4709dba552df4a96205c50a319f5e3b (patch) | |
tree | 2103028d263a084a0e562f6dd8d8c6fb2de9796e /visualizer.c | |
parent | 07e412c53829c66e948eb147873a04cd27b0771b (diff) | |
download | qmk_firmware-fa8feb21a4709dba552df4a96205c50a319f5e3b.tar.gz |
Add custom led and lcd display support
Diffstat (limited to 'visualizer.c')
-rw-r--r-- | visualizer.c | 18 |
1 files changed, 15 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[] = { GDisplay* LCD_DISPLAY = 0; GDisplay* LED_DISPLAY = 0; +__attribute__((weak)) +GDisplay* get_lcd_display(void) { + return gdispGetDisplay(0); +} + +__attribute__((weak)) +GDisplay* get_led_display(void) { + return gdispGetDisplay(1); +} void start_keyframe_animation(keyframe_animation_t* animation) { animation->current_frame = -1; @@ -444,10 +453,13 @@ void visualizer_init(void) { #ifdef USE_SERIAL_LINK add_remote_objects(remote_objects, sizeof(remote_objects) / sizeof(remote_object_t*) ); #endif - // TODO: Make sure these works when either of these are disabled - LCD_DISPLAY = gdispGetDisplay(0); - LED_DISPLAY = gdispGetDisplay(1); +#ifdef LCD_ENABLE + LCD_DISPLAY = get_lcd_display(); +#endif +#ifdef LED_ENABLE + LED_DISPLAY = get_led_display(); +#endif // We are using a low priority thread, the idea is to have it run only // when the main thread is sleeping during the matrix scanning |