aboutsummaryrefslogtreecommitdiff
path: root/keyboards/work_louder/rgb_functions.c
diff options
context:
space:
mode:
Diffstat (limited to 'keyboards/work_louder/rgb_functions.c')
-rw-r--r--keyboards/work_louder/rgb_functions.c69
1 files changed, 69 insertions, 0 deletions
diff --git a/keyboards/work_louder/rgb_functions.c b/keyboards/work_louder/rgb_functions.c
new file mode 100644
index 000000000..5a2043f9b
--- /dev/null
+++ b/keyboards/work_louder/rgb_functions.c
@@ -0,0 +1,69 @@
1/* Copyright 2021 Drashna Jael're
2 *
3 * This program is free software: you can redistribute it and/or modify
4 * it under the terms of the GNU General Public License as published by
5 * the Free Software Foundation, either version 2 of the License, or
6 * (at your option) any later version.
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
12 *
13 * You should have received a copy of the GNU General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 */
16
17#include QMK_KEYBOARD_H
18#include "rgb_functions.h"
19
20#if defined(RGBLIGHT_ENABLE) && defined(RGB_MATRIX_EANBLE)
21# undef RGB_DI_PIN
22# define RGBLIGHT_DI_PIN
23# include "ws2812.c"
24
25void rgblight_call_driver(LED_TYPE *start_led, uint8_t num_leds) {
26 ws2812_setleds(start_led, num_leds);
27}
28#endif
29
30#ifdef RGB_MATRIX_ENABLE
31bool process_record_kb(uint16_t keycode, keyrecord_t *record) {
32 if (!process_record_user(keycode, record)) { return false; }
33
34 if (record->event.pressed) {
35 switch(keycode) {
36 case RGB_MATRIX_TOGGLE: // toggle rgb matrix
37 rgb_matrix_toggle();
38 return false;
39 case RGB_MATRIX_MODE_INC:
40 rgb_matrix_step();
41 return false;
42 case RGB_MATRIX_MODE_DEC:
43 rgb_matrix_step_reverse();
44 return false;
45 case RGB_MATRIX_HUE_INC:
46 rgb_matrix_increase_hue();
47 return false;
48 case RGB_MATRIX_HUE_DEC:
49 rgb_matrix_decrease_hue();
50 return false;
51 case RGB_MATRIX_SAT_INC:
52 rgb_matrix_increase_sat();
53 return false;
54 case RGB_MATRIX_SAT_DEC:
55 rgb_matrix_decrease_sat();
56 return false;
57 case RGB_MATRIX_VAL_INC:
58 rgb_matrix_increase_val();
59 return false;
60 case RGB_MATRIX_VAL_DEC:
61 rgb_matrix_decrease_val();
62 return false;
63 default:
64 break;
65 }
66 }
67 return true;
68}
69#endif