summaryrefslogtreecommitdiff
path: root/keyboards/mt980
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
parentadfd34c4512f6215a49a8f705ce408d6c82fb8cc (diff)
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')
-rw-r--r--keyboards/mt980/config.h5
-rw-r--r--keyboards/mt980/mt980.c64
2 files changed, 5 insertions, 64 deletions
diff --git a/keyboards/mt980/config.h b/keyboards/mt980/config.h
index 6b8b952952..56927be705 100644
--- a/keyboards/mt980/config.h
+++ b/keyboards/mt980/config.h
@@ -22,6 +22,11 @@
/* COL2ROW or ROW2COL */
#define DIODE_DIRECTION ROW2COL
+#define LED_NUM_LOCK_PIN C6
+#define LED_CAPS_LOCK_PIN C7
+#define LED_SCROLL_LOCK_PIN B5
+#define LED_PIN_ON_STATE 0
+
/* number of backlight levels */
#define BACKLIGHT_PIN B6
#ifdef BACKLIGHT_PIN
diff --git a/keyboards/mt980/mt980.c b/keyboards/mt980/mt980.c
index 5461a3b21f..69f7cc491a 100644
--- a/keyboards/mt980/mt980.c
+++ b/keyboards/mt980/mt980.c
@@ -1,65 +1 @@
#include "mt980.h"
-
-__attribute__ ((weak))
-void matrix_init_keymap(void) {}
-
-__attribute__ ((weak))
-void matrix_scan_keymap(void) {}
-
-__attribute__ ((weak))
-bool process_record_keymap(uint16_t keycode, keyrecord_t *record) {
- return true;
-}
-__attribute__ ((weak))
-uint32_t layer_state_set_keymap (uint32_t state) {
- return state;
-}
-__attribute__ ((weak))
-void led_set_keymap(uint8_t usb_led) {}
-
-void matrix_init_user(void) {
- matrix_init_keymap();
-}
-
-void matrix_scan_user(void) {
- matrix_scan_keymap();
-}
-
-void keyboard_pre_init_user(void) {
- /* Set NUMLOCK indicator pin as output */
- setPinOutput(C6);
- /* Set CAPSLOCK indicator pin as output */
- setPinOutput(C7);
- /* Set SCROLLOCK indicator pin as output */
- setPinOutput(B5);
-}
-
-bool process_record_user(uint16_t keycode, keyrecord_t *record) {
- return process_record_keymap(keycode, record);
-}
-
-void led_set_user(uint8_t usb_led) {
-
- if (IS_LED_ON(usb_led, USB_LED_NUM_LOCK)) {
- writePinLow(C6);
- }
- else {
- writePinHigh(C6);
- }
-
- if (IS_LED_ON(usb_led, USB_LED_CAPS_LOCK)) {
- writePinLow(C7);
- }
- else {
- writePinHigh(C7);
- }
-
- if (IS_LED_ON(usb_led, USB_LED_SCROLL_LOCK)) {
- writePinLow(B5);
- }
- else {
- writePinHigh(B5);
- }
-
- led_set_keymap(usb_led);
-}