diff options
| author | Fred Sundvik <fsundvik@gmail.com> | 2016-04-24 16:40:41 +0300 |
|---|---|---|
| committer | Fred Sundvik <fsundvik@gmail.com> | 2016-04-24 16:40:41 +0300 |
| commit | 74baa4895c8efd409eb10eaf1e6cfc0e2677b45c (patch) | |
| tree | 66488245ff868032373d8b8baab966c8d7052071 | |
| parent | 15906b86ae1db858b38bc77393e31e7741223b01 (diff) | |
| download | qmk_firmware-74baa4895c8efd409eb10eaf1e6cfc0e2677b45c.tar.gz qmk_firmware-74baa4895c8efd409eb10eaf1e6cfc0e2677b45c.zip | |
Run mirrored keyframes for led tests as well
| -rw-r--r-- | led_test.c | 34 | ||||
| -rw-r--r-- | led_test.h | 2 | ||||
| -rw-r--r-- | visualizer.h | 4 |
3 files changed, 34 insertions, 6 deletions
diff --git a/led_test.c b/led_test.c index c987eca38..ce6c2e68e 100644 --- a/led_test.c +++ b/led_test.c | |||
| @@ -26,17 +26,24 @@ SOFTWARE. | |||
| 26 | #include "math.h" | 26 | #include "math.h" |
| 27 | 27 | ||
| 28 | keyframe_animation_t led_test_animation = { | 28 | keyframe_animation_t led_test_animation = { |
| 29 | .num_frames = 8, | 29 | .num_frames = 14, |
| 30 | .loop = true, | 30 | .loop = true, |
| 31 | .frame_lengths = { | 31 | .frame_lengths = { |
| 32 | MS2ST(1000), // fade in | 32 | MS2ST(1000), // fade in |
| 33 | MS2ST(1000), // no op (leds on) | 33 | MS2ST(1000), // no op (leds on) |
| 34 | MS2ST(1000), // fade out | 34 | MS2ST(1000), // fade out |
| 35 | MS2ST(1000), // crossfade | 35 | MS2ST(1000), // crossfade |
| 36 | MS2ST(3000), // left to rigt | 36 | MS2ST(3000), // left to rigt (outside in) |
| 37 | MS2ST(1000), // crossfade | 37 | MS2ST(1000), // crossfade |
| 38 | MS2ST(3000), // top_to_bottom | 38 | MS2ST(3000), // top_to_bottom |
| 39 | 0, // mirror leds | ||
| 39 | MS2ST(1000), // crossfade | 40 | MS2ST(1000), // crossfade |
| 41 | MS2ST(3000), // left_to_right (mirrored, so inside out) | ||
| 42 | MS2ST(1000), // crossfade | ||
| 43 | MS2ST(3000), // top_to_bottom | ||
| 44 | 0, // normal leds | ||
| 45 | MS2ST(1000), // crossfade | ||
| 46 | |||
| 40 | }, | 47 | }, |
| 41 | .frame_functions = { | 48 | .frame_functions = { |
| 42 | keyframe_fade_in_all_leds, | 49 | keyframe_fade_in_all_leds, |
| @@ -46,7 +53,13 @@ keyframe_animation_t led_test_animation = { | |||
| 46 | keyframe_led_left_to_right_gradient, | 53 | keyframe_led_left_to_right_gradient, |
| 47 | keyframe_led_crossfade, | 54 | keyframe_led_crossfade, |
| 48 | keyframe_led_top_to_bottom_gradient, | 55 | keyframe_led_top_to_bottom_gradient, |
| 49 | keyframe_led_crossfade | 56 | keyframe_mirror_led_orientation, |
| 57 | keyframe_led_crossfade, | ||
| 58 | keyframe_led_left_to_right_gradient, | ||
| 59 | keyframe_led_crossfade, | ||
| 60 | keyframe_led_top_to_bottom_gradient, | ||
| 61 | keyframe_normal_led_orientation, | ||
| 62 | keyframe_led_crossfade, | ||
| 50 | }, | 63 | }, |
| 51 | }; | 64 | }; |
| 52 | 65 | ||
| @@ -123,7 +136,6 @@ static void copy_current_led_state(uint8_t* dest) { | |||
| 123 | } | 136 | } |
| 124 | } | 137 | } |
| 125 | } | 138 | } |
| 126 | |||
| 127 | bool keyframe_led_crossfade(keyframe_animation_t* animation, visualizer_state_t* state) { | 139 | bool keyframe_led_crossfade(keyframe_animation_t* animation, visualizer_state_t* state) { |
| 128 | (void)state; | 140 | (void)state; |
| 129 | if (animation->first_update_of_frame) { | 141 | if (animation->first_update_of_frame) { |
| @@ -139,3 +151,17 @@ bool keyframe_led_crossfade(keyframe_animation_t* animation, visualizer_state_t* | |||
| 139 | } | 151 | } |
| 140 | return true; | 152 | return true; |
| 141 | } | 153 | } |
| 154 | |||
| 155 | bool keyframe_mirror_led_orientation(keyframe_animation_t* animation, visualizer_state_t* state) { | ||
| 156 | (void)state; | ||
| 157 | (void)animation; | ||
| 158 | gdispGSetOrientation(LED_DISPLAY, GDISP_ROTATE_180); | ||
| 159 | return true; | ||
| 160 | } | ||
| 161 | |||
| 162 | bool keyframe_normal_led_orientation(keyframe_animation_t* animation, visualizer_state_t* state) { | ||
| 163 | (void)state; | ||
| 164 | (void)animation; | ||
| 165 | gdispGSetOrientation(LED_DISPLAY, GDISP_ROTATE_0); | ||
| 166 | return true; | ||
| 167 | } | ||
diff --git a/led_test.h b/led_test.h index e14b25e79..5e2325753 100644 --- a/led_test.h +++ b/led_test.h | |||
| @@ -32,6 +32,8 @@ bool keyframe_fade_out_all_leds(keyframe_animation_t* animation, visualizer_stat | |||
| 32 | bool keyframe_led_left_to_right_gradient(keyframe_animation_t* animation, visualizer_state_t* state); | 32 | bool keyframe_led_left_to_right_gradient(keyframe_animation_t* animation, visualizer_state_t* state); |
| 33 | bool keyframe_led_top_to_bottom_gradient(keyframe_animation_t* animation, visualizer_state_t* state); | 33 | bool keyframe_led_top_to_bottom_gradient(keyframe_animation_t* animation, visualizer_state_t* state); |
| 34 | bool keyframe_led_crossfade(keyframe_animation_t* animation, visualizer_state_t* state); | 34 | bool keyframe_led_crossfade(keyframe_animation_t* animation, visualizer_state_t* state); |
| 35 | bool keyframe_mirror_led_orientation(keyframe_animation_t* animation, visualizer_state_t* state); | ||
| 36 | bool keyframe_normal_led_orientation(keyframe_animation_t* animation, visualizer_state_t* state); | ||
| 35 | 37 | ||
| 36 | extern keyframe_animation_t led_test_animation; | 38 | extern keyframe_animation_t led_test_animation; |
| 37 | 39 | ||
diff --git a/visualizer.h b/visualizer.h index 5375e0130..8a2772c6d 100644 --- a/visualizer.h +++ b/visualizer.h | |||
| @@ -45,8 +45,8 @@ 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 |
| 46 | void visualizer_resume(void); | 46 | void visualizer_resume(void); |
| 47 | 47 | ||
| 48 | // If you need support for more than 8 keyframes per animation, you can change this | 48 | // If you need support for more than 16 keyframes per animation, you can change this |
| 49 | #define MAX_VISUALIZER_KEY_FRAMES 8 | 49 | #define MAX_VISUALIZER_KEY_FRAMES 16 |
| 50 | 50 | ||
| 51 | struct keyframe_animation_t; | 51 | struct keyframe_animation_t; |
| 52 | 52 | ||
