diff options
Diffstat (limited to 'led_test.c')
| -rw-r--r-- | led_test.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/led_test.c b/led_test.c index ce6c2e68e..ed65a0baa 100644 --- a/led_test.c +++ b/led_test.c | |||
| @@ -63,7 +63,7 @@ keyframe_animation_t led_test_animation = { | |||
| 63 | }, | 63 | }, |
| 64 | }; | 64 | }; |
| 65 | 65 | ||
| 66 | static uint8_t fade_led_color(keyframe_animation_t* animation, uint8_t from, uint8_t to) { | 66 | static uint8_t fade_led_color(keyframe_animation_t* animation, int from, int to) { |
| 67 | int frame_length = animation->frame_lengths[animation->current_frame]; | 67 | int frame_length = animation->frame_lengths[animation->current_frame]; |
| 68 | int current_pos = frame_length - animation->time_left_in_frame; | 68 | int current_pos = frame_length - animation->time_left_in_frame; |
| 69 | int delta = to - from; | 69 | int delta = to - from; |
| @@ -107,8 +107,8 @@ bool keyframe_fade_out_all_leds(keyframe_animation_t* animation, visualizer_stat | |||
| 107 | 107 | ||
| 108 | bool keyframe_led_left_to_right_gradient(keyframe_animation_t* animation, visualizer_state_t* state) { | 108 | bool keyframe_led_left_to_right_gradient(keyframe_animation_t* animation, visualizer_state_t* state) { |
| 109 | (void)state; | 109 | (void)state; |
| 110 | int frame_length = animation->frame_lengths[animation->current_frame]; | 110 | float frame_length = animation->frame_lengths[animation->current_frame]; |
| 111 | int current_pos = frame_length - animation->time_left_in_frame; | 111 | float current_pos = frame_length - animation->time_left_in_frame; |
| 112 | float t = current_pos / frame_length; | 112 | float t = current_pos / frame_length; |
| 113 | for (int i=0; i< NUM_COLS; i++) { | 113 | for (int i=0; i< NUM_COLS; i++) { |
| 114 | uint8_t color = compute_gradient_color(t, i, NUM_COLS); | 114 | uint8_t color = compute_gradient_color(t, i, NUM_COLS); |
| @@ -119,8 +119,8 @@ bool keyframe_led_left_to_right_gradient(keyframe_animation_t* animation, visual | |||
| 119 | 119 | ||
| 120 | bool keyframe_led_top_to_bottom_gradient(keyframe_animation_t* animation, visualizer_state_t* state) { | 120 | bool keyframe_led_top_to_bottom_gradient(keyframe_animation_t* animation, visualizer_state_t* state) { |
| 121 | (void)state; | 121 | (void)state; |
| 122 | int frame_length = animation->frame_lengths[animation->current_frame]; | 122 | float frame_length = animation->frame_lengths[animation->current_frame]; |
| 123 | int current_pos = frame_length - animation->time_left_in_frame; | 123 | float current_pos = frame_length - animation->time_left_in_frame; |
| 124 | float t = current_pos / frame_length; | 124 | float t = current_pos / frame_length; |
| 125 | for (int i=0; i< NUM_ROWS; i++) { | 125 | for (int i=0; i< NUM_ROWS; i++) { |
| 126 | uint8_t color = compute_gradient_color(t, i, NUM_ROWS); | 126 | uint8_t color = compute_gradient_color(t, i, NUM_ROWS); |
| @@ -156,12 +156,12 @@ bool keyframe_mirror_led_orientation(keyframe_animation_t* animation, visualizer | |||
| 156 | (void)state; | 156 | (void)state; |
| 157 | (void)animation; | 157 | (void)animation; |
| 158 | gdispGSetOrientation(LED_DISPLAY, GDISP_ROTATE_180); | 158 | gdispGSetOrientation(LED_DISPLAY, GDISP_ROTATE_180); |
| 159 | return true; | 159 | return false; |
| 160 | } | 160 | } |
| 161 | 161 | ||
| 162 | bool keyframe_normal_led_orientation(keyframe_animation_t* animation, visualizer_state_t* state) { | 162 | bool keyframe_normal_led_orientation(keyframe_animation_t* animation, visualizer_state_t* state) { |
| 163 | (void)state; | 163 | (void)state; |
| 164 | (void)animation; | 164 | (void)animation; |
| 165 | gdispGSetOrientation(LED_DISPLAY, GDISP_ROTATE_0); | 165 | gdispGSetOrientation(LED_DISPLAY, GDISP_ROTATE_0); |
| 166 | return true; | 166 | return false; |
| 167 | } | 167 | } |
