aboutsummaryrefslogtreecommitdiff
path: root/keyboards/dk60/dk60.c
diff options
context:
space:
mode:
Diffstat (limited to 'keyboards/dk60/dk60.c')
-rw-r--r--keyboards/dk60/dk60.c46
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/*
2Copyright 2017 Damien Broqua <contact@darkou.fr>
3
4This program is free software: you can redistribute it and/or modify
5it under the terms of the GNU General Public License as published by
6the Free Software Foundation, either version 2 of the License, or
7(at your option) any later version.
8
9This program is distributed in the hope that it will be useful,
10but WITHOUT ANY WARRANTY; without even the implied warranty of
11MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12GNU General Public License for more details.
13
14You should have received a copy of the GNU General Public License
15along with this program. If not, see <http://www.gnu.org/licenses/>.
16*/
17
1#include "dk60.h" 18#include "dk60.h"
2 19
3extern inline void dk60_caps_led_on(void); 20extern inline void dk60_caps_led_on(void);
@@ -9,12 +26,10 @@ extern inline void dk60_esc_led_off(void);
9extern inline void dk60_led_all_on(void); 26extern inline void dk60_led_all_on(void);
10extern inline void dk60_led_all_off(void); 27extern inline void dk60_led_all_off(void);
11 28
12 29void dk60_blink_all_leds(void) {
13void 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
28void led_init_ports(void) { 43void 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
34void led_set_kb(uint8_t usb_led) { 48bool 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}