diff options
| author | Fred Sundvik <fsundvik@gmail.com> | 2017-06-25 12:55:18 +0300 |
|---|---|---|
| committer | Fred Sundvik <fsundvik@gmail.com> | 2017-06-25 12:55:18 +0300 |
| commit | 1e6a3f9e170759dd88ba29f67d35d9c34b3f8f8c (patch) | |
| tree | 5620b3e8325395fd07e95496ed8d60da96051692 /quantum/visualizer | |
| parent | dcf9fa1aaad50fa5dc920407e9148f1192e76705 (diff) | |
| download | qmk_firmware-1e6a3f9e170759dd88ba29f67d35d9c34b3f8f8c.tar.gz qmk_firmware-1e6a3f9e170759dd88ba29f67d35d9c34b3f8f8c.zip | |
Change M_2_PI to 2 * PI as it should be
Diffstat (limited to 'quantum/visualizer')
| -rw-r--r-- | quantum/visualizer/led_keyframes.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/quantum/visualizer/led_keyframes.c b/quantum/visualizer/led_keyframes.c index c14491e5e..2f4e20043 100644 --- a/quantum/visualizer/led_keyframes.c +++ b/quantum/visualizer/led_keyframes.c | |||
| @@ -48,7 +48,7 @@ static uint8_t crossfade_start_frame[NUM_ROWS][NUM_COLS]; | |||
| 48 | static uint8_t crossfade_end_frame[NUM_ROWS][NUM_COLS]; | 48 | static uint8_t crossfade_end_frame[NUM_ROWS][NUM_COLS]; |
| 49 | 49 | ||
| 50 | static uint8_t compute_gradient_color(float t, float index, float num) { | 50 | static uint8_t compute_gradient_color(float t, float index, float num) { |
| 51 | const float two_pi = M_2_PI; | 51 | const float two_pi = M_PI * 2.0f; |
| 52 | float normalized_index = (1.0f - index / (num - 1.0f)) * two_pi; | 52 | float normalized_index = (1.0f - index / (num - 1.0f)) * two_pi; |
| 53 | float x = t * two_pi + normalized_index; | 53 | float x = t * two_pi + normalized_index; |
| 54 | float v = 0.5 * (cosf(x) + 1.0f); | 54 | float v = 0.5 * (cosf(x) + 1.0f); |
