diff options
Diffstat (limited to 'keyboards/gray_studio/hb85/hb85.c')
-rw-r--r-- | keyboards/gray_studio/hb85/hb85.c | 40 |
1 files changed, 7 insertions, 33 deletions
diff --git a/keyboards/gray_studio/hb85/hb85.c b/keyboards/gray_studio/hb85/hb85.c index 3e4202358..21562b9e0 100644 --- a/keyboards/gray_studio/hb85/hb85.c +++ b/keyboards/gray_studio/hb85/hb85.c | |||
@@ -16,33 +16,7 @@ You should have received a copy of the GNU General Public License | |||
16 | along with this program. If not, see <http://www.gnu.org/licenses/>. | 16 | along with this program. If not, see <http://www.gnu.org/licenses/>. |
17 | */ | 17 | */ |
18 | 18 | ||
19 | #include <string.h> | 19 | #include "hb85.h" |
20 | |||
21 | #include "rgblight.h" | ||
22 | |||
23 | #include "i2c_master.h" | ||
24 | #include "quantum.h" | ||
25 | |||
26 | #ifdef RGBLIGHT_ENABLE | ||
27 | extern rgblight_config_t rgblight_config; | ||
28 | |||
29 | void rgblight_set(void) { | ||
30 | if (!rgblight_config.enable) { | ||
31 | for (uint8_t i = 0; i < RGBLED_NUM; i++) { | ||
32 | led[i].r = 0; | ||
33 | led[i].g = 0; | ||
34 | led[i].b = 0; | ||
35 | } | ||
36 | } | ||
37 | |||
38 | i2c_init(); | ||
39 | i2c_transmit(0xb0, (uint8_t*)led, 3 * RGBLED_NUM, 100); | ||
40 | } | ||
41 | #endif | ||
42 | |||
43 | __attribute__ ((weak)) | ||
44 | void matrix_scan_user(void) { | ||
45 | } | ||
46 | 20 | ||
47 | void backlight_init_ports(void) { | 21 | void backlight_init_ports(void) { |
48 | // initialize pins D0, D1, D4 and D6 as output | 22 | // initialize pins D0, D1, D4 and D6 as output |
@@ -51,7 +25,7 @@ void backlight_init_ports(void) { | |||
51 | setPinOutput(D4); | 25 | setPinOutput(D4); |
52 | setPinOutput(D6); | 26 | setPinOutput(D6); |
53 | 27 | ||
54 | // turn RGB LEDs on | 28 | // turn backlight LEDs on |
55 | writePinHigh(D0); | 29 | writePinHigh(D0); |
56 | writePinHigh(D1); | 30 | writePinHigh(D1); |
57 | writePinHigh(D4); | 31 | writePinHigh(D4); |
@@ -59,17 +33,17 @@ void backlight_init_ports(void) { | |||
59 | } | 33 | } |
60 | 34 | ||
61 | void backlight_set(uint8_t level) { | 35 | void backlight_set(uint8_t level) { |
62 | if (level == 0) { | 36 | if (level == 0) { |
63 | // turn RGB LEDs off | 37 | // turn backlight LEDs off |
64 | writePinLow(D0); | 38 | writePinLow(D0); |
65 | writePinLow(D1); | 39 | writePinLow(D1); |
66 | writePinLow(D4); | 40 | writePinLow(D4); |
67 | writePinLow(D6); | 41 | writePinLow(D6); |
68 | } else { | 42 | } else { |
69 | // turn RGB LEDs on | 43 | // turn backlight LEDs on |
70 | writePinHigh(D0); | 44 | writePinHigh(D0); |
71 | writePinHigh(D1); | 45 | writePinHigh(D1); |
72 | writePinHigh(D4); | 46 | writePinHigh(D4); |
73 | writePinHigh(D6); | 47 | writePinHigh(D6); |
74 | } | 48 | } |
75 | } | 49 | } |