diff options
author | kaylanm <1063516+kaylanm@users.noreply.github.com> | 2019-05-07 09:36:40 -0400 |
---|---|---|
committer | MechMerlin <30334081+mechmerlin@users.noreply.github.com> | 2019-05-07 06:36:40 -0700 |
commit | 3b132599427a648b1f14aaf30312f05f855625ea (patch) | |
tree | 1052655d48e9854c9c914c5676aae7c4f7b656fd | |
parent | 97b8567a1f4a64fe1d43cf54683472aeb534489b (diff) | |
download | qmk_firmware-3b132599427a648b1f14aaf30312f05f855625ea.tar.gz qmk_firmware-3b132599427a648b1f14aaf30312f05f855625ea.zip |
Add remaining RGB light components. (#5785)
-rw-r--r-- | keyboards/singa/singa.c | 25 |
1 files changed, 22 insertions, 3 deletions
diff --git a/keyboards/singa/singa.c b/keyboards/singa/singa.c index 26a7e4637..ee49ba65c 100644 --- a/keyboards/singa/singa.c +++ b/keyboards/singa/singa.c | |||
@@ -34,6 +34,25 @@ void rgblight_set(void) { | |||
34 | } | 34 | } |
35 | #endif | 35 | #endif |
36 | 36 | ||
37 | void matrix_init_kb(void) { | ||
38 | #ifdef RGBLIGHT_ENABLE | ||
39 | if (rgblight_config.enable) { | ||
40 | i2c_init(); | ||
41 | i2c_transmit(0xb0, (uint8_t*)led, 3 * RGBLED_NUM, 100); | ||
42 | } | ||
43 | #endif | ||
44 | // call user level keymaps, if any | ||
45 | matrix_init_user(); | ||
46 | } | ||
47 | |||
48 | void matrix_scan_kb(void) { | ||
49 | #ifdef RGBLIGHT_ENABLE | ||
50 | rgblight_task(); | ||
51 | #endif | ||
52 | matrix_scan_user(); | ||
53 | /* Nothing else for now. */ | ||
54 | } | ||
55 | |||
37 | __attribute__ ((weak)) | 56 | __attribute__ ((weak)) |
38 | void matrix_scan_user(void) { | 57 | void matrix_scan_user(void) { |
39 | } | 58 | } |
@@ -45,7 +64,7 @@ void backlight_init_ports(void) { | |||
45 | setPinOutput(D4); | 64 | setPinOutput(D4); |
46 | setPinOutput(D6); | 65 | setPinOutput(D6); |
47 | 66 | ||
48 | // turn RGB LEDs on | 67 | // turn backlight LEDs on |
49 | writePinHigh(D0); | 68 | writePinHigh(D0); |
50 | writePinHigh(D1); | 69 | writePinHigh(D1); |
51 | writePinHigh(D4); | 70 | writePinHigh(D4); |
@@ -54,13 +73,13 @@ void backlight_init_ports(void) { | |||
54 | 73 | ||
55 | void backlight_set(uint8_t level) { | 74 | void backlight_set(uint8_t level) { |
56 | if (level == 0) { | 75 | if (level == 0) { |
57 | // turn RGB LEDs off | 76 | // turn backlight LEDs off |
58 | writePinLow(D0); | 77 | writePinLow(D0); |
59 | writePinLow(D1); | 78 | writePinLow(D1); |
60 | writePinLow(D4); | 79 | writePinLow(D4); |
61 | writePinLow(D6); | 80 | writePinLow(D6); |
62 | } else { | 81 | } else { |
63 | // turn RGB LEDs on | 82 | // turn backlight LEDs on |
64 | writePinHigh(D0); | 83 | writePinHigh(D0); |
65 | writePinHigh(D1); | 84 | writePinHigh(D1); |
66 | writePinHigh(D4); | 85 | writePinHigh(D4); |