diff options
Diffstat (limited to 'quantum/process_keycode')
-rw-r--r-- | quantum/process_keycode/process_backlight.c | 29 |
1 files changed, 27 insertions, 2 deletions
diff --git a/quantum/process_keycode/process_backlight.c b/quantum/process_keycode/process_backlight.c index 4d12f6813..8b70339a5 100644 --- a/quantum/process_keycode/process_backlight.c +++ b/quantum/process_keycode/process_backlight.c | |||
@@ -16,11 +16,35 @@ | |||
16 | 16 | ||
17 | #include "process_backlight.h" | 17 | #include "process_backlight.h" |
18 | 18 | ||
19 | #include "backlight.h" | 19 | #ifdef LED_MATRIX_ENABLE |
20 | # include "led_matrix.h" | ||
21 | #else | ||
22 | # include "backlight.h" | ||
23 | #endif | ||
20 | 24 | ||
21 | bool process_backlight(uint16_t keycode, keyrecord_t *record) { | 25 | bool process_backlight(uint16_t keycode, keyrecord_t *record) { |
22 | if (record->event.pressed) { | 26 | if (record->event.pressed) { |
23 | switch (keycode) { | 27 | switch (keycode) { |
28 | #ifdef LED_MATRIX_ENABLE | ||
29 | case BL_ON: | ||
30 | led_matrix_enable(); | ||
31 | return false; | ||
32 | case BL_OFF: | ||
33 | led_matrix_disable(); | ||
34 | return false; | ||
35 | case BL_DEC: | ||
36 | led_matrix_decrease_val(); | ||
37 | return false; | ||
38 | case BL_INC: | ||
39 | led_matrix_increase_val(); | ||
40 | return false; | ||
41 | case BL_TOGG: | ||
42 | led_matrix_toggle(); | ||
43 | return false; | ||
44 | case BL_STEP: | ||
45 | led_matrix_step(); | ||
46 | return false; | ||
47 | #else | ||
24 | case BL_ON: | 48 | case BL_ON: |
25 | backlight_level(BACKLIGHT_LEVELS); | 49 | backlight_level(BACKLIGHT_LEVELS); |
26 | return false; | 50 | return false; |
@@ -39,10 +63,11 @@ bool process_backlight(uint16_t keycode, keyrecord_t *record) { | |||
39 | case BL_STEP: | 63 | case BL_STEP: |
40 | backlight_step(); | 64 | backlight_step(); |
41 | return false; | 65 | return false; |
42 | #ifdef BACKLIGHT_BREATHING | 66 | # ifdef BACKLIGHT_BREATHING |
43 | case BL_BRTG: | 67 | case BL_BRTG: |
44 | backlight_toggle_breathing(); | 68 | backlight_toggle_breathing(); |
45 | return false; | 69 | return false; |
70 | # endif | ||
46 | #endif | 71 | #endif |
47 | } | 72 | } |
48 | } | 73 | } |