qmk_firmware

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

viendi8l.c (1488B)


      1 /*
      2 Copyright 2022 Álvaro "Gondolindrim" Volpato <gondolindrim@acheronproject.com>
      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 "quantum.h"
     19 
     20 
     21 // Defining indicator colors
     22 uint8_t caps_color[3] = {0xFF,0xFF,0xFF};
     23 uint8_t num_color[3] = {0xFF,0xFF,0xFF};
     24 uint8_t layer_color[3] = {0xFF,0xFF,0xFF};
     25 
     26 void led_update_ports(led_t led_state) {
     27     led_state.caps_lock ? rgblight_setrgb_at(caps_color[0], caps_color[1], caps_color[2], 2) : rgblight_setrgb_at(0x00,0x00,0x00,2);
     28     led_state.num_lock ? rgblight_setrgb_at(num_color[0], num_color[1], num_color[2], 3) : rgblight_setrgb_at(0x00,0x00,0x00,3);
     29 }
     30 
     31 layer_state_t layer_state_set_kb(layer_state_t state) {
     32     switch (get_highest_layer(state)) {
     33     case 1:
     34         rgblight_setrgb_at(layer_color[0], layer_color[1], layer_color[2], 1);
     35         break;
     36     default:
     37         rgblight_setrgb_at(0x00, 0x00, 0x00, 1);
     38         break;
     39     }
     40   return state;
     41 }