aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFred Sundvik <fsundvik@gmail.com>2016-05-18 09:03:42 +0300
committerFred Sundvik <fsundvik@gmail.com>2016-05-18 09:03:42 +0300
commit94519e387a85e3b4ab72bd7d837ff590cc690eb9 (patch)
tree7e9907f2a368727f462161b944b9a1d6f0edfefb
parentfa8feb21a4709dba552df4a96205c50a319f5e3b (diff)
downloadqmk_firmware-94519e387a85e3b4ab72bd7d837ff590cc690eb9.tar.gz
qmk_firmware-94519e387a85e3b4ab72bd7d837ff590cc690eb9.zip
Add callback function for emulator drawing
-rw-r--r--visualizer.c4
-rw-r--r--visualizer.h7
2 files changed, 10 insertions, 1 deletions
diff --git a/visualizer.c b/visualizer.c
index bbb00debc..607a64566 100644
--- a/visualizer.c
+++ b/visualizer.c
@@ -413,6 +413,10 @@ static DECLARE_THREAD_FUNCTION(visualizerThread, arg) {
413#ifdef LED_ENABLE 413#ifdef LED_ENABLE
414 gdispGFlush(LED_DISPLAY); 414 gdispGFlush(LED_DISPLAY);
415#endif 415#endif
416
417#if EMULATOR
418 draw_emulator();
419#endif
416 // The animation can enable the visualizer 420 // The animation can enable the visualizer
417 // And we might need to update the state when that happens 421 // And we might need to update the state when that happens
418 // so don't sleep 422 // so don't sleep
diff --git a/visualizer.h b/visualizer.h
index 4d6a61dda..a3828e35f 100644
--- a/visualizer.h
+++ b/visualizer.h
@@ -50,6 +50,11 @@ void visualizer_resume(void);
50GDisplay* get_lcd_display(void); 50GDisplay* get_lcd_display(void);
51GDisplay* get_led_display(void); 51GDisplay* get_led_display(void);
52 52
53// For emulator builds, this function need to be implemented
54#if EMULATOR
55void draw_emulator(void);
56#endif
57
53// If you need support for more than 16 keyframes per animation, you can change this 58// If you need support for more than 16 keyframes per animation, you can change this
54#define MAX_VISUALIZER_KEY_FRAMES 16 59#define MAX_VISUALIZER_KEY_FRAMES 16
55 60
@@ -134,7 +139,7 @@ bool keyframe_enable_lcd_and_backlight(keyframe_animation_t* animation, visualiz
134// directly from the initalize_user_visualizer function (the animation can be null) 139// directly from the initalize_user_visualizer function (the animation can be null)
135bool enable_visualization(keyframe_animation_t* animation, visualizer_state_t* state); 140bool enable_visualization(keyframe_animation_t* animation, visualizer_state_t* state);
136 141
137// These two functions have to be implemented by the user 142// These functions have to be implemented by the user
138void initialize_user_visualizer(visualizer_state_t* state); 143void initialize_user_visualizer(visualizer_state_t* state);
139void update_user_visualizer_state(visualizer_state_t* state); 144void update_user_visualizer_state(visualizer_state_t* state);
140void user_visualizer_suspend(visualizer_state_t* state); 145void user_visualizer_suspend(visualizer_state_t* state);