aboutsummaryrefslogtreecommitdiff
path: root/quantum/visualizer/visualizer.c
diff options
context:
space:
mode:
Diffstat (limited to 'quantum/visualizer/visualizer.c')
-rw-r--r--quantum/visualizer/visualizer.c14
1 files changed, 5 insertions, 9 deletions
diff --git a/quantum/visualizer/visualizer.c b/quantum/visualizer/visualizer.c
index c24073405..54f6faaa4 100644
--- a/quantum/visualizer/visualizer.c
+++ b/quantum/visualizer/visualizer.c
@@ -29,9 +29,7 @@ SOFTWARE.
29#include "ch.h" 29#include "ch.h"
30#endif 30#endif
31 31
32#ifdef LCD_ENABLE
33#include "gfx.h" 32#include "gfx.h"
34#endif
35 33
36#ifdef LCD_BACKLIGHT_ENABLE 34#ifdef LCD_BACKLIGHT_ENABLE
37#include "lcd_backlight.h" 35#include "lcd_backlight.h"
@@ -45,7 +43,7 @@ SOFTWARE.
45#include "nodebug.h" 43#include "nodebug.h"
46#endif 44#endif
47 45
48#ifdef USE_SERIAL_LINK 46#ifdef SERIAL_LINK_ENABLE
49#include "serial_link/protocol/transport.h" 47#include "serial_link/protocol/transport.h"
50#include "serial_link/system/serial_link.h" 48#include "serial_link/system/serial_link.h"
51#endif 49#endif
@@ -75,7 +73,7 @@ static bool visualizer_enabled = false;
75#define MAX_SIMULTANEOUS_ANIMATIONS 4 73#define MAX_SIMULTANEOUS_ANIMATIONS 4
76static keyframe_animation_t* animations[MAX_SIMULTANEOUS_ANIMATIONS] = {}; 74static keyframe_animation_t* animations[MAX_SIMULTANEOUS_ANIMATIONS] = {};
77 75
78#ifdef USE_SERIAL_LINK 76#ifdef SERIAL_LINK_ENABLE
79MASTER_TO_ALL_SLAVES_OBJECT(current_status, visualizer_keyboard_status_t); 77MASTER_TO_ALL_SLAVES_OBJECT(current_status, visualizer_keyboard_status_t);
80 78
81static remote_object_t* remote_objects[] = { 79static remote_object_t* remote_objects[] = {
@@ -458,15 +456,13 @@ static DECLARE_THREAD_FUNCTION(visualizerThread, arg) {
458} 456}
459 457
460void visualizer_init(void) { 458void visualizer_init(void) {
461#ifdef LCD_ENABLE
462 gfxInit(); 459 gfxInit();
463#endif
464 460
465#ifdef LCD_BACKLIGHT_ENABLE 461#ifdef LCD_BACKLIGHT_ENABLE
466 lcd_backlight_init(); 462 lcd_backlight_init();
467#endif 463#endif
468 464
469#ifdef USE_SERIAL_LINK 465#ifdef SERIAL_LINK_ENABLE
470 add_remote_objects(remote_objects, sizeof(remote_objects) / sizeof(remote_object_t*) ); 466 add_remote_objects(remote_objects, sizeof(remote_objects) / sizeof(remote_object_t*) );
471#endif 467#endif
472 468
@@ -490,7 +486,7 @@ void update_status(bool changed) {
490 geventSendEvent(listener); 486 geventSendEvent(listener);
491 } 487 }
492 } 488 }
493#ifdef USE_SERIAL_LINK 489#ifdef SERIAL_LINK_ENABLE
494 static systime_t last_update = 0; 490 static systime_t last_update = 0;
495 systime_t current_update = chVTGetSystemTimeX(); 491 systime_t current_update = chVTGetSystemTimeX();
496 systime_t delta = current_update - last_update; 492 systime_t delta = current_update - last_update;
@@ -510,7 +506,7 @@ void visualizer_update(uint32_t default_state, uint32_t state, uint32_t leds) {
510 // Alternatively a mutex could be used instead of the volatile variables 506 // Alternatively a mutex could be used instead of the volatile variables
511 507
512 bool changed = false; 508 bool changed = false;
513#ifdef USE_SERIAL_LINK 509#ifdef SERIAL_LINK_ENABLE
514 if (is_serial_link_connected ()) { 510 if (is_serial_link_connected ()) {
515 visualizer_keyboard_status_t* new_status = read_current_status(); 511 visualizer_keyboard_status_t* new_status = read_current_status();
516 if (new_status) { 512 if (new_status) {