qmk_firmware

QMK firmware for my keyboards (Corne, Sweep Ferris) and trackball (Ploopy Adept)
Log | Files | Refs | Submodules | LICENSE

dk60.c (1395B)


      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 
     18 #include "dk60.h"
     19 
     20 extern inline void dk60_caps_led_on(void);
     21 extern inline void dk60_esc_led_on(void);
     22 
     23 extern inline void dk60_caps_led_off(void);
     24 extern inline void dk60_esc_led_off(void);
     25 
     26 extern inline void dk60_led_all_on(void);
     27 extern inline void dk60_led_all_off(void);
     28 
     29 void dk60_blink_all_leds(void) {
     30     dk60_led_all_off();
     31     dk60_led_all_on();
     32     wait_ms(500);
     33     dk60_led_all_off();
     34 }
     35 
     36 void matrix_init_kb(void) {
     37     dk60_blink_all_leds();
     38 
     39     matrix_init_user();
     40 }
     41 
     42 void led_init_ports(void) {
     43     gpio_set_pin_output(E6);
     44     gpio_set_pin_output(F0);
     45 }
     46 
     47 void led_update_ports(led_t led_state) {
     48     if (led_state.caps_lock) {
     49         dk60_caps_led_on();
     50     } else {
     51         dk60_caps_led_off();
     52     }
     53 }