qmk_firmware

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

rart75m.c (1615B)


      1 /* Copyright 2021 Alabahuy
      2  * This program is free software: you can redistribute it and/or modify
      3  * it under the terms of the GNU General Public License as published by
      4  * the Free Software Foundation, either version 2 of the License, or
      5  * (at your option) any later version.
      6  *
      7  * This program is distributed in the hope that it will be useful,
      8  * but WITHOUT ANY WARRANTY; without even the implied warranty of
      9  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
     10  * GNU General Public License for more details.
     11  *
     12  * You should have received a copy of the GNU General Public License
     13  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
     14  */
     15 #include "quantum.h"
     16 
     17 #ifdef OLED_ENABLE
     18 bool oled_task_kb(void) {
     19     if (!oled_task_user()) {
     20         return false;
     21     }
     22     // Host Keyboard Layer Status
     23     oled_write_P(PSTR("R A R T 7 5 M\nLayer: "), false);
     24 
     25     switch (get_highest_layer(layer_state)) {
     26         case 0:
     27             oled_write_P(PSTR("Default\n"), false);
     28             break;
     29         case 1:
     30             oled_write_P(PSTR("FN\n"), false);
     31             break;
     32         default:
     33             // Or use the write_ln shortcut over adding '\n' to the end of your string
     34             oled_write_ln_P(PSTR("Undefined\n"), false);
     35     }
     36 
     37     // Host Keyboard LED Status
     38     led_t led_state = host_keyboard_led_state();
     39     oled_write_P(led_state.num_lock ? PSTR("NUM ") : PSTR("    "), false);
     40     oled_write_P(led_state.caps_lock ? PSTR("CAP ") : PSTR("    "), false);
     41     oled_write_P(led_state.scroll_lock ? PSTR("SCR ") : PSTR("    "), false);
     42 
     43     return false;
     44 }
     45 
     46 #endif