diff options
author | Jack Sangdahl <[email protected]> | 2024-07-18 17:47:41 -0600 |
---|---|---|
committer | Jack Sangdahl <[email protected]> | 2024-07-18 17:47:41 -0600 |
commit | 19001aa5bd1a5e3643229253aa8e289125a0340d (patch) | |
tree | 22289b2f3365c1144f220f81071220a637fe6843 | |
parent | eaaa7f33b910246872e054c5af473d88153821ee (diff) | |
download | qmk_me-19001aa5bd1a5e3643229253aa8e289125a0340d.tar.gz qmk_me-19001aa5bd1a5e3643229253aa8e289125a0340d.zip |
oled overhaul and removing unused code
-rw-r--r-- | img/layout.svg | 10 | ||||
-rw-r--r-- | keyboards/minidox/keyboard.json | 68 | ||||
-rw-r--r-- | keyboards/minidox/keymaps/waffle/keymap.c | 26 | ||||
-rw-r--r-- | keyboards/minidox/readme.md | 4 | ||||
-rw-r--r-- | keymaps/crkbd/config.h | 6 | ||||
-rw-r--r-- | keymaps/crkbd/keymap.c | 21 | ||||
-rw-r--r-- | keymaps/microdox/config.h | 8 | ||||
-rw-r--r-- | keymaps/microdox/keymap.c | 40 | ||||
-rw-r--r-- | keymaps/microdox/readme.md | 6 | ||||
-rw-r--r-- | keymaps/microdox/rules.mk | 1 | ||||
-rw-r--r-- | keymaps/the_q/keymap.c | 20 | ||||
-rw-r--r-- | util/keymap.yaml | 4 | ||||
-rw-r--r-- | waffle/config.h | 9 | ||||
-rw-r--r-- | waffle/oled.c | 353 | ||||
-rw-r--r-- | waffle/oled.h | 387 | ||||
-rw-r--r-- | waffle/oledfont.h | 86 | ||||
-rw-r--r-- | waffle/rules.mk | 5 | ||||
-rw-r--r-- | waffle/tapping.c | 4 | ||||
-rw-r--r-- | waffle/waffle.c | 17 | ||||
-rw-r--r-- | waffle/waffle.h | 11 |
20 files changed, 300 insertions, 786 deletions
diff --git a/img/layout.svg b/img/layout.svg index bd5de07..25f8a42 100644 --- a/img/layout.svg +++ b/img/layout.svg @@ -587,7 +587,9 @@ path.combo { </g> <g transform="translate(700, 49)" class="key keypos-9"> <rect rx="6" ry="6" x="-26" y="-26" width="52" height="52" class="key"/> -<text x="0" y="0" class="key tap">Make</text> +<text x="0" y="0" class="key tap"> +<tspan x="0" dy="-0.6em">QK</tspan><tspan x="0" dy="1.2em">Cmpl</tspan> +</text> </g> <g transform="translate(28, 105)" class="key keypos-10"> <rect rx="6" ry="6" x="-26" y="-26" width="52" height="52" class="key"/> @@ -626,7 +628,7 @@ path.combo { <g transform="translate(532, 91)" class="key keypos-16"> <rect rx="6" ry="6" x="-26" y="-26" width="52" height="52" class="key"/> <text x="0" y="0" class="key tap"> -<tspan x="0" dy="-0.6em">Upside</tspan><tspan x="0" dy="1.2em">Down</tspan> +<tspan x="0" dy="-0.6em">Upsd</tspan><tspan x="0" dy="1.2em">Down</tspan> </text> </g> <g transform="translate(588, 84)" class="key keypos-17"> @@ -639,7 +641,9 @@ path.combo { </g> <g transform="translate(700, 105)" class="key keypos-19"> <rect rx="6" ry="6" x="-26" y="-26" width="52" height="52" class="key"/> -<text x="0" y="0" class="key tap">Reset</text> +<text x="0" y="0" class="key tap"> +<tspan x="0" dy="-0.6em">QK</tspan><tspan x="0" dy="1.2em">Boot</tspan> +</text> </g> <g transform="translate(28, 161)" class="key keypos-20"> <rect rx="6" ry="6" x="-26" y="-26" width="52" height="52" class="key"/> diff --git a/keyboards/minidox/keyboard.json b/keyboards/minidox/keyboard.json deleted file mode 100644 index 02d586c..0000000 --- a/keyboards/minidox/keyboard.json +++ /dev/null @@ -1,68 +0,0 @@ -{ - "keyboard_name": "minidox", - "manufacturer": "jacks", - "maintainer": "pngu.org", - "development_board": "promicro", - "diode_direction": "COL2ROW", - "matrix_pins": { - "cols": ["F6", "F5", "F4", "B6", "B4"], - "rows": ["F7", "B1", "B3", "B5"] - }, - "usb": { - "vid": "0x6A73", - "pid": "0x6D64", - "device_version": "1.0.0" - }, - "split": { - "enabled": true, - "soft_serial_pin": "D3", - "matrix_pins": { - "right": { - "cols": ["D7", "B4", "B5", "B6", "B2"], - "rows": ["E6", "C6", "D4", "B3"] - } - } - }, - "layouts": { - "LAYOUT_split_3x5_3": { - "layout": [ - { "matrix": [0, 0], "x":0, "y":0.25 }, - { "matrix": [0, 1], "x":1, "y":0.125 }, - { "matrix": [0, 2], "x":2, "y":0 }, - { "matrix": [0, 3], "x":3, "y":0.125 }, - { "matrix": [0, 4], "x":4, "y":0.25 }, - { "matrix": [4, 4], "x":7, "y":0.25 }, - { "matrix": [4, 3], "x":8, "y":0.125 }, - { "matrix": [4, 2], "x":9, "y":0 }, - { "matrix": [4, 1], "x":10, "y":0.125 }, - { "matrix": [4, 0], "x":11, "y":0.25 }, - { "matrix": [1, 0], "x":0, "y":1.25 }, - { "matrix": [1, 1], "x":1, "y":1.125 }, - { "matrix": [1, 2], "x":2, "y":1 }, - { "matrix": [1, 3], "x":3, "y":1.125 }, - { "matrix": [1, 4], "x":4, "y":1.25 }, - { "matrix": [5, 4], "x":7, "y":1.25 }, - { "matrix": [5, 3], "x":8, "y":1.125 }, - { "matrix": [5, 2], "x":9, "y":1 }, - { "matrix": [5, 1], "x":10, "y":1.125 }, - { "matrix": [5, 0], "x":11, "y":1.25 }, - { "matrix": [2, 0], "x":0, "y":2.25 }, - { "matrix": [2, 1], "x":1, "y":2.125 }, - { "matrix": [2, 2], "x":2, "y":2 }, - { "matrix": [2, 3], "x":3, "y":2.125 }, - { "matrix": [2, 4], "x":4, "y":2.25 }, - { "matrix": [6, 4], "x":7, "y":2.25 }, - { "matrix": [6, 3], "x":8, "y":2.125 }, - { "matrix": [6, 2], "x":9, "y":2 }, - { "matrix": [6, 1], "x":10, "y":2.125 }, - { "matrix": [6, 0], "x":11, "y":2.25 }, - { "matrix": [3, 2], "x":2.5, "y":3.25 }, - { "matrix": [3, 3], "x":3.5, "y":3.5 }, - { "matrix": [3, 4], "x":4.5, "y":3.75 }, - { "matrix": [7, 4], "x":6.5, "y":3.75 }, - { "matrix": [7, 3], "x":7.5, "y":3.5 }, - { "matrix": [7, 2], "x":8.5, "y":3.25 } - ] - } - } -} diff --git a/keyboards/minidox/keymaps/waffle/keymap.c b/keyboards/minidox/keymaps/waffle/keymap.c deleted file mode 100644 index 24abb01..0000000 --- a/keyboards/minidox/keymaps/waffle/keymap.c +++ /dev/null @@ -1,26 +0,0 @@ -// Copyright 2024 [email protected] -// SPDX-License-Identifier: GPL-3.0-or-later -#include "waffle.h" - -// clang-format off -const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - [_BASE] = LAYOUT_waffle_3x5( - ___BASE1___, - ___BASE2___, - ___BASE3___, - ___BASE4___ - ), - [_LOWER] = LAYOUT_waffle_3x5( - ___LOWER1___, - ___LOWER2___, - ___LOWER3___, - ___LOWER4___ - ), - [_RAISE] = LAYOUT_waffle_3x5( - ___RAISE1___, - ___RAISE2___, - ___RAISE3___, - ___RAISE4___ - ) -}; -// clang-format on diff --git a/keyboards/minidox/readme.md b/keyboards/minidox/readme.md deleted file mode 100644 index 87a35c1..0000000 --- a/keyboards/minidox/readme.md +++ /dev/null @@ -1,4 +0,0 @@ -### handwired minidox -![Front/Top](https://i.imgur.com/E4Pq2g8h.jpeg) -![Back](https://i.imgur.com/0zt3L3rh.jpeg) -![Inside](https://i.imgur.com/s77FOeB_d.webp?maxwidth=760&fidelity=grand) diff --git a/keymaps/crkbd/config.h b/keymaps/crkbd/config.h index 7ca4fe5..db15b46 100644 --- a/keymaps/crkbd/config.h +++ b/keymaps/crkbd/config.h @@ -8,12 +8,6 @@ #define CRC8_OPTIMIZE_SPEED #define SERIAL_USART_SPEED 921600 -#ifdef OLED_ENABLE -#define LAYER_ANIM -#define BONGO_CAT -#define FELIX_DOG -#endif - #ifdef RGB_MATRIX_ENABLE #undef WS2812_DI_PIN #define WS2812_DI_PIN B5 diff --git a/keymaps/crkbd/keymap.c b/keymaps/crkbd/keymap.c index dcbe585..2269e90 100644 --- a/keymaps/crkbd/keymap.c +++ b/keymaps/crkbd/keymap.c @@ -26,7 +26,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { // clang-format on void housekeeping_task_keymap(void) { - if (last_input_activity_elapsed() > 15000) { + if (last_input_activity_elapsed() > 300000) { const pin_t row_pins[] = MATRIX_ROW_PINS, col_pins[] = MATRIX_COL_PINS; for (uint8_t i = 0; i < ARRAY_SIZE(col_pins); ++i) { setPinOutput(col_pins[i]); @@ -93,22 +93,13 @@ bool oled_task_keymap(void) { if (is_keyboard_master()) layer_anim(); else { - oled_set_cursor(0, 0); - render_wpm(); + layer_status(); oled_set_cursor(0, 3); - felix(); + felix_dog(); oled_set_cursor(0, 7); - render_keyboard(); - oled_set_cursor(0, 9); - layer_status(); - oled_set_cursor(0, 11); - mod_status(get_mods()); - oled_set_cursor(0, 13); - keylock_status(host_keyboard_led_state()); - oled_set_cursor(1, 15); - render_keylogger(); - oled_set_cursor(0, 15); - keylogger_status(); + render_wpm(); + render_keylog(); + render_mod_status(); } return false; } diff --git a/keymaps/microdox/config.h b/keymaps/microdox/config.h deleted file mode 100644 index f088833..0000000 --- a/keymaps/microdox/config.h +++ /dev/null @@ -1,8 +0,0 @@ -// Copyright 2024 [email protected] -// SPDX-License-Identifier: GPL-2.0-or-later -#pragma once - -#ifdef OLED_ENABLE -#define BONGO_CAT -#define LAYER_ANIM -#endif diff --git a/keymaps/microdox/keymap.c b/keymaps/microdox/keymap.c deleted file mode 100644 index adf5ddd..0000000 --- a/keymaps/microdox/keymap.c +++ /dev/null @@ -1,40 +0,0 @@ -// Copyright 2024 [email protected] -// SPDX-License-Identifier: GPL-2.0-or-later -#include "waffle.h" - -// clang-format off -const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - [_BASE] = LAYOUT_waffle_3x5( - ___BASE1___, - ___BASE2___, - ___BASE3___, - ___BASE4___ - ), - [_LOWER] = LAYOUT_waffle_3x5( - ___LOWER1___, - ___LOWER2___, - ___LOWER3___, - ___LOWER4___ - ), - [_RAISE] = LAYOUT_waffle_3x5( - ___RAISE1___, - ___RAISE2___, - ___RAISE3___, - ___RAISE4___ - ) -}; -// clang-format on - -#ifdef OLED_ENABLE -oled_rotation_t oled_init_user(oled_rotation_t rotation) { - return is_keyboard_master() ? 0 : 2; -} - -bool oled_task_keymap(void) { - if (is_keyboard_master()) - layer_anim(); - else - render_wpm(); - return false; -} -#endif diff --git a/keymaps/microdox/readme.md b/keymaps/microdox/readme.md deleted file mode 100644 index 0291124..0000000 --- a/keymaps/microdox/readme.md +++ /dev/null @@ -1,6 +0,0 @@ -### rp2040 microdox v2 -![photo](https://raw.githubusercontent.com/waffle87/microdox/master/images/mdox.png) - -* microcontrollers: [sparkfun rp2040 pro micro](https://www.sparkfun.com/products/18288) - -only complaint is the added height from the buttons, qwiic connector, & usb-c port, but still seems to work with [low profile sockets](https://www.digikey.com/product-detail/en/mill-max-manufacturing-corp/315-43-164-41-003000/ED4764-64-ND/1212143). diff --git a/keymaps/microdox/rules.mk b/keymaps/microdox/rules.mk deleted file mode 100644 index cbfafcd..0000000 --- a/keymaps/microdox/rules.mk +++ /dev/null @@ -1 +0,0 @@ -CONVERT_TO = promicro_rp2040 diff --git a/keymaps/the_q/keymap.c b/keymaps/the_q/keymap.c index 91eaf38..da7dfb4 100644 --- a/keymaps/the_q/keymap.c +++ b/keymaps/the_q/keymap.c @@ -1,6 +1,5 @@ // Copyright 2024 [email protected] // SPDX-License-Identifier: GPL-2.0-or-later -#include "lib/oled.h" #include "waffle.h" // clang-format off @@ -26,18 +25,19 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { }; // clang-format on -#ifdef RGB_MATRIX_ENABLE -bool rgb_matrix_indicators_advanced_user(uint8_t led_min, uint8_t led_max) { - for (uint8_t i = led_min; i <= led_max; i++) - if (g_led_config.flags[i] & LED_FLAG_UNDERGLOW) - rgb_matrix_set_color(i, RGB_OFF); - return false; +#ifdef OLED_ENABLE +oled_rotation_t oled_init_user(oled_rotation_t rotation) { + return OLED_ROTATION_270; } -#endif // RGB_MATRIX_ENABLE -#ifdef OLED_ENABLE bool oled_task_keymap(void) { - render_layer_state(); + layer_status(); + oled_set_cursor(0, 3); + felix_dog(); + oled_set_cursor(0, 7); + render_wpm(); + render_keylog(); + render_mod_status(); return false; } #endif // OLED_ENABLE diff --git a/util/keymap.yaml b/util/keymap.yaml index 88469ba..37b342c 100644 --- a/util/keymap.yaml +++ b/util/keymap.yaml @@ -43,8 +43,8 @@ layers: - {t: ▽, type: trans} - {t: ▽, type: trans} RAISE: - - ["RGB Togg", "Mode +", "Hue +", "Sat +", "Val +", "No Mode", "Fancy", "Block", "Reg Indic", "Make"] - - ["Mouse Jig", "Mode -", "Hue -", "Sat -", "Val -", "Wide", "Upside Down", "Zalgo", "Tiny", "Reset"] + - ["RGB Togg", "Mode +", "Hue +", "Sat +", "Val +", "No Mode", "Fancy", "Block", "Reg Indic", "QK Cmpl"] + - ["Mouse Jig", "Mode -", "Hue -", "Sat -", "Val -", "Wide", "Upsd Down", "Zalgo", "Tiny", "QK Boot"] - [F1, F2, F3, F4, F5, F6, F7, F8, F9, F10] - {t: ▽, type: trans} - {t: ▽, type: trans} diff --git a/waffle/config.h b/waffle/config.h index 31d803e..9351c96 100644 --- a/waffle/config.h +++ b/waffle/config.h @@ -10,12 +10,6 @@ #define NO_ACTION_ONESHOT #define UNICODE_SELECTED_MODES UNICODE_MODE_LINUX #define ENABLE_COMPILE_KEYCODE -#ifdef RAW_ENABLE -#undef VENDOR_ID -#define VENDOR_ID 0x6A73 -#undef PRODUCT_ID -#define PRODUCT_ID 0x6B62 -#endif #undef MANUFACTURER #define MANUFACTURER "jacks" @@ -38,7 +32,8 @@ #ifdef RGB_MATRIX_ENABLE #define RGB_MATRIX_SLEEP #define RGB_MATRIX_TIMEOUT 300000 -#define RGB_MATRIX_DEFAULT_MODE RGB_MATRIX_SOLID_COLOR +#undef RGB_MATRIX_DEFAULT_MODE +#define RGB_MATRIX_DEFAULT_MODE RGB_MATRIX_ALPHAS_MODS #define ENABLE_RGB_MATRIX_ALPHAS_MODS #define ENABLE_RGB_MATRIX_GRADIENT_LEFT_RIGHT #define ENABLE_RGB_MATRIX_CYCLE_SPIRAL diff --git a/waffle/oled.c b/waffle/oled.c index cef22ad..f6734e5 100644 --- a/waffle/oled.c +++ b/waffle/oled.c @@ -1,123 +1,25 @@ // Copyright 2024 [email protected] // SPDX-License-Identifier: GPL-2.0-or-later +#include "oled.h" #include "waffle.h" -uint32_t oled_timer = 0; -void render_wpm(void) { - oled_write(PSTR("WPM: "), false); - oled_write_ln(get_u8_str(get_current_wpm(), ' '), false); -} - -#ifdef DEBUG_MATRIX_SCAN_RATE -void render_scan_rate(void) { - oled_write(get_u16_str(get_matrix_scan_rate(), ' '), false); - oled_write_ln(PSTR("/s"), false); -} -#endif - -#ifdef RAW_ENABLE -void host_info(uint8_t data) { - char buffer[3]; - oled_write_ln((char *)itoa(data, buffer, 10), false); -} - -void render_time(void) { - if (user_state.hour < 10) - oled_write(PSTR("0"), false); - host_info(user_state.hour); - oled_write(PSTR(":"), false); - if (user_state.min < 10) - oled_write(PSTR("0"), false); - host_info(user_state.min); -} -#endif +uint32_t oled_timer = 0; +char keylog_str[KEYLOG_LEN + 1] = {0}; -void qmk_logo(void) { - static const char PROGMEM qmk_logo[16] = {0x8a, 0x8b, 0x8c, 0x8d, 0x8e, 0xaa, - 0xab, 0xac, 0xad, 0xae, 0xca, 0xcb, - 0xcc, 0xcd, 0xce, 0}; - oled_write(qmk_logo, false); -}; +void oled_timer_reset(void) { oled_timer = timer_read32(); } -void render_keyboard(void) { - static const char PROGMEM keyboard[16] = {0xba, 0xbb, 0xbc, 0xbd, 0xbe, 0xda, - 0xdb, 0xdc, 0xdd, 0xde, 0}; - oled_write(keyboard, false); -}; +__attribute__((weak)) bool oled_task_keymap(void) { return true; } -void layer_status(void) { - bool blink = (timer_read() % 1000) < 500; - switch (get_highest_layer(layer_state)) { - case _RAISE: - oled_write_ln(PSTR("> hi"), false); - break; - case _LOWER: - oled_write_ln(PSTR("> lo"), false); - break; - case _ADJUST: - oled_write_ln(PSTR("> ad"), false); - break; - default: - oled_write_ln(blink ? PSTR("> _") : PSTR("> "), false); +bool oled_task_user(void) { + if (is_keyboard_master()) { + if (timer_elapsed32(oled_timer) > 300000) { + oled_off(); + return false; + } else + oled_on(); } -}; - -void mod_status(uint8_t mods) { - static const char PROGMEM status[4][3] = { - {0xd3, 0xd4, 0}, {0x93, 0x94, 0}, {0xb3, 0xb4, 0}, {0x95, 0x96, 0}}; - bool blink = (timer_read() % 1000) < 500; - if (mods & MOD_MASK_CTRL) { - oled_set_cursor(2, 11); - oled_write(status[0], false); - } else if (mods & MOD_MASK_SHIFT) { - oled_set_cursor(2, 11); - oled_write(status[1], false); - } else if (mods & MOD_MASK_ALT) { - oled_set_cursor(2, 11); - oled_write(status[2], false); - } else if (mods & MOD_MASK_GUI) { - oled_set_cursor(2, 11); - oled_write(status[3], false); - } else - oled_write_ln(blink ? PSTR("$ _") : PSTR("$ "), false); -} - -void keylock_status(led_t led_usb_state) { - bool blink = (timer_read() % 1000) < 500; - if (led_usb_state.caps_lock) - oled_write_ln(PSTR("% cap"), false); - else if (led_usb_state.num_lock) - oled_write_ln(PSTR("% num"), false); - else if (led_usb_state.scroll_lock) - oled_write_ln(PSTR("% scr"), false); - else - oled_write_ln(blink ? PSTR("% _") : PSTR("% "), false); -} - -char keylog_str[5] = {}; -static uint16_t keylog_timer = 0; -const char code_to_name[60] = { - ' ', ' ', ' ', ' ', 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', - 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', - 'u', 'v', 'w', 'x', 'y', 'z', '1', '2', '3', '4', '5', '6', - '7', '8', '9', '0', 'R', 'E', 'B', 'T', '_', '-', '=', '[', - ']', '\\', '#', ';', '\'', '`', ',', '.', '/', ' ', ' ', ' '}; - -void add_keylog(uint16_t keycode) { - for (uint8_t i = ARRAY_SIZE(keylog_str) - 1; i > 0; i--) - keylog_str[i] = keylog_str[i - 1]; - if (keycode < ARRAY_SIZE(code_to_name)) - keylog_str[0] = code_to_name[keycode & 0xFF]; - keylog_timer = timer_read(); -} - -void render_keylog(void) { oled_write(keylog_str, false); } - -void render_keylogger(void) { oled_write(keylog_str, false); } - -void keylogger_status(void) { - bool blink = (timer_read() % 1000) < 500; - oled_write_ln(blink ? PSTR("~ _") : PSTR("~ "), false); + oled_task_keymap(); + return false; } void anim_frame(uint16_t size, char const action[][size]) { @@ -126,52 +28,7 @@ void anim_frame(uint16_t size, char const action[][size]) { oled_write_raw(action[current_frame], size); } -#ifdef FELIX_DOG -void felix(void) { - static uint16_t felix_anim_timer = 0; - bool shifted = get_mods() & MOD_MASK_SHIFT || - host_keyboard_led_state().caps_lock || is_caps_word_on(); - void animate(void) { - if (shifted) - anim_frame(96, felix_bark); - else if (get_mods() & MOD_MASK_CAG) - anim_frame(96, felix_sneak); - else if (get_current_wpm() > 40) - anim_frame(96, felix_run); - else if (get_current_wpm() > 30 && get_current_wpm() <= 40) - anim_frame(96, felix_walk); - else - anim_frame(96, felix_sit); - } - if (timer_elapsed(felix_anim_timer) > 200) { - felix_anim_timer = timer_read(); - animate(); - } -} -#endif - -#ifdef BONGO_CAT -void bongo(void) { - static uint16_t bongo_anim_timer = 0; - void animate(void) { - if (get_current_wpm() <= 30) { - anim_frame(512, bongo_idle); - } - if (get_current_wpm() > 30 && get_current_wpm() <= 40) { - anim_frame(512, bongo_prep); - } - if (get_current_wpm() > 40) { - anim_frame(512, bongo_tap); - } - } - if (timer_elapsed(bongo_anim_timer) > 200) { - bongo_anim_timer = timer_read(); - animate(); - } -} -#endif - -#ifdef WPM_GRAPH +#ifdef OLED_DISPLAY_128X64 void wpm_graph(void) { static uint8_t height = OLED_DISPLAY_HEIGHT - 1, vert_count = 0, max_wpm = 160; @@ -204,41 +61,177 @@ void wpm_graph(void) { } #endif -#ifdef LAYER_ANIM +void felix_dog(void) { + static uint16_t felix_anim_timer = 0; + bool shifted = + get_mods() & MOD_MASK_SHIFT || host_keyboard_led_state().caps_lock; + if (timer_elapsed(felix_anim_timer) > 200) { + felix_anim_timer = timer_read(); + if (shifted || is_caps_word_on()) + anim_frame(96, felix_bark); + else if (get_mods() & MOD_MASK_CAG) + anim_frame(96, felix_sneak); + else if (get_current_wpm() > 60) + anim_frame(96, felix_run); + else if (get_current_wpm() && get_current_wpm() <= 60) + anim_frame(96, felix_walk); + else + anim_frame(96, felix_sit); + } +} + void layer_anim(void) { static uint16_t layer_anim_timer = 0; - void animate(void) { + if (timer_elapsed(layer_anim_timer) > 200) { + layer_anim_timer = timer_read(); switch (get_highest_layer(layer_state)) { - case _RAISE: - anim_frame(650, tap_sym); + case _BASE: + anim_frame(520, tap_num); break; case _LOWER: - anim_frame(520, tap_num); + anim_frame(650, tap_sym); break; - case _ADJUST: + case _RAISE: anim_frame(520, tap_sys); break; - default: - bongo(); } } - if (timer_elapsed(layer_anim_timer) > 200) { - layer_anim_timer = timer_read(); - animate(); +} + +void layer_status(void) { + static const char PROGMEM base[] = {0x20, 0x94, 0x95, 0x96, 0x20, + 0x20, 0xb4, 0xb5, 0xb6, 0x20, + 0x20, 0xd4, 0xd5, 0xd6, 0x20}; + static const char PROGMEM lower[] = {0x20, 0x9a, 0x9b, 0x9c, 0x20, + 0x20, 0xba, 0xbb, 0xbc, 0x20, + 0x20, 0xda, 0xdb, 0xdc, 0x20}; + static const char PROGMEM raise[] = {0x20, 0x97, 0x98, 0x99, 0x20, + 0x20, 0xb7, 0xb8, 0xb9, 0x20, + 0x20, 0xd7, 0xd8, 0xd9, 0x20}; + switch (get_highest_layer(layer_state)) { + case _LOWER: + oled_write(lower, false); + break; + case _RAISE: + oled_write(raise, false); + break; + default: + oled_write(base, false); } } -#endif -bool oled_task_user(void) { - if (is_keyboard_master()) { - if (timer_elapsed32(oled_timer) > 180000) { - oled_off(); - return false; - } else - oled_on(); +void render_mod_status(void) { + const uint8_t mods = get_mods(); + static const char PROGMEM + gui_off_1[] = {0x85, 0x86}, + gui_off_2[] = {0xa5, 0xa6}, gui_on_1[] = {0x8d, 0x8e}, + gui_on_2[] = {0xad, 0xae}, alt_off_1[] = {0x87, 0x88}, + alt_off_2[] = {0xa7, 0xa8}, alt_on_1[] = {0x8f, 0x90}, + alt_on_2[] = {0xaf, 0xb0}, ctrl_off_1[] = {0x89, 0x8a}, + ctrl_off_2[] = {0xa9, 0xaa}, ctrl_on_1[] = {0x91, 0x92}, + ctrl_on_2[] = {0xb1, 0xb2}, shift_off_1[] = {0x8b, 0x8c}, + shift_off_2[] = {0xab, 0xac}, shift_on_1[] = {0xcd, 0xce}, + shift_on_2[] = {0xcf, 0xd0}, off_off_1[] = {0xc5}, off_off_2[] = {0xc6}, + on_off_1[] = {0xc7}, on_off_2[] = {0xc8}, off_on_1[] = {0xc9}, + off_on_2[] = {0xca}, on_on_1[] = {0xcb}, on_on_2[] = {0xcc}; + + oled_write(mods & MOD_MASK_GUI ? gui_on_1 : gui_off_1, false); + if ((mods & MOD_MASK_GUI) && (mods & MOD_MASK_ALT)) + oled_write(on_on_1, false); + else if (mods & MOD_MASK_GUI) + oled_write(on_off_1, false); + else if (mods & MOD_MASK_ALT) + oled_write(off_on_1, false); + else + oled_write(off_off_1, false); + oled_write(mods & MOD_MASK_ALT ? alt_on_1 : alt_off_1, false); + oled_write(mods & MOD_MASK_GUI ? gui_on_2 : gui_off_2, false); + if (mods & MOD_MASK_GUI & MOD_MASK_ALT) + oled_write(on_on_2, false); + else if (mods & MOD_MASK_GUI) + oled_write(on_off_2, false); + else if (mods & MOD_MASK_ALT) + oled_write(off_on_2, false); + else + oled_write(off_off_2, false); + oled_write(mods & MOD_MASK_ALT ? alt_on_2 : alt_off_2, false); + oled_write(mods & MOD_MASK_CTRL ? ctrl_on_1 : ctrl_off_1, false); + if ((mods & MOD_MASK_CTRL) && (mods & MOD_MASK_SHIFT)) + oled_write(on_on_1, false); + else if (mods & MOD_MASK_CTRL) + oled_write(on_off_1, false); + else if (mods & MOD_MASK_SHIFT) + oled_write(off_on_1, false); + else + oled_write(off_off_1, false); + oled_write(mods & MOD_MASK_SHIFT ? shift_on_1 : shift_off_1, false); + oled_write(mods & MOD_MASK_CTRL ? ctrl_on_2 : ctrl_off_2, false); + if (mods & MOD_MASK_CTRL & MOD_MASK_SHIFT) + oled_write(on_on_2, false); + else if (mods & MOD_MASK_CTRL) + oled_write(on_off_2, false); + else if (mods & MOD_MASK_SHIFT) + oled_write(off_on_2, false); + else + oled_write(off_off_2, false); + oled_write(mods & MOD_MASK_SHIFT ? shift_on_2 : shift_off_2, false); +} + +void add_keylog(uint16_t keycode, keyrecord_t *record) { + if (IS_QK_MOD_TAP(keycode)) + keycode = + record->tap.count + ? keycode_config(QK_MOD_TAP_GET_TAP_KEYCODE(keycode)) + : keycode_config(0xE0 + biton(QK_MOD_TAP_GET_MODS(keycode) & 0xF) + + biton(QK_MOD_TAP_GET_MODS(keycode) & 0x10)); + else if (IS_QK_LAYER_TAP(keycode) && (record->tap.count)) + keycode = keycode_config(QK_LAYER_TAP_GET_TAP_KEYCODE(keycode)); + else if (IS_QK_MODS(keycode)) + keycode = keycode_config(QK_MODS_GET_BASIC_KEYCODE(keycode)); + else if (IS_QK_BASIC(keycode)) + keycode = keycode_config(keycode); + if ((keycode == KC_BSPC) && mod_config(get_mods()) & MOD_MASK_CTRL) { + memset(keylog_str, ' ', KEYLOG_LEN); + keylog_str[KEYLOG_LEN] = '\0'; + return; + } + char code = 0; + if (keycode < ARRAY_SIZE(code_to_name)) + code = pgm_read_byte(&code_to_name[keycode]); + if (code) { + memmove(keylog_str, keylog_str + 1, KEYLOG_LEN - 1); + keylog_str[KEYLOG_LEN - 1] = code; } - oled_task_keymap(); - return false; } -void oled_timer_reset(void) { oled_timer = timer_read32(); } +void render_keylog(void) { + oled_write(PSTR("KLG: "), false); + oled_write_ln(keylog_str, false); +} + +void render_wpm(void) { + oled_write(PSTR("WPM: "), false); + oled_write_ln(get_u8_str(get_current_wpm(), ' '), false); +} + +#ifdef DEBUG_MATRIX_SCAN_RATE +void render_scan_rate(void) { + oled_write(PSTR("MSR: "), false); + oled_write_ln(get_u16_str(get_matrix_scan_rate(), ' '), false); +} +#endif + +void oled_render_boot(bool jump_to_bootloader) { + oled_clear(); + static const char PROGMEM qmk_logo[16] = {0x80, 0x81, 0x82, 0x83, 0x84, + 0xA0, 0xA1, 0xA2, 0xA3, 0xA4, + 0xC0, 0xC1, 0xC2, 0xC3, 0xC4}; + oled_write(qmk_logo, false); + oled_set_cursor(0, 4); + oled_write(qmk_logo, false); + oled_set_cursor(0, 8); + oled_write(qmk_logo, false); + oled_set_cursor(0, 12); + oled_write(qmk_logo, false); + oled_render_dirty(true); +} diff --git a/waffle/oled.h b/waffle/oled.h index e1a50ab..6e33143 100644 --- a/waffle/oled.h +++ b/waffle/oled.h @@ -3,345 +3,49 @@ #pragma once #include "quantum.h" +#define KEYLOG_LEN 5 extern uint8_t oled_buffer[OLED_MATRIX_SIZE]; extern OLED_BLOCK_TYPE oled_dirty; -void render_wpm(void); -void render_scan_rate(void); -void render_time(void); // render time -void qmk_logo(void); -void render_keyboard(void); // small split keyboard -void layer_status(void); // active layer -void mod_status(uint8_t mods); // active modifier (ctl, shift, alt, gui) -void keylock_status(led_t led_usb_state); // active key lock (caps, num, scroll) -void add_keylog(uint16_t keycode); -void render_keylogger(void); // keylogger data -void keylogger_status(void); // keylogger prompt -void felix(void); // felix the dog (90 or 270 rotation) -void bongo(void); // solid-filled bongo cat (0 or 180 rotation) -void wpm_graph(void); // wpm graph for 128x64 oled (memory intensive) -void layer_anim(void); + void oled_timer_reset(void); bool oled_task_keymap(void); +void anim_frame(uint16_t size, char const action[][size]); +void wpm_graph(void); +void felix_dog(void); +void layer_anim(void); +void layer_status(void); +void render_mod_status(void); +void add_keylog(uint16_t keycode, keyrecord_t *record); +void render_keylog(void); +void render_wpm(void); +void render_scan_rate(void); +void oled_render_boot(bool jump_to_bootloader); -#ifdef BONGO_CAT -static const char PROGMEM bongo_idle[5][512] = { - { - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 128, 192, 192, 224, 224, 224, 224, 240, 240, 240, 240, 240, - 248, 248, 252, 252, 252, 248, 240, 192, 128, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 128, - 128, 128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 24, 124, 254, 254, 254, - 254, 254, 254, 255, 255, 255, 255, 255, 127, 127, 255, 255, 255, 255, - 255, 255, 255, 255, 255, 127, 255, 207, 207, 255, 63, 63, 63, 62, - 252, 248, 240, 224, 192, 128, 0, 0, 0, 128, 128, 128, 128, 64, - 64, 64, 64, 32, 32, 32, 32, 16, 16, 16, 16, 8, 8, 8, - 8, 8, 4, 4, 4, 4, 4, 2, 2, 2, 2, 1, 1, 1, - 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 192, 248, 252, 255, - 255, 255, 255, 255, 255, 255, 255, 243, 243, 243, 242, 254, 255, 255, - 191, 62, 61, 29, 30, 30, 30, 14, 15, 15, 15, 15, 7, 7, - 15, 15, 31, 31, 31, 31, 31, 31, 15, 1, 1, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 128, 128, 128, 128, 128, - 64, 64, 64, 64, 64, 32, 32, 32, 32, 32, 16, 16, 16, 16, - 16, 8, 8, 8, 8, 8, 4, 4, 4, 4, 4, 2, 3, 3, - 3, 1, 1, 1, 1, 1, 1, 3, 7, 7, 7, 15, 15, 15, - 15, 15, 7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - }, - { - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 128, 192, 192, 224, 224, 224, 224, 240, 240, 240, 240, 240, - 248, 248, 252, 252, 252, 248, 240, 192, 128, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 128, - 128, 128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 24, 124, 254, 254, 254, - 254, 254, 254, 255, 255, 255, 255, 255, 127, 127, 255, 255, 255, 255, - 255, 255, 255, 255, 255, 127, 255, 207, 207, 255, 63, 63, 63, 62, - 252, 248, 240, 224, 192, 128, 0, 0, 0, 128, 128, 128, 128, 64, - 64, 64, 64, 32, 32, 32, 32, 16, 16, 16, 16, 8, 8, 8, - 8, 8, 4, 4, 4, 4, 4, 2, 2, 2, 2, 1, 1, 1, - 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 192, 248, 252, 255, - 255, 255, 255, 255, 255, 255, 255, 243, 243, 243, 242, 254, 255, 255, - 191, 62, 61, 29, 30, 30, 30, 14, 15, 15, 15, 15, 7, 7, - 15, 15, 31, 31, 31, 31, 31, 31, 15, 1, 1, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 128, 128, 128, 128, 128, - 64, 64, 64, 64, 64, 32, 32, 32, 32, 32, 16, 16, 16, 16, - 16, 8, 8, 8, 8, 8, 4, 4, 4, 4, 4, 2, 3, 3, - 3, 1, 1, 1, 1, 1, 1, 3, 3, 7, 7, 15, 15, 15, - 15, 15, 7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - }, - { - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 128, 128, 192, 192, 192, 192, 224, 224, 224, 224, 240, - 248, 252, 254, 254, 252, 248, 224, 128, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 128, - 128, 128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 60, 254, 255, 255, 254, - 254, 252, 252, 254, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, - 255, 255, 255, 255, 255, 255, 255, 159, 159, 255, 127, 126, 126, 124, - 248, 240, 224, 192, 128, 0, 0, 0, 0, 128, 128, 128, 128, 64, - 64, 64, 64, 32, 32, 32, 32, 16, 16, 16, 16, 8, 8, 8, - 8, 8, 4, 4, 4, 4, 4, 2, 2, 2, 2, 1, 1, 1, - 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 128, 240, 249, 255, - 255, 255, 255, 255, 255, 255, 255, 231, 231, 231, 228, 252, 255, 255, - 191, 61, 59, 27, 29, 29, 29, 12, 15, 15, 15, 15, 6, 6, - 14, 14, 31, 31, 31, 31, 31, 31, 15, 1, 1, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 128, 128, 128, 128, 128, - 64, 64, 64, 64, 64, 32, 32, 32, 32, 32, 16, 16, 16, 16, - 16, 8, 8, 8, 8, 8, 4, 4, 4, 4, 4, 2, 3, 3, - 3, 1, 1, 1, 1, 1, 1, 3, 3, 7, 7, 15, 15, 15, - 15, 15, 7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - }, - { - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 128, 128, 0, 0, 0, - 0, 0, 128, 192, 192, 224, 224, 224, 224, 240, 240, 240, 240, 248, - 252, 254, 255, 255, 254, 252, 240, 192, 128, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 128, - 128, 128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 30, 255, 255, 255, 255, - 255, 254, 254, 255, 255, 255, 255, 255, 127, 127, 255, 255, 255, 255, - 255, 255, 255, 255, 255, 127, 255, 207, 207, 255, 63, 63, 63, 62, - 252, 248, 240, 224, 192, 128, 0, 0, 0, 128, 128, 128, 128, 64, - 64, 64, 64, 32, 32, 32, 32, 16, 16, 16, 16, 8, 8, 8, - 8, 8, 4, 4, 4, 4, 4, 2, 2, 2, 2, 1, 1, 1, - 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 128, 240, 252, 255, - 255, 255, 255, 255, 255, 255, 255, 243, 243, 243, 242, 254, 255, 255, - 191, 62, 61, 29, 30, 30, 30, 14, 15, 15, 15, 15, 7, 7, - 15, 15, 31, 31, 31, 31, 31, 31, 15, 1, 1, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 128, 128, 128, 128, 128, - 64, 64, 64, 64, 64, 32, 32, 32, 32, 32, 16, 16, 16, 16, - 16, 8, 8, 8, 8, 8, 4, 4, 4, 4, 4, 2, 3, 3, - 3, 1, 1, 1, 1, 1, 1, 3, 3, 7, 7, 15, 15, 15, - 15, 15, 7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - }, - { - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 128, 192, 192, 224, 224, 224, 224, 240, 240, 240, 240, 248, - 248, 252, 254, 254, 254, 252, 248, 192, 128, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 128, - 128, 128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 28, 254, 255, 255, 254, - 254, 254, 254, 255, 255, 255, 255, 255, 127, 127, 255, 255, 255, 255, - 255, 255, 255, 255, 255, 127, 255, 207, 207, 255, 63, 63, 63, 62, - 252, 248, 240, 224, 192, 128, 0, 0, 0, 128, 128, 128, 128, 64, - 64, 64, 64, 32, 32, 32, 32, 16, 16, 16, 16, 8, 8, 8, - 8, 8, 4, 4, 4, 4, 4, 2, 2, 2, 2, 1, 1, 1, - 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 128, 240, 252, 255, - 255, 255, 255, 255, 255, 255, 255, 243, 243, 243, 242, 254, 255, 255, - 191, 62, 61, 29, 30, 30, 30, 14, 15, 15, 15, 15, 7, 7, - 15, 15, 31, 31, 31, 31, 31, 31, 15, 1, 1, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 128, 128, 128, 128, 128, - 64, 64, 64, 64, 64, 32, 32, 32, 32, 32, 16, 16, 16, 16, - 16, 8, 8, 8, 8, 8, 4, 4, 4, 4, 4, 2, 3, 3, - 3, 1, 1, 1, 1, 1, 1, 3, 3, 7, 7, 15, 15, 15, - 15, 15, 7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - }}; - -static const char PROGMEM bongo_prep[][512] = {{ - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 128, 128, 0, 0, 0, 0, 0, 128, 192, - 192, 224, 224, 224, 224, 240, 240, 240, 240, 248, 252, 254, 255, 255, 254, - 252, 240, 192, 128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 128, 128, 128, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 30, 255, 255, - 255, 255, 255, 254, 254, 127, 127, 127, 255, 255, 127, 127, 255, 255, 255, - 255, 255, 255, 255, 255, 255, 127, 255, 207, 207, 255, 255, 255, 31, 230, - 250, 247, 207, 203, 255, 246, 124, 0, 0, 128, 128, 128, 128, 64, 64, - 64, 64, 32, 32, 32, 32, 16, 16, 16, 16, 8, 8, 8, 8, 8, - 4, 4, 4, 4, 4, 2, 2, 2, 2, 1, 1, 1, 1, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 128, 240, 252, 255, 255, 255, 231, 249, 250, 231, 230, - 251, 252, 67, 126, 126, 127, 127, 63, 62, 61, 29, 30, 30, 30, 14, - 15, 15, 15, 15, 7, 7, 7, 7, 7, 7, 3, 3, 3, 1, 1, - 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 128, 128, 128, 128, - 128, 64, 64, 64, 64, 64, 32, 32, 32, 32, 32, 16, 16, 16, 16, - 16, 8, 8, 8, 8, 8, 4, 4, 4, 4, 4, 2, 3, 3, 3, - 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, -}}; - -static const char PROGMEM bongo_tap[2][512] = { - { - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 128, 128, 0, 0, 0, - 0, 0, 128, 192, 192, 224, 224, 224, 224, 240, 240, 240, 240, 248, - 252, 254, 255, 255, 254, 252, 240, 192, 128, 0, 0, 0, 0, 0, - 0, 0, 248, 248, 248, 248, 0, 0, 0, 0, 0, 128, 128, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 128, - 128, 128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 30, 255, 255, 255, 255, - 255, 254, 254, 127, 127, 127, 255, 255, 127, 127, 255, 255, 255, 255, - 255, 255, 255, 255, 255, 127, 255, 207, 207, 255, 255, 255, 255, 254, - 252, 248, 240, 224, 195, 135, 7, 1, 0, 184, 188, 190, 159, 95, - 95, 79, 76, 32, 32, 32, 32, 16, 16, 16, 16, 8, 8, 8, - 8, 8, 4, 4, 4, 4, 4, 2, 2, 2, 2, 1, 1, 1, - 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 128, 240, 252, 255, - 255, 255, 231, 249, 250, 231, 230, 251, 124, 67, 126, 126, 127, 127, - 63, 62, 61, 29, 30, 30, 30, 14, 15, 15, 15, 15, 7, 7, - 15, 15, 31, 31, 31, 31, 31, 31, 15, 1, 61, 124, 252, 252, - 252, 252, 252, 60, 12, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 128, 128, 128, 128, 128, - 64, 64, 64, 64, 64, 32, 32, 32, 32, 32, 16, 16, 16, 16, - 16, 8, 8, 8, 8, 8, 4, 4, 4, 4, 4, 2, 3, 3, - 3, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 1, 3, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - }, - { - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 128, 128, 0, 0, 0, - 0, 0, 128, 192, 192, 224, 224, 224, 224, 240, 240, 240, 240, 248, - 252, 254, 255, 255, 254, 252, 240, 192, 128, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 128, - 128, 128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 30, 255, 255, 255, 255, - 255, 254, 254, 255, 255, 255, 255, 255, 127, 127, 255, 255, 255, 255, - 255, 255, 255, 255, 255, 127, 255, 207, 207, 255, 255, 255, 31, 230, - 250, 247, 207, 203, 255, 246, 124, 0, 0, 128, 128, 128, 128, 64, - 64, 64, 64, 32, 32, 32, 32, 16, 16, 16, 16, 8, 8, 8, - 8, 8, 4, 4, 4, 4, 4, 2, 2, 2, 2, 1, 1, 1, - 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 128, 240, 252, 255, - 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 254, 254, 255, 255, - 191, 62, 61, 29, 30, 30, 30, 14, 15, 15, 15, 15, 7, 7, - 7, 7, 7, 7, 3, 3, 3, 1, 1, 1, 1, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 128, 128, 128, 128, 128, - 64, 64, 64, 64, 64, 32, 32, 32, 32, 32, 16, 16, 16, 16, - 16, 8, 8, 8, 8, 8, 4, 4, 4, 4, 4, 2, 3, 123, - 123, 121, 121, 121, 121, 57, 49, 3, 3, 7, 7, 15, 15, 15, - 143, 143, 135, 128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - }}; -#endif +static const char PROGMEM code_to_name[256] = { + ' ', ' ', ' ', ' ', 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', + 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', + 'u', 'v', 'w', 'x', 'y', 'z', '1', '2', '3', '4', '5', '6', + '7', '8', '9', '0', 20, 19, 27, 26, 22, '-', '=', '[', + ']', '\\', '#', ';', '\'', '`', ',', '.', '/', 128, 0xD5, 0xD6, + 0xD7, 0xD8, 0xD9, 0xDA, 0xDB, 0xDC, 0xDD, 0xDE, 0XDF, 0xFB, 'P', 'S', + 19, ' ', 17, 30, 16, 16, 31, 26, 27, 25, 24, 'N', + '/', '*', '-', '+', 23, '1', '2', '3', '4', '5', '6', '7', + '8', '9', '0', '.', '\\', 'A', 0, '=', ' ', ' ', ' ', ' ', + ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', + ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', + ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', + ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', + ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', 0, ' ', ' ', + ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', + ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', + ' ', 0x9E, 0x9E, ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', + 0x80, 0x80, 0x80, 0x80, 0x80, 0x81, 0x82, 0x80, 0x80, 0x80, 0x80, 0x80, + 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 'C', 'S', 'A', 'G', + 'C', 'S', 'A', 'G', ' ', ' ', ' ', ' ', ' ', 24, 26, 24, + 25, ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', 24, 25, 27, + 26, ' ', ' ', ' '}; -#ifdef FELIX_DOG -static const char PROGMEM felix_sit[2][96] = { +static const char PROGMEM felix_sit[][96] = { { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0xfc, 0xfe, 0xfd, 0xfe, 0xdc, 0xfc, 0xfc, 0xfe, 0x5d, @@ -363,7 +67,7 @@ static const char PROGMEM felix_sit[2][96] = { 0x3f, 0x0f, 0x11, 0x1f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, }}; -static const char PROGMEM felix_walk[2][96] = { +static const char PROGMEM felix_walk[][96] = { { 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0xc0, 0xe0, 0xf0, 0xf0, 0x70, 0x30, 0x20, 0x00, 0x80, 0xc0, 0xc0, 0xf0, 0xf8, 0xf4, 0xf8, 0x70, 0xf0, 0xf0, @@ -385,7 +89,7 @@ static const char PROGMEM felix_walk[2][96] = { 0x1f, 0x3f, 0x3f, 0x33, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, }}; -static const char PROGMEM felix_run[2][96] = { +static const char PROGMEM felix_run[][96] = { { 0x00, 0x00, 0x00, 0x00, 0xe0, 0xf0, 0xf8, 0xf8, 0xf8, 0xb0, 0xa0, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0xc0, 0xc0, 0xfc, 0xf4, 0xe4, 0xf8, 0x70, @@ -407,7 +111,7 @@ static const char PROGMEM felix_run[2][96] = { 0x1f, 0x0f, 0x1f, 0x3f, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, }}; -static const char PROGMEM felix_bark[2][96] = { +static const char PROGMEM felix_bark[][96] = { { 0x00, 0xc0, 0xe0, 0xf0, 0xf0, 0x30, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x80, 0xc0, 0xfc, 0xf4, 0xe4, 0xf8, 0x70, 0xf8, 0xe4, 0xf8, @@ -429,7 +133,7 @@ static const char PROGMEM felix_bark[2][96] = { 0x3b, 0x33, 0x07, 0x07, 0x06, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, }}; -static const char PROGMEM felix_sneak[2][96] = { +static const char PROGMEM felix_sneak[][96] = { { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0xc0, 0xc0, 0xc0, 0xc0, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x40, 0x40, 0x80, 0x00, 0x80, @@ -450,10 +154,8 @@ static const char PROGMEM felix_sneak[2][96] = { 0x3f, 0x0f, 0x03, 0x07, 0x0f, 0x1f, 0x1f, 0x07, 0x1f, 0x1f, 0x0f, 0x1f, 0x3f, 0x3f, 0x37, 0x07, 0x03, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, }}; -#endif -#ifdef LAYER_ANIM -static const char PROGMEM tap_num[3][520] = { +static const char PROGMEM tap_num[][520] = { { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0x60, 0x9c, 0x03, 0, 0, 0x01, 0x02, 0x04, 0x08, @@ -590,7 +292,7 @@ static const char PROGMEM tap_num[3][520] = { 0, 0, 0, 0, 0, 0, 0, 0, }}; -static const char PROGMEM tap_sym[3][650] = { +static const char PROGMEM tap_sym[][650] = { {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0x80, 0x80, 0x40, 0x40, 0x40, 0x20, 0x20, 0x20, 0x10, 0x10, 0x10, 0x10, 0x08, 0x08, 0x08, @@ -758,7 +460,7 @@ static const char PROGMEM tap_sym[3][650] = { 0, 0, 0, 0, }}; -static const char PROGMEM tap_sys[3][520] = { +static const char PROGMEM tap_sys[][520] = { {0x01, 0x80, 0x60, 0x10, 0x48, 0x08, 0x24, 0x04, 0x14, 0x84, 0x14, 0x04, 0x28, 0x88, 0x10, 0x60, 0x80, 0, 0, 0x04, 0, 0x80, 0x60, 0x10, 0x08, 0x08, 0x04, 0x44, 0x84, 0x04, 0x04, 0x04, 0x08, 0x08, 0x10, 0x60, @@ -892,4 +594,3 @@ static const char PROGMEM tap_sys[3][520] = { 0x08, 0x11, 0x12, 0x12, 0x12, 0x12, 0x12, 0x11, 0x08, 0x08, 0x04, 0x04, 0x02, 0x01, 0x10, 0, 0, 0, 0, 0, }}; -#endif diff --git a/waffle/oledfont.h b/waffle/oledfont.h index bf924f5..209f143 100644 --- a/waffle/oledfont.h +++ b/waffle/oledfont.h @@ -2,7 +2,7 @@ // SPDX-License-Identifier: GPL-2.0-or-later #include "progmem.h" -const unsigned char font[] PROGMEM = { +static const unsigned char PROGMEM font[] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3E, 0x5B, 0x4F, 0x5B, 0x3E, 0x00, 0x3E, 0x6B, 0x4F, 0x6B, 0x3E, 0x00, 0x1C, 0x3E, 0x7C, 0x3E, 0x1C, 0x00, 0x18, 0x3C, 0x7E, 0x3C, 0x18, 0x00, 0x1C, 0x57, 0x7D, 0x57, 0x1C, 0x00, @@ -67,52 +67,52 @@ const unsigned char font[] PROGMEM = { 0x44, 0x64, 0x54, 0x4C, 0x44, 0x00, 0x00, 0x08, 0x36, 0x41, 0x00, 0x00, 0x00, 0x00, 0x77, 0x00, 0x00, 0x00, 0x00, 0x41, 0x36, 0x08, 0x00, 0x00, 0x02, 0x01, 0x02, 0x04, 0x02, 0x00, 0x3C, 0x26, 0x23, 0x26, 0x3C, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xC0, 0x60, 0x30, 0x18, - 0xF8, 0x18, 0x00, 0xC0, 0x70, 0x1C, 0x06, 0x03, 0x01, 0x01, 0x01, 0x01, - 0x01, 0xC3, 0x7E, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x08, 0x08, 0x00, - 0x00, 0x08, 0x08, 0x08, 0x00, 0x1C, 0x22, 0x41, 0x41, 0x41, 0x22, 0x1C, - 0x00, 0x08, 0x08, 0x08, 0x00, 0x00, 0x08, 0x08, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0x20, 0xF8, 0x0C, 0x04, 0xE7, 0xE4, 0xE4, 0x07, 0x04, 0xE4, 0xE7, 0xE4, 0x04, 0x07, 0xE4, 0xE4, 0xE7, 0x04, 0x0C, 0xF8, - 0x20, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1C, 0x1C, 0x3E, 0x7F, 0x7F, - 0x00, 0x14, 0x08, 0x14, 0x00, 0x00, 0x00, 0x1C, 0x1C, 0x3E, 0x7F, 0x7F, - 0x00, 0x22, 0x1C, 0x41, 0x3E, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x30, - 0x18, 0x0C, 0x06, 0x0C, 0x18, 0x30, 0x77, 0x77, 0x77, 0x00, 0x77, 0x77, - 0x77, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3E, 0x4A, 0x4F, - 0x4A, 0x3E, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x60, - 0x70, 0x3E, 0x1F, 0x19, 0x18, 0x0C, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, - 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0xF8, 0x0C, 0x06, 0x07, 0xFC, 0x00, 0xFF, 0x01, 0x00, 0x00, 0x00, - 0xFF, 0x80, 0xFF, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xF0, 0x1C, - 0x07, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1C, 0x22, 0x41, 0x00, - 0x00, 0x1C, 0x22, 0x00, 0x00, 0x1C, 0x3E, 0x7F, 0x63, 0x41, 0x22, 0x1C, - 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, + 0x20, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0xF8, 0x04, 0x22, 0x52, 0xE2, + 0x42, 0x42, 0x42, 0xE2, 0x52, 0x22, 0x22, 0x22, 0x42, 0x82, 0x02, 0x02, + 0x22, 0x22, 0x02, 0x04, 0xF8, 0x00, 0x00, 0xF8, 0x04, 0x02, 0x02, 0x82, + 0x42, 0x22, 0x42, 0x82, 0x02, 0x02, 0x02, 0x82, 0x42, 0x22, 0x12, 0x22, + 0x42, 0x82, 0x02, 0x04, 0xF8, 0x00, 0x00, 0xF8, 0xFC, 0xDE, 0xAE, 0x1E, + 0xBE, 0xBE, 0xBE, 0x1E, 0xAE, 0xDE, 0xDE, 0xDE, 0xBE, 0x7E, 0xFE, 0xFE, + 0xDE, 0xDE, 0xFE, 0xFC, 0xF8, 0x00, 0x00, 0xF8, 0xFC, 0xFE, 0xFE, 0x7E, + 0xBE, 0xDE, 0xBE, 0x7E, 0xFE, 0xFE, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x80, 0x80, 0x40, 0x40, 0x20, 0x20, 0x10, 0x10, 0x08, 0x08, 0x10, 0x10, + 0x20, 0x20, 0x40, 0x40, 0x80, 0x80, 0x80, 0x80, 0xC0, 0xC0, 0xE0, 0xE0, + 0xF0, 0xF0, 0xF8, 0xF8, 0xF0, 0xF0, 0xE0, 0xE0, 0xC0, 0xC0, 0x80, 0x80, + 0x80, 0x80, 0x40, 0x40, 0x20, 0x20, 0x10, 0x10, 0x08, 0x08, 0x10, 0x10, + 0x20, 0x20, 0x40, 0x40, 0x80, 0x80, 0x80, 0x80, 0x40, 0xC0, 0x60, 0xA0, + 0x50, 0xB0, 0x58, 0xA8, 0x50, 0xB0, 0x60, 0xA0, 0x40, 0xC0, 0x80, 0x80, 0x00, 0x00, 0x00, 0x49, 0x49, 0xFF, 0x00, 0x00, 0x0F, 0x1F, 0x3F, 0x38, 0x30, 0xFF, 0xFF, 0xFF, 0x30, 0x38, 0x3F, 0x1F, 0x0F, 0x00, 0x00, 0xFF, - 0x49, 0x49, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x60, 0x6A, 0x64, - 0x6A, 0x60, 0x40, 0x00, 0x00, 0x00, 0x00, 0x04, 0x42, 0x69, 0x65, 0x65, - 0x65, 0x69, 0x42, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x06, 0x06, - 0x0C, 0x18, 0x30, 0x66, 0x66, 0x66, 0x00, 0x00, 0xFC, 0x24, 0x24, 0xFC, - 0x24, 0x24, 0xFC, 0x24, 0x24, 0xFC, 0x24, 0x24, 0xFC, 0x24, 0x24, 0xFC, - 0x24, 0x24, 0xFC, 0x24, 0x24, 0xFC, 0x24, 0x24, 0xFC, 0x00, 0x00, 0x00, - 0xF0, 0x90, 0x90, 0xF0, 0x90, 0x90, 0xF0, 0x98, 0x9C, 0xF2, 0x22, 0x21, - 0xE1, 0x01, 0x01, 0x01, 0xF1, 0x91, 0x91, 0xFA, 0x4C, 0x4C, 0xF8, 0x48, - 0x48, 0xF8, 0x48, 0x48, 0xF8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x03, 0x0E, 0x18, 0x30, 0x21, 0x21, 0x31, 0x18, 0x10, 0x30, 0x20, - 0x60, 0x41, 0x60, 0x20, 0x30, 0x18, 0x30, 0x60, 0x40, 0x40, 0x47, 0x4C, - 0x48, 0x68, 0x38, 0x1C, 0x0F, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, - 0x00, 0x00, 0x08, 0x00, 0x00, 0x1C, 0x22, 0x41, 0x63, 0x7F, 0x3E, 0x1C, - 0x00, 0x00, 0x22, 0x1C, 0x00, 0x00, 0x41, 0x22, 0x1C, 0x00, 0x00, 0x00, + 0x49, 0x49, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1F, 0x20, 0x44, 0x4A, 0x47, + 0x42, 0x42, 0x42, 0x47, 0x4A, 0x44, 0x40, 0x40, 0x40, 0x40, 0x41, 0x42, + 0x44, 0x44, 0x40, 0x20, 0x1F, 0x00, 0x00, 0x1F, 0x20, 0x40, 0x41, 0x40, + 0x40, 0x40, 0x40, 0x40, 0x41, 0x40, 0x41, 0x41, 0x4F, 0x48, 0x48, 0x48, + 0x4F, 0x41, 0x41, 0x20, 0x1F, 0x00, 0x00, 0x1F, 0x3F, 0x7B, 0x75, 0x78, + 0x7D, 0x7D, 0x7D, 0x78, 0x75, 0x7B, 0x7F, 0x7F, 0x7F, 0x7F, 0x7E, 0x7D, + 0x7B, 0x7B, 0x7F, 0x3F, 0x1F, 0x00, 0x00, 0x1F, 0x3F, 0x7F, 0x7E, 0x7F, + 0x7F, 0x7F, 0x7F, 0x7F, 0x7E, 0x7F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x88, 0x88, 0x5D, 0x5D, 0x3E, 0x3E, 0x7C, 0x7C, 0xF8, 0xF8, 0x7C, 0x7C, + 0x3E, 0x3E, 0x5D, 0x5D, 0x88, 0x88, 0x88, 0x88, 0x55, 0x55, 0x23, 0x23, + 0x47, 0x47, 0x8F, 0x8F, 0x47, 0x47, 0x23, 0x23, 0x55, 0x55, 0x88, 0x88, + 0x88, 0x88, 0xD5, 0xD5, 0xE2, 0xE2, 0xC4, 0xC4, 0x88, 0x88, 0xC4, 0xC4, + 0xE2, 0xE2, 0xD5, 0xD5, 0x88, 0x88, 0x88, 0x88, 0x5D, 0xD5, 0x6B, 0xB6, + 0x6D, 0xD6, 0xAD, 0xDA, 0x6D, 0xD6, 0x6B, 0xB6, 0x5D, 0xD5, 0x88, 0x88, 0x00, 0x00, 0x00, 0x02, 0x02, 0x0F, 0x18, 0x10, 0x70, 0x10, 0x10, 0x70, 0x10, 0x13, 0x73, 0x13, 0x10, 0x70, 0x10, 0x10, 0x70, 0x10, 0x18, 0x0F, - 0x02, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1C, 0x22, 0xC9, 0xD1, - 0xC9, 0x22, 0x1C, 0x00, 0x00, 0x00, 0x00, 0x10, 0x02, 0x38, 0xFC, 0xED, - 0xFC, 0x38, 0x02, 0x10, 0x00, 0x00, 0x08, 0x0C, 0x7E, 0x7F, 0x7E, 0x0C, - 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0F, 0x09, 0x09, 0x09, - 0x0F, 0x09, 0x09, 0x0F, 0x09, 0x09, 0x09, 0x09, 0x09, 0x09, 0x09, 0x09, - 0x09, 0x0F, 0x09, 0x09, 0x0F, 0x09, 0x09, 0x09, 0x0F, 0x00, 0x00, 0x00, - 0x07, 0x04, 0x04, 0x07, 0x04, 0x04, 0x07, 0x04, 0x04, 0x0F, 0x09, 0x09, - 0x0F, 0x00, 0x00, 0x00, 0x07, 0x04, 0x04, 0x07, 0x02, 0x02, 0x03, 0x02, - 0x02, 0x03, 0x02, 0x02, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x02, 0x02, 0x00, 0x00, 0x00, 0x00, 0x04, 0xF8, 0x00, 0x00, 0xF8, 0x04, + 0x20, 0x1F, 0x00, 0x00, 0x1F, 0x20, 0xFC, 0xF8, 0x00, 0x00, 0xF8, 0x04, + 0x3F, 0x1F, 0x00, 0x00, 0x1F, 0x20, 0x04, 0xF8, 0x00, 0x00, 0xF8, 0xFC, + 0x20, 0x1F, 0x00, 0x00, 0x1F, 0x3F, 0xFC, 0xF8, 0x00, 0x00, 0xF8, 0xFC, + 0x3F, 0x1F, 0x00, 0x00, 0x1F, 0x3F, 0xFE, 0x7E, 0xBE, 0xDE, 0xEE, 0xDE, + 0xBE, 0x7E, 0xFE, 0xFC, 0xF8, 0x00, 0x7E, 0x7E, 0x70, 0x77, 0x77, 0x77, + 0x70, 0x7E, 0x7E, 0x3F, 0x1F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x01, 0x01, 0x02, 0x02, 0x04, 0x04, 0x08, 0x08, 0x04, 0x04, + 0x02, 0x02, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x02, 0x02, + 0x04, 0x04, 0x08, 0x08, 0x04, 0x04, 0x02, 0x02, 0x01, 0x01, 0x00, 0x00, + 0x00, 0x00, 0x01, 0x01, 0x03, 0x03, 0x07, 0x07, 0x0F, 0x0F, 0x07, 0x07, + 0x03, 0x03, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x03, 0x02, + 0x05, 0x06, 0x0D, 0x0A, 0x05, 0x06, 0x03, 0x02, 0x01, 0x01, 0x00, 0x00, }; diff --git a/waffle/rules.mk b/waffle/rules.mk index eef4b9f..ad4a03f 100644 --- a/waffle/rules.mk +++ b/waffle/rules.mk @@ -3,14 +3,13 @@ TOP_SYMBOLS = yes NRKO_ENABLE = yes COMBO_ENABLE = yes MAGIC_ENABLE = no -CONSOLE_ENABLE = no UNICODE_COMMON = yes EXTRAKEY_ENABLE = yes BOOTMAGIC_ENABLE = yes CAPS_WORD_ENABLE = yes TAP_DANCE_ENABLE = yes AUTOCORRECT_ENABLE = yes -MOUSE_JIGGLE_ENABLE = no +MOUSE_JIGGLE_ENABLE = yes DEBOUNCE_TYPE = asym_eager_defer_pk INTROSPECTION_KEYMAP_C = waffle.c @@ -46,5 +45,5 @@ endif ifeq ($(strip $(MOUSE_JIGGLE_ENABLE)), yes) OPT_DEFS += -DMOUSE_JIGGLE_ENABLE MOUSEKEY_ENABLE = yes - DEFFERED_EXEC_ENABLE = yes + DEFERRED_EXEC_ENABLE = yes endif diff --git a/waffle/tapping.c b/waffle/tapping.c index 5e9aeb0..793b8b6 100644 --- a/waffle/tapping.c +++ b/waffle/tapping.c @@ -136,13 +136,13 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { #ifdef OLED_ENABLE if (record->event.pressed) { oled_timer_reset(); - add_keylog(keycode); + add_keylog(keycode, record); } #endif #ifdef MOUSE_JIGGLE_ENABLE if (record->event.pressed) { static deferred_token token = INVALID_DEFERRED_TOKEN; - static report_mouse_t = {0}; + static report_mouse_t report = {0}; if (token) { cancel_deferred_exec(token); token = INVALID_DEFERRED_TOKEN; diff --git a/waffle/waffle.c b/waffle/waffle.c index fb6f5a4..4d63eef 100644 --- a/waffle/waffle.c +++ b/waffle/waffle.c @@ -3,14 +3,6 @@ #include "waffle.h" #include "combos.h" -#ifdef RAW_ENABLE -void raw_hid_receive(uint8_t *data, uint8_t length) { - user_state.cpu_temp = data[0]; - user_state.hour = data[1]; - user_state.min = data[2]; -} -#endif - tap_dance_action_t tap_dance_actions[] = { [EM_DASH_MINS] = ACTION_TAP_DANCE_FN(em_dash_mins), [PLY_NXT_PRV] = ACTION_TAP_DANCE_FN(ply_nxt_prv), @@ -21,7 +13,7 @@ tap_dance_action_t tap_dance_actions[] = { #if defined(SPLIT_KEYBOARD) && defined(OLED_ENABLE) #include "transactions.h" -extern char keylog_str[5]; +extern char keylog_str[KEYLOG_LEN + 1]; void keylogger_sync(uint8_t initiator2target_buffer_size, const void *initiator2target_buffer, uint8_t target2initiator_buffer_size, @@ -74,6 +66,13 @@ void keyboard_post_init_user(void) { #endif } +bool shutdown_user(bool jump_to_bootloader) { +#ifdef OLED_ENABLE + oled_render_boot(jump_to_bootloader); +#endif + return true; +} + #ifdef ENCODER_MAP_ENABLE const uint16_t PROGMEM encoder_map[][NUM_ENCODERS][NUM_DIRECTIONS] = { [_BASE] = {{KC_VOLU, KC_VOLD}, {KC_MNXT, KC_MPRV}}, diff --git a/waffle/waffle.h b/waffle/waffle.h index e7bd8de..08e67be 100644 --- a/waffle/waffle.h +++ b/waffle/waffle.h @@ -6,16 +6,7 @@ #include "oled.h" #endif -#ifdef RAW_ENABLE -#pragma message "check other device's vid/pid!" -typedef struct user_config { - uint8_t cpu_temp; - uint8_t hour; - uint8_t min; -} user_state; -#endif - -enum layers { _BASE, _LOWER, _RAISE, _ADJUST }; +enum layers { _BASE, _LOWER, _RAISE }; enum tapdances { EM_DASH_MINS, PLY_NXT_PRV, PASTE_RAISE, CBRACKET, SBRACKET }; |