qmk_firmware

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

rev2.c (2461B)


      1 /* Copyright 2020 Spaceman
      2  *
      3  * This program is free software: you can redistribute it and/or modify
      4  * it under the terms of the GNU General Public License as published by
      5  * the Free Software Foundation, either version 2 of the License, or
      6  * (at your option) any later version.
      7  *
      8  * This program is distributed in the hope that it will be useful,
      9  * but WITHOUT ANY WARRANTY; without even the implied warranty of
     10  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
     11  * GNU General Public License for more details.
     12  *
     13  * You should have received a copy of the GNU General Public License
     14  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
     15  */
     16 #include "quantum.h"
     17 
     18 
     19 #ifdef OLED_ENABLE
     20 oled_rotation_t oled_init_kb(oled_rotation_t rotation) {
     21     return OLED_ROTATION_270;
     22 }
     23 
     24 bool oled_task_kb(void) {
     25     if (!oled_task_user()) {
     26         return false;
     27     }
     28     static const char PROGMEM pancake_logo[] = {
     29         0x00, 0x00, 0x3e, 0x0a, 0x04, 0x00, 0x3c, 0x0a, 0x3c, 0x00, 0x3e, 0x0c, 0x18, 0x3e, 0x00, 0x3e,
     30         0x22, 0x22, 0x00, 0x3c, 0x0a, 0x3c, 0x00, 0x3e, 0x08, 0x36, 0x00, 0x3e, 0x2a, 0x22, 0x00, 0x00,
     31         0x00, 0x30, 0xc8, 0x84, 0x84, 0x02, 0x02, 0x02, 0x02, 0x01, 0x01, 0x01, 0x01, 0x01, 0x19, 0x1d,
     32         0x1d, 0x0d, 0x01, 0x01, 0x01, 0x01, 0x01, 0x02, 0x02, 0x02, 0x02, 0x84, 0x84, 0xc8, 0x30, 0x00,
     33         0x00, 0x63, 0x94, 0x08, 0x08, 0x11, 0x71, 0x17, 0x13, 0x22, 0x22, 0x22, 0x22, 0x22, 0x22, 0x62,
     34         0xe2, 0x22, 0x22, 0x22, 0x22, 0x22, 0x22, 0x11, 0x11, 0x11, 0x31, 0x08, 0x08, 0x94, 0x63, 0x00,
     35         0x00, 0x00, 0x03, 0x01, 0x01, 0x02, 0x02, 0x02, 0x02, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04,
     36         0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x06, 0x02, 0x02, 0x02, 0x01, 0x01, 0x00, 0x00, 0x00 };
     37     oled_write_raw_P(pancake_logo, sizeof(pancake_logo));
     38     // Host Keyboard Layer Status
     39     oled_set_cursor(0, 4);
     40     oled_write_P(PSTR("\nLAYER\n-----\n"), false);
     41 
     42     switch (get_highest_layer(layer_state)) {
     43         case 0:
     44             oled_write_P(PSTR("DEFLT\n"), false);
     45             break;
     46         case 2:
     47             oled_write_P(PSTR("FUNCT\n"), false);
     48             break;
     49         case 1:
     50             oled_write_P(PSTR("RAISE\n"), false);
     51             break;
     52         default:
     53             // Or use the write_ln shortcut over adding '\n' to the end of your string
     54             oled_write_ln_P(PSTR("Undefined"), false);
     55             break;
     56     }
     57     return false;
     58 }
     59 #endif