aboutsummaryrefslogtreecommitdiff
path: root/keyboards/ft/mars80/mars80.c
diff options
context:
space:
mode:
Diffstat (limited to 'keyboards/ft/mars80/mars80.c')
-rw-r--r--keyboards/ft/mars80/mars80.c32
1 files changed, 11 insertions, 21 deletions
diff --git a/keyboards/ft/mars80/mars80.c b/keyboards/ft/mars80/mars80.c
index 8e5127408..ca1950353 100644
--- a/keyboards/ft/mars80/mars80.c
+++ b/keyboards/ft/mars80/mars80.c
@@ -16,32 +16,22 @@
16 16
17#include "mars80.h" 17#include "mars80.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}
23
24void led_init_ports(void) {
22 setPinOutput(D1); 25 setPinOutput(D1);
23 setPinOutput(D4);
24 setPinOutput(D6); 26 setPinOutput(D6);
25
26 // turn backlight LEDs on
27 writePinHigh(D0);
28 writePinHigh(D1); 27 writePinHigh(D1);
29 writePinHigh(D4);
30 writePinHigh(D6); 28 writePinHigh(D6);
31} 29}
32 30
33void backlight_set(uint8_t level) { 31bool led_update_kb(led_t led_state) {
34 if (level == 0) { 32 if (led_update_user(led_state)) {
35 // turn backlight LEDs off 33 writePin(D1, !led_state.caps_lock);
36 writePinLow(D0); 34 writePin(D6, !led_state.scroll_lock);
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 } 35 }
36 return true;
47} 37}