diff options
Diffstat (limited to 'keyboards/pearl/pearl.c')
-rw-r--r-- | keyboards/pearl/pearl.c | 52 |
1 files changed, 5 insertions, 47 deletions
diff --git a/keyboards/pearl/pearl.c b/keyboards/pearl/pearl.c index c8cd8a860..093b5fdd9 100644 --- a/keyboards/pearl/pearl.c +++ b/keyboards/pearl/pearl.c | |||
@@ -15,49 +15,7 @@ You should have received a copy of the GNU General Public License | |||
15 | along with this program. If not, see <http://www.gnu.org/licenses/>. | 15 | along with this program. If not, see <http://www.gnu.org/licenses/>. |
16 | */ | 16 | */ |
17 | 17 | ||
18 | #include "rgblight.h" | 18 | #include "pearl.h" |
19 | #include "i2c_master.h" | ||
20 | #include "quantum.h" | ||
21 | |||
22 | #ifdef RGBLIGHT_ENABLE | ||
23 | extern rgblight_config_t rgblight_config; | ||
24 | |||
25 | void rgblight_set(void) { | ||
26 | if (!rgblight_config.enable) { | ||
27 | for (uint8_t i = 0; i < RGBLED_NUM; i++) { | ||
28 | led[i].r = 0; | ||
29 | led[i].g = 0; | ||
30 | led[i].b = 0; | ||
31 | } | ||
32 | } | ||
33 | |||
34 | i2c_init(); | ||
35 | i2c_transmit(0xb0, (uint8_t*)led, 3 * RGBLED_NUM, 100); | ||
36 | } | ||
37 | #endif | ||
38 | |||
39 | void matrix_init_kb(void) { | ||
40 | #ifdef RGBLIGHT_ENABLE | ||
41 | if (rgblight_config.enable) { | ||
42 | i2c_init(); | ||
43 | i2c_transmit(0xb0, (uint8_t*)led, 3 * RGBLED_NUM, 100); | ||
44 | } | ||
45 | #endif | ||
46 | // call user level keymaps, if any | ||
47 | matrix_init_user(); | ||
48 | } | ||
49 | |||
50 | void matrix_scan_kb(void) { | ||
51 | #ifdef RGBLIGHT_ENABLE | ||
52 | rgblight_task(); | ||
53 | #endif | ||
54 | matrix_scan_user(); | ||
55 | /* Nothing else for now. */ | ||
56 | } | ||
57 | |||
58 | __attribute__ ((weak)) | ||
59 | void matrix_scan_user(void) { | ||
60 | } | ||
61 | 19 | ||
62 | void backlight_init_ports(void) { | 20 | void backlight_init_ports(void) { |
63 | // initialize pins D0, D1, D4 and D6 as output | 21 | // initialize pins D0, D1, D4 and D6 as output |
@@ -74,17 +32,17 @@ void backlight_init_ports(void) { | |||
74 | } | 32 | } |
75 | 33 | ||
76 | void backlight_set(uint8_t level) { | 34 | void backlight_set(uint8_t level) { |
77 | if (level == 0) { | 35 | if (level == 0) { |
78 | // turn backlight LEDs off | 36 | // turn backlight LEDs off |
79 | writePinLow(D0); | 37 | writePinLow(D0); |
80 | writePinLow(D1); | 38 | writePinLow(D1); |
81 | writePinLow(D4); | 39 | writePinLow(D4); |
82 | writePinLow(D6); | 40 | writePinLow(D6); |
83 | } else { | 41 | } else { |
84 | // turn backlight LEDs on | 42 | // turn backlight LEDs on |
85 | writePinHigh(D0); | 43 | writePinHigh(D0); |
86 | writePinHigh(D1); | 44 | writePinHigh(D1); |
87 | writePinHigh(D4); | 45 | writePinHigh(D4); |
88 | writePinHigh(D6); | 46 | writePinHigh(D6); |
89 | } | 47 | } |
90 | } \ No newline at end of file | 48 | } |