aboutsummaryrefslogtreecommitdiff
path: root/keyboards/mt980/mt980.c
diff options
context:
space:
mode:
authorJoel Challis <git@zvecr.com>2020-11-17 17:06:30 +0000
committerGitHub <noreply@github.com>2020-11-17 17:06:30 +0000
commitddcb1794fa83e62e5e48536f4bc02ada63da411a (patch)
treedb5df8970f8ed22c77bdd021b781a429a5f05b49 /keyboards/mt980/mt980.c
parentadfd34c4512f6215a49a8f705ce408d6c82fb8cc (diff)
downloadqmk_firmware-ddcb1794fa83e62e5e48536f4bc02ada63da411a.tar.gz
qmk_firmware-ddcb1794fa83e62e5e48536f4bc02ada63da411a.zip
Refactor to use led config - Part 1 (#10905)
* Refactor to use led config * Refactor to use led config * Refactor to use led config * Refactor to use led config * Refactor to use led config
Diffstat (limited to 'keyboards/mt980/mt980.c')
-rw-r--r--keyboards/mt980/mt980.c64
1 files changed, 0 insertions, 64 deletions
diff --git a/keyboards/mt980/mt980.c b/keyboards/mt980/mt980.c
index 5461a3b21..69f7cc491 100644
--- a/keyboards/mt980/mt980.c
+++ b/keyboards/mt980/mt980.c
@@ -1,65 +1 @@
1#include "mt980.h" #include "mt980.h"
2
3__attribute__ ((weak))
4void matrix_init_keymap(void) {}
5
6__attribute__ ((weak))
7void matrix_scan_keymap(void) {}
8
9__attribute__ ((weak))
10bool process_record_keymap(uint16_t keycode, keyrecord_t *record) {
11 return true;
12}
13__attribute__ ((weak))
14uint32_t layer_state_set_keymap (uint32_t state) {
15 return state;
16}
17__attribute__ ((weak))
18void led_set_keymap(uint8_t usb_led) {}
19
20void matrix_init_user(void) {
21 matrix_init_keymap();
22}
23
24void matrix_scan_user(void) {
25 matrix_scan_keymap();
26}
27
28void keyboard_pre_init_user(void) {
29 /* Set NUMLOCK indicator pin as output */
30 setPinOutput(C6);
31 /* Set CAPSLOCK indicator pin as output */
32 setPinOutput(C7);
33 /* Set SCROLLOCK indicator pin as output */
34 setPinOutput(B5);
35}
36
37bool process_record_user(uint16_t keycode, keyrecord_t *record) {
38 return process_record_keymap(keycode, record);
39}
40
41void led_set_user(uint8_t usb_led) {
42
43 if (IS_LED_ON(usb_led, USB_LED_NUM_LOCK)) {
44 writePinLow(C6);
45 }
46 else {
47 writePinHigh(C6);
48 }
49
50 if (IS_LED_ON(usb_led, USB_LED_CAPS_LOCK)) {
51 writePinLow(C7);
52 }
53 else {
54 writePinHigh(C7);
55 }
56
57 if (IS_LED_ON(usb_led, USB_LED_SCROLL_LOCK)) {
58 writePinLow(B5);
59 }
60 else {
61 writePinHigh(B5);
62 }
63
64 led_set_keymap(usb_led);
65}