diff options
author | Jack Humbert <jack.humb@gmail.com> | 2017-06-27 14:21:42 -0400 |
---|---|---|
committer | Jack Humbert <jack.humb@gmail.com> | 2017-06-27 14:21:42 -0400 |
commit | 9f5b4e1d7a37f873acbc19b8385964121566653e (patch) | |
tree | 78a51918d16a84148af5276170d2c30525dee661 /quantum/visualizer/visualizer.c | |
parent | b82604dadad81872abdb9fdde18086ee69e66671 (diff) | |
parent | 4ba9438c3f71e6ea3433be4f9e1a28d36471d247 (diff) | |
download | firmware-9f5b4e1d7a37f873acbc19b8385964121566653e.tar.gz firmware-9f5b4e1d7a37f873acbc19b8385964121566653e.tar.bz2 firmware-9f5b4e1d7a37f873acbc19b8385964121566653e.zip |
Merge branch 'master' of https://github.com/qmk/qmk_firmware into dual_audio
Diffstat (limited to 'quantum/visualizer/visualizer.c')
-rw-r--r-- | quantum/visualizer/visualizer.c | 33 |
1 files changed, 19 insertions, 14 deletions
diff --git a/quantum/visualizer/visualizer.c b/quantum/visualizer/visualizer.c index a4b3ea7e4..cc99d1e3b 100644 --- a/quantum/visualizer/visualizer.c +++ b/quantum/visualizer/visualizer.c @@ -105,15 +105,19 @@ static remote_object_t* remote_objects[] = { GDisplay* LCD_DISPLAY = 0; GDisplay* LED_DISPLAY = 0; +#ifdef LCD_DISPLAY_NUMBER __attribute__((weak)) GDisplay* get_lcd_display(void) { - return gdispGetDisplay(0); + return gdispGetDisplay(LCD_DISPLAY_NUMBER); } +#endif +#ifdef LED_DISPLAY_NUMBER __attribute__((weak)) GDisplay* get_led_display(void) { - return gdispGetDisplay(1); + return gdispGetDisplay(LED_DISPLAY_NUMBER); } +#endif void start_keyframe_animation(keyframe_animation_t* animation) { animation->current_frame = -1; @@ -251,9 +255,9 @@ static DECLARE_THREAD_FUNCTION(visualizerThread, arg) { .mods = 0xFF, .leds = 0xFFFFFFFF, .suspended = false, -#ifdef VISUALIZER_USER_DATA_SIZE + #ifdef VISUALIZER_USER_DATA_SIZE .user_data = {0}, -#endif + #endif }; visualizer_state_t state = { @@ -379,25 +383,26 @@ static DECLARE_THREAD_FUNCTION(visualizerThread, arg) { void visualizer_init(void) { gfxInit(); -#ifdef LCD_BACKLIGHT_ENABLE + #ifdef LCD_BACKLIGHT_ENABLE lcd_backlight_init(); -#endif + #endif -#ifdef SERIAL_LINK_ENABLE + #ifdef SERIAL_LINK_ENABLE add_remote_objects(remote_objects, sizeof(remote_objects) / sizeof(remote_object_t*) ); -#endif + #endif -#ifdef LCD_ENABLE + #ifdef LCD_ENABLE LCD_DISPLAY = get_lcd_display(); -#endif -#ifdef BACKLIGHT_ENABLE + #endif + + #ifdef BACKLIGHT_ENABLE LED_DISPLAY = get_led_display(); -#endif + #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 - gfxThreadCreate(visualizerThreadStack, sizeof(visualizerThreadStack), - VISUALIZER_THREAD_PRIORITY, visualizerThread, NULL); + gfxThreadCreate(visualizerThreadStack, sizeof(visualizerThreadStack), + VISUALIZER_THREAD_PRIORITY, visualizerThread, NULL); } void update_status(bool changed) { |