aboutsummaryrefslogtreecommitdiff
path: root/keyboards/pearl/pearl.c
diff options
context:
space:
mode:
Diffstat (limited to 'keyboards/pearl/pearl.c')
-rw-r--r--keyboards/pearl/pearl.c52
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
15along with this program. If not, see <http://www.gnu.org/licenses/>. 15along 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
23extern rgblight_config_t rgblight_config;
24
25void 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
39void 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
50void 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))
59void matrix_scan_user(void) {
60}
61 19
62void backlight_init_ports(void) { 20void 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
76void backlight_set(uint8_t level) { 34void 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}