summaryrefslogtreecommitdiff
path: root/keyboards/kinesis
diff options
context:
space:
mode:
authorJoel Challis <git@zvecr.com>2021-03-10 22:48:18 +0000
committerGitHub <noreply@github.com>2021-03-10 22:48:18 +0000
commit790f94533c936409e6be56e8b638969b42350180 (patch)
tree9da39389c6565e8755a9075be6c4fee95e6028af /keyboards/kinesis
parent9089244db77d724f23ddfc01be370f9c029c8e6c (diff)
Refactor to use led config - Part 6 (#12115)
* Convert to config * Convert to config * Convert to config * Convert to config * Convert to config * Convert to config * Convert to config * Convert to config * revert changes
Diffstat (limited to 'keyboards/kinesis')
-rw-r--r--keyboards/kinesis/kint2pp/config.h7
-rw-r--r--keyboards/kinesis/kint2pp/kint2pp.c25
-rw-r--r--keyboards/kinesis/nguyenvietyen/config.h6
-rw-r--r--keyboards/kinesis/nguyenvietyen/nguyenvietyen.c30
4 files changed, 12 insertions, 56 deletions
diff --git a/keyboards/kinesis/kint2pp/config.h b/keyboards/kinesis/kint2pp/config.h
index 2acaf9be6e..902c9b24a0 100644
--- a/keyboards/kinesis/kint2pp/config.h
+++ b/keyboards/kinesis/kint2pp/config.h
@@ -25,7 +25,12 @@
/* COL2ROW or ROW2COL */
#define DIODE_DIRECTION COL2ROW
-
+
+#define LED_NUM_LOCK_PIN C5
+#define LED_CAPS_LOCK_PIN C1
+#define LED_SCROLL_LOCK_PIN C4
+#define LED_COMPOSE_PIN C3
+#define LED_PIN_ON_STATE 0
/* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */
#define DEBOUNCE 5
diff --git a/keyboards/kinesis/kint2pp/kint2pp.c b/keyboards/kinesis/kint2pp/kint2pp.c
index 7e2b4348c5..856e29c31e 100644
--- a/keyboards/kinesis/kint2pp/kint2pp.c
+++ b/keyboards/kinesis/kint2pp/kint2pp.c
@@ -1,26 +1 @@
#include "kint2pp.h"
-
-void matrix_init_kb(void) {
- led_init_ports();
-
-
- matrix_init_user();
-}
-void led_init_ports() {
- // * Set our LED pins as output
- setPinOutput(C3); // Keypad LED
- setPinOutput(C4); // ScrLock LED
- setPinOutput(C5); // NumLock LED
- setPinOutput(C1); // CapsLock LED
-}
-
-bool led_update_kb(led_t led_state) {
- bool res = led_update_user(led_state);
- if(res) {
- writePin(C3, !led_state.compose);
- writePin(C4, !led_state.scroll_lock);
- writePin(C5, !led_state.num_lock);
- writePin(C1, !led_state.caps_lock);
- }
- return res;
-}
diff --git a/keyboards/kinesis/nguyenvietyen/config.h b/keyboards/kinesis/nguyenvietyen/config.h
index f221acd7e7..52f4c8054b 100644
--- a/keyboards/kinesis/nguyenvietyen/config.h
+++ b/keyboards/kinesis/nguyenvietyen/config.h
@@ -25,3 +25,9 @@
/* COL2ROW or ROW2COL */
#define DIODE_DIRECTION COL2ROW
+
+#define LED_NUM_LOCK_PIN D4
+#define LED_CAPS_LOCK_PIN E6
+#define LED_SCROLL_LOCK_PIN C6
+#define LED_COMPOSE_PIN D7
+#define LED_PIN_ON_STATE 0
diff --git a/keyboards/kinesis/nguyenvietyen/nguyenvietyen.c b/keyboards/kinesis/nguyenvietyen/nguyenvietyen.c
index 1919412e93..3f01479389 100644
--- a/keyboards/kinesis/nguyenvietyen/nguyenvietyen.c
+++ b/keyboards/kinesis/nguyenvietyen/nguyenvietyen.c
@@ -1,31 +1 @@
#include "nguyenvietyen.h"
-
-void matrix_init_kb(void) {
- led_init_ports();
- matrix_init_user();
-}
-
-void led_init_ports() {
- // * Set our LED pins as output
- setPinOutput(D7); // Keypad LED
- setPinOutput(C6); // ScrLock LED
- setPinOutput(D4); // NumLock LED
- setPinOutput(E6); // CapsLock LED
-
- // turn all LEDs off by default
- writePinHigh(D7);
- writePinHigh(C6);
- writePinHigh(D4);
- writePinHigh(E6);
-}
-
-bool led_update_kb(led_t led_state) {
- bool res = led_update_user(led_state);
- if (res) {
- writePin(D7, !led_state.compose);
- writePin(C6, !led_state.scroll_lock);
- writePin(D4, !led_state.num_lock);
- writePin(E6, !led_state.caps_lock);
- }
- return res;
-}