diff options
| author | Jack Humbert <jack.humb@gmail.com> | 2016-11-17 17:42:14 -0500 |
|---|---|---|
| committer | Jack Humbert <jack.humb@gmail.com> | 2016-11-17 17:42:14 -0500 |
| commit | 3774a7fcdab5544fc787f4c200be05fcd417e31f (patch) | |
| tree | bb1c582d658ec7f19bce9d43f1c536b83066d40b | |
| parent | 530dd3377e4d409a7ca2fee7e47b60b735ebc0fa (diff) | |
| download | qmk_firmware-3774a7fcdab5544fc787f4c200be05fcd417e31f.tar.gz qmk_firmware-3774a7fcdab5544fc787f4c200be05fcd417e31f.zip | |
rgb light through midi
26 files changed, 126 insertions, 31 deletions
diff --git a/keyboards/amj60/config.h b/keyboards/amj60/config.h index d98e0e9f2..7c06f9a6c 100644 --- a/keyboards/amj60/config.h +++ b/keyboards/amj60/config.h | |||
| @@ -67,7 +67,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. | |||
| 67 | */ | 67 | */ |
| 68 | 68 | ||
| 69 | #define RGB_DI_PIN E2 | 69 | #define RGB_DI_PIN E2 |
| 70 | #define RGBLIGHT_TIMER | 70 | #define RGBLIGHT_ANIMATIONS |
| 71 | #define RGBLED_NUM 8 // Number of LEDs | 71 | #define RGBLED_NUM 8 // Number of LEDs |
| 72 | #define RGBLIGHT_HUE_STEP 10 | 72 | #define RGBLIGHT_HUE_STEP 10 |
| 73 | #define RGBLIGHT_SAT_STEP 17 | 73 | #define RGBLIGHT_SAT_STEP 17 |
diff --git a/keyboards/clueboard/rev1/config.h b/keyboards/clueboard/rev1/config.h index 8c9497232..f40876ffb 100644 --- a/keyboards/clueboard/rev1/config.h +++ b/keyboards/clueboard/rev1/config.h | |||
| @@ -26,7 +26,7 @@ | |||
| 26 | /* Underlight configuration | 26 | /* Underlight configuration |
| 27 | */ | 27 | */ |
| 28 | #define RGB_DI_PIN B2 | 28 | #define RGB_DI_PIN B2 |
| 29 | #define RGBLIGHT_TIMER | 29 | #define RGBLIGHT_ANIMATIONS |
| 30 | #define RGBLED_NUM 14 // Number of LEDs | 30 | #define RGBLED_NUM 14 // Number of LEDs |
| 31 | #define RGBLIGHT_HUE_STEP 10 | 31 | #define RGBLIGHT_HUE_STEP 10 |
| 32 | #define RGBLIGHT_SAT_STEP 17 | 32 | #define RGBLIGHT_SAT_STEP 17 |
diff --git a/keyboards/clueboard/rev2/config.h b/keyboards/clueboard/rev2/config.h index 15ca4ece8..8435fd02b 100644 --- a/keyboards/clueboard/rev2/config.h +++ b/keyboards/clueboard/rev2/config.h | |||
| @@ -30,7 +30,7 @@ | |||
| 30 | /* Underlight configuration | 30 | /* Underlight configuration |
| 31 | */ | 31 | */ |
| 32 | #define RGB_DI_PIN D7 | 32 | #define RGB_DI_PIN D7 |
| 33 | #define RGBLIGHT_TIMER | 33 | #define RGBLIGHT_ANIMATIONS |
| 34 | #define RGBLED_NUM 14 // Number of LEDs | 34 | #define RGBLED_NUM 14 // Number of LEDs |
| 35 | #define RGBLIGHT_HUE_STEP 10 | 35 | #define RGBLIGHT_HUE_STEP 10 |
| 36 | #define RGBLIGHT_SAT_STEP 17 | 36 | #define RGBLIGHT_SAT_STEP 17 |
diff --git a/keyboards/cluecard/config.h b/keyboards/cluecard/config.h index 765347b13..6520eb557 100644 --- a/keyboards/cluecard/config.h +++ b/keyboards/cluecard/config.h | |||
| @@ -140,7 +140,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. | |||
| 140 | /* Underlight configuration | 140 | /* Underlight configuration |
| 141 | */ | 141 | */ |
| 142 | #define RGB_DI_PIN E6 | 142 | #define RGB_DI_PIN E6 |
| 143 | //#define RGBLIGHT_TIMER | 143 | //#define RGBLIGHT_ANIMATIONS |
| 144 | #define RGBLED_NUM 4 // Number of LEDs | 144 | #define RGBLED_NUM 4 // Number of LEDs |
| 145 | #define RGBLIGHT_HUE_STEP 10 | 145 | #define RGBLIGHT_HUE_STEP 10 |
| 146 | #define RGBLIGHT_SAT_STEP 17 | 146 | #define RGBLIGHT_SAT_STEP 17 |
diff --git a/keyboards/cluecard/keymaps/rgb_effects/config.h b/keyboards/cluecard/keymaps/rgb_effects/config.h index e88847df4..c6c9342c8 100644 --- a/keyboards/cluecard/keymaps/rgb_effects/config.h +++ b/keyboards/cluecard/keymaps/rgb_effects/config.h | |||
| @@ -4,7 +4,7 @@ | |||
| 4 | #include "../../config.h" | 4 | #include "../../config.h" |
| 5 | 5 | ||
| 6 | // place overrides here | 6 | // place overrides here |
| 7 | #define RGBLIGHT_TIMER | 7 | #define RGBLIGHT_ANIMATIONS |
| 8 | #define RGBLIGHT_EFFECT_SNAKE_LENGTH 3 | 8 | #define RGBLIGHT_EFFECT_SNAKE_LENGTH 3 |
| 9 | #define RGBLIGHT_EFFECT_KNIGHT_LENGTH 2 | 9 | #define RGBLIGHT_EFFECT_KNIGHT_LENGTH 2 |
| 10 | #define RGBLIGHT_EFFECT_KNIGHT_OFFSET 2 | 10 | #define RGBLIGHT_EFFECT_KNIGHT_OFFSET 2 |
diff --git a/keyboards/cluepad/config.h b/keyboards/cluepad/config.h index bae05fade..bd64dfd27 100644 --- a/keyboards/cluepad/config.h +++ b/keyboards/cluepad/config.h | |||
| @@ -70,7 +70,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. | |||
| 70 | /* Underlight configuration | 70 | /* Underlight configuration |
| 71 | */ | 71 | */ |
| 72 | #define RGB_DI_PIN F6 | 72 | #define RGB_DI_PIN F6 |
| 73 | #define RGBLIGHT_TIMER | 73 | #define RGBLIGHT_ANIMATIONS |
| 74 | #define RGBLED_NUM 4 // Number of LEDs | 74 | #define RGBLED_NUM 4 // Number of LEDs |
| 75 | #define RGBLIGHT_HUE_STEP 10 | 75 | #define RGBLIGHT_HUE_STEP 10 |
| 76 | #define RGBLIGHT_SAT_STEP 17 | 76 | #define RGBLIGHT_SAT_STEP 17 |
diff --git a/keyboards/ergodox/keymaps/jack/config.h b/keyboards/ergodox/keymaps/jack/config.h index 5bf109c18..5c1165226 100644 --- a/keyboards/ergodox/keymaps/jack/config.h +++ b/keyboards/ergodox/keymaps/jack/config.h | |||
| @@ -5,12 +5,13 @@ | |||
| 5 | 5 | ||
| 6 | /* ws2812 RGB LED */ | 6 | /* ws2812 RGB LED */ |
| 7 | #define RGB_DI_PIN D7 | 7 | #define RGB_DI_PIN D7 |
| 8 | #define RGBLIGHT_TIMER | 8 | #define RGBLIGHT_ANIMATIONS |
| 9 | #define RGBLED_NUM 15 // Number of LEDs | 9 | #define RGBLED_NUM 15 // Number of LEDs |
| 10 | #define RGBLIGHT_HUE_STEP 12 | 10 | #define RGBLIGHT_HUE_STEP 12 |
| 11 | #define RGBLIGHT_SAT_STEP 255 | 11 | #define RGBLIGHT_SAT_STEP 255 |
| 12 | #define RGBLIGHT_VAL_STEP 12 | 12 | #define RGBLIGHT_VAL_STEP 12 |
| 13 | 13 | ||
| 14 | #define RGB_MIDI | 14 | #define RGB_MIDI |
| 15 | #define RGBW_BB_TWI | ||
| 15 | 16 | ||
| 16 | #endif \ No newline at end of file | 17 | #endif \ No newline at end of file |
diff --git a/keyboards/gh60/keymaps/robotmaxtron/config.h b/keyboards/gh60/keymaps/robotmaxtron/config.h index 6a29e6b8c..bcd753461 100644 --- a/keyboards/gh60/keymaps/robotmaxtron/config.h +++ b/keyboards/gh60/keymaps/robotmaxtron/config.h | |||
| @@ -182,7 +182,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. | |||
| 182 | #define ws2812_pin PF4 | 182 | #define ws2812_pin PF4 |
| 183 | */ | 183 | */ |
| 184 | #define RGB_DI_PIN F4 | 184 | #define RGB_DI_PIN F4 |
| 185 | #define RGBLIGHT_TIMER | 185 | #define RGBLIGHT_ANIMATIONS |
| 186 | #define RGBLED_NUM 8 // Number of LEDs | 186 | #define RGBLED_NUM 8 // Number of LEDs |
| 187 | #define RGBLIGHT_HUE_STEP 8 | 187 | #define RGBLIGHT_HUE_STEP 8 |
| 188 | #define RGBLIGHT_SAT_STEP 8 | 188 | #define RGBLIGHT_SAT_STEP 8 |
diff --git a/keyboards/handwired/minorca/keymaps/rgb/config.h b/keyboards/handwired/minorca/keymaps/rgb/config.h index deaac2e26..43b3c5911 100644 --- a/keyboards/handwired/minorca/keymaps/rgb/config.h +++ b/keyboards/handwired/minorca/keymaps/rgb/config.h | |||
| @@ -11,7 +11,7 @@ | |||
| 11 | 11 | ||
| 12 | /* ws2812 RGB LED */ | 12 | /* ws2812 RGB LED */ |
| 13 | #define RGB_DI_PIN D5 | 13 | #define RGB_DI_PIN D5 |
| 14 | #define RGBLIGHT_TIMER | 14 | #define RGBLIGHT_ANIMATIONS |
| 15 | #define RGBLED_NUM 13 // Number of LEDs | 15 | #define RGBLED_NUM 13 // Number of LEDs |
| 16 | #define RGBLIGHT_HUE_STEP 10 | 16 | #define RGBLIGHT_HUE_STEP 10 |
| 17 | #define RGBLIGHT_SAT_STEP 17 | 17 | #define RGBLIGHT_SAT_STEP 17 |
diff --git a/keyboards/jd40/config.h b/keyboards/jd40/config.h index e2594f4b3..047be5707 100644 --- a/keyboards/jd40/config.h +++ b/keyboards/jd40/config.h | |||
| @@ -70,7 +70,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. | |||
| 70 | ) | 70 | ) |
| 71 | 71 | ||
| 72 | #define RGB_DI_PIN D3 | 72 | #define RGB_DI_PIN D3 |
| 73 | #define RGBLIGHT_TIMER | 73 | #define RGBLIGHT_ANIMATIONS |
| 74 | #define RGBLED_NUM 12 // Number of LEDs | 74 | #define RGBLED_NUM 12 // Number of LEDs |
| 75 | #define RGBLIGHT_HUE_STEP 8 | 75 | #define RGBLIGHT_HUE_STEP 8 |
| 76 | #define RGBLIGHT_SAT_STEP 8 | 76 | #define RGBLIGHT_SAT_STEP 8 |
diff --git a/keyboards/kc60/keymaps/ws2812/config.h b/keyboards/kc60/keymaps/ws2812/config.h index 2f39ea8e5..43abf6228 100644 --- a/keyboards/kc60/keymaps/ws2812/config.h +++ b/keyboards/kc60/keymaps/ws2812/config.h | |||
| @@ -2,7 +2,7 @@ | |||
| 2 | 2 | ||
| 3 | /* WS2812B RGB Underglow LED */ | 3 | /* WS2812B RGB Underglow LED */ |
| 4 | #define RGB_DI_PIN F5 // Based on wiring depicted in ws2812_wiring.jpg | 4 | #define RGB_DI_PIN F5 // Based on wiring depicted in ws2812_wiring.jpg |
| 5 | #define RGBLIGHT_TIMER | 5 | #define RGBLIGHT_ANIMATIONS |
| 6 | #define RGBLED_NUM 16 // Number of LEDs. Change this to match your use case. | 6 | #define RGBLED_NUM 16 // Number of LEDs. Change this to match your use case. |
| 7 | #define RGBLIGHT_HUE_STEP 8 | 7 | #define RGBLIGHT_HUE_STEP 8 |
| 8 | #define RGBLIGHT_SAT_STEP 8 | 8 | #define RGBLIGHT_SAT_STEP 8 |
diff --git a/keyboards/lets_split/config.h b/keyboards/lets_split/config.h index f4d900acc..b0ad522fc 100644 --- a/keyboards/lets_split/config.h +++ b/keyboards/lets_split/config.h | |||
| @@ -75,7 +75,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. | |||
| 75 | 75 | ||
| 76 | /* ws2812 RGB LED */ | 76 | /* ws2812 RGB LED */ |
| 77 | #define RGB_DI_PIN D4 | 77 | #define RGB_DI_PIN D4 |
| 78 | #define RGBLIGHT_TIMER | 78 | #define RGBLIGHT_ANIMATIONS |
| 79 | #define RGBLED_NUM 8 // Number of LEDs | 79 | #define RGBLED_NUM 8 // Number of LEDs |
| 80 | #define RGBLIGHT_HUE_STEP 10 | 80 | #define RGBLIGHT_HUE_STEP 10 |
| 81 | #define RGBLIGHT_SAT_STEP 17 | 81 | #define RGBLIGHT_SAT_STEP 17 |
diff --git a/keyboards/lets_split/keymaps/i2c/config.h b/keyboards/lets_split/keymaps/i2c/config.h index 2671fabf6..72e5ae66b 100644 --- a/keyboards/lets_split/keymaps/i2c/config.h +++ b/keyboards/lets_split/keymaps/i2c/config.h | |||
| @@ -75,7 +75,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. | |||
| 75 | 75 | ||
| 76 | /* ws2812 RGB LED */ | 76 | /* ws2812 RGB LED */ |
| 77 | #define RGB_DI_PIN D4 | 77 | #define RGB_DI_PIN D4 |
| 78 | #define RGBLIGHT_TIMER | 78 | #define RGBLIGHT_ANIMATIONS |
| 79 | #define RGBLED_NUM 8 // Number of LEDs | 79 | #define RGBLED_NUM 8 // Number of LEDs |
| 80 | #define RGBLIGHT_HUE_STEP 10 | 80 | #define RGBLIGHT_HUE_STEP 10 |
| 81 | #define RGBLIGHT_SAT_STEP 17 | 81 | #define RGBLIGHT_SAT_STEP 17 |
diff --git a/keyboards/lets_split/keymaps/serial/config.h b/keyboards/lets_split/keymaps/serial/config.h index f4d900acc..b0ad522fc 100644 --- a/keyboards/lets_split/keymaps/serial/config.h +++ b/keyboards/lets_split/keymaps/serial/config.h | |||
| @@ -75,7 +75,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. | |||
| 75 | 75 | ||
| 76 | /* ws2812 RGB LED */ | 76 | /* ws2812 RGB LED */ |
| 77 | #define RGB_DI_PIN D4 | 77 | #define RGB_DI_PIN D4 |
| 78 | #define RGBLIGHT_TIMER | 78 | #define RGBLIGHT_ANIMATIONS |
| 79 | #define RGBLED_NUM 8 // Number of LEDs | 79 | #define RGBLED_NUM 8 // Number of LEDs |
| 80 | #define RGBLIGHT_HUE_STEP 10 | 80 | #define RGBLIGHT_HUE_STEP 10 |
| 81 | #define RGBLIGHT_SAT_STEP 17 | 81 | #define RGBLIGHT_SAT_STEP 17 |
diff --git a/keyboards/phantom/config.h b/keyboards/phantom/config.h index 983a1d73f..71a33498b 100644 --- a/keyboards/phantom/config.h +++ b/keyboards/phantom/config.h | |||
| @@ -63,7 +63,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. | |||
| 63 | /* Underlight configuration | 63 | /* Underlight configuration |
| 64 | */ | 64 | */ |
| 65 | #define RGB_DI_PIN E2 | 65 | #define RGB_DI_PIN E2 |
| 66 | #define RGBLIGHT_TIMER | 66 | #define RGBLIGHT_ANIMATIONS |
| 67 | #define RGBLED_NUM 20 // Number of LEDs | 67 | #define RGBLED_NUM 20 // Number of LEDs |
| 68 | #define RGBLIGHT_HUE_STEP 10 | 68 | #define RGBLIGHT_HUE_STEP 10 |
| 69 | #define RGBLIGHT_SAT_STEP 17 | 69 | #define RGBLIGHT_SAT_STEP 17 |
diff --git a/keyboards/planck/keymaps/experimental/config.h b/keyboards/planck/keymaps/experimental/config.h index 52acd1905..cc093bee4 100644 --- a/keyboards/planck/keymaps/experimental/config.h +++ b/keyboards/planck/keymaps/experimental/config.h | |||
| @@ -9,7 +9,7 @@ | |||
| 9 | 9 | ||
| 10 | /* ws2812 RGB LED */ | 10 | /* ws2812 RGB LED */ |
| 11 | #define RGB_DI_PIN B1 | 11 | #define RGB_DI_PIN B1 |
| 12 | #define RGBLIGHT_TIMER | 12 | #define RGBLIGHT_ANIMATIONS |
| 13 | #define RGBLED_NUM 8 // Number of LEDs | 13 | #define RGBLED_NUM 8 // Number of LEDs |
| 14 | #define RGBLIGHT_HUE_STEP 10 | 14 | #define RGBLIGHT_HUE_STEP 10 |
| 15 | #define RGBLIGHT_SAT_STEP 17 | 15 | #define RGBLIGHT_SAT_STEP 17 |
diff --git a/keyboards/planck/keymaps/yang/config.h b/keyboards/planck/keymaps/yang/config.h index feb5a1190..4ed19d76f 100644 --- a/keyboards/planck/keymaps/yang/config.h +++ b/keyboards/planck/keymaps/yang/config.h | |||
| @@ -5,7 +5,7 @@ | |||
| 5 | 5 | ||
| 6 | /* ws2812 RGB LED */ | 6 | /* ws2812 RGB LED */ |
| 7 | #define RGB_DI_PIN D1 | 7 | #define RGB_DI_PIN D1 |
| 8 | #define RGBLIGHT_TIMER | 8 | #define RGBLIGHT_ANIMATIONS |
| 9 | #define RGBLED_NUM 28 // Number of LEDs | 9 | #define RGBLED_NUM 28 // Number of LEDs |
| 10 | #define RGBLIGHT_HUE_STEP 10 | 10 | #define RGBLIGHT_HUE_STEP 10 |
| 11 | #define RGBLIGHT_SAT_STEP 17 | 11 | #define RGBLIGHT_SAT_STEP 17 |
diff --git a/keyboards/preonic/config.h b/keyboards/preonic/config.h index 3fb978c2f..f88acf211 100644 --- a/keyboards/preonic/config.h +++ b/keyboards/preonic/config.h | |||
| @@ -63,7 +63,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. | |||
| 63 | 63 | ||
| 64 | /* ws2812 RGB LED */ | 64 | /* ws2812 RGB LED */ |
| 65 | #define RGB_DI_PIN D1 | 65 | #define RGB_DI_PIN D1 |
| 66 | #define RGBLIGHT_TIMER | 66 | #define RGBLIGHT_ANIMATIONS |
| 67 | #define RGBLED_NUM 28 // Number of LEDs | 67 | #define RGBLED_NUM 28 // Number of LEDs |
| 68 | #define RGBLIGHT_HUE_STEP 10 | 68 | #define RGBLIGHT_HUE_STEP 10 |
| 69 | #define RGBLIGHT_SAT_STEP 17 | 69 | #define RGBLIGHT_SAT_STEP 17 |
diff --git a/keyboards/preonic/keymaps/kinesis/config.h b/keyboards/preonic/keymaps/kinesis/config.h index 086baa84f..e6099ceb8 100644 --- a/keyboards/preonic/keymaps/kinesis/config.h +++ b/keyboards/preonic/keymaps/kinesis/config.h | |||
| @@ -63,7 +63,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. | |||
| 63 | 63 | ||
| 64 | /* ws2812 RGB LED */ | 64 | /* ws2812 RGB LED */ |
| 65 | #define RGB_DI_PIN D1 | 65 | #define RGB_DI_PIN D1 |
| 66 | #define RGBLIGHT_TIMER | 66 | #define RGBLIGHT_ANIMATIONS |
| 67 | #define RGBLED_NUM 28 // Number of LEDs | 67 | #define RGBLED_NUM 28 // Number of LEDs |
| 68 | #define RGBLIGHT_HUE_STEP 10 | 68 | #define RGBLIGHT_HUE_STEP 10 |
| 69 | #define RGBLIGHT_SAT_STEP 17 | 69 | #define RGBLIGHT_SAT_STEP 17 |
diff --git a/keyboards/satan/config.h b/keyboards/satan/config.h index 7e9f91cc8..eb357b39e 100644 --- a/keyboards/satan/config.h +++ b/keyboards/satan/config.h | |||
| @@ -67,7 +67,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. | |||
| 67 | */ | 67 | */ |
| 68 | 68 | ||
| 69 | #define RGB_DI_PIN E2 | 69 | #define RGB_DI_PIN E2 |
| 70 | #define RGBLIGHT_TIMER | 70 | #define RGBLIGHT_ANIMATIONS |
| 71 | #define RGBLED_NUM 8 // Number of LEDs | 71 | #define RGBLED_NUM 8 // Number of LEDs |
| 72 | #define RGBLIGHT_HUE_STEP 10 | 72 | #define RGBLIGHT_HUE_STEP 10 |
| 73 | #define RGBLIGHT_SAT_STEP 17 | 73 | #define RGBLIGHT_SAT_STEP 17 |
diff --git a/keyboards/tada68/config.h b/keyboards/tada68/config.h index 5d8757936..19cf9c9b3 100644 --- a/keyboards/tada68/config.h +++ b/keyboards/tada68/config.h | |||
| @@ -67,7 +67,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. | |||
| 67 | */ | 67 | */ |
| 68 | 68 | ||
| 69 | /*#define RGB_DI_PIN E2 | 69 | /*#define RGB_DI_PIN E2 |
| 70 | #define RGBLIGHT_TIMER | 70 | #define RGBLIGHT_ANIMATIONS |
| 71 | #define RGBLED_NUM 2 // Number of LEDs | 71 | #define RGBLED_NUM 2 // Number of LEDs |
| 72 | #define RGBLIGHT_HUE_STEP 10 | 72 | #define RGBLIGHT_HUE_STEP 10 |
| 73 | #define RGBLIGHT_SAT_STEP 17 | 73 | #define RGBLIGHT_SAT_STEP 17 |
diff --git a/quantum/light_ws2812.c b/quantum/light_ws2812.c index aac058f53..a883b1388 100755 --- a/quantum/light_ws2812.c +++ b/quantum/light_ws2812.c | |||
| @@ -16,8 +16,6 @@ | |||
| 16 | #include <util/delay.h> | 16 | #include <util/delay.h> |
| 17 | #include "debug.h" | 17 | #include "debug.h" |
| 18 | 18 | ||
| 19 | #define RGBW_BB_TWI 1 | ||
| 20 | |||
| 21 | #ifdef RGBW_BB_TWI | 19 | #ifdef RGBW_BB_TWI |
| 22 | 20 | ||
| 23 | // Port for the I2C | 21 | // Port for the I2C |
diff --git a/quantum/rgblight.c b/quantum/rgblight.c index 1901010bf..6b58f6654 100644 --- a/quantum/rgblight.c +++ b/quantum/rgblight.c | |||
| @@ -174,7 +174,7 @@ void rgblight_init(void) { | |||
| 174 | } | 174 | } |
| 175 | eeconfig_debug_rgblight(); // display current eeprom values | 175 | eeconfig_debug_rgblight(); // display current eeprom values |
| 176 | 176 | ||
| 177 | #if !defined(AUDIO_ENABLE) && defined(RGBLIGHT_TIMER) | 177 | #ifdef RGBLIGHT_ANIMATIONS |
| 178 | rgblight_timer_init(); // setup the timer | 178 | rgblight_timer_init(); // setup the timer |
| 179 | #endif | 179 | #endif |
| 180 | 180 | ||
| @@ -221,7 +221,7 @@ void rgblight_mode(uint8_t mode) { | |||
| 221 | eeconfig_update_rgblight(rgblight_config.raw); | 221 | eeconfig_update_rgblight(rgblight_config.raw); |
| 222 | xprintf("rgblight mode: %u\n", rgblight_config.mode); | 222 | xprintf("rgblight mode: %u\n", rgblight_config.mode); |
| 223 | if (rgblight_config.mode == 1) { | 223 | if (rgblight_config.mode == 1) { |
| 224 | #if !defined(AUDIO_ENABLE) && defined(RGBLIGHT_TIMER) | 224 | #ifdef RGBLIGHT_ANIMATIONS |
| 225 | rgblight_timer_disable(); | 225 | rgblight_timer_disable(); |
| 226 | #endif | 226 | #endif |
| 227 | } else if (rgblight_config.mode >= 2 && rgblight_config.mode <= 23) { | 227 | } else if (rgblight_config.mode >= 2 && rgblight_config.mode <= 23) { |
| @@ -231,7 +231,7 @@ void rgblight_mode(uint8_t mode) { | |||
| 231 | // MODE 15-20, snake | 231 | // MODE 15-20, snake |
| 232 | // MODE 21-23, knight | 232 | // MODE 21-23, knight |
| 233 | 233 | ||
| 234 | #if !defined(AUDIO_ENABLE) && defined(RGBLIGHT_TIMER) | 234 | #ifdef RGBLIGHT_ANIMATIONS |
| 235 | rgblight_timer_enable(); | 235 | rgblight_timer_enable(); |
| 236 | #endif | 236 | #endif |
| 237 | } | 237 | } |
| @@ -245,7 +245,7 @@ void rgblight_toggle(void) { | |||
| 245 | if (rgblight_config.enable) { | 245 | if (rgblight_config.enable) { |
| 246 | rgblight_mode(rgblight_config.mode); | 246 | rgblight_mode(rgblight_config.mode); |
| 247 | } else { | 247 | } else { |
| 248 | #if !defined(AUDIO_ENABLE) && defined(RGBLIGHT_TIMER) | 248 | #ifdef RGBLIGHT_ANIMATIONS |
| 249 | rgblight_timer_disable(); | 249 | rgblight_timer_disable(); |
| 250 | #endif | 250 | #endif |
| 251 | _delay_ms(50); | 251 | _delay_ms(50); |
| @@ -371,7 +371,7 @@ void rgblight_set(void) { | |||
| 371 | } | 371 | } |
| 372 | } | 372 | } |
| 373 | 373 | ||
| 374 | #if !defined(AUDIO_ENABLE) && defined(RGBLIGHT_TIMER) | 374 | #ifdef RGBLIGHT_ANIMATIONS |
| 375 | 375 | ||
| 376 | // Animation timer -- AVR Timer3 | 376 | // Animation timer -- AVR Timer3 |
| 377 | void rgblight_timer_init(void) { | 377 | void rgblight_timer_init(void) { |
diff --git a/quantum/rgblight.h b/quantum/rgblight.h index d16ba24e5..330c2fe1b 100644 --- a/quantum/rgblight.h +++ b/quantum/rgblight.h | |||
| @@ -1,7 +1,7 @@ | |||
| 1 | #ifndef RGBLIGHT_H | 1 | #ifndef RGBLIGHT_H |
| 2 | #define RGBLIGHT_H | 2 | #define RGBLIGHT_H |
| 3 | 3 | ||
| 4 | #if !defined(AUDIO_ENABLE) && defined(RGBLIGHT_TIMER) | 4 | #ifdef RGBLIGHT_ANIMATIONS |
| 5 | #define RGBLIGHT_MODES 23 | 5 | #define RGBLIGHT_MODES 23 |
| 6 | #else | 6 | #else |
| 7 | #define RGBLIGHT_MODES 1 | 7 | #define RGBLIGHT_MODES 1 |
| @@ -1135,12 +1135,12 @@ For this mod, you need an unused pin wiring to DI of WS2812 strip. After wiring | |||
| 1135 | 1135 | ||
| 1136 | RGBLIGHT_ENABLE = yes | 1136 | RGBLIGHT_ENABLE = yes |
| 1137 | 1137 | ||
| 1138 | In order to use the underglow timer functions, you need to have `#define RGBLIGHT_TIMER` in your `config.h`, and have audio disabled (`AUDIO_ENABLE = no` in your Makefile). | 1138 | In order to use the underglow animation functions, you need to have `#define RGBLIGHT_ANIMATIONS` in your `config.h`. |
| 1139 | 1139 | ||
| 1140 | Please add the following options into your config.h, and set them up according your hardware configuration. These settings are for the `F4` pin by default: | 1140 | Please add the following options into your config.h, and set them up according your hardware configuration. These settings are for the `F4` pin by default: |
| 1141 | 1141 | ||
| 1142 | #define RGB_DI_PIN F4 // The pin your RGB strip is wired to | 1142 | #define RGB_DI_PIN F4 // The pin your RGB strip is wired to |
| 1143 | #define RGBLIGHT_TIMER // Require for fancier stuff (not compatible with audio) | 1143 | #define RGBLIGHT_ANIMATIONS // Require for fancier stuff (not compatible with audio) |
| 1144 | #define RGBLED_NUM 14 // Number of LEDs | 1144 | #define RGBLED_NUM 14 // Number of LEDs |
| 1145 | #define RGBLIGHT_HUE_STEP 10 | 1145 | #define RGBLIGHT_HUE_STEP 10 |
| 1146 | #define RGBLIGHT_SAT_STEP 17 | 1146 | #define RGBLIGHT_SAT_STEP 17 |
diff --git a/tmk_core/protocol/lufa/lufa.c b/tmk_core/protocol/lufa/lufa.c index b628cde37..7eb9be601 100644 --- a/tmk_core/protocol/lufa/lufa.c +++ b/tmk_core/protocol/lufa/lufa.c | |||
| @@ -51,6 +51,7 @@ | |||
| 51 | 51 | ||
| 52 | #include "descriptor.h" | 52 | #include "descriptor.h" |
| 53 | #include "lufa.h" | 53 | #include "lufa.h" |
| 54 | #include "quantum.h" | ||
| 54 | 55 | ||
| 55 | #ifdef NKRO_ENABLE | 56 | #ifdef NKRO_ENABLE |
| 56 | #include "keycode_config.h" | 57 | #include "keycode_config.h" |
| @@ -1111,9 +1112,104 @@ void cc_callback(MidiDevice * device, | |||
| 1111 | #endif | 1112 | #endif |
| 1112 | } | 1113 | } |
| 1113 | 1114 | ||
| 1115 | void send_dword(uint32_t number) { | ||
| 1116 | uint16_t word = (number >> 16); | ||
| 1117 | send_word(word); | ||
| 1118 | send_word(number & 0xFFFFUL); | ||
| 1119 | } | ||
| 1120 | |||
| 1121 | void send_word(uint16_t number) { | ||
| 1122 | uint8_t byte = number >> 8; | ||
| 1123 | send_byte(byte); | ||
| 1124 | send_byte(number & 0xFF); | ||
| 1125 | } | ||
| 1126 | |||
| 1127 | void send_byte(uint8_t number) { | ||
| 1128 | uint8_t nibble = number >> 4; | ||
| 1129 | send_nibble(nibble); | ||
| 1130 | send_nibble(number & 0xF); | ||
| 1131 | } | ||
| 1132 | |||
| 1133 | void send_nibble(uint8_t number) { | ||
| 1134 | switch (number) { | ||
| 1135 | case 0: | ||
| 1136 | register_code(KC_0); | ||
| 1137 | unregister_code(KC_0); | ||
| 1138 | break; | ||
| 1139 | case 1 ... 9: | ||
| 1140 | register_code(KC_1 + (number - 1)); | ||
| 1141 | unregister_code(KC_1 + (number - 1)); | ||
| 1142 | break; | ||
| 1143 | case 0xA ... 0xF: | ||
| 1144 | register_code(KC_A + (number - 0xA)); | ||
| 1145 | unregister_code(KC_A + (number - 0xA)); | ||
| 1146 | break; | ||
| 1147 | } | ||
| 1148 | } | ||
| 1149 | |||
| 1150 | uint8_t midi_buffer[16] = {0}; | ||
| 1151 | |||
| 1114 | void sysex_callback(MidiDevice * device, | 1152 | void sysex_callback(MidiDevice * device, |
| 1115 | uint16_t start, uint8_t length, uint8_t * data) { | 1153 | uint16_t start, uint8_t length, uint8_t * data) { |
| 1116 | // for (int i = 0; i < length; i++) | 1154 | // for (int i = 0; i < length; i++) |
| 1117 | // midi_send_cc(device, 15, 0x7F & data[i], 0x7F & (start + i)); | 1155 | // midi_send_cc(device, 15, 0x7F & data[i], 0x7F & (start + i)); |
| 1156 | // if (start == 0x27) { | ||
| 1157 | // SEND_STRING("\n"); | ||
| 1158 | // send_word(start); | ||
| 1159 | // SEND_STRING(": "); | ||
| 1160 | for (uint8_t place = 0; place < length; place++) { | ||
| 1161 | // send_byte(*data); | ||
| 1162 | midi_buffer[start + place] = *data; | ||
| 1163 | if (*data == 0xF7) | ||
| 1164 | sysex_buffer_callback(start + place, &midi_buffer); | ||
| 1165 | // SEND_STRING(" "); | ||
| 1166 | data++; | ||
| 1167 | } | ||
| 1168 | // } | ||
| 1169 | |||
| 1170 | } | ||
| 1171 | |||
| 1172 | void sysex_buffer_callback(uint8_t length, uint8_t * data) { | ||
| 1173 | uint8_t * pointer_copy = data; | ||
| 1174 | |||
| 1175 | if (*data++ != 0xF0) | ||
| 1176 | return | ||
| 1177 | data++; | ||
| 1178 | data++; | ||
| 1179 | data++; | ||
| 1180 | data++; | ||
| 1181 | |||
| 1182 | switch (*data++) { | ||
| 1183 | case 0x27: ; // RGB LED functions | ||
| 1184 | switch (*data++) | ||
| 1185 | case 0x00: ; // Update HSV | ||
| 1186 | uint32_t part1 = *data++; | ||
| 1187 | uint32_t part2 = *data++; | ||
| 1188 | uint32_t part3 = *data++; | ||
| 1189 | uint32_t part4 = *data++; | ||
| 1190 | uint32_t part5 = *data++; | ||
| 1191 | uint32_t chunk = ((part1 & 0x1FUL) << 28) | (part2 << 21) | (part3 << 14) | (part4 << 7) | part5; | ||
| 1192 | // SEND_STRING("\nCHUNK: "); | ||
| 1193 | // send_dword(chunk); | ||
| 1194 | rgblight_sethsv(((chunk >> 16) & 0xFFFF) % 360, (chunk >> 8) & 0xFF, chunk & 0xFF); | ||
| 1195 | // SEND_STRING("\nHUE: "); | ||
| 1196 | // send_word(((chunk >> 16) & 0xFFFF) % 360); | ||
| 1197 | // SEND_STRING("\nSAT: "); | ||
| 1198 | // send_word((chunk >> 8) & 0xFF); | ||
| 1199 | // SEND_STRING("\nVAL: "); | ||
| 1200 | // send_word(chunk & 0xFF); | ||
| 1201 | break; | ||
| 1202 | case 0x01: ; // Update RGB | ||
| 1203 | break; | ||
| 1204 | break; | ||
| 1205 | } | ||
| 1206 | |||
| 1207 | // SEND_STRING("\nDATA:\n"); | ||
| 1208 | // while (*pointer_copy != 0xF7) { | ||
| 1209 | // send_byte(*pointer_copy++); | ||
| 1210 | // SEND_STRING(" "); | ||
| 1211 | // } | ||
| 1212 | |||
| 1118 | } | 1213 | } |
| 1214 | |||
| 1119 | #endif | 1215 | #endif |
