aboutsummaryrefslogtreecommitdiff
path: root/keyboards/singa/singa.c
diff options
context:
space:
mode:
Diffstat (limited to 'keyboards/singa/singa.c')
-rw-r--r--keyboards/singa/singa.c33
1 files changed, 10 insertions, 23 deletions
diff --git a/keyboards/singa/singa.c b/keyboards/singa/singa.c
index 144065d02..7b60e3c29 100644
--- a/keyboards/singa/singa.c
+++ b/keyboards/singa/singa.c
@@ -16,32 +16,19 @@
16 16
17#include "singa.h" 17#include "singa.h"
18 18
19void backlight_init_ports(void) { 19void keyboard_pre_init_kb(void) {
20 // initialize pins D0, D1, D4 and D6 as output 20 led_init_ports();
21 setPinOutput(D0); 21 keyboard_pre_init_user();
22 setPinOutput(D1); 22}
23 setPinOutput(D4);
24 setPinOutput(D6);
25 23
26 // turn backlight LEDs on 24void led_init_ports(void) {
27 writePinHigh(D0); 25 setPinOutput(D1);
28 writePinHigh(D1); 26 writePinHigh(D1);
29 writePinHigh(D4);
30 writePinHigh(D6);
31} 27}
32 28
33void backlight_set(uint8_t level) { 29bool led_update_kb(led_t led_state) {
34 if (level == 0) { 30 if (led_update_user(led_state)) {
35 // turn backlight LEDs off 31 writePin(D1, !led_state.caps_lock);
36 writePinLow(D0);
37 writePinLow(D1);
38 writePinLow(D4);
39 writePinLow(D6);
40 } else {
41 // turn backlight LEDs on
42 writePinHigh(D0);
43 writePinHigh(D1);
44 writePinHigh(D4);
45 writePinHigh(D6);
46 } 32 }
33 return true;
47} 34}