diff options
Diffstat (limited to 'keyboards/dk60/dk60.c')
| -rw-r--r-- | keyboards/dk60/dk60.c | 46 |
1 files changed, 30 insertions, 16 deletions
diff --git a/keyboards/dk60/dk60.c b/keyboards/dk60/dk60.c index 8b9dc547d..6d72ff6bd 100644 --- a/keyboards/dk60/dk60.c +++ b/keyboards/dk60/dk60.c | |||
| @@ -1,3 +1,20 @@ | |||
| 1 | /* | ||
| 2 | Copyright 2017 Damien Broqua <contact@darkou.fr> | ||
| 3 | |||
| 4 | This program is free software: you can redistribute it and/or modify | ||
| 5 | it under the terms of the GNU General Public License as published by | ||
| 6 | the Free Software Foundation, either version 2 of the License, or | ||
| 7 | (at your option) any later version. | ||
| 8 | |||
| 9 | This program is distributed in the hope that it will be useful, | ||
| 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| 12 | GNU General Public License for more details. | ||
| 13 | |||
| 14 | You should have received a copy of the GNU General Public License | ||
| 15 | along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
| 16 | */ | ||
| 17 | |||
| 1 | #include "dk60.h" | 18 | #include "dk60.h" |
| 2 | 19 | ||
| 3 | extern inline void dk60_caps_led_on(void); | 20 | extern inline void dk60_caps_led_on(void); |
| @@ -9,12 +26,10 @@ extern inline void dk60_esc_led_off(void); | |||
| 9 | extern inline void dk60_led_all_on(void); | 26 | extern inline void dk60_led_all_on(void); |
| 10 | extern inline void dk60_led_all_off(void); | 27 | extern inline void dk60_led_all_off(void); |
| 11 | 28 | ||
| 12 | 29 | void dk60_blink_all_leds(void) { | |
| 13 | void dk60_blink_all_leds(void) | ||
| 14 | { | ||
| 15 | dk60_led_all_off(); | 30 | dk60_led_all_off(); |
| 16 | dk60_led_all_on(); | 31 | dk60_led_all_on(); |
| 17 | _delay_ms(500); | 32 | wait_ms(500); |
| 18 | dk60_led_all_off(); | 33 | dk60_led_all_off(); |
| 19 | } | 34 | } |
| 20 | 35 | ||
| @@ -26,19 +41,18 @@ void matrix_init_kb(void) { | |||
| 26 | } | 41 | } |
| 27 | 42 | ||
| 28 | void led_init_ports(void) { | 43 | void led_init_ports(void) { |
| 29 | // * Set our LED pins as output | 44 | setPinOutput(E6); |
| 30 | DDRE |= (1<<6); | 45 | setPinOutput(F0); |
| 31 | DDRF |= (1<<0); | ||
| 32 | } | 46 | } |
| 33 | 47 | ||
| 34 | void led_set_kb(uint8_t usb_led) { | 48 | bool led_update_kb(led_t led_state) { |
| 35 | if (usb_led & (1<<USB_LED_CAPS_LOCK)) { | 49 | if (led_update_user(led_state)) { |
| 36 | // Turn capslock on | 50 | if (led_state.caps_lock) { |
| 37 | dk60_caps_led_on(); | 51 | dk60_caps_led_on(); |
| 38 | } else { | 52 | } else { |
| 39 | // Turn capslock off | 53 | dk60_caps_led_off(); |
| 40 | dk60_caps_led_off(); | 54 | } |
| 41 | } | 55 | } |
| 42 | 56 | ||
| 43 | led_set_user(usb_led); | 57 | return true; |
| 44 | } | 58 | } |
