From ba264c69c28dd36ab8bd7eda1ba19ecf51eae6a9 Mon Sep 17 00:00:00 2001 From: fauxpark Date: Wed, 22 Jan 2020 13:21:47 +1100 Subject: [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 --- keyboards/cospad/cospad.c | 23 +++++++++++------------ 1 file changed, 11 insertions(+), 12 deletions(-) (limited to 'keyboards/cospad/cospad.c') 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 -- cgit v1.2.3