summaryrefslogtreecommitdiff
path: root/keyboards/cospad/cospad.c
diff options
context:
space:
mode:
authorfauxpark <fauxpark@gmail.com>2020-01-22 13:21:47 +1100
committerDrashna Jaelre <drashna@live.com>2020-01-21 18:21:47 -0800
commitba264c69c28dd36ab8bd7eda1ba19ecf51eae6a9 (patch)
tree17ee56b0444b4bf25d5a6e205dac28e2e8c045d9 /keyboards/cospad/cospad.c
parent8e500c36709d6b3c1d1906db22d635ea55f74e70 (diff)
[Keyboard] Cospad refactor (#7957)
* Cospad refactor * Add num lock indicator code * Add led_init_ports() * Revert change to matrix position blanks * Define BACKLIGHT_ON_STATE explicitly, in anticipation of PR6749
Diffstat (limited to 'keyboards/cospad/cospad.c')
-rw-r--r--keyboards/cospad/cospad.c23
1 files changed, 11 insertions, 12 deletions
diff --git a/keyboards/cospad/cospad.c b/keyboards/cospad/cospad.c
index e7ef71f874..c1f3a70479 100644
--- a/keyboards/cospad/cospad.c
+++ b/keyboards/cospad/cospad.c
@@ -1,5 +1,4 @@
-
-/* Copyright 2019
+/* Copyright 2020
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -16,18 +15,18 @@
*/
#include "cospad.h"
-#ifdef BACKLIGHT_ENABLE
-
-void backlight_init_ports(void) {
- setPinOutput(F7);
+void keyboard_pre_init_kb(void) {
+ led_init_ports();
+ keyboard_pre_init_user();
}
-void backlight_set(uint8_t level) {
- writePin(F7, !!level);
+void led_init_ports(void) {
+ setPinOutput(B2);
}
-void backlight_task(void) {
- // do nothing - as default implementation of software PWM does not work
+bool led_update_kb(led_t led_state) {
+ if (led_update_user(led_state)) {
+ writePin(B2, !led_state.num_lock);
+ }
+ return true;
}
-
-#endif //BACKLIGHT_ENABLE