diff options
author | Jack Humbert <jack.humb@gmail.com> | 2018-05-08 15:24:18 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-05-08 15:24:18 -0400 |
commit | 14b7602a65dedaf51db1c9288144765d43a83a15 (patch) | |
tree | 8e21e6b77db1581deaeecfa3373fe70470e64c1f /quantum/quantum.c | |
parent | 46dca121fd2f51c4f5b87e48af37f43340591433 (diff) | |
download | qmk_firmware-14b7602a65dedaf51db1c9288144765d43a83a15.tar.gz |
Adds IS31FL3731 RGB Matrix Implementation (#2910)
* adds is31fl3731 rgb matrix implementation
* fix build script for force pushes
* allow bootloader size to be overwritten
* adds planck light implementation
* split led config into 2 arrays
* idk
* betterize register handling
* update planck implementation
* update planck
* refine rgb interface
* cleanup names, rgb matrix
* start documentation
* finish up docs
* add effects list
* clean-up merge
* add RGB_MATRIX_SKIP_FRAMES
* add support for at90usb1286 to bootloader options
Diffstat (limited to 'quantum/quantum.c')
-rw-r--r-- | quantum/quantum.c | 23 |
1 files changed, 21 insertions, 2 deletions
diff --git a/quantum/quantum.c b/quantum/quantum.c index 2662e5ef1..e1bc8b242 100644 --- a/quantum/quantum.c +++ b/quantum/quantum.c @@ -230,6 +230,9 @@ bool process_record_quantum(keyrecord_t *record) { process_clicky(keycode, record) && #endif //AUDIO_CLICKY process_record_kb(keycode, record) && + #if defined(RGB_MATRIX_ENABLE) && defined(RGB_MATRIX_KEYPRESSES) + process_rgb_matrix(keycode, record) && + #endif #if defined(MIDI_ENABLE) && defined(MIDI_ADVANCED) process_midi(keycode, record) && #endif @@ -307,7 +310,7 @@ bool process_record_quantum(keyrecord_t *record) { } return false; #endif - #ifdef RGBLIGHT_ENABLE + #if defined(RGBLIGHT_ENABLE) || defined(RGB_MATRIX_ENABLE) case RGB_TOG: if (record->event.pressed) { rgblight_toggle(); @@ -835,9 +838,18 @@ void matrix_init_quantum() { #ifdef AUDIO_ENABLE audio_init(); #endif + #ifdef RGB_MATRIX_ENABLE + rgb_matrix_init_drivers(); + #endif matrix_init_kb(); } +uint8_t rgb_matrix_task_counter = 0; + +#ifndef RGB_MATRIX_SKIP_FRAMES + #define RGB_MATRIX_SKIP_FRAMES 1 +#endif + void matrix_scan_quantum() { #if defined(AUDIO_ENABLE) matrix_scan_music(); @@ -855,9 +867,16 @@ void matrix_scan_quantum() { backlight_task(); #endif + #ifdef RGB_MATRIX_ENABLE + rgb_matrix_task(); + if (rgb_matrix_task_counter == 0) { + rgb_matrix_update_pwm_buffers(); + } + rgb_matrix_task_counter = ((rgb_matrix_task_counter + 1) % (RGB_MATRIX_SKIP_FRAMES + 1)); + #endif + matrix_scan_kb(); } - #if defined(BACKLIGHT_ENABLE) && defined(BACKLIGHT_PIN) static const uint8_t backlight_pin = BACKLIGHT_PIN; |