qmk_firmware

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

minizone.c (1923B)


      1 // Copyright 2022 takashicompany (@takashicompany)
      2 // SPDX-License-Identifier: GPL-2.0-or-later
      3 
      4 #include "quantum.h"
      5 
      6 #ifdef OLED_ENABLE
      7 
      8 oled_rotation_t oled_init_kb(oled_rotation_t rotation) {
      9     return OLED_ROTATION_270;
     10 }
     11 
     12 //Variable that stores the number of times the key was pressed
     13 static uint16_t press_count = 0;
     14 
     15 bool process_record_kb(uint16_t keycode, keyrecord_t *record) {
     16 
     17      // Increment the counter when a key is pressed
     18     if (record->event.pressed) {
     19         press_count++;
     20     }
     21 
     22     return process_record_user(keycode, record);
     23 }
     24 
     25 bool oled_task_kb(void) {
     26 
     27     if (!oled_task_user()) { return false; }
     28 
     29     static const char PROGMEM my_logo[] = {
     30         0x00, 0x00, 0x00, 0xf0, 0xf0, 0x30, 0x30, 0xf0, 0xe0, 0x30, 0x30, 0xf0, 0xe0, 0x00, 0x00, 0xf6, 
     31         0xf6, 0x00, 0x00, 0xf0, 0xf0, 0x20, 0x30, 0x30, 0xf0, 0xe0, 0x00, 0x00, 0xf6, 0xf6, 0x00, 0x00, 
     32         0x00, 0xc0, 0x40, 0x4f, 0x4f, 0x40, 0x40, 0x4f, 0x4f, 0xc0, 0x00, 0x0f, 0x0f, 0x00, 0x00, 0x0f, 
     33         0x0f, 0x00, 0x00, 0x0f, 0x0f, 0x00, 0x00, 0x00, 0x0f, 0x0f, 0x00, 0x00, 0x0f, 0x0f, 0x00, 0x00, 
     34         0x00, 0x03, 0xc2, 0x32, 0x0e, 0x82, 0x60, 0x18, 0x06, 0x03, 0xc0, 0xe0, 0x30, 0x30, 0x30, 0xe0, 
     35         0xc0, 0x00, 0xf0, 0xf0, 0x20, 0x30, 0x30, 0xf0, 0xe0, 0x00, 0xc0, 0xe0, 0xb0, 0xb0, 0xe0, 0xc0, 
     36         0x1e, 0x13, 0x10, 0x10, 0x12, 0x13, 0x12, 0x12, 0x12, 0x1c, 0x03, 0x07, 0x0c, 0x0c, 0x0c, 0x07, 
     37         0x03, 0x00, 0x0f, 0x0f, 0x00, 0x00, 0x00, 0x0f, 0x0f, 0x00, 0x03, 0x07, 0x0d, 0x0d, 0x0d, 0x09
     38     };
     39 
     40     oled_write_raw_P(my_logo, sizeof(my_logo));
     41     oled_set_cursor(0, 5);
     42 
     43     oled_write_ln_P(PSTR("Layer"), false);
     44     oled_write_ln(get_u8_str(get_highest_layer(layer_state), ' '), false);
     45 
     46     oled_write_ln_P(PSTR(" "), false);
     47     oled_write_ln_P(PSTR(" "), false);
     48 
     49     oled_write_ln_P(PSTR("Count"), false);
     50     oled_write_ln(get_u16_str(press_count, ' '), false);
     51 
     52     return false;
     53 
     54 }
     55 #endif