diff options
| author | Fred Sundvik <fsundvik@gmail.com> | 2016-07-07 12:46:10 +0300 |
|---|---|---|
| committer | Fred Sundvik <fsundvik@gmail.com> | 2016-07-07 12:46:10 +0300 |
| commit | 07d0d5cbe48d7afaf0bc8c9916d40179ec51cb42 (patch) | |
| tree | 0cf84f2066fc5d285a04f4213f74daa534eb4d17 /quantum/visualizer/led_test.c | |
| parent | 9772e697a04472f3c710376bfb2919ec2c3672a3 (diff) | |
| download | qmk_firmware-07d0d5cbe48d7afaf0bc8c9916d40179ec51cb42.tar.gz qmk_firmware-07d0d5cbe48d7afaf0bc8c9916d40179ec51cb42.zip | |
Makefile fixes and update of Visualizer
Diffstat (limited to 'quantum/visualizer/led_test.c')
| -rw-r--r-- | quantum/visualizer/led_test.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/quantum/visualizer/led_test.c b/quantum/visualizer/led_test.c index c2ea30b55..a9abace8d 100644 --- a/quantum/visualizer/led_test.c +++ b/quantum/visualizer/led_test.c | |||
| @@ -89,8 +89,8 @@ static uint8_t crossfade_start_frame[NUM_ROWS][NUM_COLS]; | |||
| 89 | static uint8_t crossfade_end_frame[NUM_ROWS][NUM_COLS]; | 89 | static uint8_t crossfade_end_frame[NUM_ROWS][NUM_COLS]; |
| 90 | 90 | ||
| 91 | static uint8_t compute_gradient_color(float t, float index, float num) { | 91 | static uint8_t compute_gradient_color(float t, float index, float num) { |
| 92 | const float two_pi = 2.0f * PI; | 92 | const float two_pi = M_2_PI; |
| 93 | float normalized_index = (1.0f - index / (num - 1)) * two_pi; | 93 | float normalized_index = (1.0f - index / (num - 1.0f)) * two_pi; |
| 94 | float x = t * two_pi + normalized_index; | 94 | float x = t * two_pi + normalized_index; |
| 95 | float v = 0.5 * (cosf(x) + 1.0f); | 95 | float v = 0.5 * (cosf(x) + 1.0f); |
| 96 | return (uint8_t)(255.0f * v); | 96 | return (uint8_t)(255.0f * v); |
