From 3fa592a4024a24a636fa0c562e6761667a94f565 Mon Sep 17 00:00:00 2001 From: Drashna Jaelre Date: Tue, 14 Dec 2021 20:53:36 -0800 Subject: [Keymap] Unicode and Pointing Device and Autocorect for drashna keymaps (#15415) --- .../tractyl_manuform/5x6_right/f411/f411.c | 29 +- .../tractyl_manuform/5x6_right/f411/readme.md | 5 +- .../5x6_right/keymaps/drashna/keymap.c | 121 +- keyboards/handwired/tractyl_manuform/tm_sync.c | 3 +- .../handwired/tractyl_manuform/tractyl_manuform.c | 2 + keyboards/keebio/iris/keymaps/drashna/rules.mk | 32 +- keyboards/moonlander/keymaps/drashna/keymap.c | 2 +- keyboards/orthodox/keymaps/drashna/rules.mk | 2 +- keyboards/splitkb/zima/keymaps/drashna/config.h | 2 +- layouts/community/ergodox/drashna/rules.mk | 10 +- layouts/community/ortho_5x12/drashna/rules.mk | 1 + layouts/community/split_3x6_3/drashna/rules.mk | 1 + users/drashna/config.h | 4 +- users/drashna/drashna.c | 10 +- users/drashna/drashna.h | 21 +- users/drashna/drashna_font.h | 1404 -------------------- .../keyrecords/autocorrection/autocorrection.c | 143 ++ .../keyrecords/autocorrection/autocorrection.h | 10 + .../autocorrection/make_autocorrection_data.py | 273 ++++ users/drashna/keyrecords/caps_word.c | 69 + users/drashna/keyrecords/caps_word.h | 8 + users/drashna/keyrecords/process_records.c | 220 +++ users/drashna/keyrecords/process_records.h | 142 ++ users/drashna/keyrecords/tap_dances.c | 72 + users/drashna/keyrecords/tap_dances.h | 44 + users/drashna/keyrecords/unicode.c | 287 ++++ users/drashna/keyrecords/wrappers.h | 278 ++++ users/drashna/oled/drashna_font.h | 1404 ++++++++++++++++++++ users/drashna/oled/oled_stuff.c | 445 +++++++ users/drashna/oled/oled_stuff.h | 131 ++ users/drashna/oled_stuff.c | 441 ------ users/drashna/oled_stuff.h | 131 -- users/drashna/pointing/pointing.c | 136 ++ users/drashna/pointing/pointing.h | 23 + users/drashna/process_records.c | 205 --- users/drashna/process_records.h | 139 -- users/drashna/readme.md | 12 +- users/drashna/readme/handlers.md | 97 ++ users/drashna/readme/keycodes.md | 10 + users/drashna/readme/rgb.md | 43 + users/drashna/readme/secrets.md | 123 ++ users/drashna/readme/tap_dance.md | 119 ++ users/drashna/readme/wrappers.md | 11 + users/drashna/readme_handlers.md | 97 -- users/drashna/readme_keycodes.md | 10 - users/drashna/readme_rgb.md | 43 - users/drashna/readme_secrets.md | 123 -- users/drashna/readme_tap_dance.md | 119 -- users/drashna/readme_wrappers.md | 11 - users/drashna/rgb/rgb_matrix_stuff.c | 97 ++ users/drashna/rgb/rgb_matrix_stuff.h | 25 + users/drashna/rgb/rgb_stuff.c | 132 ++ users/drashna/rgb/rgb_stuff.h | 25 + users/drashna/rgb_matrix_stuff.c | 97 -- users/drashna/rgb_matrix_stuff.h | 25 - users/drashna/rgb_stuff.c | 132 -- users/drashna/rgb_stuff.h | 25 - users/drashna/rules.mk | 40 +- users/drashna/split/transport_sync.c | 174 +++ users/drashna/split/transport_sync.h | 36 + users/drashna/tap_dances.c | 72 - users/drashna/tap_dances.h | 44 - users/drashna/transport_sync.c | 174 --- users/drashna/transport_sync.h | 36 - users/drashna/unicoooode.c | 282 ---- users/drashna/wrappers.h | 278 ---- 66 files changed, 4695 insertions(+), 4067 deletions(-) delete mode 100644 users/drashna/drashna_font.h create mode 100644 users/drashna/keyrecords/autocorrection/autocorrection.c create mode 100644 users/drashna/keyrecords/autocorrection/autocorrection.h create mode 100755 users/drashna/keyrecords/autocorrection/make_autocorrection_data.py create mode 100644 users/drashna/keyrecords/caps_word.c create mode 100644 users/drashna/keyrecords/caps_word.h create mode 100644 users/drashna/keyrecords/process_records.c create mode 100644 users/drashna/keyrecords/process_records.h create mode 100644 users/drashna/keyrecords/tap_dances.c create mode 100644 users/drashna/keyrecords/tap_dances.h create mode 100644 users/drashna/keyrecords/unicode.c create mode 100644 users/drashna/keyrecords/wrappers.h create mode 100644 users/drashna/oled/drashna_font.h create mode 100644 users/drashna/oled/oled_stuff.c create mode 100644 users/drashna/oled/oled_stuff.h delete mode 100644 users/drashna/oled_stuff.c delete mode 100644 users/drashna/oled_stuff.h create mode 100644 users/drashna/pointing/pointing.c create mode 100644 users/drashna/pointing/pointing.h delete mode 100644 users/drashna/process_records.c delete mode 100644 users/drashna/process_records.h create mode 100644 users/drashna/readme/handlers.md create mode 100644 users/drashna/readme/keycodes.md create mode 100644 users/drashna/readme/rgb.md create mode 100644 users/drashna/readme/secrets.md create mode 100644 users/drashna/readme/tap_dance.md create mode 100644 users/drashna/readme/wrappers.md delete mode 100644 users/drashna/readme_handlers.md delete mode 100644 users/drashna/readme_keycodes.md delete mode 100644 users/drashna/readme_rgb.md delete mode 100644 users/drashna/readme_secrets.md delete mode 100644 users/drashna/readme_tap_dance.md delete mode 100644 users/drashna/readme_wrappers.md create mode 100644 users/drashna/rgb/rgb_matrix_stuff.c create mode 100644 users/drashna/rgb/rgb_matrix_stuff.h create mode 100644 users/drashna/rgb/rgb_stuff.c create mode 100644 users/drashna/rgb/rgb_stuff.h delete mode 100644 users/drashna/rgb_matrix_stuff.c delete mode 100644 users/drashna/rgb_matrix_stuff.h delete mode 100644 users/drashna/rgb_stuff.c delete mode 100644 users/drashna/rgb_stuff.h create mode 100644 users/drashna/split/transport_sync.c create mode 100644 users/drashna/split/transport_sync.h delete mode 100644 users/drashna/tap_dances.c delete mode 100644 users/drashna/tap_dances.h delete mode 100644 users/drashna/transport_sync.c delete mode 100644 users/drashna/transport_sync.h delete mode 100644 users/drashna/unicoooode.c delete mode 100644 users/drashna/wrappers.h diff --git a/keyboards/handwired/tractyl_manuform/5x6_right/f411/f411.c b/keyboards/handwired/tractyl_manuform/5x6_right/f411/f411.c index 700b0685f2..5cd269e311 100644 --- a/keyboards/handwired/tractyl_manuform/5x6_right/f411/f411.c +++ b/keyboards/handwired/tractyl_manuform/5x6_right/f411/f411.c @@ -16,7 +16,7 @@ #include "f411.h" -void matrix_init_sub_kb(void) { setPinInputHigh(A0); } +void keyboard_pre_init_sub(void) { setPinInputHigh(A0); } void matrix_scan_sub_kb(void) { if (!readPin(A0)) { @@ -24,6 +24,33 @@ void matrix_scan_sub_kb(void) { } } +void bootmagic_lite(void) { + // We need multiple scans because debouncing can't be turned off. + matrix_scan(); +#if defined(DEBOUNCE) && DEBOUNCE > 0 + wait_ms(DEBOUNCE * 2); +#else + wait_ms(30); +#endif + matrix_scan(); + + uint8_t row = BOOTMAGIC_LITE_ROW; + uint8_t col = BOOTMAGIC_LITE_COLUMN; + +#if defined(SPLIT_KEYBOARD) && defined(BOOTMAGIC_LITE_ROW_RIGHT) && defined(BOOTMAGIC_LITE_COLUMN_RIGHT) + if (!is_keyboard_left()) { + row = BOOTMAGIC_LITE_ROW_RIGHT; + col = BOOTMAGIC_LITE_COLUMN_RIGHT; + } +#endif + + if (matrix_get_row(row) & (1 << col) || !readPin(A0)) { + eeconfig_disable(); + bootloader_jump(); + } +} + + #ifdef USB_VBUS_PIN bool usb_vbus_state(void) { setPinInputLow(USB_VBUS_PIN); diff --git a/keyboards/handwired/tractyl_manuform/5x6_right/f411/readme.md b/keyboards/handwired/tractyl_manuform/5x6_right/f411/readme.md index b387435122..f732295ba3 100644 --- a/keyboards/handwired/tractyl_manuform/5x6_right/f411/readme.md +++ b/keyboards/handwired/tractyl_manuform/5x6_right/f411/readme.md @@ -1,7 +1,7 @@ # Drashna's Blackpill Tractyl Manuform (5x6) with a right side trackball * System Timer on TIM5 -* ~~VBUS mod, using PB10~~ (*doesn't seem to work for me*) +* VBUS mod, using PB10 -- does work, but not on my tractyl... bad soldering probably * Split Hand Pin, using PC14 * Full Duplex Serial/USART using PA2 and PA3 on USART2 * PWM Audio using PB1 and TIM3 and GPT on TIM4 @@ -12,7 +12,8 @@ * SSD1306 OLED display (128x64) using PB8-PB9 on I2C1 * Pull-up resistor (22k) on PA10 to fix reset issue. * Pull-up resistor (5.1k) on PA1 for WS2812 LED support, and wire it's VCC to the 5V pin. -* Pins PA9, PA11, A12 are not useable because they're used for USB connection, and can't be shared. +* Pins PA9 is meant for VBUS sense, and has an internal pulldown resistor. A 5.1k pullup resistor can work (but should be avoided) +* Pins PA11 and A12 are not useable because they're used for USB connection, and can't be shared. * Pin PB2 is used by BOOT1, and is unusable ## Keyboard Info diff --git a/keyboards/handwired/tractyl_manuform/5x6_right/keymaps/drashna/keymap.c b/keyboards/handwired/tractyl_manuform/5x6_right/keymaps/drashna/keymap.c index f893a8cc41..958f694172 100644 --- a/keyboards/handwired/tractyl_manuform/5x6_right/keymaps/drashna/keymap.c +++ b/keyboards/handwired/tractyl_manuform/5x6_right/keymaps/drashna/keymap.c @@ -16,11 +16,6 @@ #include "drashna.h" -enum tractyl_keycodes { - KC_ACCEL = NEW_SAFE_RANGE, -}; - -bool enable_acceleration = false; // clang-format off #define LAYOUT_5x6_right_wrapper(...) LAYOUT_5x6_right(__VA_ARGS__) #define LAYOUT_5x6_right_base( \ @@ -129,10 +124,10 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { VRSN, _________________ADJUST_L1_________________, _________________ADJUST_R1_________________, EEP_RST, KEYLOCK, _________________ADJUST_L2_________________, _________________ADJUST_R2_________________, TG_MODS, UC_MOD, _________________ADJUST_L3_________________, _________________ADJUST_R3_________________, KC_MPLY, - HPT_DWLI, HPT_DWLD, TG_GAME, TG_DBLO, - HPT_TOG, HPT_BUZ, KC_NUKE, + TG(_DIABLOII), AUTO_CTN, TG_GAME, TG_DBLO, + _______, _______, KC_NUKE, _______, _______, _______, - _______, TG(_DIABLOII),KC_NUKE, _______ + _______, _______, KC_NUKE, _______ ), }; @@ -169,116 +164,6 @@ bool encoder_update_user(uint8_t index, bool clockwise) { } #endif -#ifdef POINTING_DEVICE_ENABLE -static uint16_t mouse_timer = 0; -static uint16_t mouse_debounce_timer = 0; -static uint8_t mouse_keycode_tracker = 0; -bool tap_toggling = false; - -# ifdef TAPPING_TERM_PER_KEY -# define TAP_CHECK get_tapping_term(KC_BTN1, NULL) -# else -# ifndef TAPPING_TERM -# define TAPPING_TERM 200 -# endif -# define TAP_CHECK TAPPING_TERM -# endif - -report_mouse_t pointing_device_task_user(report_mouse_t mouse_report) { - int8_t x = mouse_report.x, y = mouse_report.y; - mouse_report.x = 0; - mouse_report.y = 0; - - if (x != 0 && y != 0) { - mouse_timer = timer_read(); -# ifdef OLED_ENABLE - oled_timer = timer_read32(); -# endif - if (timer_elapsed(mouse_debounce_timer) > TAP_CHECK) { - if (enable_acceleration) { - x = (x > 0 ? x * x / 16 + x : -x * x / 16 + x); - y = (y > 0 ? y * y / 16 + y : -y * y / 16 + y); - } - mouse_report.x = x; - mouse_report.y = y; - if (!layer_state_is(_MOUSE)) { - layer_on(_MOUSE); - } - } - } - return mouse_report; -} - -void matrix_scan_keymap(void) { - if (timer_elapsed(mouse_timer) > 650 && layer_state_is(_MOUSE) && !mouse_keycode_tracker && !tap_toggling) { - layer_off(_MOUSE); - } - if (tap_toggling) { - if (!layer_state_is(_MOUSE)) { - layer_on(_MOUSE); - } - } -} - -bool process_record_keymap(uint16_t keycode, keyrecord_t* record) { - switch (keycode) { - case TT(_MOUSE): - if (record->event.pressed) { - mouse_keycode_tracker++; - } else { -# if TAPPING_TOGGLE != 0 - if (record->tap.count == TAPPING_TOGGLE) { - tap_toggling ^= 1; -# if TAPPING_TOGGLE == 1 - if (!tap_toggling) mouse_keycode_tracker -= record->tap.count + 1; -# else - if (!tap_toggling) mouse_keycode_tracker -= record->tap.count; -# endif - } else { - mouse_keycode_tracker--; - } -# endif - } - mouse_timer = timer_read(); - break; - case TG(_MOUSE): - if (record->event.pressed) { - tap_toggling ^= 1; - } - break; - case MO(_MOUSE): - case DPI_CONFIG: - case KC_MS_UP ... KC_MS_WH_RIGHT: - record->event.pressed ? mouse_keycode_tracker++ : mouse_keycode_tracker--; - mouse_timer = timer_read(); - case KC_ACCEL: - enable_acceleration = record->event.pressed; - break; - default: - if (IS_NOEVENT(record->event)) break; - if ((keycode >= QK_LAYER_TAP && keycode <= QK_LAYER_TAP_MAX) && (((keycode >> 0x8) & 0xF) == _MOUSE)) { - record->event.pressed ? mouse_keycode_tracker++ : mouse_keycode_tracker--; - mouse_timer = timer_read(); - break; - } - if (layer_state_is(_MOUSE) && !mouse_keycode_tracker) { - layer_off(_MOUSE); - } - mouse_keycode_tracker = 0; - mouse_debounce_timer = timer_read(); - break; - } - return true; -} - -layer_state_t layer_state_set_keymap(layer_state_t state) { - if (layer_state_cmp(state, _GAMEPAD) || layer_state_cmp(state, _DIABLO)) { - state |= ((layer_state_t)1 << _MOUSE); - } - return state; -} -#endif - #ifdef OLED_ENABLE // WPM-responsive animation stuff here # define SLEEP_FRAMES 2 diff --git a/keyboards/handwired/tractyl_manuform/tm_sync.c b/keyboards/handwired/tractyl_manuform/tm_sync.c index 733f09a22e..549a17a22f 100644 --- a/keyboards/handwired/tractyl_manuform/tm_sync.c +++ b/keyboards/handwired/tractyl_manuform/tm_sync.c @@ -1,5 +1,6 @@ /* Copyright 2020 Christopher Courtney, aka Drashna Jael're (@drashna) - * + * Copyright 2021 Dasky (@daskygit) + * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 2 of the License, or diff --git a/keyboards/handwired/tractyl_manuform/tractyl_manuform.c b/keyboards/handwired/tractyl_manuform/tractyl_manuform.c index 4b36fab54f..6095bfb7e2 100644 --- a/keyboards/handwired/tractyl_manuform/tractyl_manuform.c +++ b/keyboards/handwired/tractyl_manuform/tractyl_manuform.c @@ -70,6 +70,7 @@ bool process_record_kb(uint16_t keycode, keyrecord_t* record) { return true; } __attribute__((weak)) void keyboard_pre_init_sync(void) {} +__attribute__((weak)) void keyboard_pre_init_sub(void) {} void keyboard_pre_init_kb(void) { // debug_enable = true; // debug_matrix = true; @@ -82,6 +83,7 @@ void keyboard_pre_init_kb(void) { writePin(DEBUG_LED_PIN, !debug_enable); #endif + keyboard_pre_init_sub(); keyboard_pre_init_sync(); keyboard_pre_init_user(); } diff --git a/keyboards/keebio/iris/keymaps/drashna/rules.mk b/keyboards/keebio/iris/keymaps/drashna/rules.mk index 41c67b573d..ca140d76ce 100644 --- a/keyboards/keebio/iris/keymaps/drashna/rules.mk +++ b/keyboards/keebio/iris/keymaps/drashna/rules.mk @@ -1,17 +1,17 @@ -BOOTMAGIC_ENABLE = no # Enable Bootmagic Lite -MOUSEKEY_ENABLE = no # Mouse keys(+4700) -EXTRAKEY_ENABLE = yes # Audio control and System control(+450) -CONSOLE_ENABLE = no # Console for debug(+400) -COMMAND_ENABLE = no # Commands for debug and configuration -TAP_DANCE_ENABLE = no -RGBLIGHT_ENABLE = yes -AUDIO_ENABLE = no -NKRO_ENABLE = yes -BACKLIGHT_ENABLE = no -SWAP_HANDS_ENABLE = no -SPACE_CADET_ENABLE = no - -INDICATOR_LIGHTS = no -RGBLIGHT_STARTUP_ANIMATION = no - +BOOTMAGIC_ENABLE = no # Enable Bootmagic Lite +MOUSEKEY_ENABLE = no # Mouse keys +EXTRAKEY_ENABLE = yes # Audio control and System control +CONSOLE_ENABLE = no # Console for debug +COMMAND_ENABLE = no # Commands for debug and configuration +TAP_DANCE_ENABLE = no +RGBLIGHT_ENABLE = yes +AUDIO_ENABLE = no +NKRO_ENABLE = yes +BACKLIGHT_ENABLE = no +SWAP_HANDS_ENABLE = no BOOTLOADER = qmk-dfu + +INDICATOR_LIGHTS = no +RGBLIGHT_STARTUP_ANIMATION = no +CUSTOM_UNICODE_ENABLE = no +CUSTOM_SPLIT_TRANSPORT_SYNC = no diff --git a/keyboards/moonlander/keymaps/drashna/keymap.c b/keyboards/moonlander/keymaps/drashna/keymap.c index cd53b1e100..1b5280e742 100644 --- a/keyboards/moonlander/keymaps/drashna/keymap.c +++ b/keyboards/moonlander/keymaps/drashna/keymap.c @@ -110,7 +110,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { VRSN, _________________ADJUST_L1_________________, TG(_DIABLOII), _______, _________________ADJUST_R1_________________, EEP_RST, KEYLOCK, _________________ADJUST_L2_________________, _______, _______, _________________ADJUST_R2_________________, RGB_IDL, UC_MOD, _________________ADJUST_L3_________________, _________________ADJUST_R3_________________, TG_MODS, - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_PAUS, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, AUTO_CTN, _______, _______, _______, _______, _______, _______ ), }; diff --git a/keyboards/orthodox/keymaps/drashna/rules.mk b/keyboards/orthodox/keymaps/drashna/rules.mk index 6f72712d84..9637d3b395 100644 --- a/keyboards/orthodox/keymaps/drashna/rules.mk +++ b/keyboards/orthodox/keymaps/drashna/rules.mk @@ -11,6 +11,6 @@ SPACE_CADET_ENABLE = no INDICATOR_LIGHTS = yes RGBLIGHT_STARTUP_ANIMATION = yes - +CUSTOM_UNICODE_ENABLE = no BOOTLOADER = qmk-dfu diff --git a/keyboards/splitkb/zima/keymaps/drashna/config.h b/keyboards/splitkb/zima/keymaps/drashna/config.h index 8d0908182e..b4457ec4b8 100644 --- a/keyboards/splitkb/zima/keymaps/drashna/config.h +++ b/keyboards/splitkb/zima/keymaps/drashna/config.h @@ -17,7 +17,7 @@ #pragma once -#define OLED_FONT_H "users/drashna/drashna_font.h" +#define OLED_FONT_H "users/drashna/oled/drashna_font.h" #define OLED_UPDATE_INTERVAL 15 #define OLED_DISABLE_TIMEOUT #define OLED_FONT_END 255 diff --git a/layouts/community/ergodox/drashna/rules.mk b/layouts/community/ergodox/drashna/rules.mk index 853f1efd24..61b6263071 100644 --- a/layouts/community/ergodox/drashna/rules.mk +++ b/layouts/community/ergodox/drashna/rules.mk @@ -1,4 +1,4 @@ -BOOTMAGIC_ENABLE = yes # Enable Bootmagic Lite +BOOTMAGIC_ENABLE = yes # Enable Bootmagic Lite TAP_DANCE_ENABLE = no COMMAND_ENABLE = no # Commands for debug and configuration CONSOLE_ENABLE = no @@ -9,12 +9,12 @@ ifeq ($(strip $(KEYBOARD)), ergodox_ez) RGB_MATRIX_ENABLE = yes INDICATOR_LIGHTS = no RGBLIGHT_STARTUP_ANIMATION = yes - PIMORONI_TRACKBALL_ENABLE = yes + PIMORONI_TRACKBALL_ENABLE = no MOUSEKEY_ENABLE = no endif -UNICODE_ENABLE = no -UNICDOEMAP_ENABLE = no - +UNICODE_ENABLE = no +UNICDOEMAP_ENABLE = no +CUSTOM_UNICODE_ENABLE = no DEBOUNCE_TYPE = sym_eager_pr diff --git a/layouts/community/ortho_5x12/drashna/rules.mk b/layouts/community/ortho_5x12/drashna/rules.mk index 69a025cc03..98ac829092 100644 --- a/layouts/community/ortho_5x12/drashna/rules.mk +++ b/layouts/community/ortho_5x12/drashna/rules.mk @@ -14,4 +14,5 @@ ifeq ($(strip $(KEYBOARD)), fractal) RGBLIGHT_ENABLE = yes RGBLIGHT_STARTUP_ANIMATION = yes BOOTLOADER = qmk-dfu + CUSTOM_UNICODE_ENABLE = no endif diff --git a/layouts/community/split_3x6_3/drashna/rules.mk b/layouts/community/split_3x6_3/drashna/rules.mk index edc9304fec..cf2dfbdc88 100644 --- a/layouts/community/split_3x6_3/drashna/rules.mk +++ b/layouts/community/split_3x6_3/drashna/rules.mk @@ -32,6 +32,7 @@ ifeq ($(strip $(CTPC)), yes) SWAP_HANDS_ENABLE = yes WPM_ENABLE = yes else + CUSTOM_UNICODE_ENABLE = no BOOTLOADER = qmk-hid BOOTLOADER_SIZE = 512 endif diff --git a/users/drashna/config.h b/users/drashna/config.h index 8b5d5ba937..cc8f9ac83c 100644 --- a/users/drashna/config.h +++ b/users/drashna/config.h @@ -77,7 +77,7 @@ # endif #endif // !AUDIO_ENABLE -#define UNICODE_SELECTED_MODES UC_WIN, UC_MAC +#define UNICODE_SELECTED_MODES UC_WINC, UC_MAC #ifdef RGBLIGHT_ENABLE # define RGBLIGHT_SLEEP @@ -200,7 +200,7 @@ # ifdef OLED_FONT_H # undef OLED_FONT_H # endif -# define OLED_FONT_H "drashna_font.h" +# define OLED_FONT_H "oled/drashna_font.h" # define OLED_FONT_END 255 // # define OLED_FONT_5X5 // # define OLED_FONT_AZTECH diff --git a/users/drashna/drashna.c b/users/drashna/drashna.c index 7e07a2c7c5..9c1233ed90 100644 --- a/users/drashna/drashna.c +++ b/users/drashna/drashna.c @@ -70,7 +70,9 @@ void matrix_init_user(void) { DDRB &= ~(1 << 0); PORTB &= ~(1 << 0); #endif - +#ifdef CUSTOM_UNICODE_ENABLE + matrix_init_unicode(); +#endif matrix_init_secret(); matrix_init_keymap(); } @@ -152,6 +154,9 @@ void matrix_scan_user(void) { #if defined(RGB_MATRIX_ENABLE) matrix_scan_rgb_matrix(); #endif +#if defined(POINTING_DEVICE_ENABLE) + matrix_scan_pointing(); +#endif matrix_scan_secret(); @@ -171,6 +176,9 @@ layer_state_t layer_state_set_user(layer_state_t state) { } state = update_tri_layer_state(state, _RAISE, _LOWER, _ADJUST); +#if defined(POINTING_DEVICE_ENABLE) + state = layer_state_set_pointing(state); +#endif #if defined(RGBLIGHT_ENABLE) state = layer_state_set_rgb_light(state); #endif // RGBLIGHT_ENABLE diff --git a/users/drashna/drashna.h b/users/drashna/drashna.h index 6a45141d9a..7bcae881e4 100644 --- a/users/drashna/drashna.h +++ b/users/drashna/drashna.h @@ -18,25 +18,25 @@ #include QMK_KEYBOARD_H #include "eeprom.h" -#include "wrappers.h" -#include "process_records.h" +#include "keyrecords/wrappers.h" +#include "keyrecords/process_records.h" #ifdef TAP_DANCE_ENABLE -# include "tap_dances.h" +# include "keyrecords/tap_dances.h" #endif // TAP_DANCE_ENABLE #if defined(RGBLIGHT_ENABLE) -# include "rgb_stuff.h" +# include "rgb/rgb_stuff.h" #endif #if defined(RGB_MATRIX_ENABLE) -# include "rgb_matrix_stuff.h" +# include "rgb/rgb_matrix_stuff.h" #endif #if defined(OLED_ENABLE) -# include "oled_stuff.h" -#endif -#if defined(PIMORONI_TRACKBALL_ENABLE) -# include "drivers/sensors/pimoroni_trackball.h" +# include "oled/oled_stuff.h" #endif #ifdef SPLIT_KEYBOARD -# include "transport_sync.h" +# include "split/transport_sync.h" +#endif +#ifdef POINTING_DEVICE_ENABLE +# include "pointing/pointing.h" #endif /* Define layer names */ @@ -113,6 +113,7 @@ typedef union { bool nuke_switch :1; bool swapped_numbers :1; bool rgb_matrix_idle_anim :1; + bool autocorrection :1; }; } userspace_config_t; // clang-format on diff --git a/users/drashna/drashna_font.h b/users/drashna/drashna_font.h deleted file mode 100644 index 844292a53a..0000000000 --- a/users/drashna/drashna_font.h +++ /dev/null @@ -1,1404 +0,0 @@ -#pragma once - -// additional fonts from -// https://github.com/datacute/TinyOLED-Fonts - -#if __has_include("../../../../Documents/qmk/oled_font.h") -# include "../../../../Documents/qmk/oled_font.h" -#else - -// additional fonts from -// https://github.com/datacute/TinyOLED-Fonts - -# include "progmem.h" - -// clang-format off -static const unsigned char font[] PROGMEM = { - 0x07, 0x08, 0x7F, 0x08, 0x07, 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, - 0x1C, 0x5E, 0x7F, 0x5E, 0x1C, 0x00, - 0x00, 0x18, 0x3C, 0x18, 0x00, 0x00, - 0xFF, 0xE7, 0xC3, 0xE7, 0xFF, 0x00, - 0x00, 0x18, 0x24, 0x18, 0x00, 0x00, - 0xFF, 0xE7, 0xDB, 0xE7, 0xFF, 0x00, - 0x30, 0x48, 0x3A, 0x06, 0x0E, 0x00, - 0x26, 0x29, 0x79, 0x29, 0x26, 0x00, - 0x40, 0x7F, 0x05, 0x05, 0x07, 0x00, - 0x40, 0x7F, 0x05, 0x25, 0x3F, 0x00, - 0x5A, 0x3C, 0xE7, 0x3C, 0x5A, 0x00, - 0x7F, 0x3E, 0x1C, 0x1C, 0x08, 0x00, - 0x08, 0x1C, 0x1C, 0x3E, 0x7F, 0x00, - 0x14, 0x22, 0x7F, 0x22, 0x14, 0x00, - 0x5F, 0x5F, 0x00, 0x5F, 0x5F, 0x00, - 0x06, 0x09, 0x7F, 0x01, 0x7F, 0x00, - 0x00, 0x66, 0x89, 0x95, 0x6A, 0x00, - 0x60, 0x60, 0x60, 0x60, 0x60, 0x00, - 0x94, 0xA2, 0xFF, 0xA2, 0x94, 0x00, - 0x08, 0x04, 0x7E, 0x04, 0x08, 0x00, - 0x10, 0x20, 0x7E, 0x20, 0x10, 0x00, - 0x08, 0x08, 0x2A, 0x1C, 0x08, 0x00, - 0x08, 0x1C, 0x2A, 0x08, 0x08, 0x00, - 0x1E, 0x10, 0x10, 0x10, 0x10, 0x00, - 0x0C, 0x1E, 0x0C, 0x1E, 0x0C, 0x00, - 0x30, 0x38, 0x3E, 0x38, 0x30, 0x00, - 0x06, 0x0E, 0x3E, 0x0E, 0x06, 0x00, - -# if defined(OLED_FONT_5X5) - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x5c, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x06, 0x00, 0x06, 0x00, 0x00, 0x00, - 0x28, 0x7c, 0x28, 0x7c, 0x28, 0x00, - 0x5c, 0x54, 0xfe, 0x54, 0x74, 0x00, - 0x44, 0x20, 0x10, 0x08, 0x44, 0x00, - 0x28, 0x54, 0x54, 0x20, 0x50, 0x00, - 0x06, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x38, 0x44, 0x00, 0x00, 0x00, 0x00, - 0x44, 0x38, 0x00, 0x00, 0x00, 0x00, - 0x02, 0x07, 0x02, 0x00, 0x00, 0x00, - 0x10, 0x10, 0x7c, 0x10, 0x10, 0x00, - 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x10, 0x10, 0x10, 0x10, 0x10, 0x00, - 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x60, 0x10, 0x0c, 0x00, 0x00, 0x00, - 0x7c, 0x64, 0x54, 0x4c, 0x7c, 0x00, - 0x48, 0x7c, 0x40, 0x00, 0x00, 0x00, - 0x64, 0x54, 0x54, 0x54, 0x48, 0x00, - 0x44, 0x54, 0x54, 0x54, 0x6c, 0x00, - 0x3c, 0x20, 0x70, 0x20, 0x20, 0x00, - 0x5c, 0x54, 0x54, 0x54, 0x24, 0x00, - 0x7c, 0x54, 0x54, 0x54, 0x74, 0x00, - 0x04, 0x04, 0x64, 0x14, 0x0c, 0x00, - 0x7c, 0x54, 0x54, 0x54, 0x7c, 0x00, - 0x5c, 0x54, 0x54, 0x54, 0x7c, 0x00, - 0x44, 0x00, 0x00, 0x00, 0x00, 0x00, - 0xc4, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x10, 0x28, 0x44, 0x00, 0x00, 0x00, - 0x28, 0x28, 0x28, 0x28, 0x28, 0x00, - 0x44, 0x28, 0x10, 0x00, 0x00, 0x00, - 0x08, 0x04, 0x54, 0x08, 0x00, 0x00, - 0x7c, 0x44, 0x54, 0x54, 0x5c, 0x00, - 0x7c, 0x24, 0x24, 0x24, 0x7c, 0x00, - 0x7c, 0x54, 0x54, 0x54, 0x6c, 0x00, - 0x7c, 0x44, 0x44, 0x44, 0x44, 0x00, - 0x7c, 0x44, 0x44, 0x44, 0x38, 0x00, - 0x7c, 0x54, 0x54, 0x54, 0x44, 0x00, - 0x7c, 0x14, 0x14, 0x14, 0x04, 0x00, - 0x7c, 0x44, 0x44, 0x54, 0x74, 0x00, - 0x7c, 0x10, 0x10, 0x10, 0x7c, 0x00, - 0x44, 0x44, 0x7c, 0x44, 0x44, 0x00, - 0x60, 0x40, 0x40, 0x44, 0x7c, 0x00, - 0x7c, 0x10, 0x10, 0x28, 0x44, 0x00, - 0x7c, 0x40, 0x40, 0x40, 0x40, 0x00, - 0x7c, 0x08, 0x10, 0x08, 0x7c, 0x00, - 0x7c, 0x08, 0x10, 0x20, 0x7c, 0x00, - 0x38, 0x44, 0x44, 0x44, 0x38, 0x00, - 0x7c, 0x14, 0x14, 0x14, 0x08, 0x00, - 0x3c, 0x24, 0x64, 0x24, 0x3c, 0x00, - 0x7c, 0x14, 0x14, 0x14, 0x68, 0x00, - 0x5c, 0x54, 0x54, 0x54, 0x74, 0x00, - 0x04, 0x04, 0x7c, 0x04, 0x04, 0x00, - 0x7c, 0x40, 0x40, 0x40, 0x7c, 0x00, - 0x0c, 0x30, 0x40, 0x30, 0x0c, 0x00, - 0x3c, 0x40, 0x30, 0x40, 0x3c, 0x00, - 0x44, 0x28, 0x10, 0x28, 0x44, 0x00, - 0x0c, 0x10, 0x60, 0x10, 0x0c, 0x00, - 0x44, 0x64, 0x54, 0x4c, 0x44, 0x00, - 0x7c, 0x44, 0x00, 0x00, 0x00, 0x00, - 0x0c, 0x10, 0x60, 0x00, 0x00, 0x00, - 0x44, 0x7c, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x01, 0x00, 0x01, 0x00, 0x00, - 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, - 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, - 0x7c, 0x24, 0x24, 0x24, 0x7c, 0x00, - 0x7c, 0x54, 0x54, 0x54, 0x6c, 0x00, - 0x7c, 0x44, 0x44, 0x44, 0x44, 0x00, - 0x7c, 0x44, 0x44, 0x44, 0x38, 0x00, - 0x7c, 0x54, 0x54, 0x54, 0x44, 0x00, - 0x7c, 0x14, 0x14, 0x14, 0x04, 0x00, - 0x7c, 0x44, 0x44, 0x54, 0x74, 0x00, - 0x7c, 0x10, 0x10, 0x10, 0x7c, 0x00, - 0x44, 0x44, 0x7c, 0x44, 0x44, 0x00, - 0x60, 0x40, 0x40, 0x44, 0x7c, 0x00, - 0x7c, 0x10, 0x10, 0x28, 0x44, 0x00, - 0x7c, 0x40, 0x40, 0x40, 0x40, 0x00, - 0x7c, 0x08, 0x10, 0x08, 0x7c, 0x00, - 0x7c, 0x08, 0x10, 0x20, 0x7c, 0x00, - 0x38, 0x44, 0x44, 0x44, 0x38, 0x00, - 0x7c, 0x14, 0x14, 0x14, 0x08, 0x00, - 0x3c, 0x24, 0x64, 0x24, 0x3c, 0x00, - 0x7c, 0x14, 0x14, 0x14, 0x68, 0x00, - 0x5c, 0x54, 0x54, 0x54, 0x74, 0x00, - 0x04, 0x04, 0x7c, 0x04, 0x04, 0x00, - 0x7c, 0x40, 0x40, 0x40, 0x7c, 0x00, - 0x0c, 0x30, 0x40, 0x30, 0x0c, 0x00, - 0x3c, 0x40, 0x30, 0x40, 0x3c, 0x00, - 0x44, 0x28, 0x10, 0x28, 0x44, 0x00, - 0x0c, 0x10, 0x60, 0x10, 0x0c, 0x00, - 0x44, 0x64, 0x54, 0x4c, 0x44, 0x00, - 0x10, 0x7c, 0x44, 0x00, 0x00, 0x00, - 0x6c, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x44, 0x7c, 0x10, 0x00, 0x00, 0x00, - 0x02, 0x01, 0x02, 0x01, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -# lif defined(OLED_FONT_AZTECH) - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x2e, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x02, 0x00, 0x02, 0x00, 0x00, - 0x00, 0x0a, 0x1e, 0x0a, 0x1e, 0x00, - 0x00, 0x0e, 0x2a, 0x6b, 0x2a, 0x3a, - 0x00, 0x06, 0x06, 0x26, 0x18, 0x06, - 0x38, 0x3e, 0x2a, 0x2a, 0x28, 0x38, - 0x18, 0x02, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x3e, 0x22, 0x00, 0x00, 0x00, - 0x00, 0x22, 0x3e, 0x00, 0x00, 0x00, - 0x00, 0x0e, 0x0e, 0x0e, 0x04, 0x00, - 0x00, 0x08, 0x1c, 0x08, 0x00, 0x00, - 0x00, 0x20, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x08, 0x08, 0x08, 0x00, 0x00, - 0x00, 0x20, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x20, 0x18, 0x06, 0x00, 0x00, - 0x00, 0x3e, 0x22, 0x2a, 0x22, 0x3e, - 0x02, 0x3e, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x38, 0x28, 0x2a, 0x2a, 0x2e, - 0x00, 0x22, 0x2a, 0x2e, 0x38, 0x00, - 0x00, 0x0e, 0x08, 0x08, 0x3e, 0x08, - 0x00, 0x2e, 0x2a, 0x2a, 0x28, 0x38, - 0x00, 0x3e, 0x2a, 0x2a, 0x28, 0x38, - 0x00, 0x06, 0x02, 0x02, 0x0a, 0x3e, - 0x00, 0x38, 0x2e, 0x2a, 0x2e, 0x38, - 0x00, 0x0e, 0x0a, 0x2a, 0x2a, 0x3e, - 0x00, 0x28, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x28, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x08, 0x14, 0x22, 0x00, 0x00, - 0x00, 0x14, 0x14, 0x14, 0x14, 0x00, - 0x00, 0x22, 0x14, 0x08, 0x00, 0x00, - 0x00, 0x06, 0x02, 0x2a, 0x0a, 0x06, - 0x00, 0x3e, 0x02, 0x3a, 0x2a, 0x0a, - 0x22, 0x3e, 0x02, 0x0a, 0x0a, 0x3e, - 0x00, 0x3e, 0x22, 0x2a, 0x2e, 0x38, - 0x00, 0x3e, 0x22, 0x22, 0x20, 0x30, - 0x00, 0x3e, 0x22, 0x22, 0x22, 0x3c, - 0x00, 0x3e, 0x2a, 0x22, 0x20, 0x30, - 0x00, 0x3e, 0x0a, 0x0a, 0x06, 0x02, - 0x00, 0x3e, 0x22, 0x2a, 0x28, 0x38, - 0x00, 0x3e, 0x08, 0x08, 0x08, 0x3e, - 0x00, 0x22, 0x3e, 0x22, 0x00, 0x00, - 0x00, 0x30, 0x20, 0x20, 0x22, 0x3e, - 0x00, 0x3e, 0x08, 0x08, 0x0e, 0x38, - 0x00, 0x3e, 0x20, 0x20, 0x20, 0x30, - 0x00, 0x3e, 0x02, 0x3e, 0x20, 0x3e, - 0x3e, 0x3e, 0x02, 0x3e, 0x20, 0x3e, - 0x00, 0x3e, 0x22, 0x22, 0x22, 0x3e, - 0x00, 0x3e, 0x02, 0x0a, 0x0a, 0x0e, - 0x00, 0x3e, 0x22, 0x22, 0x22, 0x3e, - 0x00, 0x3e, 0x02, 0x0a, 0x0e, 0x38, - 0x00, 0x0e, 0x0a, 0x2a, 0x2a, 0x3a, - 0x00, 0x06, 0x02, 0x3e, 0x02, 0x06, - 0x00, 0x3e, 0x20, 0x20, 0x20, 0x3e, - 0x00, 0x3e, 0x20, 0x20, 0x3e, 0x00, - 0x00, 0x3e, 0x20, 0x3e, 0x02, 0x3e, - 0x3e, 0x3a, 0x0e, 0x08, 0x0e, 0x3a, - 0x00, 0x0e, 0x08, 0x08, 0x28, 0x3e, - 0x00, 0x3a, 0x2a, 0x2a, 0x0a, 0x0e, - 0x00, 0x3e, 0x22, 0x00, 0x00, 0x00, - 0x00, 0x02, 0x0c, 0x30, 0x00, 0x00, - 0x22, 0x3e, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x01, 0x00, 0x01, 0x00, 0x00, - 0x00, 0x20, 0x20, 0x20, 0x00, 0x00, - 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x38, 0x28, 0x28, 0x08, 0x38, - 0x00, 0x3e, 0x20, 0x28, 0x28, 0x38, - 0x00, 0x38, 0x28, 0x28, 0x20, 0x30, - 0x00, 0x38, 0x28, 0x28, 0x20, 0x3e, - 0x00, 0xf8, 0x88, 0x28, 0x28, 0x38, - 0x00, 0xf8, 0x28, 0x28, 0x18, 0x08, - 0x00, 0x38, 0x28, 0xa8, 0x88, 0xf8, - 0x00, 0x3c, 0x08, 0x08, 0x08, 0x38, - 0x00, 0x3a, 0x00, 0x00, 0x00, 0x00, - 0x80, 0xfa, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x3e, 0x08, 0x08, 0x38, 0x2c, - 0x00, 0x3e, 0x20, 0x00, 0x00, 0x00, - 0x00, 0x38, 0x08, 0x38, 0x20, 0x38, - 0x38, 0x38, 0x08, 0x38, 0x20, 0x38, - 0x00, 0x38, 0x28, 0x28, 0x28, 0x38, - 0x00, 0xf8, 0x08, 0x28, 0x28, 0x38, - 0x00, 0x38, 0x28, 0x28, 0x08, 0xf8, - 0x00, 0x38, 0x08, 0x08, 0x18, 0x08, - 0x00, 0x38, 0x28, 0xa8, 0xa8, 0xe8, - 0x00, 0x3e, 0x28, 0x28, 0x20, 0x30, - 0x00, 0x38, 0x20, 0x20, 0x20, 0x38, - 0x00, 0x38, 0x20, 0x38, 0x00, 0x00, - 0x00, 0x38, 0x20, 0x38, 0x08, 0x38, - 0x38, 0x28, 0x38, 0x10, 0x38, 0x28, - 0x00, 0x38, 0x20, 0xa0, 0xa0, 0xf8, - 0x00, 0xe8, 0xa8, 0xa8, 0x28, 0x38, - 0x08, 0x3e, 0x22, 0x00, 0x00, 0x00, - 0x00, 0x3f, 0x00, 0x00, 0x00, 0x00, - 0x22, 0x3e, 0x08, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -# elif defined(OLED_FONT_BMPLAIN) - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x2e, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x03, 0x00, 0x03, 0x00, 0x00, 0x00, - 0x0a, 0x1f, 0x0a, 0x1f, 0x0a, 0x00, - 0x2e, 0x2a, 0x6b, 0x2a, 0x3a, 0x00, - 0x0e, 0x2a, 0x1e, 0x08, 0x3c, 0x2a, - 0x3e, 0x2a, 0x2a, 0x22, 0x38, 0x08, - 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x1c, 0x22, 0x00, 0x00, 0x00, 0x00, - 0x22, 0x1c, 0x00, 0x00, 0x00, 0x00, - 0x15, 0x0e, 0x04, 0x0e, 0x15, 0x00, - 0x08, 0x08, 0x3e, 0x08, 0x08, 0x00, - 0x60, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x08, 0x08, 0x08, 0x08, 0x08, 0x00, - 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x20, 0x10, 0x08, 0x04, 0x02, 0x00, - 0x3e, 0x22, 0x2a, 0x22, 0x3e, 0x00, - 0x04, 0x3e, 0x00, 0x00, 0x00, 0x00, - 0x3a, 0x2a, 0x2a, 0x2a, 0x2e, 0x00, - 0x2a, 0x2a, 0x2a, 0x2a, 0x3e, 0x00, - 0x0e, 0x08, 0x08, 0x08, 0x3e, 0x00, - 0x2e, 0x2a, 0x2a, 0x2a, 0x3a, 0x00, - 0x3e, 0x2a, 0x2a, 0x2a, 0x3a, 0x00, - 0x02, 0x02, 0x02, 0x02, 0x3e, 0x00, - 0x3e, 0x2a, 0x2a, 0x2a, 0x3e, 0x00, - 0x2e, 0x2a, 0x2a, 0x2a, 0x3e, 0x00, - 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x34, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x08, 0x14, 0x22, 0x00, 0x00, 0x00, - 0x14, 0x14, 0x14, 0x14, 0x14, 0x00, - 0x22, 0x14, 0x08, 0x00, 0x00, 0x00, - 0x06, 0x02, 0x2a, 0x0a, 0x0e, 0x00, - 0x3e, 0x02, 0x3a, 0x2a, 0x3e, 0x00, - 0x3e, 0x12, 0x12, 0x12, 0x3e, 0x00, - 0x3e, 0x2a, 0x2a, 0x2a, 0x36, 0x00, - 0x3e, 0x22, 0x22, 0x22, 0x22, 0x00, - 0x3e, 0x22, 0x22, 0x22, 0x1c, 0x00, - 0x3e, 0x2a, 0x2a, 0x2a, 0x22, 0x00, - 0x3e, 0x0a, 0x0a, 0x0a, 0x02, 0x00, - 0x3e, 0x22, 0x2a, 0x2a, 0x3a, 0x00, - 0x3e, 0x08, 0x08, 0x08, 0x3e, 0x00, - 0x22, 0x3e, 0x22, 0x00, 0x00, 0x00, - 0x38, 0x20, 0x20, 0x20, 0x3e, 0x00, - 0x3e, 0x08, 0x08, 0x14, 0x22, 0x00, - 0x3e, 0x20, 0x20, 0x20, 0x20, 0x00, - 0x3e, 0x04, 0x38, 0x04, 0x3e, 0x00, - 0x3e, 0x04, 0x08, 0x10, 0x3e, 0x00, - 0x3e, 0x22, 0x22, 0x22, 0x3e, 0x00, - 0x3e, 0x0a, 0x0a, 0x0a, 0x0e, 0x00, - 0x3e, 0x22, 0x72, 0x22, 0x3e, 0x00, - 0x3e, 0x0a, 0x0a, 0x1a, 0x2e, 0x00, - 0x2e, 0x2a, 0x2a, 0x2a, 0x3a, 0x00, - 0x02, 0x02, 0x3e, 0x02, 0x02, 0x00, - 0x1e, 0x20, 0x20, 0x20, 0x1e, 0x00, - 0x0e, 0x10, 0x20, 0x10, 0x0e, 0x00, - 0x3e, 0x10, 0x0e, 0x10, 0x3e, 0x00, - 0x22, 0x14, 0x08, 0x14, 0x22, 0x00, - 0x02, 0x04, 0x38, 0x04, 0x02, 0x00, - 0x3a, 0x2a, 0x2a, 0x2a, 0x2e, 0x00, - 0x3e, 0x22, 0x00, 0x00, 0x00, 0x00, - 0x3f, 0x21, 0x3f, 0x00, 0x00, 0x00, - 0x22, 0x3e, 0x00, 0x00, 0x00, 0x00, - 0x0c, 0x1e, 0x3c, 0x1e, 0x0c, 0x00, - 0x20, 0x20, 0x20, 0x20, 0x20, 0x00, - 0x1c, 0x3e, 0x3e, 0x3e, 0x1c, 0x00, - 0x3c, 0x24, 0x24, 0x24, 0x3c, 0x20, - 0x3e, 0x24, 0x24, 0x24, 0x3c, 0x00, - 0x3c, 0x24, 0x24, 0x24, 0x24, 0x00, - 0x3c, 0x24, 0x24, 0x24, 0x3e, 0x00, - 0x3c, 0x24, 0x34, 0x2c, 0x24, 0x00, - 0x08, 0x3e, 0x0a, 0x0a, 0x00, 0x00, - 0x1c, 0x54, 0x54, 0x54, 0x7c, 0x00, - 0x3e, 0x04, 0x04, 0x04, 0x3c, 0x00, - 0x3a, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x7a, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x3e, 0x08, 0x14, 0x22, 0x00, 0x00, - 0x02, 0x3e, 0x00, 0x00, 0x00, 0x00, - 0x3c, 0x04, 0x3c, 0x04, 0x3c, 0x00, - 0x3c, 0x04, 0x04, 0x04, 0x3c, 0x00, - 0x3c, 0x24, 0x24, 0x24, 0x3c, 0x00, - 0x7c, 0x24, 0x24, 0x24, 0x3c, 0x00, - 0x3c, 0x24, 0x24, 0x24, 0x7c, 0x00, - 0x3c, 0x04, 0x04, 0x04, 0x00, 0x00, - 0x24, 0x2c, 0x34, 0x24, 0x00, 0x00, - 0x04, 0x3e, 0x24, 0x24, 0x00, 0x00, - 0x3c, 0x20, 0x20, 0x20, 0x3c, 0x00, - 0x0c, 0x10, 0x20, 0x10, 0x0c, 0x00, - 0x3c, 0x20, 0x3c, 0x20, 0x3c, 0x00, - 0x24, 0x24, 0x18, 0x24, 0x24, 0x00, - 0x1c, 0x50, 0x50, 0x50, 0x7c, 0x00, - 0x24, 0x34, 0x2c, 0x24, 0x00, 0x00, - 0x08, 0x3e, 0x22, 0x00, 0x00, 0x00, - 0x1c, 0x22, 0x22, 0x22, 0x1c, 0x00, - 0x22, 0x3e, 0x08, 0x00, 0x00, 0x00, - 0x01, 0x01, 0x01, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -# elif defined(OLED_FONT_CRACKERS) - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x5E, 0x06, 0x06, 0x00, 0x00, 0x00, - 0x1E, 0x00, 0x00, 0x1E, 0x00, 0x00, - 0x20, 0x7C, 0x38, 0x38, 0x7C, 0x08, - 0x48, 0xFE, 0x64, 0x64, 0x00, 0x00, - 0x64, 0x60, 0x60, 0x18, 0x0C, 0x0C, - 0x74, 0x4A, 0x4A, 0x7E, 0x48, 0x00, - 0x1E, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x3C, 0x7E, 0x7E, 0x42, 0x00, 0x00, - 0x42, 0x7E, 0x7E, 0x3C, 0x00, 0x00, - 0x04, 0x0C, 0x04, 0x06, 0x0C, 0x04, - 0x10, 0x3C, 0x3C, 0x3C, 0x10, 0x00, - 0x00, 0x60, 0xE0, 0x00, 0x00, 0x00, - 0x08, 0x08, 0x08, 0x00, 0x00, 0x00, - 0x60, 0x60, 0x60, 0x00, 0x00, 0x00, - 0x60, 0x78, 0x78, 0x1E, 0x06, 0x00, - 0x3C, 0x3C, 0x7E, 0x42, 0x7E, 0x7E, - 0x04, 0x7E, 0x7E, 0x7E, 0x00, 0x00, - 0x76, 0x7A, 0x7E, 0x7E, 0x4C, 0x00, - 0x4A, 0x7E, 0x7E, 0x7C, 0x00, 0x00, - 0x0E, 0x08, 0x7E, 0x7E, 0x7E, 0x00, - 0x4E, 0x4E, 0x4E, 0x7A, 0x1A, 0x00, - 0x3C, 0x7E, 0x7E, 0x4A, 0x7A, 0x00, - 0x02, 0x02, 0x0A, 0x7E, 0x7E, 0x7E, - 0x7E, 0x7E, 0x7E, 0x4A, 0x7E, 0x00, - 0x0C, 0x4A, 0x7E, 0x7E, 0x3C, 0x00, - 0x66, 0x66, 0x66, 0x00, 0x00, 0x00, - 0x66, 0xE6, 0x00, 0x00, 0x00, 0x00, - 0x08, 0x3C, 0x7E, 0x7E, 0x62, 0x00, - 0x14, 0x14, 0x14, 0x00, 0x00, 0x00, - 0x62, 0x7E, 0x7E, 0x3C, 0x08, 0x00, - 0x02, 0x4A, 0x0E, 0x0E, 0x0C, 0x00, - 0x3C, 0x7E, 0x7E, 0x4A, 0x72, 0x30, - 0x7A, 0x4A, 0x7E, 0x7E, 0x7C, 0x00, - 0x7E, 0x7E, 0x7E, 0x4A, 0x24, 0x00, - 0x3C, 0x7E, 0x7E, 0x7E, 0x46, 0x00, - 0x7E, 0x7E, 0x7E, 0x62, 0x3C, 0x00, - 0x7E, 0x7E, 0x7E, 0x4A, 0x00, 0x00, - 0x7E, 0x7E, 0x7E, 0x0A, 0x00, 0x00, - 0x3C, 0x7E, 0x7E, 0x42, 0x62, 0x00, - 0x7E, 0x7E, 0x7E, 0x18, 0x7E, 0x00, - 0x7E, 0x7E, 0x7E, 0x00, 0x00, 0x00, - 0x40, 0x7E, 0x7E, 0x7E, 0x00, 0x00, - 0x7E, 0x7E, 0x7E, 0x3C, 0x66, 0x00, - 0x7E, 0x7E, 0x7E, 0x40, 0x00, 0x00, - 0x7E, 0x3E, 0x3E, 0x7C, 0x3E, 0x3E, - 0x7E, 0x3E, 0x7E, 0x7C, 0x7E, 0x00, - 0x3C, 0x3C, 0x7E, 0x62, 0x7E, 0x7E, - 0x7E, 0x7E, 0x7E, 0x22, 0x0C, 0x00, - 0x3C, 0x7E, 0x7E, 0x62, 0x7E, 0x7C, - 0x7E, 0x7E, 0x7E, 0x0A, 0x64, 0x00, - 0x4C, 0x4E, 0x4E, 0x7A, 0x1A, 0x00, - 0x02, 0x7E, 0x7E, 0x7E, 0x02, 0x00, - 0x7E, 0x60, 0x7E, 0x7E, 0x7E, 0x00, - 0x3E, 0x60, 0x7E, 0x7E, 0x3E, 0x00, - 0x7E, 0x7C, 0x7C, 0x3E, 0x7C, 0x7C, - 0x46, 0x7E, 0x08, 0x7E, 0x62, 0x62, - 0x5E, 0x5E, 0x5E, 0x70, 0x3E, 0x00, - 0x66, 0x7A, 0x7A, 0x5E, 0x66, 0x00, - 0x7E, 0x7E, 0x7E, 0x42, 0x00, 0x00, - 0x06, 0x1E, 0x1E, 0x78, 0x60, 0x00, - 0x42, 0x7E, 0x7E, 0x7E, 0x00, 0x00, - 0x0C, 0x06, 0x0C, 0x00, 0x00, 0x00, - 0x40, 0x40, 0x40, 0x40, 0x40, 0x00, - 0x02, 0x06, 0x06, 0x04, 0x00, 0x00, - 0x78, 0x24, 0x7C, 0x7C, 0x78, 0x00, - 0x7C, 0x7C, 0x7C, 0x48, 0x20, 0x00, - 0x18, 0x7C, 0x7C, 0x7C, 0x4C, 0x00, - 0x20, 0x48, 0x7C, 0x7C, 0x7C, 0x00, - 0x18, 0x7C, 0x7C, 0x74, 0x4C, 0x00, - 0x78, 0x7C, 0x7C, 0x24, 0x00, 0x00, - 0x18, 0x7C, 0x7C, 0x44, 0x74, 0x00, - 0x7C, 0x7C, 0x7C, 0x08, 0x60, 0x00, - 0x7C, 0x7C, 0x7C, 0x00, 0x00, 0x00, - 0x40, 0x7C, 0x7C, 0x7C, 0x00, 0x00, - 0x7C, 0x7C, 0x7C, 0x20, 0x48, 0x00, - 0x7C, 0x7C, 0x7C, 0x40, 0x00, 0x00, - 0x7C, 0x3C, 0x3C, 0x78, 0x3C, 0x3C, - 0x7C, 0x7C, 0x7C, 0x04, 0x78, 0x00, - 0x18, 0x18, 0x7C, 0x44, 0x7C, 0x7C, - 0x7C, 0x7C, 0x7C, 0x24, 0x08, 0x00, - 0x18, 0x18, 0x7C, 0x44, 0x7C, 0x7C, - 0x7C, 0x7C, 0x7C, 0x04, 0x00, 0x00, - 0x5C, 0x7C, 0x7C, 0x74, 0x00, 0x00, - 0x08, 0x7C, 0x7C, 0x7C, 0x48, 0x00, - 0x7C, 0x60, 0x7C, 0x7C, 0x7C, 0x00, - 0x3C, 0x60, 0x7C, 0x7C, 0x3C, 0x00, - 0x7C, 0x78, 0x78, 0x3C, 0x78, 0x78, - 0x4C, 0x3C, 0x3C, 0x78, 0x64, 0x00, - 0x4C, 0x4C, 0x4C, 0x78, 0x3C, 0x00, - 0x5C, 0x74, 0x44, 0x5C, 0x74, 0x00, - 0x24, 0x7E, 0x42, 0x42, 0x00, 0x00, - 0x7E, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x42, 0x7E, 0x24, 0x00, 0x00, 0x00, - 0x04, 0x06, 0x06, 0x02, 0x04, 0x06, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -# elif defined(OLED_FONT_EIN) - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x5F, 0x00, 0x00, 0x00, - 0x00, 0x07, 0x00, 0x07, 0x00, 0x00, - 0x14, 0x7F, 0x14, 0x7F, 0x14, 0x00, - 0x24, 0x2A, 0x7F, 0x2A, 0x12, 0x00, - 0x23, 0x13, 0x08, 0x64, 0x62, 0x00, - 0x36, 0x49, 0x56, 0x20, 0x50, 0x00, - 0x00, 0x08, 0x07, 0x03, 0x00, 0x00, - 0x00, 0x1C, 0x22, 0x41, 0x00, 0x00, - 0x00, 0x41, 0x22, 0x1C, 0x00, 0x00, - 0x2A, 0x1C, 0x7F, 0x1C, 0x2A, 0x00, - 0x08, 0x08, 0x3E, 0x08, 0x08, 0x00, - 0x00, 0x80, 0x70, 0x30, 0x00, 0x00, - 0x08, 0x08, 0x08, 0x08, 0x08, 0x00, - 0x00, 0x00, 0x60, 0x60, 0x00, 0x00, - 0x20, 0x10, 0x08, 0x04, 0x02, 0x00, - 0x3E, 0x51, 0x49, 0x45, 0x3E, 0x00, - 0x00, 0x42, 0x7F, 0x40, 0x00, 0x00, - 0x72, 0x49, 0x49, 0x49, 0x46, 0x00, - 0x21, 0x41, 0x49, 0x4D, 0x33, 0x00, - 0x18, 0x14, 0x12, 0x7F, 0x10, 0x00, - 0x27, 0x45, 0x45, 0x45, 0x39, 0x00, - 0x3C, 0x4A, 0x49, 0x49, 0x31, 0x00, - 0x41, 0x21, 0x11, 0x09, 0x07, 0x00, - 0x36, 0x49, 0x49, 0x49, 0x36, 0x00, - 0x46, 0x49, 0x49, 0x29, 0x1E, 0x00, - 0x00, 0x00, 0x14, 0x00, 0x00, 0x00, - 0x00, 0x40, 0x34, 0x00, 0x00, 0x00, - 0x00, 0x08, 0x14, 0x22, 0x41, 0x00, - 0x14, 0x14, 0x14, 0x14, 0x14, 0x00, - 0x00, 0x41, 0x22, 0x14, 0x08, 0x00, - 0x02, 0x01, 0x59, 0x09, 0x06, 0x00, - 0x00, 0x41, 0x5D, 0x59, 0x4E, 0x00, - 0x7C, 0x12, 0x11, 0x12, 0x7C, 0x00, - 0x7F, 0x49, 0x49, 0x49, 0x36, 0x00, - 0x3E, 0x41, 0x41, 0x41, 0x22, 0x00, - 0x7F, 0x41, 0x41, 0x41, 0x3E, 0x00, - 0x7F, 0x49, 0x49, 0x49, 0x41, 0x00, - 0x7F, 0x09, 0x09, 0x09, 0x01, 0x00, - 0x3E, 0x41, 0x41, 0x51, 0x73, 0x00, - 0x7F, 0x08, 0x08, 0x08, 0x7F, 0x00, - 0x00, 0x00, 0x7F, 0x00, 0x00, 0x00, - 0x20, 0x40, 0x40, 0x3F, 0x00, 0x00, - 0x7F, 0x08, 0x14, 0x22, 0x41, 0x00, - 0x7F, 0x40, 0x40, 0x40, 0x40, 0x00, - 0x7F, 0x02, 0x1C, 0x02, 0x7F, 0x00, - 0x7F, 0x04, 0x08, 0x10, 0x7F, 0x00, - 0x3E, 0x41, 0x41, 0x41, 0x3E, 0x00, - 0x7F, 0x09, 0x09, 0x09, 0x06, 0x00, - 0x3E, 0x41, 0x51, 0x21, 0x5E, 0x00, - 0x7F, 0x09, 0x19, 0x29, 0x46, 0x00, - 0x26, 0x49, 0x49, 0x49, 0x32, 0x00, - 0x01, 0x01, 0x7F, 0x01, 0x01, 0x00, - 0x3F, 0x40, 0x40, 0x40, 0x3F, 0x00, - 0x1F, 0x20, 0x40, 0x20, 0x1F, 0x00, - 0x3F, 0x40, 0x38, 0x40, 0x3F, 0x00, - 0x63, 0x14, 0x08, 0x14, 0x63, 0x00, - 0x03, 0x04, 0x78, 0x04, 0x03, 0x00, - 0x61, 0x59, 0x49, 0x4D, 0x43, 0x00, - 0x00, 0x7F, 0x41, 0x41, 0x41, 0x00, - 0x02, 0x04, 0x08, 0x10, 0x20, 0x00, - 0x00, 0x41, 0x41, 0x41, 0x7F, 0x00, - 0x04, 0x02, 0x01, 0x02, 0x04, 0x00, - 0x40, 0x40, 0x40, 0x40, 0x40, 0x00, - 0x00, 0x03, 0x07, 0x08, 0x00, 0x00, - 0x78, 0x14, 0x14, 0x78, 0x00, 0x00, - 0x7C, 0x54, 0x54, 0x28, 0x00, 0x00, - 0x38, 0x44, 0x44, 0x28, 0x00, 0x00, - 0x7C, 0x44, 0x44, 0x38, 0x00, 0x00, - 0x7C, 0x54, 0x54, 0x44, 0x00, 0x00, - 0x7C, 0x14, 0x14, 0x04, 0x00, 0x00, - 0x38, 0x44, 0x54, 0x34, 0x00, 0x00, - 0x7C, 0x10, 0x10, 0x7C, 0x00, 0x00, - 0x00, 0x7C, 0x00, 0x00, 0x00, 0x00, - 0x20, 0x40, 0x40, 0x3C, 0x00, 0x00, - 0x7C, 0x10, 0x28, 0x44, 0x00, 0x00, - 0x7C, 0x40, 0x40, 0x40, 0x00, 0x00, - 0x7C, 0x08, 0x70, 0x08, 0x7C, 0x00, - 0x7C, 0x08, 0x10, 0x7C, 0x00, 0x00, - 0x38, 0x44, 0x44, 0x38, 0x00, 0x00, - 0x7C, 0x14, 0x14, 0x08, 0x00, 0x00, - 0x38, 0x44, 0x24, 0x58, 0x00, 0x00, - 0x7C, 0x14, 0x34, 0x48, 0x00, 0x00, - 0x48, 0x54, 0x54, 0x24, 0x00, 0x00, - 0x04, 0x7C, 0x04, 0x00, 0x00, 0x00, - 0x3C, 0x40, 0x40, 0x3C, 0x00, 0x00, - 0x3C, 0x40, 0x20, 0x1C, 0x00, 0x00, - 0x3C, 0x40, 0x30, 0x40, 0x3C, 0x00, - 0x44, 0x28, 0x10, 0x28, 0x44, 0x00, - 0x0C, 0x10, 0x70, 0x10, 0x0C, 0x00, - 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, -# elif defined(OLED_FONT_HISKYF21) - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x5C, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x0C, 0x00, 0x0C, 0x00, 0x00, 0x00, - 0x28, 0x7C, 0x28, 0x7C, 0x28, 0x00, - 0x48, 0x54, 0x54, 0xFE, 0x54, 0x54, - 0x44, 0x20, 0x10, 0x08, 0x44, 0x00, - 0x28, 0x54, 0x54, 0x54, 0x74, 0x10, - 0x0C, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x78, 0x84, 0x00, 0x00, 0x00, 0x00, - 0x84, 0x78, 0x00, 0x00, 0x00, 0x00, - 0x48, 0x30, 0x30, 0x48, 0x00, 0x00, - 0x10, 0x38, 0x10, 0x00, 0x00, 0x00, - 0xC0, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x10, 0x10, 0x10, 0x10, 0x00, 0x00, - 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x60, 0x10, 0x0C, 0x00, 0x00, 0x00, - 0x38, 0x44, 0x44, 0x44, 0x44, 0x38, - 0x08, 0x7C, 0x00, 0x00, 0x00, 0x00, - 0x64, 0x54, 0x54, 0x54, 0x48, 0x00, - 0x44, 0x54, 0x54, 0x54, 0x28, 0x00, - 0x1C, 0x10, 0x10, 0x10, 0x7C, 0x00, - 0x4C, 0x54, 0x54, 0x54, 0x24, 0x00, - 0x38, 0x54, 0x54, 0x54, 0x54, 0x20, - 0x44, 0x24, 0x14, 0x0C, 0x00, 0x00, - 0x28, 0x54, 0x54, 0x54, 0x54, 0x28, - 0x08, 0x54, 0x54, 0x54, 0x54, 0x38, - 0x48, 0x00, 0x00, 0x00, 0x00, 0x00, - 0xC8, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x10, 0x28, 0x44, 0x00, 0x00, 0x00, - 0x28, 0x28, 0x28, 0x28, 0x00, 0x00, - 0x44, 0x28, 0x10, 0x00, 0x00, 0x00, - 0x04, 0x54, 0x14, 0x14, 0x08, 0x00, - 0x38, 0x44, 0x5C, 0x54, 0x48, 0x00, - 0x60, 0x18, 0x14, 0x14, 0x18, 0x60, - 0x7C, 0x54, 0x54, 0x54, 0x58, 0x30, - 0x38, 0x44, 0x44, 0x44, 0x40, 0x00, - 0x7C, 0x44, 0x44, 0x44, 0x38, 0x00, - 0x7C, 0x54, 0x54, 0x54, 0x54, 0x40, - 0x7C, 0x14, 0x14, 0x14, 0x10, 0x00, - 0x38, 0x44, 0x44, 0x44, 0x70, 0x10, - 0x7C, 0x10, 0x10, 0x10, 0x10, 0x7C, - 0x7C, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x20, 0x40, 0x40, 0x40, 0x40, 0x3C, - 0x7C, 0x10, 0x10, 0x28, 0x44, 0x00, - 0x7C, 0x40, 0x40, 0x40, 0x00, 0x00, - 0x7C, 0x08, 0x10, 0x60, 0x10, 0x08, - 0x7C, 0x08, 0x10, 0x20, 0x7C, 0x00, - 0x38, 0x44, 0x44, 0x44, 0x44, 0x38, - 0x7C, 0x24, 0x24, 0x24, 0x18, 0x00, - 0x38, 0x44, 0x64, 0x44, 0x38, 0x00, - 0x7C, 0x14, 0x14, 0x14, 0x68, 0x00, - 0x48, 0x54, 0x54, 0x54, 0x54, 0x20, - 0x04, 0x04, 0x7C, 0x04, 0x04, 0x00, - 0x3C, 0x40, 0x40, 0x40, 0x3C, 0x00, - 0x0C, 0x30, 0x40, 0x30, 0x0C, 0x00, - 0x0C, 0x30, 0x40, 0x20, 0x1C, 0x20, - 0x74, 0x2C, 0x10, 0x28, 0x44, 0x00, - 0x04, 0x08, 0x70, 0x08, 0x04, 0x00, - 0x44, 0x64, 0x54, 0x4C, 0x44, 0x00, - 0xFC, 0x84, 0x00, 0x00, 0x00, 0x00, - 0x0C, 0x10, 0x60, 0x00, 0x00, 0x00, - 0x84, 0xFC, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x7F, 0x41, 0x7F, 0x00, 0x00, - 0x40, 0x40, 0x40, 0x40, 0x00, 0x00, - 0x00, 0x7F, 0x41, 0x7F, 0x00, 0x00, - 0x60, 0x18, 0x14, 0x14, 0x18, 0x60, - 0x7C, 0x54, 0x54, 0x54, 0x58, 0x30, - 0x38, 0x44, 0x44, 0x44, 0x40, 0x00, - 0x7C, 0x44, 0x44, 0x44, 0x38, 0x00, - 0x7C, 0x54, 0x54, 0x54, 0x54, 0x40, - 0x7C, 0x14, 0x14, 0x14, 0x10, 0x00, - 0x38, 0x44, 0x44, 0x44, 0x70, 0x10, - 0x7C, 0x10, 0x10, 0x10, 0x10, 0x7C, - 0x7C, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x20, 0x40, 0x40, 0x40, 0x40, 0x3C, - 0x7C, 0x10, 0x10, 0x28, 0x44, 0x00, - 0x7C, 0x40, 0x40, 0x40, 0x00, 0x00, - 0x7C, 0x08, 0x10, 0x60, 0x10, 0x08, - 0x7C, 0x08, 0x10, 0x20, 0x7C, 0x00, - 0x38, 0x44, 0x44, 0x44, 0x44, 0x38, - 0x7C, 0x24, 0x24, 0x24, 0x18, 0x00, - 0x38, 0x44, 0x64, 0x44, 0x38, 0x00, - 0x7C, 0x14, 0x14, 0x14, 0x68, 0x00, - 0x48, 0x54, 0x54, 0x54, 0x54, 0x20, - 0x04, 0x04, 0x7C, 0x04, 0x04, 0x00, - 0x3C, 0x40, 0x40, 0x40, 0x3C, 0x00, - 0x0C, 0x30, 0x40, 0x30, 0x0C, 0x00, - 0x0C, 0x30, 0x40, 0x20, 0x1C, 0x20, - 0x74, 0x2C, 0x10, 0x28, 0x44, 0x00, - 0x04, 0x08, 0x70, 0x08, 0x04, 0x00, - 0x44, 0x64, 0x54, 0x4C, 0x44, 0x00, - 0x00, 0x7F, 0x41, 0x7F, 0x00, 0x00, - 0xFC, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x7F, 0x41, 0x7F, 0x00, 0x00, - 0x00, 0x7F, 0x41, 0x7F, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -# elif defined(OLED_FONT_SUPER_DIGG) - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x58, 0x5C, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x01, 0x00, 0x00, 0x01, 0x00, - 0x14, 0x7F, 0x14, 0x7F, 0x14, 0x00, - 0x5C, 0xFE, 0x54, 0xFE, 0x74, 0x00, - 0x03, 0x63, 0x38, 0x0C, 0x63, 0x60, - 0x70, 0x5C, 0x54, 0x74, 0x7C, 0x50, - 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, - 0x70, 0x7C, 0x44, 0x00, 0x00, 0x00, - 0x44, 0x7C, 0x70, 0x00, 0x00, 0x00, - 0x2A, 0x1C, 0x7F, 0x1C, 0x2A, 0x00, - 0x10, 0x10, 0x70, 0x7C, 0x10, 0x00, - 0x40, 0xC0, 0x00, 0x00, 0x00, 0x00, - 0x10, 0x10, 0x10, 0x10, 0x00, 0x00, - 0x40, 0x40, 0x00, 0x00, 0x00, 0x00, - 0x70, 0x7C, 0x03, 0x00, 0x00, 0x00, - 0x7C, 0x44, 0x44, 0x44, 0x7C, 0x1C, - 0x04, 0x04, 0x7C, 0x1C, 0x00, 0x00, - 0x74, 0x74, 0x54, 0x54, 0x5C, 0x00, - 0x44, 0x54, 0x54, 0x54, 0x7C, 0x70, - 0x1C, 0x10, 0x10, 0x7C, 0x7C, 0x00, - 0x5C, 0x5C, 0x54, 0x54, 0x74, 0x00, - 0x70, 0x7C, 0x54, 0x54, 0x74, 0x00, - 0x04, 0x14, 0x14, 0x14, 0x7C, 0x70, - 0x70, 0x5C, 0x54, 0x74, 0x7C, 0x00, - 0x5C, 0x54, 0x54, 0x54, 0x7C, 0x1C, - 0x50, 0x50, 0x00, 0x00, 0x00, 0x00, - 0x50, 0xD0, 0x00, 0x00, 0x00, 0x00, - 0x18, 0x18, 0x24, 0x42, 0x00, 0x00, - 0x28, 0x28, 0x28, 0x28, 0x00, 0x00, - 0x42, 0x24, 0x18, 0x18, 0x00, 0x00, - 0x04, 0x14, 0x54, 0x54, 0x1C, 0x1C, - 0xF8, 0x04, 0x74, 0x74, 0x54, 0x54, - 0x70, 0x7C, 0x14, 0x14, 0x3C, 0x00, - 0x7C, 0x74, 0x54, 0x54, 0x7C, 0x00, - 0x70, 0x7C, 0x44, 0x44, 0x44, 0x44, - 0x70, 0x7C, 0x44, 0x44, 0x48, 0x70, - 0x70, 0x7C, 0x54, 0x54, 0x54, 0x44, - 0x70, 0x7C, 0x14, 0x14, 0x14, 0x04, - 0x70, 0x7C, 0x44, 0x44, 0x54, 0x74, - 0x70, 0x7C, 0x10, 0x10, 0x7C, 0x00, - 0x70, 0x7C, 0x00, 0x00, 0x00, 0x00, - 0x60, 0x40, 0x40, 0x40, 0x7C, 0x70, - 0x7C, 0x70, 0x10, 0x1C, 0x70, 0x00, - 0x70, 0x7C, 0x40, 0x40, 0x40, 0x60, - 0x70, 0x7C, 0x04, 0x04, 0x7C, 0x04, - 0x70, 0x7C, 0x04, 0x04, 0x04, 0x7C, - 0x70, 0x7C, 0x44, 0x44, 0x44, 0x7C, - 0x70, 0x7C, 0x24, 0x24, 0x3C, 0x00, - 0x7C, 0x44, 0x44, 0x44, 0x7C, 0x00, - 0x7C, 0x74, 0x14, 0x14, 0x3C, 0x00, - 0x5C, 0x5C, 0x54, 0x54, 0x74, 0x00, - 0x04, 0x04, 0x7C, 0x74, 0x04, 0x00, - 0x70, 0x7C, 0x40, 0x40, 0x40, 0x7C, - 0x70, 0x7C, 0x40, 0x40, 0x20, 0x1C, - 0x70, 0x7C, 0x40, 0x40, 0x7C, 0x40, - 0x70, 0x7C, 0x10, 0x10, 0x3C, 0x00, - 0x1C, 0x10, 0x70, 0x70, 0x1C, 0x00, - 0x74, 0x74, 0x54, 0x54, 0x5C, 0x00, - 0xF0, 0xFE, 0x82, 0x00, 0x00, 0x00, - 0x03, 0x7C, 0x70, 0x00, 0x00, 0x00, - 0x82, 0xFE, 0xF0, 0x00, 0x00, 0x00, - 0x04, 0x02, 0x01, 0x06, 0x04, 0x00, - 0x40, 0x40, 0x40, 0x40, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x70, 0x7C, 0x14, 0x14, 0x3C, 0x00, - 0x7C, 0x74, 0x54, 0x54, 0x7C, 0x00, - 0x70, 0x7C, 0x44, 0x44, 0x44, 0x44, - 0x70, 0x7C, 0x44, 0x44, 0x48, 0x70, - 0x70, 0x7C, 0x54, 0x54, 0x54, 0x44, - 0x70, 0x7C, 0x14, 0x14, 0x14, 0x04, - 0x70, 0x7C, 0x44, 0x44, 0x54, 0x74, - 0x70, 0x7C, 0x10, 0x10, 0x7C, 0x00, - 0x70, 0x7C, 0x00, 0x00, 0x00, 0x00, - 0x60, 0x40, 0x40, 0x40, 0x7C, 0x70, - 0x7C, 0x70, 0x10, 0x1C, 0x70, 0x00, - 0x70, 0x7C, 0x40, 0x40, 0x40, 0x60, - 0x70, 0x7C, 0x04, 0x04, 0x7C, 0x04, - 0x70, 0x7C, 0x04, 0x04, 0x04, 0x7C, - 0x70, 0x7C, 0x44, 0x44, 0x44, 0x7C, - 0x70, 0x7C, 0x24, 0x24, 0x3C, 0x00, - 0x7C, 0x44, 0x44, 0x44, 0x7C, 0x00, - 0x7C, 0x74, 0x14, 0x14, 0x3C, 0x00, - 0x5C, 0x5C, 0x54, 0x54, 0x74, 0x00, - 0x04, 0x04, 0x7C, 0x74, 0x04, 0x00, - 0x70, 0x7C, 0x40, 0x40, 0x40, 0x7C, - 0x70, 0x7C, 0x40, 0x40, 0x20, 0x1C, - 0x70, 0x7C, 0x40, 0x40, 0x7C, 0x40, - 0x70, 0x7C, 0x10, 0x10, 0x3C, 0x00, - 0x1C, 0x10, 0x70, 0x70, 0x1C, 0x00, - 0x74, 0x74, 0x54, 0x54, 0x5C, 0x00, - 0x10, 0xFE, 0xC2, 0x00, 0x00, 0x00, - 0x00, 0x44, 0x77, 0x00, 0x00, 0x00, - 0xC2, 0xFE, 0x10, 0x00, 0x00, 0x00, - 0x02, 0x01, 0x03, 0x04, 0x06, 0x02, - 0x3C, 0x22, 0x21, 0x22, 0x3C, 0x00, -#elif defined (OLED_FONT_ZXPIX) - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x2F, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x03, 0x00, 0x03, 0x00, 0x00, 0x00, - 0x12, 0x3F, 0x12, 0x12, 0x3F, 0x12, - 0x2E, 0x2A, 0x7F, 0x2A, 0x3A, 0x00, - 0x23, 0x13, 0x08, 0x04, 0x32, 0x31, - 0x10, 0x2A, 0x25, 0x2A, 0x10, 0x20, - 0x02, 0x01, 0x00, 0x00, 0x00, 0x00, - 0x1E, 0x21, 0x00, 0x00, 0x00, 0x00, - 0x21, 0x1E, 0x00, 0x00, 0x00, 0x00, - 0x08, 0x2A, 0x1C, 0x2A, 0x08, 0x08, - 0x08, 0x08, 0x3E, 0x08, 0x08, 0x08, - 0x80, 0x60, 0x00, 0x00, 0x00, 0x00, - 0x08, 0x08, 0x08, 0x08, 0x08, 0x00, - 0x30, 0x30, 0x00, 0x00, 0x00, 0x00, - 0x20, 0x10, 0x08, 0x04, 0x02, 0x00, - 0x1E, 0x31, 0x29, 0x25, 0x23, 0x1E, - 0x22, 0x21, 0x3F, 0x20, 0x20, 0x20, - 0x32, 0x29, 0x29, 0x29, 0x29, 0x26, - 0x12, 0x21, 0x21, 0x25, 0x25, 0x1A, - 0x18, 0x14, 0x12, 0x3F, 0x10, 0x10, - 0x17, 0x25, 0x25, 0x25, 0x25, 0x19, - 0x1E, 0x25, 0x25, 0x25, 0x25, 0x18, - 0x01, 0x01, 0x31, 0x09, 0x05, 0x03, - 0x1A, 0x25, 0x25, 0x25, 0x25, 0x1A, - 0x06, 0x29, 0x29, 0x29, 0x29, 0x1E, - 0x24, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x80, 0x64, 0x00, 0x00, 0x00, 0x00, - 0x08, 0x14, 0x22, 0x00, 0x00, 0x00, - 0x14, 0x14, 0x14, 0x14, 0x14, 0x00, - 0x22, 0x14, 0x08, 0x00, 0x00, 0x00, - 0x02, 0x01, 0x01, 0x29, 0x05, 0x02, - 0x1E, 0x21, 0x2D, 0x2B, 0x2D, 0x0E, - 0x3E, 0x09, 0x09, 0x09, 0x09, 0x3E, - 0x3F, 0x25, 0x25, 0x25, 0x25, 0x1A, - 0x1E, 0x21, 0x21, 0x21, 0x21, 0x12, - 0x3F, 0x21, 0x21, 0x21, 0x12, 0x0C, - 0x3F, 0x25, 0x25, 0x25, 0x25, 0x21, - 0x3F, 0x05, 0x05, 0x05, 0x05, 0x01, - 0x1E, 0x21, 0x21, 0x21, 0x29, 0x1A, - 0x3F, 0x04, 0x04, 0x04, 0x04, 0x3F, - 0x21, 0x21, 0x3F, 0x21, 0x21, 0x21, - 0x10, 0x20, 0x20, 0x20, 0x20, 0x1F, - 0x3F, 0x04, 0x0C, 0x0A, 0x11, 0x20, - 0x3F, 0x20, 0x20, 0x20, 0x20, 0x20, - 0x3F, 0x02, 0x04, 0x04, 0x02, 0x3F, - 0x3F, 0x02, 0x04, 0x08, 0x10, 0x3F, - 0x1E, 0x21, 0x21, 0x21, 0x21, 0x1E, - 0x3F, 0x09, 0x09, 0x09, 0x09, 0x06, - 0x1E, 0x21, 0x29, 0x31, 0x21, 0x1E, - 0x3F, 0x09, 0x09, 0x09, 0x19, 0x26, - 0x12, 0x25, 0x25, 0x25, 0x25, 0x18, - 0x01, 0x01, 0x01, 0x3F, 0x01, 0x01, - 0x1F, 0x20, 0x20, 0x20, 0x20, 0x1F, - 0x0F, 0x10, 0x20, 0x20, 0x10, 0x0F, - 0x1F, 0x20, 0x10, 0x10, 0x20, 0x1F, - 0x21, 0x12, 0x0C, 0x0C, 0x12, 0x21, - 0x01, 0x02, 0x0C, 0x38, 0x04, 0x02, - 0x21, 0x31, 0x29, 0x25, 0x23, 0x21, - 0x3F, 0x21, 0x00, 0x00, 0x00, 0x00, - 0x02, 0x04, 0x08, 0x10, 0x20, 0x00, - 0x21, 0x3F, 0x00, 0x00, 0x00, 0x00, - 0x04, 0x02, 0x3F, 0x02, 0x04, 0x00, - 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, - 0x01, 0x02, 0x00, 0x00, 0x00, 0x00, - 0x10, 0x30, 0x2A, 0x2A, 0x3C, 0x00, - 0x3F, 0x24, 0x24, 0x24, 0x18, 0x00, - 0x0C, 0x14, 0x22, 0x22, 0x00, 0x00, - 0x18, 0x24, 0x24, 0x24, 0x3F, 0x00, - 0x1C, 0x2C, 0x2A, 0x2A, 0x24, 0x00, - 0x3E, 0x05, 0x01, 0x00, 0x00, 0x00, - 0x18, 0x28, 0xA4, 0xA4, 0x7C, 0x00, - 0x3F, 0x04, 0x04, 0x0C, 0x30, 0x00, - 0x24, 0x3D, 0x20, 0x00, 0x00, 0x00, - 0x20, 0x40, 0x40, 0x3D, 0x00, 0x00, - 0x3F, 0x0C, 0x12, 0x20, 0x00, 0x00, - 0x1F, 0x20, 0x20, 0x00, 0x00, 0x00, - 0x3E, 0x02, 0x3C, 0x02, 0x3C, 0x00, - 0x3E, 0x02, 0x02, 0x02, 0x3C, 0x00, - 0x0C, 0x14, 0x22, 0x32, 0x0C, 0x00, - 0xFC, 0x24, 0x24, 0x24, 0x18, 0x00, - 0x18, 0x24, 0x24, 0x24, 0xFC, 0x80, - 0x3C, 0x04, 0x02, 0x02, 0x00, 0x00, - 0x24, 0x2C, 0x2A, 0x2A, 0x10, 0x00, - 0x02, 0x1F, 0x22, 0x20, 0x00, 0x00, - 0x1E, 0x20, 0x20, 0x20, 0x1E, 0x00, - 0x06, 0x18, 0x20, 0x18, 0x06, 0x00, - 0x1E, 0x30, 0x1C, 0x30, 0x0E, 0x00, - 0x22, 0x14, 0x08, 0x14, 0x22, 0x00, - 0x0C, 0x10, 0xA0, 0xA0, 0x7C, 0x00, - 0x22, 0x32, 0x2A, 0x26, 0x22, 0x22, - 0x0C, 0x3F, 0x21, 0x00, 0x00, 0x00, - 0x3F, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x21, 0x3F, 0x0C, 0x00, 0x00, 0x00, - 0x02, 0x01, 0x02, 0x01, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -# else // default font - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x5F, 0x00, 0x00, 0x00, - 0x00, 0x07, 0x00, 0x07, 0x00, 0x00, - 0x14, 0x7F, 0x14, 0x7F, 0x14, 0x00, - 0x24, 0x2A, 0x7F, 0x2A, 0x12, 0x00, - 0x23, 0x13, 0x08, 0x64, 0x62, 0x00, - 0x36, 0x49, 0x56, 0x20, 0x50, 0x00, - 0x00, 0x08, 0x07, 0x03, 0x00, 0x00, - 0x00, 0x1C, 0x22, 0x41, 0x00, 0x00, - 0x00, 0x41, 0x22, 0x1C, 0x00, 0x00, - 0x2A, 0x1C, 0x7F, 0x1C, 0x2A, 0x00, - 0x08, 0x08, 0x3E, 0x08, 0x08, 0x00, - 0x00, 0x80, 0x70, 0x30, 0x00, 0x00, - 0x08, 0x08, 0x08, 0x08, 0x08, 0x00, - 0x00, 0x00, 0x60, 0x60, 0x00, 0x00, - 0x20, 0x10, 0x08, 0x04, 0x02, 0x00, - 0x3E, 0x51, 0x49, 0x45, 0x3E, 0x00, - 0x00, 0x42, 0x7F, 0x40, 0x00, 0x00, - 0x72, 0x49, 0x49, 0x49, 0x46, 0x00, - 0x21, 0x41, 0x49, 0x4D, 0x33, 0x00, - 0x18, 0x14, 0x12, 0x7F, 0x10, 0x00, - 0x27, 0x45, 0x45, 0x45, 0x39, 0x00, - 0x3C, 0x4A, 0x49, 0x49, 0x31, 0x00, - 0x41, 0x21, 0x11, 0x09, 0x07, 0x00, - 0x36, 0x49, 0x49, 0x49, 0x36, 0x00, - 0x46, 0x49, 0x49, 0x29, 0x1E, 0x00, - 0x00, 0x00, 0x14, 0x00, 0x00, 0x00, - 0x00, 0x40, 0x34, 0x00, 0x00, 0x00, - 0x00, 0x08, 0x14, 0x22, 0x41, 0x00, - 0x14, 0x14, 0x14, 0x14, 0x14, 0x00, - 0x00, 0x41, 0x22, 0x14, 0x08, 0x00, - 0x02, 0x01, 0x59, 0x09, 0x06, 0x00, - 0x3E, 0x41, 0x5D, 0x59, 0x4E, 0x00, - 0x7C, 0x12, 0x11, 0x12, 0x7C, 0x00, - 0x7F, 0x49, 0x49, 0x49, 0x36, 0x00, - 0x3E, 0x41, 0x41, 0x41, 0x22, 0x00, - 0x7F, 0x41, 0x41, 0x41, 0x3E, 0x00, - 0x7F, 0x49, 0x49, 0x49, 0x41, 0x00, - 0x7F, 0x09, 0x09, 0x09, 0x01, 0x00, - 0x3E, 0x41, 0x41, 0x51, 0x73, 0x00, - 0x7F, 0x08, 0x08, 0x08, 0x7F, 0x00, - 0x00, 0x41, 0x7F, 0x41, 0x00, 0x00, - 0x20, 0x40, 0x41, 0x3F, 0x01, 0x00, - 0x7F, 0x08, 0x14, 0x22, 0x41, 0x00, - 0x7F, 0x40, 0x40, 0x40, 0x40, 0x00, - 0x7F, 0x02, 0x1C, 0x02, 0x7F, 0x00, - 0x7F, 0x04, 0x08, 0x10, 0x7F, 0x00, - 0x3E, 0x41, 0x41, 0x41, 0x3E, 0x00, - 0x7F, 0x09, 0x09, 0x09, 0x06, 0x00, - 0x3E, 0x41, 0x51, 0x21, 0x5E, 0x00, - 0x7F, 0x09, 0x19, 0x29, 0x46, 0x00, - 0x26, 0x49, 0x49, 0x49, 0x32, 0x00, - 0x03, 0x01, 0x7F, 0x01, 0x03, 0x00, - 0x3F, 0x40, 0x40, 0x40, 0x3F, 0x00, - 0x1F, 0x20, 0x40, 0x20, 0x1F, 0x00, - 0x3F, 0x40, 0x38, 0x40, 0x3F, 0x00, - 0x63, 0x14, 0x08, 0x14, 0x63, 0x00, - 0x03, 0x04, 0x78, 0x04, 0x03, 0x00, - 0x61, 0x59, 0x49, 0x4D, 0x43, 0x00, - 0x00, 0x7F, 0x41, 0x41, 0x41, 0x00, - 0x02, 0x04, 0x08, 0x10, 0x20, 0x00, - 0x00, 0x41, 0x41, 0x41, 0x7F, 0x00, - 0x04, 0x02, 0x01, 0x02, 0x04, 0x00, - 0x40, 0x40, 0x40, 0x40, 0x40, 0x00, - 0x00, 0x03, 0x07, 0x08, 0x00, 0x00, - 0x20, 0x54, 0x54, 0x78, 0x40, 0x00, - 0x7F, 0x28, 0x44, 0x44, 0x38, 0x00, - 0x38, 0x44, 0x44, 0x44, 0x28, 0x00, - 0x38, 0x44, 0x44, 0x28, 0x7F, 0x00, - 0x38, 0x54, 0x54, 0x54, 0x18, 0x00, - 0x00, 0x08, 0x7E, 0x09, 0x02, 0x00, - 0x18, 0x24, 0x24, 0x1C, 0x78, 0x00, - 0x7F, 0x08, 0x04, 0x04, 0x78, 0x00, - 0x00, 0x44, 0x7D, 0x40, 0x00, 0x00, - 0x20, 0x40, 0x40, 0x3D, 0x00, 0x00, - 0x7F, 0x10, 0x28, 0x44, 0x00, 0x00, - 0x00, 0x41, 0x7F, 0x40, 0x00, 0x00, - 0x7C, 0x04, 0x78, 0x04, 0x78, 0x00, - 0x7C, 0x08, 0x04, 0x04, 0x78, 0x00, - 0x38, 0x44, 0x44, 0x44, 0x38, 0x00, - 0x7C, 0x18, 0x24, 0x24, 0x18, 0x00, - 0x18, 0x24, 0x24, 0x18, 0x7C, 0x00, - 0x7C, 0x08, 0x04, 0x04, 0x08, 0x00, - 0x48, 0x54, 0x54, 0x54, 0x24, 0x00, - 0x04, 0x04, 0x3F, 0x44, 0x24, 0x00, - 0x3C, 0x40, 0x40, 0x20, 0x7C, 0x00, - 0x1C, 0x20, 0x40, 0x20, 0x1C, 0x00, - 0x3C, 0x40, 0x30, 0x40, 0x3C, 0x00, - 0x44, 0x28, 0x10, 0x28, 0x44, 0x00, - 0x4C, 0x90, 0x90, 0x90, 0x7C, 0x00, - 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, -# endif - -// top Logo section -# if defined(OLED_LOGO_GMK_BAD) - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x80, 0xC0, 0xE0, 0xF0, 0xF0, 0x70, - 0x38, 0x38, 0x38, 0x78, 0x70, 0xF0, - 0xE0, 0xE0, 0x80, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x80, 0xF0, 0xF8, - 0xF8, 0xF8, 0xF8, 0x00, 0x00, 0x00, - 0x80, 0xE0, 0xF8, 0xF8, 0xF8, 0xF8, - 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x80, 0xF8, 0xF8, 0xF8, 0x38, 0x00, - 0x80, 0xE0, 0xF0, 0xF8, 0x78, 0x38, - 0x08, 0x08, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x80, 0xF8, 0xF8, 0xF8, 0x38, 0x38, - 0x38, 0xF8, 0xF0, 0xF0, 0xE0, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x80, 0xFC, 0xFC, - 0xFC, 0x1C, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -# elif defined(OLED_LOGO_HUE_MANITEE) - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x80, 0xC0, 0xC0, - 0x90, 0x70, 0xE8, 0xA8, 0xE4, 0xC4, - 0xC4, 0xA0, 0xE4, 0xB0, 0xDC, 0xE4, - 0xFC, 0xFC, 0xFC, 0xFC, 0x3C, 0x3C, - 0xFC, 0xF8, 0xF0, 0xF0, 0xE0, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0xF8, 0xF8, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0xF8, 0xF8, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -# elif defined(OLED_LOGO_CORNE) - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0xC0, 0xE0, - 0xF0, 0xF8, 0xF8, 0x18, 0x00, 0xC0, - 0xF0, 0xFC, 0xFE, 0xFF, 0xFF, 0xFF, - 0xFF, 0xFF, 0xFF, 0xFF, 0x7E, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x80, 0xC0, 0xE0, 0xE0, - 0xE0, 0xE0, 0xE0, 0xE0, 0xE0, 0xE0, - 0xC0, 0x80, 0x00, 0x00, 0x00, 0x00, - 0x80, 0xC0, 0xE0, 0xE0, 0xE0, 0xE0, - 0xE0, 0xE0, 0xE0, 0xE0, 0xC0, 0x80, - 0x00, 0x00, 0x00, 0xE0, 0xE0, 0xC0, - 0xC0, 0xE0, 0xE0, 0xE0, 0xE0, 0x00, - 0x00, 0xE0, 0xE0, 0xC0, 0xC0, 0xE0, - 0xE0, 0xE0, 0xE0, 0xE0, 0xC0, 0x80, - 0x00, 0x00, 0x00, 0x00, 0x80, 0xC0, - 0xE0, 0xE0, 0xE0, 0xE0, 0xE0, 0xE0, - 0xE0, 0xE0, 0xC0, 0x80, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -# elif defined(OLED_LOGO_LOOSE) - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0xC0, 0xE0, 0xF0, 0xF8, - 0xF8, 0xF8, 0xF8, 0xF8, 0xF8, 0x00, - 0xFC, 0xFE, 0xFE, 0xFE, 0xFE, 0xFE, - 0x02, 0xF9, 0x01, 0x01, 0x05, 0x09, - 0x11, 0x22, 0x06, 0xFE, 0xFE, 0xFE, - 0xFE, 0xFE, 0xFE, 0xFE, 0x46, 0x46, - 0x44, 0x44, 0x45, 0x44, 0x29, 0x28, - 0x2A, 0x28, 0x11, 0x13, 0x05, 0x07, - 0x05, 0x07, 0x05, 0x07, 0x05, 0x07, - 0xE5, 0xE7, 0xE5, 0x07, 0x05, 0x07, - 0x05, 0x07, 0x05, 0x07, 0x05, 0x07, - 0x85, 0xC7, 0xE5, 0xE7, 0xE5, 0xE7, - 0xE5, 0xE7, 0xE5, 0xC7, 0x85, 0x07, - 0x85, 0xC7, 0xE5, 0xE7, 0xE5, 0xE7, - 0xE5, 0xE7, 0xE5, 0xC7, 0x85, 0x07, - 0x85, 0xC7, 0xE5, 0xE7, 0xE5, 0xE7, - 0xE5, 0xE7, 0xE5, 0xE7, 0xE5, 0x07, - 0xE5, 0xE7, 0xE5, 0xE7, 0xE5, 0xE7, - 0xE5, 0xE7, 0xE5, 0xE7, 0xE5, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -# elif defined(OLED_LOGO_SKEEB) - 0xC0, 0x20, 0x10, 0x08, 0x04, 0x02, - 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, - 0x01, 0x01, 0x03, 0x07, 0x0F, 0x1F, - 0x3F, 0x7F, 0xFF, 0xFF, 0xFF, 0xFF, - 0xFF, 0xFF, 0xFF, 0xFF, 0x01, 0x01, - 0xFF, 0xFF, 0x01, 0x01, 0xFF, 0xFF, - 0x01, 0x01, 0xFF, 0xFF, 0x19, 0x19, - 0x99, 0x99, 0x99, 0x99, 0x99, 0x99, - 0x01, 0x01, 0xFF, 0xFF, 0x81, 0x81, - 0x99, 0x99, 0x99, 0x99, 0x99, 0x99, - 0x19, 0x19, 0xFF, 0xFF, 0xF9, 0xF9, - 0xF9, 0xF9, 0x01, 0x01, 0xF9, 0xF9, - 0xF9, 0xF9, 0xFF, 0xFF, 0x99, 0x99, - 0x99, 0x99, 0x99, 0x99, 0x99, 0x99, - 0xF9, 0xF9, 0xFF, 0xFF, 0x19, 0x19, - 0x99, 0x99, 0x99, 0x99, 0x99, 0x99, - 0x67, 0x67, 0xFF, 0xFF, 0xFF, 0xFF, - 0xFF, 0xFF, 0xFF, 0xFF, 0x7F, 0x3F, - 0x1F, 0x0F, 0x07, 0x03, 0x01, 0x01, - 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, - 0x02, 0x04, 0x08, 0x10, 0x20, 0xC0, -# else - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x40, 0x40, 0x40, 0xF0, 0xF8, 0xF8, - 0xFF, 0x38, 0xFF, 0xF8, 0xF8, 0x3F, - 0xF8, 0xF8, 0xFF, 0x38, 0xFF, 0xF8, - 0xF8, 0xF0, 0x40, 0x40, 0x40, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, - 0xC0, 0xC0, 0xC0, 0x80, 0x00, 0x00, - 0xC0, 0xC0, 0x80, 0x00, 0x00, 0x00, - 0x80, 0xC0, 0xC0, 0x00, 0xC0, 0xC0, - 0x00, 0x00, 0x80, 0xC0, 0xC0, 0x00, - 0x00, 0x00, 0x00, 0x00, 0xC0, 0xC0, - 0xC0, 0xC0, 0xC0, 0x00, 0xC0, 0xC0, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -#endif - -// First icon section - 0xE0, 0xF0, 0xF0, 0xF0, 0xE0, 0xEC, - 0xEE, 0xF7, 0xF3, 0x70, 0x20, 0x00, - 0x7C, 0x7C, 0x7C, 0x7E, 0x00, 0x7E, - 0x7E, 0x7E, 0x7F, 0x7F, 0x7F, 0x00, - 0x00, 0x80, 0xC0, 0xE0, 0x7E, 0x5B, - 0x4F, 0x5B, 0xFE, 0xC0, 0x00, 0x00, - 0xC0, 0x00, 0xDC, 0xD7, 0xDE, 0xDE, - 0xDE, 0xD7, 0xDC, 0x00, 0xC0, 0x00, - 0x3E, 0x4A, 0x4F, 0x4A, 0x3E, 0x00, - 0x18, 0x3C, 0x7C, 0x3A, 0x7D, 0x24, - 0x14, 0x36, 0x00, 0x36, 0x77, 0x77, - -// middle logo section -# if defined(OLED_LOGO_GMK_BAD) - 0x00, 0x00, 0x00, 0x00, 0x00, 0x3C, - 0xFF, 0xFF, 0xFF, 0xC1, 0x80, 0x00, - 0x00, 0x38, 0x38, 0xB8, 0xB8, 0xF9, - 0xF9, 0xF8, 0x38, 0x00, 0x00, 0x00, - 0x00, 0xC0, 0xF8, 0xFF, 0xFF, 0x1F, - 0x01, 0x3F, 0xFF, 0xFF, 0xF0, 0xFE, - 0x7F, 0x0F, 0x03, 0xFF, 0xFF, 0xFF, - 0xFF, 0x00, 0x00, 0x00, 0x00, 0x80, - 0xFF, 0xFF, 0xFF, 0x3F, 0x1E, 0x7F, - 0xFF, 0xFF, 0xF3, 0xC1, 0x80, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, - 0xFF, 0xFF, 0xFF, 0x3F, 0x1C, 0x1C, - 0x9C, 0xFF, 0xFF, 0xF3, 0xE1, 0x00, - 0x00, 0x00, 0x00, 0xF0, 0xFC, 0xFE, - 0xFF, 0x0F, 0x07, 0x07, 0x8E, 0xFF, - 0xFF, 0xFF, 0x3F, 0x00, 0x00, 0x00, - 0x00, 0xF0, 0xFC, 0xFE, 0xFF, 0x8F, - 0x07, 0x07, 0x8E, 0xFF, 0xFF, 0xFF, - 0x3F, 0x00, 0x00, 0x00, 0x00, 0x80, - 0xC0, 0x80, 0x00, 0x00, 0x00, 0x00, -# elif defined(OLED_LOGO_HUE_MANITEE) - 0x00, 0x00, 0x00, 0x00, 0x00, 0xF0, - 0xFC, 0xF6, 0xF7, 0xEF, 0xFF, 0x87, - 0x1F, 0x1F, 0x1F, 0x1F, 0x1F, 0x1F, - 0x1F, 0x1F, 0x1F, 0xFF, 0xFF, 0xFF, - 0xFF, 0x07, 0x1F, 0x1F, 0x19, 0x15, - 0xF7, 0x16, 0x1A, 0x1B, 0x16, 0x07, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x0C, 0x0C, 0x33, 0x33, - 0x33, 0x33, 0x33, 0x33, 0xC0, 0xC0, - 0x00, 0x00, 0x03, 0x03, 0xFF, 0xFF, - 0x03, 0x03, 0x00, 0x00, 0xC0, 0xC0, - 0x00, 0x00, 0x00, 0xFC, 0xFC, 0x03, - 0x03, 0x03, 0x03, 0x03, 0x03, 0xFC, - 0xFC, 0x00, 0x00, 0x00, 0xFC, 0xFC, - 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, - 0xC0, 0xC0, 0x00, 0x00, 0x00, 0x00, - 0xFF, 0xFF, 0x30, 0x30, 0xCC, 0xCC, - 0x03, 0x03, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -# elif defined(OLED_LOGO_CORNE) - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0xF8, 0xFC, 0xFE, - 0xFF, 0xE0, 0x00, 0xFF, 0xFF, 0xFF, - 0xFF, 0xFF, 0xFF, 0x80, 0xFF, 0xFF, - 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, - 0xFF, 0x1F, 0x07, 0x01, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0xFF, 0xFF, 0xFF, 0x81, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x81, - 0xC3, 0xC3, 0xC3, 0x00, 0x00, 0xFF, - 0xFF, 0xFF, 0x81, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x81, 0xFF, 0xFF, - 0xFF, 0x00, 0x00, 0xFF, 0xFF, 0xFF, - 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0xFF, 0xFF, 0xFF, 0x01, 0x00, - 0x00, 0x00, 0x00, 0x01, 0xFF, 0xFF, - 0xFF, 0x00, 0x00, 0xFF, 0xFF, 0xFF, - 0x9D, 0x1C, 0x1C, 0x1C, 0x1C, 0x1C, - 0x1C, 0x9D, 0xDF, 0xDF, 0xDF, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -# elif defined(OLED_LOGO_LOOSE) - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, - 0xFF, 0xFF, 0xE3, 0xC1, 0xC1, 0x00, - 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, - 0x00, 0xFF, 0x00, 0x00, 0x80, 0x00, - 0x1C, 0x3E, 0x7F, 0xFF, 0xFF, 0xFF, - 0xFF, 0xFF, 0xFF, 0xFF, 0x22, 0x22, - 0x22, 0x22, 0x22, 0x22, 0x22, 0x22, - 0x22, 0x22, 0x22, 0x14, 0x14, 0x14, - 0x14, 0x14, 0x08, 0x08, 0x00, 0x00, - 0xFF, 0xFF, 0xFF, 0x80, 0x80, 0x80, - 0x80, 0x80, 0x80, 0x80, 0x80, 0x00, - 0xFF, 0xFF, 0xFF, 0xFF, 0x80, 0xBE, - 0x80, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, - 0xFF, 0xFF, 0xFF, 0xFF, 0x81, 0xBD, - 0x81, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, - 0x8F, 0x9F, 0x9C, 0x9C, 0x9C, 0x9C, - 0x9C, 0x9C, 0x9C, 0xFC, 0xF8, 0x00, - 0xFF, 0xFF, 0xFF, 0x9C, 0x9C, 0x9C, - 0x9C, 0x9C, 0x9C, 0x80, 0x80, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -# elif defined(OLED_LOGO_SKEEB) - 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x01, 0x03, 0x07, - 0x0F, 0x0F, 0x0F, 0x0F, 0x08, 0x08, - 0x0F, 0x0F, 0x0E, 0x0E, 0x0F, 0x0F, - 0x08, 0x08, 0x0F, 0x0F, 0x08, 0x08, - 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, - 0x08, 0x08, 0x0F, 0x0F, 0x09, 0x09, - 0x09, 0x09, 0xF9, 0xF9, 0x09, 0x09, - 0x08, 0x08, 0x0F, 0x0F, 0x0F, 0x0F, - 0x0F, 0x0F, 0x08, 0x08, 0x0F, 0x0F, - 0x0F, 0x0F, 0x0F, 0x0F, 0x09, 0x09, - 0x09, 0x09, 0x09, 0x09, 0x09, 0x09, - 0x09, 0x09, 0x0F, 0x0F, 0x08, 0x08, - 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, - 0x08, 0x08, 0x0F, 0x0F, 0x0F, 0x0F, - 0x07, 0x03, 0x01, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, -# else - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x49, 0x49, 0x49, 0xFF, 0xFF, 0xFF, - 0xFF, 0xE0, 0xDF, 0xBF, 0xBF, 0x00, - 0xBF, 0xBF, 0xDF, 0xE0, 0xFF, 0xFF, - 0xFF, 0xFF, 0x49, 0x49, 0x49, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x1F, 0x3F, - 0x60, 0x60, 0xE0, 0xBF, 0x1F, 0x00, - 0x7F, 0x7F, 0x07, 0x1E, 0x38, 0x1E, - 0x07, 0x7F, 0x7F, 0x00, 0x7F, 0x7F, - 0x0E, 0x1F, 0x3B, 0x71, 0x60, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x7F, 0x7F, - 0x0C, 0x0C, 0x0C, 0x00, 0x7E, 0x7E, - 0x00, 0x7F, 0x7E, 0x03, 0x03, 0x00, - 0x7F, 0x7E, 0x03, 0x03, 0x7E, 0x7E, - 0x03, 0x03, 0x7F, 0x7E, 0x00, 0x0F, - 0x3E, 0x70, 0x3C, 0x06, 0x3C, 0x70, - 0x3E, 0x0F, 0x00, 0x32, 0x7B, 0x49, - 0x49, 0x3F, 0x7E, 0x00, 0x7F, 0x7E, - 0x03, 0x03, 0x00, 0x1E, 0x3F, 0x69, - 0x69, 0x6F, 0x26, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -# endif - -// second icon section - 0x0F, 0x1F, 0x3F, 0x7F, 0x7F, 0x7F, - 0x7F, 0x7F, 0x3F, 0x1E, 0x0C, 0x00, - 0x1F, 0x1F, 0x1F, 0x3F, 0x00, 0x3F, - 0x3F, 0x3F, 0x7F, 0x7F, 0x7F, 0x00, - 0x30, 0x7B, 0x7F, 0x78, 0x30, 0x20, - 0x20, 0x30, 0x78, 0x7F, 0x3B, 0x00, - 0x03, 0x00, 0x0F, 0x7F, 0x0F, 0x0F, - 0x0F, 0x7F, 0x0F, 0x00, 0x03, 0x00, - 0x00, 0x44, 0x28, 0xFF, 0x5A, 0x24, - 0xF0, 0xFE, 0xF1, 0x91, 0xF6, 0xF0, - 0xF0, 0xFC, 0xF2, 0x92, 0xFC, 0xF0, - -// bottom logo section -# if defined(OLED_LOGO_GMK_BAD) - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x01, 0x03, 0x03, 0x03, 0x07, - 0x07, 0x07, 0x07, 0x03, 0x03, 0x03, - 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x06, 0x07, 0x07, 0x07, 0x01, 0x00, - 0x00, 0x00, 0x07, 0x07, 0x07, 0x01, - 0x00, 0x00, 0x00, 0x07, 0x07, 0x07, - 0x07, 0x00, 0x00, 0x00, 0x00, 0x07, - 0x07, 0x07, 0x07, 0x00, 0x00, 0x00, - 0x00, 0x03, 0x07, 0x07, 0x07, 0x06, - 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, - 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, - 0x07, 0x07, 0x03, 0x01, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x03, 0x07, - 0x07, 0x07, 0x07, 0x03, 0x07, 0x07, - 0x07, 0x07, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x03, 0x07, 0x07, 0x07, - 0x07, 0x03, 0x07, 0x07, 0x07, 0x07, - 0x00, 0x00, 0x00, 0x00, 0x01, 0x07, - 0x07, 0x07, 0x01, 0x00, 0x00, 0x00, -# elif defined(OLED_LOGO_HUE_MANITEE) - 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, - 0x03, 0x07, 0x07, 0x07, 0x07, 0x01, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x03, 0x07, 0x07, - 0x03, 0x00, 0x00, 0x02, 0x04, 0x00, - 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x03, 0x03, 0x03, 0x03, - 0x03, 0x03, 0x03, 0x03, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x03, 0x03, 0x03, 0x03, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, - 0x03, 0x03, 0x03, 0x03, 0x03, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x03, 0x03, 0x00, 0x00, 0x00, 0x00, - 0x03, 0x03, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -# elif defined(OLED_LOGO_CORNE) - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x03, 0x0F, 0x1F, - 0x3F, 0x3F, 0x3F, 0x3F, 0x1F, 0x1F, - 0x3F, 0x3F, 0x7F, 0x7F, 0x7F, 0x3F, - 0x3F, 0x1F, 0x3F, 0x7F, 0x7F, 0x7F, - 0x7F, 0x7C, 0x78, 0x78, 0x38, 0x1C, - 0x0F, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x01, 0x03, 0x07, 0x07, - 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, - 0x03, 0x01, 0x00, 0x00, 0x00, 0x00, - 0x01, 0x03, 0x07, 0x07, 0x07, 0x07, - 0x07, 0x07, 0x07, 0x07, 0x03, 0x01, - 0x00, 0x00, 0x00, 0x07, 0x07, 0x07, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x07, 0x07, 0x07, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x07, 0x07, - 0x07, 0x00, 0x00, 0x00, 0x01, 0x03, - 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, - 0x07, 0x07, 0x03, 0x01, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -# elif defined(OLED_LOGO_LOOSE) - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x01, 0x03, 0x07, 0x0F, - 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x00, - 0x1F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, - 0x20, 0x47, 0x48, 0x50, 0x40, 0x41, - 0x42, 0x24, 0x30, 0x3F, 0x3F, 0x3F, - 0x3F, 0x3F, 0x3F, 0x3F, 0x31, 0x31, - 0x11, 0x51, 0x11, 0x11, 0x4A, 0x0A, - 0x2A, 0x0A, 0x44, 0x64, 0x50, 0x70, - 0x50, 0x70, 0x50, 0x70, 0x50, 0x70, - 0x53, 0x73, 0x53, 0x73, 0x53, 0x73, - 0x53, 0x73, 0x53, 0x73, 0x53, 0x70, - 0x50, 0x71, 0x53, 0x73, 0x53, 0x73, - 0x53, 0x73, 0x53, 0x71, 0x50, 0x70, - 0x50, 0x71, 0x53, 0x73, 0x53, 0x73, - 0x53, 0x73, 0x53, 0x71, 0x50, 0x70, - 0x53, 0x73, 0x53, 0x73, 0x53, 0x73, - 0x53, 0x73, 0x53, 0x73, 0x51, 0x70, - 0x53, 0x73, 0x53, 0x73, 0x53, 0x73, - 0x53, 0x73, 0x53, 0x73, 0x53, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -# elif defined(OLED_LOGO_SKEEB) - 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, - 0xFF, 0x08, 0x08, 0x08, 0x08, 0x08, - 0x08, 0x08, 0x08, 0x08, 0x08, 0xFF, - 0x08, 0x08, 0x0F, 0x0F, 0x08, 0x08, - 0x03, 0x04, 0x08, 0x10, 0x20, 0x40, - 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, - 0x40, 0x20, 0x10, 0x08, 0x04, 0x03, - 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, - 0x00, 0x00, 0xFF, 0xFF, 0x00, 0x00, - 0x80, 0xC0, 0xE0, 0xF0, 0xF8, 0xF8, - 0xF8, 0xF8, 0xF8, 0xF8, 0xF8, 0xF8, - 0xF8, 0xF8, 0xF0, 0xE0, 0xC0, 0x80, - 0x01, 0x02, 0xFC, 0xF8, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, -#else - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x01, 0x01, 0x01, 0x07, 0x0F, 0x0F, - 0x7F, 0x0F, 0x7F, 0x0F, 0x0F, 0x7E, - 0x0F, 0x0F, 0x7F, 0x0F, 0x7F, 0x0F, - 0x0F, 0x07, 0x01, 0x01, 0x01, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x01, 0x01, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -#endif - -// third icon section - 0x1F, 0x05, 0x00, 0x02, 0x1F, 0x00, - 0x1F, 0x05, 0x00, 0x1D, 0x17, 0x00, - 0x1F, 0x05, 0x00, 0x15, 0x1F, 0x00, - 0x1F, 0x05, 0x00, 0x07, 0x1C, 0x00, - 0x1F, 0x05, 0x00, 0x17, 0x1D, 0x00, - 0x1F, 0x05, 0x00, 0x1F, 0x1D, 0x00, - 0x1F, 0x05, 0x00, 0x01, 0x1F, 0x00, - 0x1F, 0x05, 0x00, 0x1F, 0x1F, 0x00, - 0x1F, 0x05, 0x00, 0x07, 0x1F, 0x00, - 0x1F, 0x05, 0x00, 0x70, 0x77, 0x00, - 0x1F, 0x05, 0x00, 0x00, 0x77, 0x00, - -// fourth icon section - 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, 0x30, 0x18, 0x0C, - 0x06, 0x0C, 0x18, 0x30, 0x00, 0x00, - 0x00, 0x00, 0x06, 0x06, 0x06, 0x0C, - 0x18, 0x30, 0x66, 0x66, 0x66, 0x00, - 0x00, 0x00, 0x00, 0x08, 0x0C, 0x7E, - 0x7F, 0x7E, 0x0C, 0x08, 0x00, 0x00, - 0x00, 0x00, 0x77, 0x77, 0x77, 0x00, - 0x77, 0x77, 0x77, 0x00, 0x00, 0x00, - 0x00, 0x00, 0xE7, 0xA5, 0xFF, 0x24, - 0x24, 0xFF, 0xA5, 0xE7, 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, - 0x00, 0x00, 0x00, 0x3E, 0x4A, 0x4F, - 0x4A, 0x3E, 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, 0x1C, 0x14, 0x1C, 0x08, - 0x18, 0x08, 0x18, 0x00, 0x00, 0x00, - 0x00, 0x70, 0xC8, 0xEE, 0xF9, 0x70, - 0x1F, 0x05, 0x00, 0x10, 0x77, 0x40, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - }; -// clang-format on -#endif diff --git a/users/drashna/keyrecords/autocorrection/autocorrection.c b/users/drashna/keyrecords/autocorrection/autocorrection.c new file mode 100644 index 0000000000..7c8c28c674 --- /dev/null +++ b/users/drashna/keyrecords/autocorrection/autocorrection.c @@ -0,0 +1,143 @@ +// Copyright 2021 Google LLC +// Copyright 2022 @filterpaper +// SPDX-License-Identifier: Apache-2.0 +// Original source: https://getreuer.info/posts/keyboards/autocorrection + +#include "autocorrection.h" +#include + +#if __has_include("autocorrection_data.h") +# include "autocorrection_data.h" +# if AUTOCORRECTION_MIN_LENGTH < 4 +# error Minimum Length is too short and may cause overflows +# endif + +bool process_autocorrection(uint16_t keycode, keyrecord_t* record) { + static uint8_t typo_buffer[AUTOCORRECTION_MAX_LENGTH] = {KC_SPC}; + static uint8_t typo_buffer_size = 1; + + if (keycode == AUTO_CTN) { + if (record->event.pressed) { + typo_buffer_size = 0; + userspace_config.autocorrection ^= 1; + eeconfig_update_user(userspace_config.raw); + } + return false; + } + + if (!userspace_config.autocorrection) { + typo_buffer_size = 0; + return true; + } + + switch (keycode) { + case KC_LSFT: + case KC_RSFT: + return true; +# ifndef NO_ACTION_TAPPING + case QK_MOD_TAP ... QK_MOD_TAP_MAX: + if (((keycode >> 8) & 0xF) == MOD_LSFT) { + return true; + } +# ifndef NO_ACTION_LAYER + case QK_LAYER_TAP ... QK_LAYER_TAP_MAX: +# endif + if (record->event.pressed || !record->tap.count) { + return true; + } + keycode &= 0xFF; + break; +# endif +# ifndef NO_ACTION_ONESHOT + case QK_ONE_SHOT_MOD ... QK_ONE_SHOT_MOD_MAX: + if ((keycode & 0xF) == MOD_LSFT) { + return true; + } +# endif + default: + if (!record->event.pressed) { + return true; + } + } + + // Subtract buffer for Backspace key, reset for other non-alpha. + if (!(KC_A <= keycode && keycode <= KC_Z)) { + if (keycode == KC_BSPC) { + // Remove last character from the buffer. + if (typo_buffer_size > 0) { + --typo_buffer_size; + } + return true; + } else if (KC_1 <= keycode && keycode <= KC_SLSH && keycode != KC_ESC) { + // Set a word boundary if space, period, digit, etc. is pressed. + // Behave more conservatively for the enter key. Reset, so that enter + // can't be used on a word ending. + if (keycode == KC_ENT) { + typo_buffer_size = 0; + } + keycode = KC_SPC; + } else { + // Clear state if some other non-alpha key is pressed. + typo_buffer_size = 0; + return true; + } + } + + // Rotate oldest character if buffer is full. + if (typo_buffer_size >= AUTOCORRECTION_MAX_LENGTH) { + memmove(typo_buffer, typo_buffer + 1, AUTOCORRECTION_MAX_LENGTH - 1); + typo_buffer_size = AUTOCORRECTION_MAX_LENGTH - 1; + } + + // Append `keycode` to buffer. + typo_buffer[typo_buffer_size++] = keycode; + // Return if buffer is smaller than the shortest word. + if (typo_buffer_size < AUTOCORRECTION_MIN_LENGTH) { + return true; + } + + // Check for typo in buffer using a trie stored in `autocorrection_data`. + uint16_t state = 0; + uint8_t code = pgm_read_byte(autocorrection_data + state); + for (uint8_t i = typo_buffer_size - 1; i >= 0; --i) { + uint8_t const key_i = typo_buffer[i]; + + if (code & 64) { // Check for match in node with multiple children. + code &= 63; + for (; code != key_i; code = pgm_read_byte(autocorrection_data + (state += 3))) { + if (!code) return true; + } + // Follow link to child node. + state = (pgm_read_byte(autocorrection_data + state + 1) | pgm_read_byte(autocorrection_data + state + 2) << 8); + // Check for match in node with single child. + } else if (code != key_i) { + return true; + } else if (!(code = pgm_read_byte(autocorrection_data + (++state)))) { + ++state; + } + + code = pgm_read_byte(autocorrection_data + state); + + if (code & 128) { // A typo was found! Apply autocorrection. + const uint8_t backspaces = code & 63; + for (uint8_t i = 0; i < backspaces; ++i) { + tap_code(KC_BSPC); + } + send_string_P((char const*)(autocorrection_data + state + 1)); + + if (keycode == KC_SPC) { + typo_buffer[0] = KC_SPC; + typo_buffer_size = 1; + return true; + } else { + typo_buffer_size = 0; + return false; + } + } + } + return true; +} +#else +# pragma message "Warning!!! Autocorrect is not corretly setup!" +bool process_autocorrection(uint16_t keycode, keyrecord_t* record) { return true; } +#endif diff --git a/users/drashna/keyrecords/autocorrection/autocorrection.h b/users/drashna/keyrecords/autocorrection/autocorrection.h new file mode 100644 index 0000000000..57685eb4b5 --- /dev/null +++ b/users/drashna/keyrecords/autocorrection/autocorrection.h @@ -0,0 +1,10 @@ +// Copyright 2021 Google LLC +// Copyright 2022 @filterpaper +// SPDX-License-Identifier: Apache-2.0 +// Original source: https://getreuer.info/posts/keyboards/autocorrection + +#pragma once + +#include "drashna.h" + +bool process_autocorrection(uint16_t keycode, keyrecord_t* record); diff --git a/users/drashna/keyrecords/autocorrection/make_autocorrection_data.py b/users/drashna/keyrecords/autocorrection/make_autocorrection_data.py new file mode 100755 index 0000000000..27383b8955 --- /dev/null +++ b/users/drashna/keyrecords/autocorrection/make_autocorrection_data.py @@ -0,0 +1,273 @@ +# Copyright 2021 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +"""Python program to make autocorrection_data.h. + +This program reads "autocorrection_dict.txt" and generates a C source file +"autocorrection_data.h" with a serialized trie embedded as an array. Run this +program without arguments like + +$ python3 make_autocorrection_data.py + +Or to read from a different typo dict file, pass it as the first argument like + +$ python3 make_autocorrection_data.py dict.txt + +Each line of the dict file defines one typo and its correction with the syntax +"typo -> correction". Blank lines or lines starting with '#' are ignored. +Example: + + :thier -> their + fitler -> filter + lenght -> length + ouput -> output + widht -> width + +See autocorrection_dict_extra.txt for a larger example. + +For full documentation, see +https://getreuer.info/posts/keyboards/autocorrection +""" + +import sys +import textwrap +from typing import Any, Dict, List, Tuple + +try: + from english_words import english_words_lower_alpha_set as CORRECT_WORDS +except ImportError: + print('Autocorrection will falsely trigger when a typo is a substring of a ' + 'correctly spelled word. To check for this, install the english_words ' + 'package and rerun this script:\n\n pip install english_words\n') + # Use a minimal word list as a fallback. + CORRECT_WORDS = ('information', 'available', 'international', 'language', + 'loosest', 'reference', 'wealthier', 'entertainment', + 'association', 'provides', 'technology', 'statehood') + +KC_A = 4 +KC_SPC = 0x2c + +def parse_file(file_name: str) -> List[Tuple[str, str]]: + """Parses autocorrections dictionary file. + + Each line of the file defines one typo and its correction with the syntax + "typo -> correction". Blank lines or lines starting with '#' are ignored. The + function validates that typos only have characters a-z and that typos are not + substrings of other typos, otherwise the longer typo would never trigger. + + Args: + file_name: String, path of the autocorrections dictionary. + Returns: + List of (typo, correction) tuples. + """ + + autocorrections = [] + typos = set() + line_number = 0 + for line in open(file_name, 'rt'): + line_number += 1 + line = line.strip() + if line and line[0] != '#': + # Parse syntax "typo -> correction", using strip to ignore indenting. + tokens = [token.strip() for token in line.split('->', 1)] + if len(tokens) != 2 or not tokens[0]: + print(f'Error:{line_number}: Invalid syntax: "{line}"') + sys.exit(1) + + typo, correction = tokens + typo = typo.lower() # Force typos to lowercase. + typo = typo.replace(' ', ':') + + if typo in typos: + print(f'Warning:{line_number}: Ignoring duplicate typo: "{typo}"') + continue + + # Check that `typo` is valid. + if not(all([ord('a') <= ord(c) <= ord('z') or c == ':' for c in typo])): + print(f'Error:{line_number}: Typo "{typo}" has ' + 'characters other than a-z and :.') + sys.exit(1) + for other_typo in typos: + if typo in other_typo or other_typo in typo: + print(f'Error:{line_number}: Typos may not be substrings of one ' + f'another, otherwise the longer typo would never trigger: ' + f'"{typo}" vs. "{other_typo}".') + sys.exit(1) + if len(typo) < 5: + print(f'Warning:{line_number}: It is suggested that typos are at ' + f'least 5 characters long to avoid false triggers: "{typo}"') + + if typo.startswith(':') and typo.endswith(':'): + if typo[1:-1] in CORRECT_WORDS: + print(f'Warning:{line_number}: Typo "{typo}" is a correctly spelled ' + 'dictionary word.') + elif typo.startswith(':') and not typo.endswith(':'): + for word in CORRECT_WORDS: + if word.startswith(typo[1:]): + print(f'Warning:{line_number}: Typo "{typo}" would falsely trigger ' + f'on correctly spelled word "{word}".') + elif not typo.startswith(':') and typo.endswith(':'): + for word in CORRECT_WORDS: + if word.endswith(typo[:-1]): + print(f'Warning:{line_number}: Typo "{typo}" would falsely trigger ' + f'on correctly spelled word "{word}".') + elif not typo.startswith(':') and not typo.endswith(':'): + for word in CORRECT_WORDS: + if typo in word: + print(f'Warning:{line_number}: Typo "{typo}" would falsely trigger ' + f'on correctly spelled word "{word}".') + + autocorrections.append((typo, correction)) + typos.add(typo) + + return autocorrections + + +def make_trie(autocorrections: List[Tuple[str, str]]) -> Dict[str, Any]: + """Makes a trie from the the typos, writing in reverse. + + Args: + autocorrections: List of (typo, correction) tuples. + Returns: + Dict of dict, representing the trie. + """ + trie = {} + for typo, correction in autocorrections: + node = trie + for letter in typo[::-1]: + node = node.setdefault(letter, {}) + node['LEAF'] = (typo, correction) + + return trie + + +def serialize_trie(autocorrections: List[Tuple[str, str]], + trie: Dict[str, Any]) -> List[int]: + """Serializes trie and correction data in a form readable by the C code. + + Args: + autocorrections: List of (typo, correction) tuples. + trie: Dict of dicts. + Returns: + List of ints in the range 0-255. + """ + table = [] + + # Traverse trie in depth first order. + def traverse(trie_node): + if 'LEAF' in trie_node: # Handle a leaf trie node. + typo, correction = trie_node['LEAF'] + word_boundary_ending = typo[-1] == ':' + typo = typo.strip(':') + i = 0 # Make the autocorrection data for this entry and serialize it. + while i < min(len(typo), len(correction)) and typo[i] == correction[i]: + i += 1 + backspaces = len(typo) - i - 1 + word_boundary_ending + assert 0 <= backspaces <= 63 + correction = correction[i:] + data = [backspaces + 128] + list(bytes(correction, 'ascii')) + [0] + + entry = {'data': data, 'links': [], 'byte_offset': 0} + table.append(entry) + elif len(trie_node) == 1: # Handle trie node with a single child. + c, trie_node = next(iter(trie_node.items())) + entry = {'chars': c, 'byte_offset': 0} + + # It's common for a trie to have long chains of single-child nodes. We + # find the whole chain so that we can serialize it more efficiently. + while len(trie_node) == 1 and 'LEAF' not in trie_node: + c, trie_node = next(iter(trie_node.items())) + entry['chars'] += c + + table.append(entry) + entry['links'] = [traverse(trie_node)] + else: # Handle trie node with multiple children. + entry = {'chars': ''.join(sorted(trie_node.keys())), 'byte_offset': 0} + table.append(entry) + entry['links'] = [traverse(trie_node[c]) for c in entry['chars']] + return entry + + traverse(trie) + + def serialize(e): + def kc_code(c): + if ord('a') <= ord(c) <= ord('z'): + return ord(c) - ord('a') + KC_A + elif c == ':': + return KC_SPC + else: + raise ValueError(f'Invalid character: {c}') + + encode_link = lambda link: [link['byte_offset'] & 255, + link['byte_offset'] >> 8] + + if not e['links']: # Handle a leaf table entry. + return e['data'] + elif len(e['links']) == 1: # Handle a chain table entry. + return list(map(kc_code, e['chars'])) + [0] #+ encode_link(e['links'][0])) + else: # Handle a branch table entry. + data = [] + for c, link in zip(e['chars'], e['links']): + data += [kc_code(c) | (0 if data else 64)] + encode_link(link) + return data + [0] + + byte_offset = 0 + for e in table: # To encode links, first compute byte offset of each entry. + e['byte_offset'] = byte_offset + byte_offset += len(serialize(e)) + assert 0 <= byte_offset <= 0xffff + + return [b for e in table for b in serialize(e)] # Serialize final table. + + +def write_generated_code(autocorrections: List[Tuple[str, str]], + data: List[int], + file_name: str) -> None: + """Writes autocorrection data as generated C code to `file_name`. + + Args: + autocorrections: List of (typo, correction) tuples. + data: List of ints in 0-255, the serialized trie. + file_name: String, path of the output C file. + """ + assert all(0 <= b <= 255 for b in data) + typo_len = lambda e: len(e[0]) + min_typo = min(autocorrections, key=typo_len)[0] + max_typo = max(autocorrections, key=typo_len)[0] + generated_code = ''.join([ + '// Generated code.\n\n', + f'// Autocorrection dictionary ({len(autocorrections)} entries):\n', + ''.join(sorted(f'// {typo:<{len(max_typo)}} -> {correction}\n' + for typo, correction in autocorrections)), + f'\n#define AUTOCORRECTION_MIN_LENGTH {len(min_typo)} // "{min_typo}"\n', + f'#define AUTOCORRECTION_MAX_LENGTH {len(max_typo)} // "{max_typo}"\n\n', + textwrap.fill('static const uint8_t autocorrection_data[%d] PROGMEM = {%s};' % ( + len(data), ', '.join(map(str, data))), width=80, subsequent_indent=' '), + '\n\n']) + + with open(file_name, 'wt') as f: + f.write(generated_code) + + +def main(argv): + dict_file = argv[1] if len(argv) > 1 else 'autocorrection_dict.txt' + autocorrections = parse_file(dict_file) + trie = make_trie(autocorrections) + data = serialize_trie(autocorrections, trie) + print(f'Processed %d autocorrection entries to table with %d bytes.' + % (len(autocorrections), len(data))) + write_generated_code(autocorrections, data, 'autocorrection_data.h') + +if __name__ == '__main__': + main(sys.argv) diff --git a/users/drashna/keyrecords/caps_word.c b/users/drashna/keyrecords/caps_word.c new file mode 100644 index 0000000000..731568328a --- /dev/null +++ b/users/drashna/keyrecords/caps_word.c @@ -0,0 +1,69 @@ +// Copyright 2021 Google LLC. +// SPDX-License-Identifier: Apache-2.0 + +#include "caps_word.h" + +bool caps_word_enabled = false; +bool caps_word_shifted = false; + +bool process_caps_word(uint16_t keycode, keyrecord_t* record) { + if (!caps_word_enabled) { + // Pressing both shift keys at the same time enables caps word. + if (((get_mods() | get_oneshot_mods()) & MOD_MASK_SHIFT) == MOD_MASK_SHIFT) { + clear_mods(); + clear_oneshot_mods(); + caps_word_shifted = false; + caps_word_enabled = true; + return false; + } + return true; + } + + if (!record->event.pressed) { + return true; + } + + if (!((get_mods() | get_oneshot_mods()) & ~MOD_MASK_SHIFT)) { + switch (keycode) { + case QK_MOD_TAP ... QK_MOD_TAP_MAX: + case QK_LAYER_TAP ... QK_LAYER_TAP_MAX: + // Earlier return if this has not been considered tapped yet. + if (record->tap.count == 0) { + return true; + } + // Get the base tapping keycode of a mod- or layer-tap key. + keycode &= 0xff; + } + + switch (keycode) { + // Letter keys should be shifted. + case KC_A ... KC_Z: + if (!caps_word_shifted) { + register_code(KC_LSFT); + } + caps_word_shifted = true; + return true; + + // Keycodes that continue caps word but shouldn't get shifted. + case KC_1 ... KC_0: + case KC_BSPC: + case KC_MINS: + case KC_UNDS: + if (caps_word_shifted) { + unregister_code(KC_LSFT); + } + caps_word_shifted = false; + return true; + + // Any other keycode disables caps word. + } + } + + // Disable caps word. + caps_word_enabled = false; + if (caps_word_shifted) { + unregister_code(KC_LSFT); + } + caps_word_shifted = false; + return true; +} diff --git a/users/drashna/keyrecords/caps_word.h b/users/drashna/keyrecords/caps_word.h new file mode 100644 index 0000000000..79e410ddda --- /dev/null +++ b/users/drashna/keyrecords/caps_word.h @@ -0,0 +1,8 @@ +// Copyright 2021 Google LLC. +// SPDX-License-Identifier: Apache-2.0 + +#pragma once + +#include "drashna.h" + +bool process_caps_word(uint16_t keycode, keyrecord_t* record); diff --git a/users/drashna/keyrecords/process_records.c b/users/drashna/keyrecords/process_records.c new file mode 100644 index 0000000000..c7d4a925b0 --- /dev/null +++ b/users/drashna/keyrecords/process_records.c @@ -0,0 +1,220 @@ +/* Copyright 2020 Christopher Courtney, aka Drashna Jael're (@drashna) + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#include "drashna.h" +#include "version.h" +#ifdef CAPS_WORD_ENABLE +# include "caps_word.h" +#endif +#ifdef AUTOCORRECTION_ENABLE +# include "autocorrection/autocorrection.h" +#endif + +uint16_t copy_paste_timer; +bool host_driver_disabled = false; +// Defines actions tor my global custom keycodes. Defined in drashna.h file +// Then runs the _keymap's record handier if not processed here + +__attribute__((weak)) bool process_record_keymap(uint16_t keycode, keyrecord_t *record) { return true; } +__attribute__((weak)) bool process_record_secrets(uint16_t keycode, keyrecord_t *record) { return true; } +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + // If console is enabled, it will print the matrix position and status of each key pressed +#ifdef KEYLOGGER_ENABLE + uprintf("KL: kc: 0x%04X, col: %2u, row: %2u, pressed: %b, time: %5u, int: %b, count: %u\n", keycode, record->event.key.col, record->event.key.row, record->event.pressed, record->event.time, record->tap.interrupted, record->tap.count); +#endif // KEYLOGGER_ENABLE +#ifdef OLED_ENABLE + process_record_user_oled(keycode, record); +#endif // OLED + + if (!(process_record_keymap(keycode, record) && process_record_secrets(keycode, record) +#ifdef RGB_MATRIX_ENABLE + && process_record_user_rgb_matrix(keycode, record) +#endif +#ifdef RGBLIGHT_ENABLE + && process_record_user_rgb_light(keycode, record) +#endif +#ifdef CUSTOM_UNICODE_ENABLE + && process_record_unicode(keycode, record) +#endif +#if defined(POINTING_DEVICE_ENABLE) + && process_record_pointing(keycode, record) +#endif +#ifdef CAPS_WORD_ENABLE + && process_caps_word(keycode, record) +#endif +#ifdef AUTOCORRECTION_ENABLE + && process_autocorrection(keycode, record) +#endif + && true)) { + return false; + } + + switch (keycode) { + case FIRST_DEFAULT_LAYER_KEYCODE ... LAST_DEFAULT_LAYER_KEYCODE: + if (record->event.pressed) { + uint8_t mods = mod_config(get_mods() | get_oneshot_mods()); + if (!mods) { + set_single_persistent_default_layer(keycode - FIRST_DEFAULT_LAYER_KEYCODE); +#if LAST_DEFAULT_LAYER_KEYCODE > (FIRST_DEFAULT_LAYER_KEYCODE + 3) + } else if (mods & MOD_MASK_SHIFT) { + set_single_persistent_default_layer(keycode - FIRST_DEFAULT_LAYER_KEYCODE + 4); +# if LAST_DEFAULT_LAYER_KEYCODE > (FIRST_DEFAULT_LAYER_KEYCODE + 7) + + } else if (mods & MOD_MASK_CTRL) { + set_single_persistent_default_layer(keycode - FIRST_DEFAULT_LAYER_KEYCODE + 8); +# endif +#endif + } + } + break; + + case KC_MAKE: // Compiles the firmware, and adds the flash command based on keyboard bootloader + if (!record->event.pressed) { +#ifndef MAKE_BOOTLOADER + uint8_t temp_mod = mod_config(get_mods()); + uint8_t temp_osm = mod_config(get_oneshot_mods()); + clear_mods(); + clear_oneshot_mods(); +#endif + send_string_with_delay_P(PSTR("qmk"), TAP_CODE_DELAY); +#ifndef MAKE_BOOTLOADER + if ((temp_mod | temp_osm) & MOD_MASK_SHIFT) +#endif + { + send_string_with_delay_P(PSTR(" flash "), TAP_CODE_DELAY); +#ifndef MAKE_BOOTLOADER + } else { + send_string_with_delay_P(PSTR(" compile "), TAP_CODE_DELAY); +#endif + } + send_string_with_delay_P(PSTR("-kb " QMK_KEYBOARD " -km " QMK_KEYMAP), TAP_CODE_DELAY); +#ifdef CONVERT_TO_PROTON_C + send_string_with_delay_P(PSTR(" -e CTPC=yes"), TAP_CODE_DELAY); +#endif + send_string_with_delay_P(PSTR(SS_TAP(X_ENTER)), TAP_CODE_DELAY); + } + break; + + case VRSN: // Prints firmware version + if (record->event.pressed) { + send_string_with_delay_P(PSTR(QMK_KEYBOARD "/" QMK_KEYMAP " @ " QMK_VERSION ", Built on: " QMK_BUILDDATE), TAP_CODE_DELAY); + } + break; + + case KC_DIABLO_CLEAR: // reset all Diablo timers, disabling them +#ifdef TAP_DANCE_ENABLE + if (record->event.pressed) { + for (uint8_t index = 0; index < 4; index++) { + diablo_timer[index].key_interval = 0; + } + } +#endif // TAP_DANCE_ENABLE + break; + + case KC_CCCV: // One key copy/paste + if (record->event.pressed) { + copy_paste_timer = timer_read(); + } else { + if (timer_elapsed(copy_paste_timer) > TAPPING_TERM) { // Hold, copy + tap_code16(LCTL(KC_C)); + } else { // Tap, paste + tap_code16(LCTL(KC_V)); + } + } + break; + case KC_RGB_T: // This allows me to use underglow as layer indication, or as normal +#if defined(RGBLIGHT_ENABLE) || defined(RGB_MATRIX_ENABLE) + if (record->event.pressed) { + userspace_config.rgb_layer_change ^= 1; + dprintf("rgblight layer change [EEPROM]: %u\n", userspace_config.rgb_layer_change); + eeconfig_update_user(userspace_config.raw); + if (userspace_config.rgb_layer_change) { +# if defined(RGBLIGHT_ENABLE) && defined(RGB_MATRIX_ENABLE) + rgblight_enable_noeeprom(); +# endif + layer_state_set(layer_state); // This is needed to immediately set the layer color (looks better) +# if defined(RGBLIGHT_ENABLE) && defined(RGB_MATRIX_ENABLE) + } else { + rgblight_disable_noeeprom(); +# endif + } + } +#endif // RGBLIGHT_ENABLE + break; + +#if defined(RGBLIGHT_ENABLE) || defined(RGB_MATRIX_ENABLE) + case RGB_TOG: + // Split keyboards need to trigger on key-up for edge-case issue +# ifndef SPLIT_KEYBOARD + if (record->event.pressed) { +# else + if (!record->event.pressed) { +# endif +# if defined(RGBLIGHT_ENABLE) && !defined(RGBLIGHT_DISABLE_KEYCODES) + rgblight_toggle(); +# endif +# if defined(RGB_MATRIX_ENABLE) && !defined(RGB_MATRIX_DISABLE_KEYCODES) + rgb_matrix_toggle(); +# endif + } + return false; + break; + case RGB_MODE_FORWARD ... RGB_MODE_GRADIENT: // quantum_keycodes.h L400 for definitions + if (record->event.pressed) { + bool is_eeprom_updated; +# if defined(RGBLIGHT_ENABLE) && !defined(RGBLIGHT_DISABLE_KEYCODES) + // This disables layer indication, as it's assumed that if you're changing this ... you want that disabled + if (userspace_config.rgb_layer_change) { + userspace_config.rgb_layer_change = false; + dprintf("rgblight layer change [EEPROM]: %u\n", userspace_config.rgb_layer_change); + is_eeprom_updated = true; + } +# endif +# if defined(RGB_MATRIX_ENABLE) && defined(RGB_MATRIX_FRAMEBUFFER_EFFECTS) + if (userspace_config.rgb_matrix_idle_anim) { + userspace_config.rgb_matrix_idle_anim = false; + dprintf("RGB Matrix Idle Animation [EEPROM]: %u\n", userspace_config.rgb_matrix_idle_anim); + is_eeprom_updated = true; + } +# endif + if (is_eeprom_updated) { + eeconfig_update_user(userspace_config.raw); + } + } + break; +#endif + case KEYLOCK: { + static host_driver_t *host_driver = 0; + + if (record->event.pressed) { + if (host_get_driver()) { + host_driver = host_get_driver(); + clear_keyboard(); + host_set_driver(0); + host_driver_disabled = true; + } else { + host_set_driver(host_driver); + host_driver_disabled = false; + } + } + break; + } + } + return true; +} + +__attribute__((weak)) void post_process_record_keymap(uint16_t keycode, keyrecord_t *record) {} +void post_process_record_user(uint16_t keycode, keyrecord_t *record) { post_process_record_keymap(keycode, record); } diff --git a/users/drashna/keyrecords/process_records.h b/users/drashna/keyrecords/process_records.h new file mode 100644 index 0000000000..df506b3647 --- /dev/null +++ b/users/drashna/keyrecords/process_records.h @@ -0,0 +1,142 @@ +/* Copyright 2020 Christopher Courtney, aka Drashna Jael're (@drashna) + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#pragma once +#include "drashna.h" + +#if defined(KEYBOARD_handwired_tractyl_manuform) +# define PLACEHOLDER_SAFE_RANGE KEYMAP_SAFE_RANGE +#else +# define PLACEHOLDER_SAFE_RANGE SAFE_RANGE +#endif + +enum userspace_custom_keycodes { + VRSN = PLACEHOLDER_SAFE_RANGE, // Prints QMK Firmware and board info + KC_QWERTY, // Sets default layer to QWERTY + FIRST_DEFAULT_LAYER_KEYCODE = KC_QWERTY, // Sets default layer to QWERTY + KC_COLEMAK_DH, // Sets default layer to COLEMAK + KC_COLEMAK, // Sets default layer to COLEMAK + KC_DVORAK, // Sets default layer to DVORAK + LAST_DEFAULT_LAYER_KEYCODE = KC_DVORAK, // Sets default layer to WORKMAN + KC_DIABLO_CLEAR, // Clears all Diablo Timers + KC_MAKE, // Run keyboard's customized make command + KC_RGB_T, // Toggles RGB Layer Indication mode + RGB_IDL, // RGB Idling animations + KC_SECRET_1, // test1 + KC_SECRET_2, // test2 + KC_SECRET_3, // test3 + KC_SECRET_4, // test4 + KC_SECRET_5, // test5 + KC_CCCV, // Hold to copy, tap to paste + KC_NUKE, // NUCLEAR LAUNCH DETECTED!!! + UC_FLIP, // (ಠ痊ಠ)┻━┻ + UC_TABL, // ┬─┬ノ( º _ ºノ) + UC_SHRG, // ¯\_(ツ)_/¯ + UC_DISA, // ಠ_ಠ + UC_IRNY, + UC_CLUE, + KEYLOCK, // Locks keyboard by unmounting driver + KC_NOMODE, + KC_WIDE, + KC_SCRIPT, + KC_BLOCKS, + KC_REGIONAL, + KC_AUSSIE, + KC_ZALGO, + KC_ACCEL, + AUTO_CTN, // Toggle Autocorrect status + NEW_SAFE_RANGE // use "NEWPLACEHOLDER for keymap specific codes +}; + +bool process_record_secrets(uint16_t keycode, keyrecord_t *record); +bool process_record_keymap(uint16_t keycode, keyrecord_t *record); +void post_process_record_keymap(uint16_t keycode, keyrecord_t *record); +#ifdef CUSTOM_UNICODE_ENABLE +bool process_record_unicode(uint16_t keycode, keyrecord_t *record); +void matrix_init_unicode(void); +#endif + +#define LOWER MO(_LOWER) +#define RAISE MO(_RAISE) +#define ADJUST MO(_ADJUST) +#define TG_MODS OS_TOGG +#define TG_GAME TG(_GAMEPAD) +#define TG_DBLO TG(_DIABLO) +#define OS_LWR OSL(_LOWER) +#define OS_RSE OSL(_RAISE) + +#define KC_SEC1 KC_SECRET_1 +#define KC_SEC2 KC_SECRET_2 +#define KC_SEC3 KC_SECRET_3 +#define KC_SEC4 KC_SECRET_4 +#define KC_SEC5 KC_SECRET_5 + +#define QWERTY KC_QWERTY +#define DVORAK KC_DVORAK +#define COLEMAK KC_COLEMAK +#define COLEMAKDH KC_COLEMAK_DH + +#define DEFLYR1 FIRST_DEFAULT_LAYER_KEYCODE +#define DEFLYR2 (FIRST_DEFAULT_LAYER_KEYCODE + 1) +#define DEFLYR3 (FIRST_DEFAULT_LAYER_KEYCODE + 2) +#define DEFLYR4 (FIRST_DEFAULT_LAYER_KEYCODE + 3) +#if LAST_DEFAULT_LAYER_KEYCODE > (FIRST_DEFAULT_LAYER_KEYCODE + 3) +# define DEFLYR5 (FIRST_DEFAULT_LAYER_KEYCODE + 4) +# define DEFLYR6 (FIRST_DEFAULT_LAYER_KEYCODE + 5) +# define DEFLYR7 (FIRST_DEFAULT_LAYER_KEYCODE + 6) +# define DEFLYR8 (FIRST_DEFAULT_LAYER_KEYCODE + 7) +# if LAST_DEFAULT_LAYER_KEYCODE > (FIRST_DEFAULT_LAYER_KEYCODE + 7) +# define DEFLYR9 (FIRST_DEFAULT_LAYER_KEYCODE + 8) +# define DEFLYR10 (FIRST_DEFAULT_LAYER_KEYCODE + 9) +# define DEFLYR11 (FIRST_DEFAULT_LAYER_KEYCODE + 10) +# define DEFLYR12 (FIRST_DEFAULT_LAYER_KEYCODE + 11) +# endif +#endif + +#define KC_RESET RESET +#define KC_RST KC_RESET + +#ifdef SWAP_HANDS_ENABLE +# define KC_C1R3 SH_T(KC_TAB) +#elif defined(DRASHNA_LP) +# define KC_C1R3 TG(_GAMEPAD) +#else // SWAP_HANDS_ENABLE +# define KC_C1R3 KC_TAB +#endif // SWAP_HANDS_ENABLE + +#define BK_LWER LT(_LOWER, KC_BSPC) +#define SP_LWER LT(_LOWER, KC_SPC) +#define DL_RAIS LT(_RAISE, KC_DEL) +#define ET_RAIS LT(_RAISE, KC_ENTER) + +/* OSM keycodes, to keep things clean and easy to change */ +#define KC_MLSF OSM(MOD_LSFT) +#define KC_MRSF OSM(MOD_RSFT) + +#define OS_LGUI OSM(MOD_LGUI) +#define OS_RGUI OSM(MOD_RGUI) +#define OS_LSFT OSM(MOD_LSFT) +#define OS_RSFT OSM(MOD_RSFT) +#define OS_LCTL OSM(MOD_LCTL) +#define OS_RCTL OSM(MOD_RCTL) +#define OS_LALT OSM(MOD_LALT) +#define OS_RALT OSM(MOD_RALT) +#define OS_MEH OSM(MOD_MEH) +#define OS_HYPR OSM(MOD_HYPR) + +#define ALT_APP ALT_T(KC_APP) + +#define MG_NKRO MAGIC_TOGGLE_NKRO diff --git a/users/drashna/keyrecords/tap_dances.c b/users/drashna/keyrecords/tap_dances.c new file mode 100644 index 0000000000..01873489d8 --- /dev/null +++ b/users/drashna/keyrecords/tap_dances.c @@ -0,0 +1,72 @@ +/* Copyright 2020 Christopher Courtney, aka Drashna Jael're (@drashna) + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#include "tap_dances.h" + +#define NUM_OF_DIABLO_KEYS 4 +// define diablo macro timer variables +diablo_timer_t diablo_timer[NUM_OF_DIABLO_KEYS]; + +// Set the default intervals. Always start with 0 so that it will disable on first hit. +// Otherwise, you will need to hit a bunch of times, or hit the "clear" command +uint8_t diablo_times[] = {0, 1, 3, 5, 10, 30}; + +// Cycle through the times for the macro, starting at 0, for disabled. +void diablo_tapdance_master(qk_tap_dance_state_t *state, void *user_data) { + diable_keys_t *diablo_keys = (diable_keys_t *)user_data; + // Sets the keycode based on the index + diablo_timer[diablo_keys->index].keycode = diablo_keys->keycode; + + // if the tapdance is hit more than the number of elemints in the array, reset + if (state->count >= (sizeof(diablo_times) / sizeof(uint8_t))) { + diablo_timer[diablo_keys->index].key_interval = 0; + reset_tap_dance(state); + } else { // else set the interval (tapdance count starts at 1, array starts at 0, so offset by one) + diablo_timer[diablo_keys->index].key_interval = diablo_times[state->count - 1]; + } +} + +// clang-format off +// One function to rule them all!! Where the Magic Sauce lies +#define ACTION_TAP_DANCE_DIABLO(index, keycode) { \ + .fn = { NULL, (void *)diablo_tapdance_master, NULL }, \ + .user_data = (void *)&((diable_keys_t) { index, keycode }), \ + } +// clang-format on + +// Tap Dance Definitions, sets the index and the keycode. +qk_tap_dance_action_t tap_dance_actions[] = { + // tap once to disable, and more to enable timed micros + [TD_D3_1] = ACTION_TAP_DANCE_DIABLO(0, KC_1), + [TD_D3_2] = ACTION_TAP_DANCE_DIABLO(1, KC_2), + [TD_D3_3] = ACTION_TAP_DANCE_DIABLO(2, KC_3), + [TD_D3_4] = ACTION_TAP_DANCE_DIABLO(3, KC_4), +}; + +// Checks each of the 4 timers/keys to see if enough time has elapsed +void run_diablo_macro_check(void) { + for (uint8_t index = 0; index < NUM_OF_DIABLO_KEYS; index++) { + // if key_interval is 0, it's disabled, so only run if it's set. If it's set, check the timer. + if (diablo_timer[index].key_interval && timer_elapsed(diablo_timer[index].timer) > (diablo_timer[index].key_interval * 1000)) { + // reset the timer, since enough time has passed + diablo_timer[index].timer = timer_read(); + // send keycode ONLY if we're on the diablo layer. + if (IS_LAYER_ON(_DIABLO)) { + tap_code(diablo_timer[index].keycode); + } + } + } +} diff --git a/users/drashna/keyrecords/tap_dances.h b/users/drashna/keyrecords/tap_dances.h new file mode 100644 index 0000000000..81e462ce29 --- /dev/null +++ b/users/drashna/keyrecords/tap_dances.h @@ -0,0 +1,44 @@ +/* Copyright 2020 Christopher Courtney, aka Drashna Jael're (@drashna) + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#pragma once +#include "drashna.h" + +// define diablo macro timer variables +extern uint8_t diablo_times[]; +typedef struct { + uint16_t timer; + uint8_t key_interval; + uint8_t keycode; +} diablo_timer_t; + +typedef struct { + uint8_t index; + uint8_t keycode; +} diable_keys_t; + +extern diablo_timer_t diablo_timer[]; + +void run_diablo_macro_check(void); + +#ifdef TAP_DANCE_ENABLE +enum { + TD_D3_1 = 0, + TD_D3_2, + TD_D3_3, + TD_D3_4, +}; +#endif // TAP_DANCE_ENABLE diff --git a/users/drashna/keyrecords/unicode.c b/users/drashna/keyrecords/unicode.c new file mode 100644 index 0000000000..88df2c9df9 --- /dev/null +++ b/users/drashna/keyrecords/unicode.c @@ -0,0 +1,287 @@ +/* Copyright 2020 @ridingqwerty + * Copyright 2020 @tzarc + * Copyright 2021 Christopher Courtney, aka Drashna Jael're (@drashna) + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#include "drashna.h" +#include "process_unicode_common.h" + +uint16_t typing_mode; + +void tap_code16_nomods(uint8_t kc) { + uint8_t temp_mod = get_mods(); + clear_mods(); + clear_oneshot_mods(); + tap_code16(kc); + set_mods(temp_mod); +} + +void tap_unicode_glyph_nomods(uint32_t glyph) { + uint8_t temp_mod = get_mods(); + clear_mods(); + clear_oneshot_mods(); + register_unicode(glyph); + set_mods(temp_mod); +} + +typedef uint32_t (*translator_function_t)(bool is_shifted, uint32_t keycode); + +#define DEFINE_UNICODE_RANGE_TRANSLATOR(translator_name, lower_alpha, upper_alpha, zero_glyph, number_one, space_glyph) \ + static inline uint32_t translator_name(bool is_shifted, uint32_t keycode) { \ + switch (keycode) { \ + case KC_A ... KC_Z: \ + return (is_shifted ? upper_alpha : lower_alpha) + keycode - KC_A; \ + case KC_0: \ + return zero_glyph; \ + case KC_1 ... KC_9: \ + return (number_one + keycode - KC_1); \ + case KC_SPACE: \ + return space_glyph; \ + } \ + return keycode; \ + } + +#define DEFINE_UNICODE_LUT_TRANSLATOR(translator_name, ...) \ + static inline uint32_t translator_name(bool is_shifted, uint32_t keycode) { \ + static const uint32_t translation[] = {__VA_ARGS__}; \ + uint32_t ret = keycode; \ + if ((keycode - KC_A) < (sizeof(translation) / sizeof(uint32_t))) { \ + ret = translation[keycode - KC_A]; \ + } \ + return ret; \ + } + +bool process_record_glyph_replacement(uint16_t keycode, keyrecord_t *record, translator_function_t translator) { + uint8_t temp_mod = get_mods(); + uint8_t temp_osm = get_oneshot_mods(); + bool is_shifted = (temp_mod | temp_osm) & MOD_MASK_SHIFT; + if (((temp_mod | temp_osm) & (MOD_MASK_CTRL | MOD_MASK_ALT | MOD_MASK_GUI)) == 0) { + if (KC_A <= keycode && keycode <= KC_Z) { + if (record->event.pressed) { + tap_unicode_glyph_nomods(translator(is_shifted, keycode)); + } + return false; + } else if (KC_1 <= keycode && keycode <= KC_0) { + if (is_shifted) { // skip shifted numbers, so that we can still use symbols etc. + return process_record_keymap(keycode, record); + } + if (record->event.pressed) { + register_unicode(translator(is_shifted, keycode)); + } + return false; + } else if (keycode == KC_SPACE) { + if (record->event.pressed) { + register_unicode(translator(is_shifted, keycode)); + } + return false; + } + } + return true; +} + +DEFINE_UNICODE_RANGE_TRANSLATOR(unicode_range_translator_wide, 0xFF41, 0xFF21, 0xFF10, 0xFF11, 0x2003); +DEFINE_UNICODE_RANGE_TRANSLATOR(unicode_range_translator_script, 0x1D4EA, 0x1D4D0, 0x1D7CE, 0x1D7C1, 0x2002); +DEFINE_UNICODE_RANGE_TRANSLATOR(unicode_range_translator_boxes, 0x1F170, 0x1F170, '0', '1', 0x2002); +DEFINE_UNICODE_RANGE_TRANSLATOR(unicode_range_translator_regional, 0x1F1E6, 0x1F1E6, '0', '1', 0x2003); + +DEFINE_UNICODE_LUT_TRANSLATOR(unicode_lut_translator_aussie, + 0x0250, // a + 'q', // b + 0x0254, // c + 'p', // d + 0x01DD, // e + 0x025F, // f + 0x0183, // g + 0x0265, // h + 0x1D09, // i + 0x027E, // j + 0x029E, // k + 'l', // l + 0x026F, // m + 'u', // n + 'o', // o + 'd', // p + 'b', // q + 0x0279, // r + 's', // s + 0x0287, // t + 'n', // u + 0x028C, // v + 0x028D, // w + 0x2717, // x + 0x028E, // y + 'z', // z + 0x0269, // 1 + 0x3139, // 2 + 0x0190, // 3 + 0x3123, // 4 + 0x03DB, // 5 + '9', // 6 + 0x3125, // 7 + '8', // 8 + '6', // 9 + '0' // 0 +); + +bool process_record_aussie(uint16_t keycode, keyrecord_t *record) { + bool is_shifted = (get_mods() | get_oneshot_mods()) & MOD_MASK_SHIFT; + if ((KC_A <= keycode) && (keycode <= KC_0)) { + if (record->event.pressed) { + if (!process_record_glyph_replacement(keycode, record, unicode_lut_translator_aussie)) { + tap_code16_nomods(KC_LEFT); + return false; + } + } + } else if (record->event.pressed && keycode == KC_SPACE) { + tap_code16_nomods(KC_SPACE); + tap_code16_nomods(KC_LEFT); + return false; + } else if (record->event.pressed && keycode == KC_ENTER) { + tap_code16_nomods(KC_END); + tap_code16_nomods(KC_ENTER); + return false; + } else if (record->event.pressed && keycode == KC_HOME) { + tap_code16_nomods(KC_END); + return false; + } else if (record->event.pressed && keycode == KC_END) { + tap_code16_nomods(KC_HOME); + return false; + } else if (record->event.pressed && keycode == KC_BSPC) { + tap_code16_nomods(KC_DELT); + return false; + } else if (record->event.pressed && keycode == KC_DELT) { + tap_code16_nomods(KC_BSPC); + return false; + } else if (record->event.pressed && keycode == KC_QUOT) { + tap_unicode_glyph_nomods(is_shifted ? 0x201E : 0x201A); + tap_code16_nomods(KC_LEFT); + return false; + } else if (record->event.pressed && keycode == KC_COMMA) { + tap_unicode_glyph_nomods(is_shifted ? '<' : 0x2018); + tap_code16_nomods(KC_LEFT); + return false; + } else if (record->event.pressed && keycode == KC_DOT) { + tap_unicode_glyph_nomods(is_shifted ? '>' : 0x02D9); + tap_code16_nomods(KC_LEFT); + return false; + } else if (record->event.pressed && keycode == KC_SLASH) { + tap_unicode_glyph_nomods(is_shifted ? 0x00BF : '/'); + tap_code16_nomods(KC_LEFT); + return false; + } + return true; +} + +bool process_record_zalgo(uint16_t keycode, keyrecord_t *record) { + if ((KC_A <= keycode) && (keycode <= KC_0)) { + if (record->event.pressed) { + tap_code16_nomods(keycode); + + int number = (rand() % (8 + 1 - 2)) + 2; + for (int index = 0; index < number; index++) { + uint16_t hex = (rand() % (0x036F + 1 - 0x0300)) + 0x0300; + register_unicode(hex); + } + + return false; + } + } + return true; +} + +bool process_record_unicode(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + case UC_FLIP: // (ノಠ痊ಠ)ノ彡┻━┻ + if (record->event.pressed) { + send_unicode_string("(ノಠ痊ಠ)ノ彡┻━┻"); + } + break; + + case UC_TABL: // ┬─┬ノ( º _ ºノ) + if (record->event.pressed) { + send_unicode_string("┬─┬ノ( º _ ºノ)"); + } + break; + + case UC_SHRG: // ¯\_(ツ)_/¯ + if (record->event.pressed) { + send_unicode_string("¯\\_(ツ)_/¯"); + } + break; + + case UC_DISA: // ಠ_ಠ + if (record->event.pressed) { + send_unicode_string("ಠ_ಠ"); + } + break; + + case UC_IRNY: // ⸮ + if (record->event.pressed) { + register_unicode(0x2E2E); + } + break; + case UC_CLUE: // ‽ + if (record->event.pressed) { + register_unicode(0x203D); + } + break; + case KC_NOMODE ... KC_ZALGO: + if (record->event.pressed) { + if (typing_mode != keycode) { + typing_mode = keycode; + } else { + typing_mode = 0; + } + } + break; + + break; + } + if (((keycode >= QK_MOD_TAP && keycode <= QK_MOD_TAP_MAX) || (keycode >= QK_LAYER_TAP && keycode <= QK_LAYER_TAP_MAX)) && record->tap.count) { + keycode &= 0xFF; + } + + if (typing_mode == KC_WIDE) { + if (((KC_A <= keycode) && (keycode <= KC_0)) || keycode == KC_SPACE) { + return process_record_glyph_replacement(keycode, record, unicode_range_translator_wide); + } + } else if (typing_mode == KC_SCRIPT) { + if (((KC_A <= keycode) && (keycode <= KC_0)) || keycode == KC_SPACE) { + return process_record_glyph_replacement(keycode, record, unicode_range_translator_script); + } + } else if (typing_mode == KC_BLOCKS) { + if (((KC_A <= keycode) && (keycode <= KC_0)) || keycode == KC_SPACE) { + return process_record_glyph_replacement(keycode, record, unicode_range_translator_boxes); + } + } else if (typing_mode == KC_REGIONAL) { + if (((KC_A <= keycode) && (keycode <= KC_0)) || keycode == KC_SPACE) { + if (!process_record_glyph_replacement(keycode, record, unicode_range_translator_regional)) { + wait_us(500); + tap_unicode_glyph_nomods(0x200C); + return false; + } + } + } else if (typing_mode == KC_AUSSIE) { + return process_record_aussie(keycode, record); + } else if (typing_mode == KC_ZALGO) { + return process_record_zalgo(keycode, record); + } + return process_unicode_common(keycode, record); +} + +void matrix_init_unicode(void) { + unicode_input_mode_init(); +} diff --git a/users/drashna/keyrecords/wrappers.h b/users/drashna/keyrecords/wrappers.h new file mode 100644 index 0000000000..c1ae815579 --- /dev/null +++ b/users/drashna/keyrecords/wrappers.h @@ -0,0 +1,278 @@ +/* Copyright 2020 Christopher Courtney, aka Drashna Jael're (@drashna) + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#pragma once +#include "drashna.h" +/* +Since our quirky block definitions are basically a list of comma separated +arguments, we need a wrapper in order for these definitions to be +expanded before being used as arguments to the LAYOUT_xxx macro. +*/ + +/* +Blocks for each of the four major keyboard layouts +Organized so we can quickly adapt and modify all of them +at once, rather than for each keyboard, one at a time. +And this allows for much cleaner blocks in the keymaps. +For instance Tap/Hold for Control on all of the layouts + +NOTE: These are all the same length. If you do a search/replace + then you need to add/remove underscores to keep the + lengths consistent. +*/ +// clang-format off +#define _________________QWERTY_L1_________________ KC_Q, KC_W, KC_E, KC_R, KC_T +#define _________________QWERTY_L2_________________ KC_A, KC_S, KC_D, KC_F, KC_G +#define _________________QWERTY_L3_________________ KC_Z, KC_X, KC_C, KC_V, KC_B + +#define _________________QWERTY_R1_________________ KC_Y, KC_U, KC_I, KC_O, KC_P +#define _________________QWERTY_R2_________________ KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT +#define _________________QWERTY_R3_________________ KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH + + +#define _________________COLEMAK_L1________________ KC_Q, KC_W, KC_F, KC_P, KC_G +#define _________________COLEMAK_L2________________ KC_A, KC_R, KC_S, KC_T, KC_D +#define _________________COLEMAK_L3________________ KC_Z, KC_X, KC_C, KC_V, KC_B + +#define _________________COLEMAK_R1________________ KC_J, KC_L, KC_U, KC_Y, KC_SCLN +#define _________________COLEMAK_R2________________ KC_H, KC_N, KC_E, KC_I, KC_O, KC_QUOT +#define _________________COLEMAK_R3________________ KC_K, KC_M, KC_COMM, KC_DOT, KC_SLSH + +#define ______________COLEMAK_MOD_DH_L1____________ KC_Q, KC_W, KC_F, KC_P, KC_B +#define ______________COLEMAK_MOD_DH_L2____________ KC_A, KC_R, KC_S, KC_T, KC_G +#define ______________COLEMAK_MOD_DH_L3____________ KC_Z, KC_X, KC_C, KC_D, KC_V + +#define ______________COLEMAK_MOD_DH_R1____________ KC_J, KC_L, KC_U, KC_Y, KC_SCLN +#define ______________COLEMAK_MOD_DH_R2____________ KC_M, KC_N, KC_E, KC_I, KC_O, KC_QUOT +#define ______________COLEMAK_MOD_DH_R3____________ KC_K, KC_H, KC_COMM, KC_DOT, KC_SLASH + + +#define _________________DVORAK_L1_________________ KC_QUOT, KC_COMM, KC_DOT, KC_P, KC_Y +#define _________________DVORAK_L2_________________ KC_A, KC_O, KC_E, KC_U, KC_I +#define _________________DVORAK_L3_________________ KC_SCLN, KC_Q, KC_J, KC_K, KC_X + +#define _________________DVORAK_R1_________________ KC_F, KC_G, KC_C, KC_R, KC_L +#define _________________DVORAK_R2_________________ KC_D, KC_H, KC_T, KC_N, KC_S, KC_SLSH +#define _________________DVORAK_R3_________________ KC_B, KC_M, KC_W, KC_V, KC_Z + + +#define ________________DVORAK_AU_L1_______________ KC_QUOT, KC_COMM, KC_DOT, KC_P, KC_Y +#define ________________DVORAK_AU_L2_______________ KC_O, KC_A, KC_E, KC_I, KC_U +#define ________________DVORAK_AU_L3_______________ KC_SCLN, KC_Q, KC_J, KC_K, KC_X + +#define ________________DVORAK_AU_R1_______________ KC_F, KC_G, KC_C, KC_R, KC_L +#define ________________DVORAK_AU_R2_______________ KC_D, KC_H, KC_T, KC_N, KC_S, KC_SLSH +#define ________________DVORAK_AU_R3_______________ KC_B, KC_M, KC_W, KC_V, KC_Z + +#define _________________WORKMAN_L1________________ KC_Q, KC_D, KC_R, KC_W, KC_B +#define _________________WORKMAN_L2________________ KC_A, KC_S, KC_H, KC_T, KC_G +#define _________________WORKMAN_L3________________ KC_Z, KC_X, KC_M, KC_C, KC_V + +#define _________________WORKMAN_R1________________ KC_J, KC_F, KC_U, KC_P, KC_SCLN +#define _________________WORKMAN_R2________________ KC_Y, KC_N, KC_E, KC_O, KC_I, KC_QUOT +#define _________________WORKMAN_R3________________ KC_K, KC_L, KC_COMM, KC_DOT, KC_SLSH + + +#define _________________NORMAN_L1_________________ KC_Q, KC_W, KC_D, KC_F, KC_K +#define _________________NORMAN_L2_________________ KC_A, KC_S, KC_E, KC_T, KC_G +#define _________________NORMAN_L3_________________ KC_Z, KC_X, KC_C, KC_V, KC_B + +#define _________________NORMAN_R1_________________ KC_J, KC_U, KC_R, KC_L, KC_SCLN +#define _________________NORMAN_R2_________________ KC_Y, KC_N, KC_I, KC_O, KC_U, KC_QUOT +#define _________________NORMAN_R3_________________ KC_P, KC_M, KC_COMM, KC_DOT, KC_SLSH + + +#define _________________MALTRON_L1________________ KC_Q, KC_P, KC_Y, KC_C, KC_B +#define _________________MALTRON_L2________________ KC_A, KC_N, KC_I, KC_S, KC_F +#define _________________MALTRON_L3________________ KC_SCLN, KC_SLSH, KC_J, KC_G, KC_COMM + +#define _________________MALTRON_R1________________ KC_V, KC_M, KC_U, KC_Z, KC_L +#define _________________MALTRON_R2________________ KC_D, KC_T, KC_D, KC_O, KC_R, KC_QUOT +#define _________________MALTRON_R3________________ KC_DOT, KC_W, KC_K, KC_MINS, KC_X + + +#define _________________EUCALYN_L1________________ KC_Q, KC_W, KC_COMM, KC_DOT, KC_SCLN +#define _________________EUCALYN_L2________________ KC_A, KC_O, KC_E, KC_I, KC_U +#define _________________EUCALYN_L3________________ KC_Z, KC_X, KC_C, KC_V, KC_F + +#define _________________EUCALYN_R1________________ KC_M, KC_R, KC_D, KC_Y, KC_P +#define _________________EUCALYN_R2________________ KC_G, KC_T, KC_K, KC_S, KC_N, KC_QUOT +#define _________________EUCALYN_R3________________ KC_B, KC_H, KC_J, KC_L, KC_SLSH + +// Qwerty-like +#define _____________CARPLAX_QFMLWY_L1_____________ KC_Q, KC_F, KC_M, KC_L, KC_W +#define _____________CARPLAX_QFMLWY_L2_____________ KC_D, KC_S, KC_T, KC_N, KC_R +#define _____________CARPLAX_QFMLWY_L3_____________ KC_Z, KC_V, KC_G, KC_C, KC_X + +#define _____________CARPLAX_QFMLWY_R1_____________ KC_Y, KC_U, KC_O, KC_B, KC_J +#define _____________CARPLAX_QFMLWY_R2_____________ KC_I, KC_A, KC_E, KC_H, KC_SCLN, KC_QUOT +#define _____________CARPLAX_QFMLWY_R3_____________ KC_P, KC_K, KC_COMM, KC_DOT, KC_SLSH + +// Colemak like +#define _____________CARPLAX_QGMLWB_L1_____________ KC_Q, KC_G, KC_M, KC_L, KC_W +#define _____________CARPLAX_QGMLWB_L2_____________ KC_D, KC_S, KC_T, KC_N, KC_R +#define _____________CARPLAX_QGMLWB_L3_____________ KC_Z, KC_X, KC_C, KC_F, KC_J + +#define _____________CARPLAX_QGMLWB_R1_____________ KC_B, KC_Y, KC_U, KC_V, KC_SCLN +#define _____________CARPLAX_QGMLWB_R2_____________ KC_I, KC_A, KC_E, KC_O, KC_H, KC_QUOT +#define _____________CARPLAX_QGMLWB_R3_____________ KC_K, KC_P, KC_COMM, KC_DOT, KC_SLSH + +// colemak like, zxcv fixed +#define _____________CARPLAX_QGMLWY_L1_____________ KC_Q, KC_G, KC_M, KC_L, KC_W +#define _____________CARPLAX_QGMLWY_L2_____________ KC_D, KC_S, KC_T, KC_N, KC_R +#define _____________CARPLAX_QGMLWY_L3_____________ KC_Z, KC_X, KC_C, KC_V, KC_J + +#define _____________CARPLAX_QGMLWY_R1_____________ KC_Y, KC_F, KC_U, KC_B, KC_SCLN +#define _____________CARPLAX_QGMLWY_R2_____________ KC_I, KC_A, KC_E, KC_O, KC_H, KC_QUOT +#define _____________CARPLAX_QGMLWY_R3_____________ KC_K, KC_P, KC_COMM, KC_DOT, KC_SLSH + +// teeheehee +#define _____________CARPLAX_TNWCLR_L1_____________ KC_T, KC_N, KC_W, KC_C, KC_L +#define _____________CARPLAX_TNWCLR_L2_____________ KC_S, KC_K, KC_J, KC_X, KC_G +#define _____________CARPLAX_TNWCLR_L3_____________ KC_E, KC_O, KC_D, KC_I, KC_A + +#define _____________CARPLAX_TNWCLR_R1_____________ KC_R, KC_B, KC_F, KC_M, KC_H +#define _____________CARPLAX_TNWCLR_R2_____________ KC_P, KC_Q, KC_Z, KC_V, KC_SCLN, KC_QUOT +#define _____________CARPLAX_TNWCLR_R3_____________ KC_U, KC_Y, KC_COMM, KC_DOT, KC_SLSH + + +#define _________________WHITE_R1__________________ KC_V, KC_Y, KC_D, KC_COMM, KC_QUOT +#define _________________WHITE_R2__________________ KC_A, KC_T, KC_H, KC_E, KC_B +#define _________________WHITE_R3__________________ KC_P, KC_K, KC_G, KC_W, KC_Q + +#define _________________WHITE_L1__________________ KC_INT1, KC_J, KC_M, KC_L, KC_U +#define _________________WHITE_L2__________________ KC_MINS, KC_C, KC_S, KC_N, KC_O, KC_I +#define _________________WHITE_L3__________________ KC_X, KC_R, KC_F, KC_DOT, KC_Z + + +#define _________________HALMAK_L1_________________ KC_W, KC_L, KC_R, KC_B, KC_Z +#define _________________HALMAK_L2_________________ KC_S, KC_H, KC_N, KC_T, KC_COMM +#define _________________HALMAK_L3_________________ KC_F, KC_M, KC_V, KC_V, KC_SLASH + +#define _________________HALMAK_R1_________________ KC_SCLN, KC_Q, KC_U, KC_D, KC_J +#define _________________HALMAK_R2_________________ KC_DOT, KC_A, KC_E, KC_O, KC_I, KC_QUOTE +#define _________________HALMAK_R3_________________ KC_G, KC_P, KC_X, KC_K, KC_Y + + +#define __________________ISRT_L1__________________ KC_W, KC_C, KC_L, KC_M, KC_K +#define __________________ISRT_L2__________________ KC_I, KC_S, KC_R, KC_T, KC_G +#define __________________ISRT_L3__________________ KC_Q, KC_V, KC_W, KC_D, KC_J + +#define __________________ISRT_R1__________________ KC_Z, KC_F, KC_U, KC_COMM, KC_QUOTE +#define __________________ISRT_R2__________________ KC_P, KC_N, KC_E, KC_A, KC_O, KC_SCLN +#define __________________ISRT_R3__________________ KC_B, KC_H, KC_SLSH, KC_DOT, KC_X + + +#define __________________SOUL_L1__________________ KC_Q, KC_W, KC_L, KC_D, KC_P +#define __________________SOUL_L2__________________ KC_A, KC_S, KC_R, KC_T, KC_G +#define __________________SOUL_L3__________________ KC_Z, KC_X, KC_C, KC_V, KC_J + +#define __________________SOUL_R1__________________ KC_K, KC_M, KC_U, KC_Y, KC_SCLN +#define __________________SOUL_R2__________________ KC_F, KC_N, KC_E, KC_I, KC_O, KC_QUOTE +#define __________________SOUL_R3__________________ KC_B, KC_H, KC_COMM, KC_DOT, KC_SLSH + + +#define __________________NIRO_L1__________________ KC_Q, KC_W, KC_U, KC_D, KC_P +#define __________________NIRO_L2__________________ KC_A, KC_S, KC_E, KC_T, KC_G +#define __________________NIRO_L3__________________ KC_Z, KC_X, KC_C, KC_V, KC_B + +#define __________________NIRO_R1__________________ KC_J, KC_F, KC_Y, KC_L, KC_SCLN +#define __________________NIRO_R2__________________ KC_H, KC_N, KC_I, KC_R, KC_O, KC_QUOTE +#define __________________NIRO_R3__________________ KC_K, KC_M, KC_COMM, KC_DOT, KC_SLSH + + +#define _________________ASSET_L1__________________ KC_Q, KC_W, KC_J, KC_F, KC_G +#define _________________ASSET_L2__________________ KC_A, KC_S, KC_E, KC_T, KC_D +#define _________________ASSET_L3__________________ KC_Z, KC_X, KC_C, KC_V, KC_B + +#define _________________ASSET_R1__________________ KC_Y, KC_P, KC_U, KC_L, KC_SCLN +#define _________________ASSET_R2__________________ KC_H, KC_N, KC_I, KC_O, KC_R, KC_QUOTE +#define _________________ASSET_R3__________________ KC_K, KC_M, KC_COMM, KC_DOT, KC_SLSH + + +#define _________________MTGAP_L1__________________ KC_Y, KC_P, KC_O, KC_U, KC_J +#define _________________MTGAP_L2__________________ KC_I, KC_N, KC_E, KC_A, KC_COMM +#define _________________MTGAP_L3__________________ KC_Q, KC_Z, KC_SLSH, KC_DOT, KC_SCLN + +#define _________________MTGAP_R1__________________ KC_K, KC_D, KC_L, KC_C, KC_W +#define _________________MTGAP_R2__________________ KC_M, KC_H, KC_T, KC_S, KC_R, KC_QUOTE +#define _________________MTGAP_R3__________________ KC_B, KC_F, KC_G, KC_V, KC_X + + +#define _________________MINIMAK_L1________________ KC_Q, KC_W, KC_D, KC_R, KC_K +#define _________________MINIMAK_L2________________ KC_A, KC_S, KC_T, KC_F, KC_G +#define _________________MINIMAK_L3________________ KC_Z, KC_X, KC_C, KC_V, KC_B + +#define _________________MINIMAK_R1________________ KC_Y, KC_U, KC_I, KC_O, KC_P +#define _________________MINIMAK_R2________________ KC_H, KC_J, KC_E, KC_L, KC_SCLN, KC_QUOT +#define _________________MINIMAK_R3________________ KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH + + +#define ________________MINIMAK_8_L1_______________ KC_Q, KC_W, KC_D, KC_R, KC_K +#define ________________MINIMAK_8_L2_______________ KC_A, KC_S, KC_T, KC_F, KC_G +#define ________________MINIMAK_8_L3_______________ KC_Z, KC_X, KC_C, KC_V, KC_B + +#define ________________MINIMAK_8_R1_______________ KC_Y, KC_U, KC_I, KC_L, KC_P +#define ________________MINIMAK_8_R2_______________ KC_H, KC_N, KC_E, KC_O, KC_SCLN, KC_QUOT +#define ________________MINIMAK_8_R3_______________ KC_J, KC_M, KC_COMM, KC_DOT, KC_SLSH + + +#define _______________MINIMAK_12_L1_______________ KC_Q, KC_W, KC_D, KC_F, KC_K +#define _______________MINIMAK_12_L2_______________ KC_A, KC_S, KC_T, KC_R, KC_G +#define _______________MINIMAK_12_L3_______________ KC_Z, KC_X, KC_C, KC_V, KC_B + +#define _______________MINIMAK_12_R1_______________ KC_Y, KC_U, KC_I, KC_L, KC_SCLN +#define _______________MINIMAK_12_R2_______________ KC_H, KC_N, KC_E, KC_O, KC_P, KC_QUOT +#define _______________MINIMAK_12_R3_______________ KC_J, KC_M, KC_COMM, KC_DOT, KC_SLSH + + +#define ________________NUMBER_LEFT________________ KC_1, KC_2, KC_3, KC_4, KC_5 +#define ________________NUMBER_RIGHT_______________ KC_6, KC_7, KC_8, KC_9, KC_0 +#define _________________FUNC_LEFT_________________ KC_F1, KC_F2, KC_F3, KC_F4, KC_F5 +#define _________________FUNC_RIGHT________________ KC_F6, KC_F7, KC_F8, KC_F9, KC_F10 + +#define ___________________BLANK___________________ _______, _______, _______, _______, _______ + + +#define _________________LOWER_L1__________________ KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC +#define _________________LOWER_L2__________________ _________________FUNC_LEFT_________________ +#define _________________LOWER_L3__________________ _________________FUNC_RIGHT________________ + +#define _________________LOWER_R1__________________ KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN +#define _________________LOWER_R2__________________ _______, KC_UNDS, KC_PLUS, KC_LCBR, KC_RCBR +#define _________________LOWER_R3__________________ _______, KC_HOME, KC_PGDN, KC_PGUP, KC_END + + + +#define _________________RAISE_L1__________________ ________________NUMBER_LEFT________________ +#define _________________RAISE_L2__________________ ___________________BLANK___________________ +#define _________________RAISE_L3__________________ ___________________BLANK___________________ + +#define _________________RAISE_R1__________________ ________________NUMBER_RIGHT_______________ +#define _________________RAISE_R2__________________ _______, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC +#define _________________RAISE_R3__________________ _______, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT + + + +#define _________________ADJUST_L1_________________ RGB_MOD, RGB_HUI, RGB_SAI, RGB_VAI, RGB_TOG +#define _________________ADJUST_L2_________________ MU_TOG , CK_TOGG, AU_ON, AU_OFF, CG_NORM +#define _________________ADJUST_L3_________________ RGB_RMOD,RGB_HUD,RGB_SAD, RGB_VAD, KC_RGB_T + +#define _________________ADJUST_R1_________________ KC_SEC1, KC_SEC2, KC_SEC3, KC_SEC4, KC_SEC5 +#define _________________ADJUST_R2_________________ CG_SWAP, DEFLYR1, DEFLYR2, DEFLYR3, DEFLYR4 +#define _________________ADJUST_R3_________________ MG_NKRO, KC_MUTE, KC_VOLD, KC_VOLU, KC_MNXT + +// clang-format on diff --git a/users/drashna/oled/drashna_font.h b/users/drashna/oled/drashna_font.h new file mode 100644 index 0000000000..844292a53a --- /dev/null +++ b/users/drashna/oled/drashna_font.h @@ -0,0 +1,1404 @@ +#pragma once + +// additional fonts from +// https://github.com/datacute/TinyOLED-Fonts + +#if __has_include("../../../../Documents/qmk/oled_font.h") +# include "../../../../Documents/qmk/oled_font.h" +#else + +// additional fonts from +// https://github.com/datacute/TinyOLED-Fonts + +# include "progmem.h" + +// clang-format off +static const unsigned char font[] PROGMEM = { + 0x07, 0x08, 0x7F, 0x08, 0x07, 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, + 0x1C, 0x5E, 0x7F, 0x5E, 0x1C, 0x00, + 0x00, 0x18, 0x3C, 0x18, 0x00, 0x00, + 0xFF, 0xE7, 0xC3, 0xE7, 0xFF, 0x00, + 0x00, 0x18, 0x24, 0x18, 0x00, 0x00, + 0xFF, 0xE7, 0xDB, 0xE7, 0xFF, 0x00, + 0x30, 0x48, 0x3A, 0x06, 0x0E, 0x00, + 0x26, 0x29, 0x79, 0x29, 0x26, 0x00, + 0x40, 0x7F, 0x05, 0x05, 0x07, 0x00, + 0x40, 0x7F, 0x05, 0x25, 0x3F, 0x00, + 0x5A, 0x3C, 0xE7, 0x3C, 0x5A, 0x00, + 0x7F, 0x3E, 0x1C, 0x1C, 0x08, 0x00, + 0x08, 0x1C, 0x1C, 0x3E, 0x7F, 0x00, + 0x14, 0x22, 0x7F, 0x22, 0x14, 0x00, + 0x5F, 0x5F, 0x00, 0x5F, 0x5F, 0x00, + 0x06, 0x09, 0x7F, 0x01, 0x7F, 0x00, + 0x00, 0x66, 0x89, 0x95, 0x6A, 0x00, + 0x60, 0x60, 0x60, 0x60, 0x60, 0x00, + 0x94, 0xA2, 0xFF, 0xA2, 0x94, 0x00, + 0x08, 0x04, 0x7E, 0x04, 0x08, 0x00, + 0x10, 0x20, 0x7E, 0x20, 0x10, 0x00, + 0x08, 0x08, 0x2A, 0x1C, 0x08, 0x00, + 0x08, 0x1C, 0x2A, 0x08, 0x08, 0x00, + 0x1E, 0x10, 0x10, 0x10, 0x10, 0x00, + 0x0C, 0x1E, 0x0C, 0x1E, 0x0C, 0x00, + 0x30, 0x38, 0x3E, 0x38, 0x30, 0x00, + 0x06, 0x0E, 0x3E, 0x0E, 0x06, 0x00, + +# if defined(OLED_FONT_5X5) + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x5c, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x06, 0x00, 0x06, 0x00, 0x00, 0x00, + 0x28, 0x7c, 0x28, 0x7c, 0x28, 0x00, + 0x5c, 0x54, 0xfe, 0x54, 0x74, 0x00, + 0x44, 0x20, 0x10, 0x08, 0x44, 0x00, + 0x28, 0x54, 0x54, 0x20, 0x50, 0x00, + 0x06, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x38, 0x44, 0x00, 0x00, 0x00, 0x00, + 0x44, 0x38, 0x00, 0x00, 0x00, 0x00, + 0x02, 0x07, 0x02, 0x00, 0x00, 0x00, + 0x10, 0x10, 0x7c, 0x10, 0x10, 0x00, + 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x10, 0x10, 0x10, 0x10, 0x10, 0x00, + 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x60, 0x10, 0x0c, 0x00, 0x00, 0x00, + 0x7c, 0x64, 0x54, 0x4c, 0x7c, 0x00, + 0x48, 0x7c, 0x40, 0x00, 0x00, 0x00, + 0x64, 0x54, 0x54, 0x54, 0x48, 0x00, + 0x44, 0x54, 0x54, 0x54, 0x6c, 0x00, + 0x3c, 0x20, 0x70, 0x20, 0x20, 0x00, + 0x5c, 0x54, 0x54, 0x54, 0x24, 0x00, + 0x7c, 0x54, 0x54, 0x54, 0x74, 0x00, + 0x04, 0x04, 0x64, 0x14, 0x0c, 0x00, + 0x7c, 0x54, 0x54, 0x54, 0x7c, 0x00, + 0x5c, 0x54, 0x54, 0x54, 0x7c, 0x00, + 0x44, 0x00, 0x00, 0x00, 0x00, 0x00, + 0xc4, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x10, 0x28, 0x44, 0x00, 0x00, 0x00, + 0x28, 0x28, 0x28, 0x28, 0x28, 0x00, + 0x44, 0x28, 0x10, 0x00, 0x00, 0x00, + 0x08, 0x04, 0x54, 0x08, 0x00, 0x00, + 0x7c, 0x44, 0x54, 0x54, 0x5c, 0x00, + 0x7c, 0x24, 0x24, 0x24, 0x7c, 0x00, + 0x7c, 0x54, 0x54, 0x54, 0x6c, 0x00, + 0x7c, 0x44, 0x44, 0x44, 0x44, 0x00, + 0x7c, 0x44, 0x44, 0x44, 0x38, 0x00, + 0x7c, 0x54, 0x54, 0x54, 0x44, 0x00, + 0x7c, 0x14, 0x14, 0x14, 0x04, 0x00, + 0x7c, 0x44, 0x44, 0x54, 0x74, 0x00, + 0x7c, 0x10, 0x10, 0x10, 0x7c, 0x00, + 0x44, 0x44, 0x7c, 0x44, 0x44, 0x00, + 0x60, 0x40, 0x40, 0x44, 0x7c, 0x00, + 0x7c, 0x10, 0x10, 0x28, 0x44, 0x00, + 0x7c, 0x40, 0x40, 0x40, 0x40, 0x00, + 0x7c, 0x08, 0x10, 0x08, 0x7c, 0x00, + 0x7c, 0x08, 0x10, 0x20, 0x7c, 0x00, + 0x38, 0x44, 0x44, 0x44, 0x38, 0x00, + 0x7c, 0x14, 0x14, 0x14, 0x08, 0x00, + 0x3c, 0x24, 0x64, 0x24, 0x3c, 0x00, + 0x7c, 0x14, 0x14, 0x14, 0x68, 0x00, + 0x5c, 0x54, 0x54, 0x54, 0x74, 0x00, + 0x04, 0x04, 0x7c, 0x04, 0x04, 0x00, + 0x7c, 0x40, 0x40, 0x40, 0x7c, 0x00, + 0x0c, 0x30, 0x40, 0x30, 0x0c, 0x00, + 0x3c, 0x40, 0x30, 0x40, 0x3c, 0x00, + 0x44, 0x28, 0x10, 0x28, 0x44, 0x00, + 0x0c, 0x10, 0x60, 0x10, 0x0c, 0x00, + 0x44, 0x64, 0x54, 0x4c, 0x44, 0x00, + 0x7c, 0x44, 0x00, 0x00, 0x00, 0x00, + 0x0c, 0x10, 0x60, 0x00, 0x00, 0x00, + 0x44, 0x7c, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x01, 0x00, 0x01, 0x00, 0x00, + 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, + 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, + 0x7c, 0x24, 0x24, 0x24, 0x7c, 0x00, + 0x7c, 0x54, 0x54, 0x54, 0x6c, 0x00, + 0x7c, 0x44, 0x44, 0x44, 0x44, 0x00, + 0x7c, 0x44, 0x44, 0x44, 0x38, 0x00, + 0x7c, 0x54, 0x54, 0x54, 0x44, 0x00, + 0x7c, 0x14, 0x14, 0x14, 0x04, 0x00, + 0x7c, 0x44, 0x44, 0x54, 0x74, 0x00, + 0x7c, 0x10, 0x10, 0x10, 0x7c, 0x00, + 0x44, 0x44, 0x7c, 0x44, 0x44, 0x00, + 0x60, 0x40, 0x40, 0x44, 0x7c, 0x00, + 0x7c, 0x10, 0x10, 0x28, 0x44, 0x00, + 0x7c, 0x40, 0x40, 0x40, 0x40, 0x00, + 0x7c, 0x08, 0x10, 0x08, 0x7c, 0x00, + 0x7c, 0x08, 0x10, 0x20, 0x7c, 0x00, + 0x38, 0x44, 0x44, 0x44, 0x38, 0x00, + 0x7c, 0x14, 0x14, 0x14, 0x08, 0x00, + 0x3c, 0x24, 0x64, 0x24, 0x3c, 0x00, + 0x7c, 0x14, 0x14, 0x14, 0x68, 0x00, + 0x5c, 0x54, 0x54, 0x54, 0x74, 0x00, + 0x04, 0x04, 0x7c, 0x04, 0x04, 0x00, + 0x7c, 0x40, 0x40, 0x40, 0x7c, 0x00, + 0x0c, 0x30, 0x40, 0x30, 0x0c, 0x00, + 0x3c, 0x40, 0x30, 0x40, 0x3c, 0x00, + 0x44, 0x28, 0x10, 0x28, 0x44, 0x00, + 0x0c, 0x10, 0x60, 0x10, 0x0c, 0x00, + 0x44, 0x64, 0x54, 0x4c, 0x44, 0x00, + 0x10, 0x7c, 0x44, 0x00, 0x00, 0x00, + 0x6c, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x44, 0x7c, 0x10, 0x00, 0x00, 0x00, + 0x02, 0x01, 0x02, 0x01, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +# lif defined(OLED_FONT_AZTECH) + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x2e, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x02, 0x00, 0x02, 0x00, 0x00, + 0x00, 0x0a, 0x1e, 0x0a, 0x1e, 0x00, + 0x00, 0x0e, 0x2a, 0x6b, 0x2a, 0x3a, + 0x00, 0x06, 0x06, 0x26, 0x18, 0x06, + 0x38, 0x3e, 0x2a, 0x2a, 0x28, 0x38, + 0x18, 0x02, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x3e, 0x22, 0x00, 0x00, 0x00, + 0x00, 0x22, 0x3e, 0x00, 0x00, 0x00, + 0x00, 0x0e, 0x0e, 0x0e, 0x04, 0x00, + 0x00, 0x08, 0x1c, 0x08, 0x00, 0x00, + 0x00, 0x20, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x08, 0x08, 0x08, 0x00, 0x00, + 0x00, 0x20, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x20, 0x18, 0x06, 0x00, 0x00, + 0x00, 0x3e, 0x22, 0x2a, 0x22, 0x3e, + 0x02, 0x3e, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x38, 0x28, 0x2a, 0x2a, 0x2e, + 0x00, 0x22, 0x2a, 0x2e, 0x38, 0x00, + 0x00, 0x0e, 0x08, 0x08, 0x3e, 0x08, + 0x00, 0x2e, 0x2a, 0x2a, 0x28, 0x38, + 0x00, 0x3e, 0x2a, 0x2a, 0x28, 0x38, + 0x00, 0x06, 0x02, 0x02, 0x0a, 0x3e, + 0x00, 0x38, 0x2e, 0x2a, 0x2e, 0x38, + 0x00, 0x0e, 0x0a, 0x2a, 0x2a, 0x3e, + 0x00, 0x28, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x28, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x08, 0x14, 0x22, 0x00, 0x00, + 0x00, 0x14, 0x14, 0x14, 0x14, 0x00, + 0x00, 0x22, 0x14, 0x08, 0x00, 0x00, + 0x00, 0x06, 0x02, 0x2a, 0x0a, 0x06, + 0x00, 0x3e, 0x02, 0x3a, 0x2a, 0x0a, + 0x22, 0x3e, 0x02, 0x0a, 0x0a, 0x3e, + 0x00, 0x3e, 0x22, 0x2a, 0x2e, 0x38, + 0x00, 0x3e, 0x22, 0x22, 0x20, 0x30, + 0x00, 0x3e, 0x22, 0x22, 0x22, 0x3c, + 0x00, 0x3e, 0x2a, 0x22, 0x20, 0x30, + 0x00, 0x3e, 0x0a, 0x0a, 0x06, 0x02, + 0x00, 0x3e, 0x22, 0x2a, 0x28, 0x38, + 0x00, 0x3e, 0x08, 0x08, 0x08, 0x3e, + 0x00, 0x22, 0x3e, 0x22, 0x00, 0x00, + 0x00, 0x30, 0x20, 0x20, 0x22, 0x3e, + 0x00, 0x3e, 0x08, 0x08, 0x0e, 0x38, + 0x00, 0x3e, 0x20, 0x20, 0x20, 0x30, + 0x00, 0x3e, 0x02, 0x3e, 0x20, 0x3e, + 0x3e, 0x3e, 0x02, 0x3e, 0x20, 0x3e, + 0x00, 0x3e, 0x22, 0x22, 0x22, 0x3e, + 0x00, 0x3e, 0x02, 0x0a, 0x0a, 0x0e, + 0x00, 0x3e, 0x22, 0x22, 0x22, 0x3e, + 0x00, 0x3e, 0x02, 0x0a, 0x0e, 0x38, + 0x00, 0x0e, 0x0a, 0x2a, 0x2a, 0x3a, + 0x00, 0x06, 0x02, 0x3e, 0x02, 0x06, + 0x00, 0x3e, 0x20, 0x20, 0x20, 0x3e, + 0x00, 0x3e, 0x20, 0x20, 0x3e, 0x00, + 0x00, 0x3e, 0x20, 0x3e, 0x02, 0x3e, + 0x3e, 0x3a, 0x0e, 0x08, 0x0e, 0x3a, + 0x00, 0x0e, 0x08, 0x08, 0x28, 0x3e, + 0x00, 0x3a, 0x2a, 0x2a, 0x0a, 0x0e, + 0x00, 0x3e, 0x22, 0x00, 0x00, 0x00, + 0x00, 0x02, 0x0c, 0x30, 0x00, 0x00, + 0x22, 0x3e, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x01, 0x00, 0x01, 0x00, 0x00, + 0x00, 0x20, 0x20, 0x20, 0x00, 0x00, + 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x38, 0x28, 0x28, 0x08, 0x38, + 0x00, 0x3e, 0x20, 0x28, 0x28, 0x38, + 0x00, 0x38, 0x28, 0x28, 0x20, 0x30, + 0x00, 0x38, 0x28, 0x28, 0x20, 0x3e, + 0x00, 0xf8, 0x88, 0x28, 0x28, 0x38, + 0x00, 0xf8, 0x28, 0x28, 0x18, 0x08, + 0x00, 0x38, 0x28, 0xa8, 0x88, 0xf8, + 0x00, 0x3c, 0x08, 0x08, 0x08, 0x38, + 0x00, 0x3a, 0x00, 0x00, 0x00, 0x00, + 0x80, 0xfa, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x3e, 0x08, 0x08, 0x38, 0x2c, + 0x00, 0x3e, 0x20, 0x00, 0x00, 0x00, + 0x00, 0x38, 0x08, 0x38, 0x20, 0x38, + 0x38, 0x38, 0x08, 0x38, 0x20, 0x38, + 0x00, 0x38, 0x28, 0x28, 0x28, 0x38, + 0x00, 0xf8, 0x08, 0x28, 0x28, 0x38, + 0x00, 0x38, 0x28, 0x28, 0x08, 0xf8, + 0x00, 0x38, 0x08, 0x08, 0x18, 0x08, + 0x00, 0x38, 0x28, 0xa8, 0xa8, 0xe8, + 0x00, 0x3e, 0x28, 0x28, 0x20, 0x30, + 0x00, 0x38, 0x20, 0x20, 0x20, 0x38, + 0x00, 0x38, 0x20, 0x38, 0x00, 0x00, + 0x00, 0x38, 0x20, 0x38, 0x08, 0x38, + 0x38, 0x28, 0x38, 0x10, 0x38, 0x28, + 0x00, 0x38, 0x20, 0xa0, 0xa0, 0xf8, + 0x00, 0xe8, 0xa8, 0xa8, 0x28, 0x38, + 0x08, 0x3e, 0x22, 0x00, 0x00, 0x00, + 0x00, 0x3f, 0x00, 0x00, 0x00, 0x00, + 0x22, 0x3e, 0x08, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +# elif defined(OLED_FONT_BMPLAIN) + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x2e, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x03, 0x00, 0x03, 0x00, 0x00, 0x00, + 0x0a, 0x1f, 0x0a, 0x1f, 0x0a, 0x00, + 0x2e, 0x2a, 0x6b, 0x2a, 0x3a, 0x00, + 0x0e, 0x2a, 0x1e, 0x08, 0x3c, 0x2a, + 0x3e, 0x2a, 0x2a, 0x22, 0x38, 0x08, + 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x1c, 0x22, 0x00, 0x00, 0x00, 0x00, + 0x22, 0x1c, 0x00, 0x00, 0x00, 0x00, + 0x15, 0x0e, 0x04, 0x0e, 0x15, 0x00, + 0x08, 0x08, 0x3e, 0x08, 0x08, 0x00, + 0x60, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x08, 0x08, 0x08, 0x08, 0x08, 0x00, + 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x20, 0x10, 0x08, 0x04, 0x02, 0x00, + 0x3e, 0x22, 0x2a, 0x22, 0x3e, 0x00, + 0x04, 0x3e, 0x00, 0x00, 0x00, 0x00, + 0x3a, 0x2a, 0x2a, 0x2a, 0x2e, 0x00, + 0x2a, 0x2a, 0x2a, 0x2a, 0x3e, 0x00, + 0x0e, 0x08, 0x08, 0x08, 0x3e, 0x00, + 0x2e, 0x2a, 0x2a, 0x2a, 0x3a, 0x00, + 0x3e, 0x2a, 0x2a, 0x2a, 0x3a, 0x00, + 0x02, 0x02, 0x02, 0x02, 0x3e, 0x00, + 0x3e, 0x2a, 0x2a, 0x2a, 0x3e, 0x00, + 0x2e, 0x2a, 0x2a, 0x2a, 0x3e, 0x00, + 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x34, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x08, 0x14, 0x22, 0x00, 0x00, 0x00, + 0x14, 0x14, 0x14, 0x14, 0x14, 0x00, + 0x22, 0x14, 0x08, 0x00, 0x00, 0x00, + 0x06, 0x02, 0x2a, 0x0a, 0x0e, 0x00, + 0x3e, 0x02, 0x3a, 0x2a, 0x3e, 0x00, + 0x3e, 0x12, 0x12, 0x12, 0x3e, 0x00, + 0x3e, 0x2a, 0x2a, 0x2a, 0x36, 0x00, + 0x3e, 0x22, 0x22, 0x22, 0x22, 0x00, + 0x3e, 0x22, 0x22, 0x22, 0x1c, 0x00, + 0x3e, 0x2a, 0x2a, 0x2a, 0x22, 0x00, + 0x3e, 0x0a, 0x0a, 0x0a, 0x02, 0x00, + 0x3e, 0x22, 0x2a, 0x2a, 0x3a, 0x00, + 0x3e, 0x08, 0x08, 0x08, 0x3e, 0x00, + 0x22, 0x3e, 0x22, 0x00, 0x00, 0x00, + 0x38, 0x20, 0x20, 0x20, 0x3e, 0x00, + 0x3e, 0x08, 0x08, 0x14, 0x22, 0x00, + 0x3e, 0x20, 0x20, 0x20, 0x20, 0x00, + 0x3e, 0x04, 0x38, 0x04, 0x3e, 0x00, + 0x3e, 0x04, 0x08, 0x10, 0x3e, 0x00, + 0x3e, 0x22, 0x22, 0x22, 0x3e, 0x00, + 0x3e, 0x0a, 0x0a, 0x0a, 0x0e, 0x00, + 0x3e, 0x22, 0x72, 0x22, 0x3e, 0x00, + 0x3e, 0x0a, 0x0a, 0x1a, 0x2e, 0x00, + 0x2e, 0x2a, 0x2a, 0x2a, 0x3a, 0x00, + 0x02, 0x02, 0x3e, 0x02, 0x02, 0x00, + 0x1e, 0x20, 0x20, 0x20, 0x1e, 0x00, + 0x0e, 0x10, 0x20, 0x10, 0x0e, 0x00, + 0x3e, 0x10, 0x0e, 0x10, 0x3e, 0x00, + 0x22, 0x14, 0x08, 0x14, 0x22, 0x00, + 0x02, 0x04, 0x38, 0x04, 0x02, 0x00, + 0x3a, 0x2a, 0x2a, 0x2a, 0x2e, 0x00, + 0x3e, 0x22, 0x00, 0x00, 0x00, 0x00, + 0x3f, 0x21, 0x3f, 0x00, 0x00, 0x00, + 0x22, 0x3e, 0x00, 0x00, 0x00, 0x00, + 0x0c, 0x1e, 0x3c, 0x1e, 0x0c, 0x00, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x00, + 0x1c, 0x3e, 0x3e, 0x3e, 0x1c, 0x00, + 0x3c, 0x24, 0x24, 0x24, 0x3c, 0x20, + 0x3e, 0x24, 0x24, 0x24, 0x3c, 0x00, + 0x3c, 0x24, 0x24, 0x24, 0x24, 0x00, + 0x3c, 0x24, 0x24, 0x24, 0x3e, 0x00, + 0x3c, 0x24, 0x34, 0x2c, 0x24, 0x00, + 0x08, 0x3e, 0x0a, 0x0a, 0x00, 0x00, + 0x1c, 0x54, 0x54, 0x54, 0x7c, 0x00, + 0x3e, 0x04, 0x04, 0x04, 0x3c, 0x00, + 0x3a, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x7a, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x3e, 0x08, 0x14, 0x22, 0x00, 0x00, + 0x02, 0x3e, 0x00, 0x00, 0x00, 0x00, + 0x3c, 0x04, 0x3c, 0x04, 0x3c, 0x00, + 0x3c, 0x04, 0x04, 0x04, 0x3c, 0x00, + 0x3c, 0x24, 0x24, 0x24, 0x3c, 0x00, + 0x7c, 0x24, 0x24, 0x24, 0x3c, 0x00, + 0x3c, 0x24, 0x24, 0x24, 0x7c, 0x00, + 0x3c, 0x04, 0x04, 0x04, 0x00, 0x00, + 0x24, 0x2c, 0x34, 0x24, 0x00, 0x00, + 0x04, 0x3e, 0x24, 0x24, 0x00, 0x00, + 0x3c, 0x20, 0x20, 0x20, 0x3c, 0x00, + 0x0c, 0x10, 0x20, 0x10, 0x0c, 0x00, + 0x3c, 0x20, 0x3c, 0x20, 0x3c, 0x00, + 0x24, 0x24, 0x18, 0x24, 0x24, 0x00, + 0x1c, 0x50, 0x50, 0x50, 0x7c, 0x00, + 0x24, 0x34, 0x2c, 0x24, 0x00, 0x00, + 0x08, 0x3e, 0x22, 0x00, 0x00, 0x00, + 0x1c, 0x22, 0x22, 0x22, 0x1c, 0x00, + 0x22, 0x3e, 0x08, 0x00, 0x00, 0x00, + 0x01, 0x01, 0x01, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +# elif defined(OLED_FONT_CRACKERS) + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x5E, 0x06, 0x06, 0x00, 0x00, 0x00, + 0x1E, 0x00, 0x00, 0x1E, 0x00, 0x00, + 0x20, 0x7C, 0x38, 0x38, 0x7C, 0x08, + 0x48, 0xFE, 0x64, 0x64, 0x00, 0x00, + 0x64, 0x60, 0x60, 0x18, 0x0C, 0x0C, + 0x74, 0x4A, 0x4A, 0x7E, 0x48, 0x00, + 0x1E, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x3C, 0x7E, 0x7E, 0x42, 0x00, 0x00, + 0x42, 0x7E, 0x7E, 0x3C, 0x00, 0x00, + 0x04, 0x0C, 0x04, 0x06, 0x0C, 0x04, + 0x10, 0x3C, 0x3C, 0x3C, 0x10, 0x00, + 0x00, 0x60, 0xE0, 0x00, 0x00, 0x00, + 0x08, 0x08, 0x08, 0x00, 0x00, 0x00, + 0x60, 0x60, 0x60, 0x00, 0x00, 0x00, + 0x60, 0x78, 0x78, 0x1E, 0x06, 0x00, + 0x3C, 0x3C, 0x7E, 0x42, 0x7E, 0x7E, + 0x04, 0x7E, 0x7E, 0x7E, 0x00, 0x00, + 0x76, 0x7A, 0x7E, 0x7E, 0x4C, 0x00, + 0x4A, 0x7E, 0x7E, 0x7C, 0x00, 0x00, + 0x0E, 0x08, 0x7E, 0x7E, 0x7E, 0x00, + 0x4E, 0x4E, 0x4E, 0x7A, 0x1A, 0x00, + 0x3C, 0x7E, 0x7E, 0x4A, 0x7A, 0x00, + 0x02, 0x02, 0x0A, 0x7E, 0x7E, 0x7E, + 0x7E, 0x7E, 0x7E, 0x4A, 0x7E, 0x00, + 0x0C, 0x4A, 0x7E, 0x7E, 0x3C, 0x00, + 0x66, 0x66, 0x66, 0x00, 0x00, 0x00, + 0x66, 0xE6, 0x00, 0x00, 0x00, 0x00, + 0x08, 0x3C, 0x7E, 0x7E, 0x62, 0x00, + 0x14, 0x14, 0x14, 0x00, 0x00, 0x00, + 0x62, 0x7E, 0x7E, 0x3C, 0x08, 0x00, + 0x02, 0x4A, 0x0E, 0x0E, 0x0C, 0x00, + 0x3C, 0x7E, 0x7E, 0x4A, 0x72, 0x30, + 0x7A, 0x4A, 0x7E, 0x7E, 0x7C, 0x00, + 0x7E, 0x7E, 0x7E, 0x4A, 0x24, 0x00, + 0x3C, 0x7E, 0x7E, 0x7E, 0x46, 0x00, + 0x7E, 0x7E, 0x7E, 0x62, 0x3C, 0x00, + 0x7E, 0x7E, 0x7E, 0x4A, 0x00, 0x00, + 0x7E, 0x7E, 0x7E, 0x0A, 0x00, 0x00, + 0x3C, 0x7E, 0x7E, 0x42, 0x62, 0x00, + 0x7E, 0x7E, 0x7E, 0x18, 0x7E, 0x00, + 0x7E, 0x7E, 0x7E, 0x00, 0x00, 0x00, + 0x40, 0x7E, 0x7E, 0x7E, 0x00, 0x00, + 0x7E, 0x7E, 0x7E, 0x3C, 0x66, 0x00, + 0x7E, 0x7E, 0x7E, 0x40, 0x00, 0x00, + 0x7E, 0x3E, 0x3E, 0x7C, 0x3E, 0x3E, + 0x7E, 0x3E, 0x7E, 0x7C, 0x7E, 0x00, + 0x3C, 0x3C, 0x7E, 0x62, 0x7E, 0x7E, + 0x7E, 0x7E, 0x7E, 0x22, 0x0C, 0x00, + 0x3C, 0x7E, 0x7E, 0x62, 0x7E, 0x7C, + 0x7E, 0x7E, 0x7E, 0x0A, 0x64, 0x00, + 0x4C, 0x4E, 0x4E, 0x7A, 0x1A, 0x00, + 0x02, 0x7E, 0x7E, 0x7E, 0x02, 0x00, + 0x7E, 0x60, 0x7E, 0x7E, 0x7E, 0x00, + 0x3E, 0x60, 0x7E, 0x7E, 0x3E, 0x00, + 0x7E, 0x7C, 0x7C, 0x3E, 0x7C, 0x7C, + 0x46, 0x7E, 0x08, 0x7E, 0x62, 0x62, + 0x5E, 0x5E, 0x5E, 0x70, 0x3E, 0x00, + 0x66, 0x7A, 0x7A, 0x5E, 0x66, 0x00, + 0x7E, 0x7E, 0x7E, 0x42, 0x00, 0x00, + 0x06, 0x1E, 0x1E, 0x78, 0x60, 0x00, + 0x42, 0x7E, 0x7E, 0x7E, 0x00, 0x00, + 0x0C, 0x06, 0x0C, 0x00, 0x00, 0x00, + 0x40, 0x40, 0x40, 0x40, 0x40, 0x00, + 0x02, 0x06, 0x06, 0x04, 0x00, 0x00, + 0x78, 0x24, 0x7C, 0x7C, 0x78, 0x00, + 0x7C, 0x7C, 0x7C, 0x48, 0x20, 0x00, + 0x18, 0x7C, 0x7C, 0x7C, 0x4C, 0x00, + 0x20, 0x48, 0x7C, 0x7C, 0x7C, 0x00, + 0x18, 0x7C, 0x7C, 0x74, 0x4C, 0x00, + 0x78, 0x7C, 0x7C, 0x24, 0x00, 0x00, + 0x18, 0x7C, 0x7C, 0x44, 0x74, 0x00, + 0x7C, 0x7C, 0x7C, 0x08, 0x60, 0x00, + 0x7C, 0x7C, 0x7C, 0x00, 0x00, 0x00, + 0x40, 0x7C, 0x7C, 0x7C, 0x00, 0x00, + 0x7C, 0x7C, 0x7C, 0x20, 0x48, 0x00, + 0x7C, 0x7C, 0x7C, 0x40, 0x00, 0x00, + 0x7C, 0x3C, 0x3C, 0x78, 0x3C, 0x3C, + 0x7C, 0x7C, 0x7C, 0x04, 0x78, 0x00, + 0x18, 0x18, 0x7C, 0x44, 0x7C, 0x7C, + 0x7C, 0x7C, 0x7C, 0x24, 0x08, 0x00, + 0x18, 0x18, 0x7C, 0x44, 0x7C, 0x7C, + 0x7C, 0x7C, 0x7C, 0x04, 0x00, 0x00, + 0x5C, 0x7C, 0x7C, 0x74, 0x00, 0x00, + 0x08, 0x7C, 0x7C, 0x7C, 0x48, 0x00, + 0x7C, 0x60, 0x7C, 0x7C, 0x7C, 0x00, + 0x3C, 0x60, 0x7C, 0x7C, 0x3C, 0x00, + 0x7C, 0x78, 0x78, 0x3C, 0x78, 0x78, + 0x4C, 0x3C, 0x3C, 0x78, 0x64, 0x00, + 0x4C, 0x4C, 0x4C, 0x78, 0x3C, 0x00, + 0x5C, 0x74, 0x44, 0x5C, 0x74, 0x00, + 0x24, 0x7E, 0x42, 0x42, 0x00, 0x00, + 0x7E, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x42, 0x7E, 0x24, 0x00, 0x00, 0x00, + 0x04, 0x06, 0x06, 0x02, 0x04, 0x06, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +# elif defined(OLED_FONT_EIN) + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x5F, 0x00, 0x00, 0x00, + 0x00, 0x07, 0x00, 0x07, 0x00, 0x00, + 0x14, 0x7F, 0x14, 0x7F, 0x14, 0x00, + 0x24, 0x2A, 0x7F, 0x2A, 0x12, 0x00, + 0x23, 0x13, 0x08, 0x64, 0x62, 0x00, + 0x36, 0x49, 0x56, 0x20, 0x50, 0x00, + 0x00, 0x08, 0x07, 0x03, 0x00, 0x00, + 0x00, 0x1C, 0x22, 0x41, 0x00, 0x00, + 0x00, 0x41, 0x22, 0x1C, 0x00, 0x00, + 0x2A, 0x1C, 0x7F, 0x1C, 0x2A, 0x00, + 0x08, 0x08, 0x3E, 0x08, 0x08, 0x00, + 0x00, 0x80, 0x70, 0x30, 0x00, 0x00, + 0x08, 0x08, 0x08, 0x08, 0x08, 0x00, + 0x00, 0x00, 0x60, 0x60, 0x00, 0x00, + 0x20, 0x10, 0x08, 0x04, 0x02, 0x00, + 0x3E, 0x51, 0x49, 0x45, 0x3E, 0x00, + 0x00, 0x42, 0x7F, 0x40, 0x00, 0x00, + 0x72, 0x49, 0x49, 0x49, 0x46, 0x00, + 0x21, 0x41, 0x49, 0x4D, 0x33, 0x00, + 0x18, 0x14, 0x12, 0x7F, 0x10, 0x00, + 0x27, 0x45, 0x45, 0x45, 0x39, 0x00, + 0x3C, 0x4A, 0x49, 0x49, 0x31, 0x00, + 0x41, 0x21, 0x11, 0x09, 0x07, 0x00, + 0x36, 0x49, 0x49, 0x49, 0x36, 0x00, + 0x46, 0x49, 0x49, 0x29, 0x1E, 0x00, + 0x00, 0x00, 0x14, 0x00, 0x00, 0x00, + 0x00, 0x40, 0x34, 0x00, 0x00, 0x00, + 0x00, 0x08, 0x14, 0x22, 0x41, 0x00, + 0x14, 0x14, 0x14, 0x14, 0x14, 0x00, + 0x00, 0x41, 0x22, 0x14, 0x08, 0x00, + 0x02, 0x01, 0x59, 0x09, 0x06, 0x00, + 0x00, 0x41, 0x5D, 0x59, 0x4E, 0x00, + 0x7C, 0x12, 0x11, 0x12, 0x7C, 0x00, + 0x7F, 0x49, 0x49, 0x49, 0x36, 0x00, + 0x3E, 0x41, 0x41, 0x41, 0x22, 0x00, + 0x7F, 0x41, 0x41, 0x41, 0x3E, 0x00, + 0x7F, 0x49, 0x49, 0x49, 0x41, 0x00, + 0x7F, 0x09, 0x09, 0x09, 0x01, 0x00, + 0x3E, 0x41, 0x41, 0x51, 0x73, 0x00, + 0x7F, 0x08, 0x08, 0x08, 0x7F, 0x00, + 0x00, 0x00, 0x7F, 0x00, 0x00, 0x00, + 0x20, 0x40, 0x40, 0x3F, 0x00, 0x00, + 0x7F, 0x08, 0x14, 0x22, 0x41, 0x00, + 0x7F, 0x40, 0x40, 0x40, 0x40, 0x00, + 0x7F, 0x02, 0x1C, 0x02, 0x7F, 0x00, + 0x7F, 0x04, 0x08, 0x10, 0x7F, 0x00, + 0x3E, 0x41, 0x41, 0x41, 0x3E, 0x00, + 0x7F, 0x09, 0x09, 0x09, 0x06, 0x00, + 0x3E, 0x41, 0x51, 0x21, 0x5E, 0x00, + 0x7F, 0x09, 0x19, 0x29, 0x46, 0x00, + 0x26, 0x49, 0x49, 0x49, 0x32, 0x00, + 0x01, 0x01, 0x7F, 0x01, 0x01, 0x00, + 0x3F, 0x40, 0x40, 0x40, 0x3F, 0x00, + 0x1F, 0x20, 0x40, 0x20, 0x1F, 0x00, + 0x3F, 0x40, 0x38, 0x40, 0x3F, 0x00, + 0x63, 0x14, 0x08, 0x14, 0x63, 0x00, + 0x03, 0x04, 0x78, 0x04, 0x03, 0x00, + 0x61, 0x59, 0x49, 0x4D, 0x43, 0x00, + 0x00, 0x7F, 0x41, 0x41, 0x41, 0x00, + 0x02, 0x04, 0x08, 0x10, 0x20, 0x00, + 0x00, 0x41, 0x41, 0x41, 0x7F, 0x00, + 0x04, 0x02, 0x01, 0x02, 0x04, 0x00, + 0x40, 0x40, 0x40, 0x40, 0x40, 0x00, + 0x00, 0x03, 0x07, 0x08, 0x00, 0x00, + 0x78, 0x14, 0x14, 0x78, 0x00, 0x00, + 0x7C, 0x54, 0x54, 0x28, 0x00, 0x00, + 0x38, 0x44, 0x44, 0x28, 0x00, 0x00, + 0x7C, 0x44, 0x44, 0x38, 0x00, 0x00, + 0x7C, 0x54, 0x54, 0x44, 0x00, 0x00, + 0x7C, 0x14, 0x14, 0x04, 0x00, 0x00, + 0x38, 0x44, 0x54, 0x34, 0x00, 0x00, + 0x7C, 0x10, 0x10, 0x7C, 0x00, 0x00, + 0x00, 0x7C, 0x00, 0x00, 0x00, 0x00, + 0x20, 0x40, 0x40, 0x3C, 0x00, 0x00, + 0x7C, 0x10, 0x28, 0x44, 0x00, 0x00, + 0x7C, 0x40, 0x40, 0x40, 0x00, 0x00, + 0x7C, 0x08, 0x70, 0x08, 0x7C, 0x00, + 0x7C, 0x08, 0x10, 0x7C, 0x00, 0x00, + 0x38, 0x44, 0x44, 0x38, 0x00, 0x00, + 0x7C, 0x14, 0x14, 0x08, 0x00, 0x00, + 0x38, 0x44, 0x24, 0x58, 0x00, 0x00, + 0x7C, 0x14, 0x34, 0x48, 0x00, 0x00, + 0x48, 0x54, 0x54, 0x24, 0x00, 0x00, + 0x04, 0x7C, 0x04, 0x00, 0x00, 0x00, + 0x3C, 0x40, 0x40, 0x3C, 0x00, 0x00, + 0x3C, 0x40, 0x20, 0x1C, 0x00, 0x00, + 0x3C, 0x40, 0x30, 0x40, 0x3C, 0x00, + 0x44, 0x28, 0x10, 0x28, 0x44, 0x00, + 0x0C, 0x10, 0x70, 0x10, 0x0C, 0x00, + 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, +# elif defined(OLED_FONT_HISKYF21) + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x5C, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x0C, 0x00, 0x0C, 0x00, 0x00, 0x00, + 0x28, 0x7C, 0x28, 0x7C, 0x28, 0x00, + 0x48, 0x54, 0x54, 0xFE, 0x54, 0x54, + 0x44, 0x20, 0x10, 0x08, 0x44, 0x00, + 0x28, 0x54, 0x54, 0x54, 0x74, 0x10, + 0x0C, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x78, 0x84, 0x00, 0x00, 0x00, 0x00, + 0x84, 0x78, 0x00, 0x00, 0x00, 0x00, + 0x48, 0x30, 0x30, 0x48, 0x00, 0x00, + 0x10, 0x38, 0x10, 0x00, 0x00, 0x00, + 0xC0, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x10, 0x10, 0x10, 0x10, 0x00, 0x00, + 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x60, 0x10, 0x0C, 0x00, 0x00, 0x00, + 0x38, 0x44, 0x44, 0x44, 0x44, 0x38, + 0x08, 0x7C, 0x00, 0x00, 0x00, 0x00, + 0x64, 0x54, 0x54, 0x54, 0x48, 0x00, + 0x44, 0x54, 0x54, 0x54, 0x28, 0x00, + 0x1C, 0x10, 0x10, 0x10, 0x7C, 0x00, + 0x4C, 0x54, 0x54, 0x54, 0x24, 0x00, + 0x38, 0x54, 0x54, 0x54, 0x54, 0x20, + 0x44, 0x24, 0x14, 0x0C, 0x00, 0x00, + 0x28, 0x54, 0x54, 0x54, 0x54, 0x28, + 0x08, 0x54, 0x54, 0x54, 0x54, 0x38, + 0x48, 0x00, 0x00, 0x00, 0x00, 0x00, + 0xC8, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x10, 0x28, 0x44, 0x00, 0x00, 0x00, + 0x28, 0x28, 0x28, 0x28, 0x00, 0x00, + 0x44, 0x28, 0x10, 0x00, 0x00, 0x00, + 0x04, 0x54, 0x14, 0x14, 0x08, 0x00, + 0x38, 0x44, 0x5C, 0x54, 0x48, 0x00, + 0x60, 0x18, 0x14, 0x14, 0x18, 0x60, + 0x7C, 0x54, 0x54, 0x54, 0x58, 0x30, + 0x38, 0x44, 0x44, 0x44, 0x40, 0x00, + 0x7C, 0x44, 0x44, 0x44, 0x38, 0x00, + 0x7C, 0x54, 0x54, 0x54, 0x54, 0x40, + 0x7C, 0x14, 0x14, 0x14, 0x10, 0x00, + 0x38, 0x44, 0x44, 0x44, 0x70, 0x10, + 0x7C, 0x10, 0x10, 0x10, 0x10, 0x7C, + 0x7C, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x20, 0x40, 0x40, 0x40, 0x40, 0x3C, + 0x7C, 0x10, 0x10, 0x28, 0x44, 0x00, + 0x7C, 0x40, 0x40, 0x40, 0x00, 0x00, + 0x7C, 0x08, 0x10, 0x60, 0x10, 0x08, + 0x7C, 0x08, 0x10, 0x20, 0x7C, 0x00, + 0x38, 0x44, 0x44, 0x44, 0x44, 0x38, + 0x7C, 0x24, 0x24, 0x24, 0x18, 0x00, + 0x38, 0x44, 0x64, 0x44, 0x38, 0x00, + 0x7C, 0x14, 0x14, 0x14, 0x68, 0x00, + 0x48, 0x54, 0x54, 0x54, 0x54, 0x20, + 0x04, 0x04, 0x7C, 0x04, 0x04, 0x00, + 0x3C, 0x40, 0x40, 0x40, 0x3C, 0x00, + 0x0C, 0x30, 0x40, 0x30, 0x0C, 0x00, + 0x0C, 0x30, 0x40, 0x20, 0x1C, 0x20, + 0x74, 0x2C, 0x10, 0x28, 0x44, 0x00, + 0x04, 0x08, 0x70, 0x08, 0x04, 0x00, + 0x44, 0x64, 0x54, 0x4C, 0x44, 0x00, + 0xFC, 0x84, 0x00, 0x00, 0x00, 0x00, + 0x0C, 0x10, 0x60, 0x00, 0x00, 0x00, + 0x84, 0xFC, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x7F, 0x41, 0x7F, 0x00, 0x00, + 0x40, 0x40, 0x40, 0x40, 0x00, 0x00, + 0x00, 0x7F, 0x41, 0x7F, 0x00, 0x00, + 0x60, 0x18, 0x14, 0x14, 0x18, 0x60, + 0x7C, 0x54, 0x54, 0x54, 0x58, 0x30, + 0x38, 0x44, 0x44, 0x44, 0x40, 0x00, + 0x7C, 0x44, 0x44, 0x44, 0x38, 0x00, + 0x7C, 0x54, 0x54, 0x54, 0x54, 0x40, + 0x7C, 0x14, 0x14, 0x14, 0x10, 0x00, + 0x38, 0x44, 0x44, 0x44, 0x70, 0x10, + 0x7C, 0x10, 0x10, 0x10, 0x10, 0x7C, + 0x7C, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x20, 0x40, 0x40, 0x40, 0x40, 0x3C, + 0x7C, 0x10, 0x10, 0x28, 0x44, 0x00, + 0x7C, 0x40, 0x40, 0x40, 0x00, 0x00, + 0x7C, 0x08, 0x10, 0x60, 0x10, 0x08, + 0x7C, 0x08, 0x10, 0x20, 0x7C, 0x00, + 0x38, 0x44, 0x44, 0x44, 0x44, 0x38, + 0x7C, 0x24, 0x24, 0x24, 0x18, 0x00, + 0x38, 0x44, 0x64, 0x44, 0x38, 0x00, + 0x7C, 0x14, 0x14, 0x14, 0x68, 0x00, + 0x48, 0x54, 0x54, 0x54, 0x54, 0x20, + 0x04, 0x04, 0x7C, 0x04, 0x04, 0x00, + 0x3C, 0x40, 0x40, 0x40, 0x3C, 0x00, + 0x0C, 0x30, 0x40, 0x30, 0x0C, 0x00, + 0x0C, 0x30, 0x40, 0x20, 0x1C, 0x20, + 0x74, 0x2C, 0x10, 0x28, 0x44, 0x00, + 0x04, 0x08, 0x70, 0x08, 0x04, 0x00, + 0x44, 0x64, 0x54, 0x4C, 0x44, 0x00, + 0x00, 0x7F, 0x41, 0x7F, 0x00, 0x00, + 0xFC, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x7F, 0x41, 0x7F, 0x00, 0x00, + 0x00, 0x7F, 0x41, 0x7F, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +# elif defined(OLED_FONT_SUPER_DIGG) + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x58, 0x5C, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x01, 0x00, 0x00, 0x01, 0x00, + 0x14, 0x7F, 0x14, 0x7F, 0x14, 0x00, + 0x5C, 0xFE, 0x54, 0xFE, 0x74, 0x00, + 0x03, 0x63, 0x38, 0x0C, 0x63, 0x60, + 0x70, 0x5C, 0x54, 0x74, 0x7C, 0x50, + 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, + 0x70, 0x7C, 0x44, 0x00, 0x00, 0x00, + 0x44, 0x7C, 0x70, 0x00, 0x00, 0x00, + 0x2A, 0x1C, 0x7F, 0x1C, 0x2A, 0x00, + 0x10, 0x10, 0x70, 0x7C, 0x10, 0x00, + 0x40, 0xC0, 0x00, 0x00, 0x00, 0x00, + 0x10, 0x10, 0x10, 0x10, 0x00, 0x00, + 0x40, 0x40, 0x00, 0x00, 0x00, 0x00, + 0x70, 0x7C, 0x03, 0x00, 0x00, 0x00, + 0x7C, 0x44, 0x44, 0x44, 0x7C, 0x1C, + 0x04, 0x04, 0x7C, 0x1C, 0x00, 0x00, + 0x74, 0x74, 0x54, 0x54, 0x5C, 0x00, + 0x44, 0x54, 0x54, 0x54, 0x7C, 0x70, + 0x1C, 0x10, 0x10, 0x7C, 0x7C, 0x00, + 0x5C, 0x5C, 0x54, 0x54, 0x74, 0x00, + 0x70, 0x7C, 0x54, 0x54, 0x74, 0x00, + 0x04, 0x14, 0x14, 0x14, 0x7C, 0x70, + 0x70, 0x5C, 0x54, 0x74, 0x7C, 0x00, + 0x5C, 0x54, 0x54, 0x54, 0x7C, 0x1C, + 0x50, 0x50, 0x00, 0x00, 0x00, 0x00, + 0x50, 0xD0, 0x00, 0x00, 0x00, 0x00, + 0x18, 0x18, 0x24, 0x42, 0x00, 0x00, + 0x28, 0x28, 0x28, 0x28, 0x00, 0x00, + 0x42, 0x24, 0x18, 0x18, 0x00, 0x00, + 0x04, 0x14, 0x54, 0x54, 0x1C, 0x1C, + 0xF8, 0x04, 0x74, 0x74, 0x54, 0x54, + 0x70, 0x7C, 0x14, 0x14, 0x3C, 0x00, + 0x7C, 0x74, 0x54, 0x54, 0x7C, 0x00, + 0x70, 0x7C, 0x44, 0x44, 0x44, 0x44, + 0x70, 0x7C, 0x44, 0x44, 0x48, 0x70, + 0x70, 0x7C, 0x54, 0x54, 0x54, 0x44, + 0x70, 0x7C, 0x14, 0x14, 0x14, 0x04, + 0x70, 0x7C, 0x44, 0x44, 0x54, 0x74, + 0x70, 0x7C, 0x10, 0x10, 0x7C, 0x00, + 0x70, 0x7C, 0x00, 0x00, 0x00, 0x00, + 0x60, 0x40, 0x40, 0x40, 0x7C, 0x70, + 0x7C, 0x70, 0x10, 0x1C, 0x70, 0x00, + 0x70, 0x7C, 0x40, 0x40, 0x40, 0x60, + 0x70, 0x7C, 0x04, 0x04, 0x7C, 0x04, + 0x70, 0x7C, 0x04, 0x04, 0x04, 0x7C, + 0x70, 0x7C, 0x44, 0x44, 0x44, 0x7C, + 0x70, 0x7C, 0x24, 0x24, 0x3C, 0x00, + 0x7C, 0x44, 0x44, 0x44, 0x7C, 0x00, + 0x7C, 0x74, 0x14, 0x14, 0x3C, 0x00, + 0x5C, 0x5C, 0x54, 0x54, 0x74, 0x00, + 0x04, 0x04, 0x7C, 0x74, 0x04, 0x00, + 0x70, 0x7C, 0x40, 0x40, 0x40, 0x7C, + 0x70, 0x7C, 0x40, 0x40, 0x20, 0x1C, + 0x70, 0x7C, 0x40, 0x40, 0x7C, 0x40, + 0x70, 0x7C, 0x10, 0x10, 0x3C, 0x00, + 0x1C, 0x10, 0x70, 0x70, 0x1C, 0x00, + 0x74, 0x74, 0x54, 0x54, 0x5C, 0x00, + 0xF0, 0xFE, 0x82, 0x00, 0x00, 0x00, + 0x03, 0x7C, 0x70, 0x00, 0x00, 0x00, + 0x82, 0xFE, 0xF0, 0x00, 0x00, 0x00, + 0x04, 0x02, 0x01, 0x06, 0x04, 0x00, + 0x40, 0x40, 0x40, 0x40, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x70, 0x7C, 0x14, 0x14, 0x3C, 0x00, + 0x7C, 0x74, 0x54, 0x54, 0x7C, 0x00, + 0x70, 0x7C, 0x44, 0x44, 0x44, 0x44, + 0x70, 0x7C, 0x44, 0x44, 0x48, 0x70, + 0x70, 0x7C, 0x54, 0x54, 0x54, 0x44, + 0x70, 0x7C, 0x14, 0x14, 0x14, 0x04, + 0x70, 0x7C, 0x44, 0x44, 0x54, 0x74, + 0x70, 0x7C, 0x10, 0x10, 0x7C, 0x00, + 0x70, 0x7C, 0x00, 0x00, 0x00, 0x00, + 0x60, 0x40, 0x40, 0x40, 0x7C, 0x70, + 0x7C, 0x70, 0x10, 0x1C, 0x70, 0x00, + 0x70, 0x7C, 0x40, 0x40, 0x40, 0x60, + 0x70, 0x7C, 0x04, 0x04, 0x7C, 0x04, + 0x70, 0x7C, 0x04, 0x04, 0x04, 0x7C, + 0x70, 0x7C, 0x44, 0x44, 0x44, 0x7C, + 0x70, 0x7C, 0x24, 0x24, 0x3C, 0x00, + 0x7C, 0x44, 0x44, 0x44, 0x7C, 0x00, + 0x7C, 0x74, 0x14, 0x14, 0x3C, 0x00, + 0x5C, 0x5C, 0x54, 0x54, 0x74, 0x00, + 0x04, 0x04, 0x7C, 0x74, 0x04, 0x00, + 0x70, 0x7C, 0x40, 0x40, 0x40, 0x7C, + 0x70, 0x7C, 0x40, 0x40, 0x20, 0x1C, + 0x70, 0x7C, 0x40, 0x40, 0x7C, 0x40, + 0x70, 0x7C, 0x10, 0x10, 0x3C, 0x00, + 0x1C, 0x10, 0x70, 0x70, 0x1C, 0x00, + 0x74, 0x74, 0x54, 0x54, 0x5C, 0x00, + 0x10, 0xFE, 0xC2, 0x00, 0x00, 0x00, + 0x00, 0x44, 0x77, 0x00, 0x00, 0x00, + 0xC2, 0xFE, 0x10, 0x00, 0x00, 0x00, + 0x02, 0x01, 0x03, 0x04, 0x06, 0x02, + 0x3C, 0x22, 0x21, 0x22, 0x3C, 0x00, +#elif defined (OLED_FONT_ZXPIX) + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x2F, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x03, 0x00, 0x03, 0x00, 0x00, 0x00, + 0x12, 0x3F, 0x12, 0x12, 0x3F, 0x12, + 0x2E, 0x2A, 0x7F, 0x2A, 0x3A, 0x00, + 0x23, 0x13, 0x08, 0x04, 0x32, 0x31, + 0x10, 0x2A, 0x25, 0x2A, 0x10, 0x20, + 0x02, 0x01, 0x00, 0x00, 0x00, 0x00, + 0x1E, 0x21, 0x00, 0x00, 0x00, 0x00, + 0x21, 0x1E, 0x00, 0x00, 0x00, 0x00, + 0x08, 0x2A, 0x1C, 0x2A, 0x08, 0x08, + 0x08, 0x08, 0x3E, 0x08, 0x08, 0x08, + 0x80, 0x60, 0x00, 0x00, 0x00, 0x00, + 0x08, 0x08, 0x08, 0x08, 0x08, 0x00, + 0x30, 0x30, 0x00, 0x00, 0x00, 0x00, + 0x20, 0x10, 0x08, 0x04, 0x02, 0x00, + 0x1E, 0x31, 0x29, 0x25, 0x23, 0x1E, + 0x22, 0x21, 0x3F, 0x20, 0x20, 0x20, + 0x32, 0x29, 0x29, 0x29, 0x29, 0x26, + 0x12, 0x21, 0x21, 0x25, 0x25, 0x1A, + 0x18, 0x14, 0x12, 0x3F, 0x10, 0x10, + 0x17, 0x25, 0x25, 0x25, 0x25, 0x19, + 0x1E, 0x25, 0x25, 0x25, 0x25, 0x18, + 0x01, 0x01, 0x31, 0x09, 0x05, 0x03, + 0x1A, 0x25, 0x25, 0x25, 0x25, 0x1A, + 0x06, 0x29, 0x29, 0x29, 0x29, 0x1E, + 0x24, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x80, 0x64, 0x00, 0x00, 0x00, 0x00, + 0x08, 0x14, 0x22, 0x00, 0x00, 0x00, + 0x14, 0x14, 0x14, 0x14, 0x14, 0x00, + 0x22, 0x14, 0x08, 0x00, 0x00, 0x00, + 0x02, 0x01, 0x01, 0x29, 0x05, 0x02, + 0x1E, 0x21, 0x2D, 0x2B, 0x2D, 0x0E, + 0x3E, 0x09, 0x09, 0x09, 0x09, 0x3E, + 0x3F, 0x25, 0x25, 0x25, 0x25, 0x1A, + 0x1E, 0x21, 0x21, 0x21, 0x21, 0x12, + 0x3F, 0x21, 0x21, 0x21, 0x12, 0x0C, + 0x3F, 0x25, 0x25, 0x25, 0x25, 0x21, + 0x3F, 0x05, 0x05, 0x05, 0x05, 0x01, + 0x1E, 0x21, 0x21, 0x21, 0x29, 0x1A, + 0x3F, 0x04, 0x04, 0x04, 0x04, 0x3F, + 0x21, 0x21, 0x3F, 0x21, 0x21, 0x21, + 0x10, 0x20, 0x20, 0x20, 0x20, 0x1F, + 0x3F, 0x04, 0x0C, 0x0A, 0x11, 0x20, + 0x3F, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x3F, 0x02, 0x04, 0x04, 0x02, 0x3F, + 0x3F, 0x02, 0x04, 0x08, 0x10, 0x3F, + 0x1E, 0x21, 0x21, 0x21, 0x21, 0x1E, + 0x3F, 0x09, 0x09, 0x09, 0x09, 0x06, + 0x1E, 0x21, 0x29, 0x31, 0x21, 0x1E, + 0x3F, 0x09, 0x09, 0x09, 0x19, 0x26, + 0x12, 0x25, 0x25, 0x25, 0x25, 0x18, + 0x01, 0x01, 0x01, 0x3F, 0x01, 0x01, + 0x1F, 0x20, 0x20, 0x20, 0x20, 0x1F, + 0x0F, 0x10, 0x20, 0x20, 0x10, 0x0F, + 0x1F, 0x20, 0x10, 0x10, 0x20, 0x1F, + 0x21, 0x12, 0x0C, 0x0C, 0x12, 0x21, + 0x01, 0x02, 0x0C, 0x38, 0x04, 0x02, + 0x21, 0x31, 0x29, 0x25, 0x23, 0x21, + 0x3F, 0x21, 0x00, 0x00, 0x00, 0x00, + 0x02, 0x04, 0x08, 0x10, 0x20, 0x00, + 0x21, 0x3F, 0x00, 0x00, 0x00, 0x00, + 0x04, 0x02, 0x3F, 0x02, 0x04, 0x00, + 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, + 0x01, 0x02, 0x00, 0x00, 0x00, 0x00, + 0x10, 0x30, 0x2A, 0x2A, 0x3C, 0x00, + 0x3F, 0x24, 0x24, 0x24, 0x18, 0x00, + 0x0C, 0x14, 0x22, 0x22, 0x00, 0x00, + 0x18, 0x24, 0x24, 0x24, 0x3F, 0x00, + 0x1C, 0x2C, 0x2A, 0x2A, 0x24, 0x00, + 0x3E, 0x05, 0x01, 0x00, 0x00, 0x00, + 0x18, 0x28, 0xA4, 0xA4, 0x7C, 0x00, + 0x3F, 0x04, 0x04, 0x0C, 0x30, 0x00, + 0x24, 0x3D, 0x20, 0x00, 0x00, 0x00, + 0x20, 0x40, 0x40, 0x3D, 0x00, 0x00, + 0x3F, 0x0C, 0x12, 0x20, 0x00, 0x00, + 0x1F, 0x20, 0x20, 0x00, 0x00, 0x00, + 0x3E, 0x02, 0x3C, 0x02, 0x3C, 0x00, + 0x3E, 0x02, 0x02, 0x02, 0x3C, 0x00, + 0x0C, 0x14, 0x22, 0x32, 0x0C, 0x00, + 0xFC, 0x24, 0x24, 0x24, 0x18, 0x00, + 0x18, 0x24, 0x24, 0x24, 0xFC, 0x80, + 0x3C, 0x04, 0x02, 0x02, 0x00, 0x00, + 0x24, 0x2C, 0x2A, 0x2A, 0x10, 0x00, + 0x02, 0x1F, 0x22, 0x20, 0x00, 0x00, + 0x1E, 0x20, 0x20, 0x20, 0x1E, 0x00, + 0x06, 0x18, 0x20, 0x18, 0x06, 0x00, + 0x1E, 0x30, 0x1C, 0x30, 0x0E, 0x00, + 0x22, 0x14, 0x08, 0x14, 0x22, 0x00, + 0x0C, 0x10, 0xA0, 0xA0, 0x7C, 0x00, + 0x22, 0x32, 0x2A, 0x26, 0x22, 0x22, + 0x0C, 0x3F, 0x21, 0x00, 0x00, 0x00, + 0x3F, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x21, 0x3F, 0x0C, 0x00, 0x00, 0x00, + 0x02, 0x01, 0x02, 0x01, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +# else // default font + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x5F, 0x00, 0x00, 0x00, + 0x00, 0x07, 0x00, 0x07, 0x00, 0x00, + 0x14, 0x7F, 0x14, 0x7F, 0x14, 0x00, + 0x24, 0x2A, 0x7F, 0x2A, 0x12, 0x00, + 0x23, 0x13, 0x08, 0x64, 0x62, 0x00, + 0x36, 0x49, 0x56, 0x20, 0x50, 0x00, + 0x00, 0x08, 0x07, 0x03, 0x00, 0x00, + 0x00, 0x1C, 0x22, 0x41, 0x00, 0x00, + 0x00, 0x41, 0x22, 0x1C, 0x00, 0x00, + 0x2A, 0x1C, 0x7F, 0x1C, 0x2A, 0x00, + 0x08, 0x08, 0x3E, 0x08, 0x08, 0x00, + 0x00, 0x80, 0x70, 0x30, 0x00, 0x00, + 0x08, 0x08, 0x08, 0x08, 0x08, 0x00, + 0x00, 0x00, 0x60, 0x60, 0x00, 0x00, + 0x20, 0x10, 0x08, 0x04, 0x02, 0x00, + 0x3E, 0x51, 0x49, 0x45, 0x3E, 0x00, + 0x00, 0x42, 0x7F, 0x40, 0x00, 0x00, + 0x72, 0x49, 0x49, 0x49, 0x46, 0x00, + 0x21, 0x41, 0x49, 0x4D, 0x33, 0x00, + 0x18, 0x14, 0x12, 0x7F, 0x10, 0x00, + 0x27, 0x45, 0x45, 0x45, 0x39, 0x00, + 0x3C, 0x4A, 0x49, 0x49, 0x31, 0x00, + 0x41, 0x21, 0x11, 0x09, 0x07, 0x00, + 0x36, 0x49, 0x49, 0x49, 0x36, 0x00, + 0x46, 0x49, 0x49, 0x29, 0x1E, 0x00, + 0x00, 0x00, 0x14, 0x00, 0x00, 0x00, + 0x00, 0x40, 0x34, 0x00, 0x00, 0x00, + 0x00, 0x08, 0x14, 0x22, 0x41, 0x00, + 0x14, 0x14, 0x14, 0x14, 0x14, 0x00, + 0x00, 0x41, 0x22, 0x14, 0x08, 0x00, + 0x02, 0x01, 0x59, 0x09, 0x06, 0x00, + 0x3E, 0x41, 0x5D, 0x59, 0x4E, 0x00, + 0x7C, 0x12, 0x11, 0x12, 0x7C, 0x00, + 0x7F, 0x49, 0x49, 0x49, 0x36, 0x00, + 0x3E, 0x41, 0x41, 0x41, 0x22, 0x00, + 0x7F, 0x41, 0x41, 0x41, 0x3E, 0x00, + 0x7F, 0x49, 0x49, 0x49, 0x41, 0x00, + 0x7F, 0x09, 0x09, 0x09, 0x01, 0x00, + 0x3E, 0x41, 0x41, 0x51, 0x73, 0x00, + 0x7F, 0x08, 0x08, 0x08, 0x7F, 0x00, + 0x00, 0x41, 0x7F, 0x41, 0x00, 0x00, + 0x20, 0x40, 0x41, 0x3F, 0x01, 0x00, + 0x7F, 0x08, 0x14, 0x22, 0x41, 0x00, + 0x7F, 0x40, 0x40, 0x40, 0x40, 0x00, + 0x7F, 0x02, 0x1C, 0x02, 0x7F, 0x00, + 0x7F, 0x04, 0x08, 0x10, 0x7F, 0x00, + 0x3E, 0x41, 0x41, 0x41, 0x3E, 0x00, + 0x7F, 0x09, 0x09, 0x09, 0x06, 0x00, + 0x3E, 0x41, 0x51, 0x21, 0x5E, 0x00, + 0x7F, 0x09, 0x19, 0x29, 0x46, 0x00, + 0x26, 0x49, 0x49, 0x49, 0x32, 0x00, + 0x03, 0x01, 0x7F, 0x01, 0x03, 0x00, + 0x3F, 0x40, 0x40, 0x40, 0x3F, 0x00, + 0x1F, 0x20, 0x40, 0x20, 0x1F, 0x00, + 0x3F, 0x40, 0x38, 0x40, 0x3F, 0x00, + 0x63, 0x14, 0x08, 0x14, 0x63, 0x00, + 0x03, 0x04, 0x78, 0x04, 0x03, 0x00, + 0x61, 0x59, 0x49, 0x4D, 0x43, 0x00, + 0x00, 0x7F, 0x41, 0x41, 0x41, 0x00, + 0x02, 0x04, 0x08, 0x10, 0x20, 0x00, + 0x00, 0x41, 0x41, 0x41, 0x7F, 0x00, + 0x04, 0x02, 0x01, 0x02, 0x04, 0x00, + 0x40, 0x40, 0x40, 0x40, 0x40, 0x00, + 0x00, 0x03, 0x07, 0x08, 0x00, 0x00, + 0x20, 0x54, 0x54, 0x78, 0x40, 0x00, + 0x7F, 0x28, 0x44, 0x44, 0x38, 0x00, + 0x38, 0x44, 0x44, 0x44, 0x28, 0x00, + 0x38, 0x44, 0x44, 0x28, 0x7F, 0x00, + 0x38, 0x54, 0x54, 0x54, 0x18, 0x00, + 0x00, 0x08, 0x7E, 0x09, 0x02, 0x00, + 0x18, 0x24, 0x24, 0x1C, 0x78, 0x00, + 0x7F, 0x08, 0x04, 0x04, 0x78, 0x00, + 0x00, 0x44, 0x7D, 0x40, 0x00, 0x00, + 0x20, 0x40, 0x40, 0x3D, 0x00, 0x00, + 0x7F, 0x10, 0x28, 0x44, 0x00, 0x00, + 0x00, 0x41, 0x7F, 0x40, 0x00, 0x00, + 0x7C, 0x04, 0x78, 0x04, 0x78, 0x00, + 0x7C, 0x08, 0x04, 0x04, 0x78, 0x00, + 0x38, 0x44, 0x44, 0x44, 0x38, 0x00, + 0x7C, 0x18, 0x24, 0x24, 0x18, 0x00, + 0x18, 0x24, 0x24, 0x18, 0x7C, 0x00, + 0x7C, 0x08, 0x04, 0x04, 0x08, 0x00, + 0x48, 0x54, 0x54, 0x54, 0x24, 0x00, + 0x04, 0x04, 0x3F, 0x44, 0x24, 0x00, + 0x3C, 0x40, 0x40, 0x20, 0x7C, 0x00, + 0x1C, 0x20, 0x40, 0x20, 0x1C, 0x00, + 0x3C, 0x40, 0x30, 0x40, 0x3C, 0x00, + 0x44, 0x28, 0x10, 0x28, 0x44, 0x00, + 0x4C, 0x90, 0x90, 0x90, 0x7C, 0x00, + 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, +# endif + +// top Logo section +# if defined(OLED_LOGO_GMK_BAD) + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x80, 0xC0, 0xE0, 0xF0, 0xF0, 0x70, + 0x38, 0x38, 0x38, 0x78, 0x70, 0xF0, + 0xE0, 0xE0, 0x80, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x80, 0xF0, 0xF8, + 0xF8, 0xF8, 0xF8, 0x00, 0x00, 0x00, + 0x80, 0xE0, 0xF8, 0xF8, 0xF8, 0xF8, + 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x80, 0xF8, 0xF8, 0xF8, 0x38, 0x00, + 0x80, 0xE0, 0xF0, 0xF8, 0x78, 0x38, + 0x08, 0x08, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x80, 0xF8, 0xF8, 0xF8, 0x38, 0x38, + 0x38, 0xF8, 0xF0, 0xF0, 0xE0, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x80, 0xFC, 0xFC, + 0xFC, 0x1C, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +# elif defined(OLED_LOGO_HUE_MANITEE) + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x80, 0xC0, 0xC0, + 0x90, 0x70, 0xE8, 0xA8, 0xE4, 0xC4, + 0xC4, 0xA0, 0xE4, 0xB0, 0xDC, 0xE4, + 0xFC, 0xFC, 0xFC, 0xFC, 0x3C, 0x3C, + 0xFC, 0xF8, 0xF0, 0xF0, 0xE0, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0xF8, 0xF8, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0xF8, 0xF8, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +# elif defined(OLED_LOGO_CORNE) + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0xC0, 0xE0, + 0xF0, 0xF8, 0xF8, 0x18, 0x00, 0xC0, + 0xF0, 0xFC, 0xFE, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0x7E, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x80, 0xC0, 0xE0, 0xE0, + 0xE0, 0xE0, 0xE0, 0xE0, 0xE0, 0xE0, + 0xC0, 0x80, 0x00, 0x00, 0x00, 0x00, + 0x80, 0xC0, 0xE0, 0xE0, 0xE0, 0xE0, + 0xE0, 0xE0, 0xE0, 0xE0, 0xC0, 0x80, + 0x00, 0x00, 0x00, 0xE0, 0xE0, 0xC0, + 0xC0, 0xE0, 0xE0, 0xE0, 0xE0, 0x00, + 0x00, 0xE0, 0xE0, 0xC0, 0xC0, 0xE0, + 0xE0, 0xE0, 0xE0, 0xE0, 0xC0, 0x80, + 0x00, 0x00, 0x00, 0x00, 0x80, 0xC0, + 0xE0, 0xE0, 0xE0, 0xE0, 0xE0, 0xE0, + 0xE0, 0xE0, 0xC0, 0x80, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +# elif defined(OLED_LOGO_LOOSE) + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0xC0, 0xE0, 0xF0, 0xF8, + 0xF8, 0xF8, 0xF8, 0xF8, 0xF8, 0x00, + 0xFC, 0xFE, 0xFE, 0xFE, 0xFE, 0xFE, + 0x02, 0xF9, 0x01, 0x01, 0x05, 0x09, + 0x11, 0x22, 0x06, 0xFE, 0xFE, 0xFE, + 0xFE, 0xFE, 0xFE, 0xFE, 0x46, 0x46, + 0x44, 0x44, 0x45, 0x44, 0x29, 0x28, + 0x2A, 0x28, 0x11, 0x13, 0x05, 0x07, + 0x05, 0x07, 0x05, 0x07, 0x05, 0x07, + 0xE5, 0xE7, 0xE5, 0x07, 0x05, 0x07, + 0x05, 0x07, 0x05, 0x07, 0x05, 0x07, + 0x85, 0xC7, 0xE5, 0xE7, 0xE5, 0xE7, + 0xE5, 0xE7, 0xE5, 0xC7, 0x85, 0x07, + 0x85, 0xC7, 0xE5, 0xE7, 0xE5, 0xE7, + 0xE5, 0xE7, 0xE5, 0xC7, 0x85, 0x07, + 0x85, 0xC7, 0xE5, 0xE7, 0xE5, 0xE7, + 0xE5, 0xE7, 0xE5, 0xE7, 0xE5, 0x07, + 0xE5, 0xE7, 0xE5, 0xE7, 0xE5, 0xE7, + 0xE5, 0xE7, 0xE5, 0xE7, 0xE5, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +# elif defined(OLED_LOGO_SKEEB) + 0xC0, 0x20, 0x10, 0x08, 0x04, 0x02, + 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, + 0x01, 0x01, 0x03, 0x07, 0x0F, 0x1F, + 0x3F, 0x7F, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0x01, 0x01, + 0xFF, 0xFF, 0x01, 0x01, 0xFF, 0xFF, + 0x01, 0x01, 0xFF, 0xFF, 0x19, 0x19, + 0x99, 0x99, 0x99, 0x99, 0x99, 0x99, + 0x01, 0x01, 0xFF, 0xFF, 0x81, 0x81, + 0x99, 0x99, 0x99, 0x99, 0x99, 0x99, + 0x19, 0x19, 0xFF, 0xFF, 0xF9, 0xF9, + 0xF9, 0xF9, 0x01, 0x01, 0xF9, 0xF9, + 0xF9, 0xF9, 0xFF, 0xFF, 0x99, 0x99, + 0x99, 0x99, 0x99, 0x99, 0x99, 0x99, + 0xF9, 0xF9, 0xFF, 0xFF, 0x19, 0x19, + 0x99, 0x99, 0x99, 0x99, 0x99, 0x99, + 0x67, 0x67, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0x7F, 0x3F, + 0x1F, 0x0F, 0x07, 0x03, 0x01, 0x01, + 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, + 0x02, 0x04, 0x08, 0x10, 0x20, 0xC0, +# else + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x40, 0x40, 0x40, 0xF0, 0xF8, 0xF8, + 0xFF, 0x38, 0xFF, 0xF8, 0xF8, 0x3F, + 0xF8, 0xF8, 0xFF, 0x38, 0xFF, 0xF8, + 0xF8, 0xF0, 0x40, 0x40, 0x40, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, + 0xC0, 0xC0, 0xC0, 0x80, 0x00, 0x00, + 0xC0, 0xC0, 0x80, 0x00, 0x00, 0x00, + 0x80, 0xC0, 0xC0, 0x00, 0xC0, 0xC0, + 0x00, 0x00, 0x80, 0xC0, 0xC0, 0x00, + 0x00, 0x00, 0x00, 0x00, 0xC0, 0xC0, + 0xC0, 0xC0, 0xC0, 0x00, 0xC0, 0xC0, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +#endif + +// First icon section + 0xE0, 0xF0, 0xF0, 0xF0, 0xE0, 0xEC, + 0xEE, 0xF7, 0xF3, 0x70, 0x20, 0x00, + 0x7C, 0x7C, 0x7C, 0x7E, 0x00, 0x7E, + 0x7E, 0x7E, 0x7F, 0x7F, 0x7F, 0x00, + 0x00, 0x80, 0xC0, 0xE0, 0x7E, 0x5B, + 0x4F, 0x5B, 0xFE, 0xC0, 0x00, 0x00, + 0xC0, 0x00, 0xDC, 0xD7, 0xDE, 0xDE, + 0xDE, 0xD7, 0xDC, 0x00, 0xC0, 0x00, + 0x3E, 0x4A, 0x4F, 0x4A, 0x3E, 0x00, + 0x18, 0x3C, 0x7C, 0x3A, 0x7D, 0x24, + 0x14, 0x36, 0x00, 0x36, 0x77, 0x77, + +// middle logo section +# if defined(OLED_LOGO_GMK_BAD) + 0x00, 0x00, 0x00, 0x00, 0x00, 0x3C, + 0xFF, 0xFF, 0xFF, 0xC1, 0x80, 0x00, + 0x00, 0x38, 0x38, 0xB8, 0xB8, 0xF9, + 0xF9, 0xF8, 0x38, 0x00, 0x00, 0x00, + 0x00, 0xC0, 0xF8, 0xFF, 0xFF, 0x1F, + 0x01, 0x3F, 0xFF, 0xFF, 0xF0, 0xFE, + 0x7F, 0x0F, 0x03, 0xFF, 0xFF, 0xFF, + 0xFF, 0x00, 0x00, 0x00, 0x00, 0x80, + 0xFF, 0xFF, 0xFF, 0x3F, 0x1E, 0x7F, + 0xFF, 0xFF, 0xF3, 0xC1, 0x80, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, + 0xFF, 0xFF, 0xFF, 0x3F, 0x1C, 0x1C, + 0x9C, 0xFF, 0xFF, 0xF3, 0xE1, 0x00, + 0x00, 0x00, 0x00, 0xF0, 0xFC, 0xFE, + 0xFF, 0x0F, 0x07, 0x07, 0x8E, 0xFF, + 0xFF, 0xFF, 0x3F, 0x00, 0x00, 0x00, + 0x00, 0xF0, 0xFC, 0xFE, 0xFF, 0x8F, + 0x07, 0x07, 0x8E, 0xFF, 0xFF, 0xFF, + 0x3F, 0x00, 0x00, 0x00, 0x00, 0x80, + 0xC0, 0x80, 0x00, 0x00, 0x00, 0x00, +# elif defined(OLED_LOGO_HUE_MANITEE) + 0x00, 0x00, 0x00, 0x00, 0x00, 0xF0, + 0xFC, 0xF6, 0xF7, 0xEF, 0xFF, 0x87, + 0x1F, 0x1F, 0x1F, 0x1F, 0x1F, 0x1F, + 0x1F, 0x1F, 0x1F, 0xFF, 0xFF, 0xFF, + 0xFF, 0x07, 0x1F, 0x1F, 0x19, 0x15, + 0xF7, 0x16, 0x1A, 0x1B, 0x16, 0x07, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x0C, 0x0C, 0x33, 0x33, + 0x33, 0x33, 0x33, 0x33, 0xC0, 0xC0, + 0x00, 0x00, 0x03, 0x03, 0xFF, 0xFF, + 0x03, 0x03, 0x00, 0x00, 0xC0, 0xC0, + 0x00, 0x00, 0x00, 0xFC, 0xFC, 0x03, + 0x03, 0x03, 0x03, 0x03, 0x03, 0xFC, + 0xFC, 0x00, 0x00, 0x00, 0xFC, 0xFC, + 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, + 0xC0, 0xC0, 0x00, 0x00, 0x00, 0x00, + 0xFF, 0xFF, 0x30, 0x30, 0xCC, 0xCC, + 0x03, 0x03, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +# elif defined(OLED_LOGO_CORNE) + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0xF8, 0xFC, 0xFE, + 0xFF, 0xE0, 0x00, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0x80, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0x1F, 0x07, 0x01, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0xFF, 0xFF, 0xFF, 0x81, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x81, + 0xC3, 0xC3, 0xC3, 0x00, 0x00, 0xFF, + 0xFF, 0xFF, 0x81, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x81, 0xFF, 0xFF, + 0xFF, 0x00, 0x00, 0xFF, 0xFF, 0xFF, + 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0xFF, 0xFF, 0xFF, 0x01, 0x00, + 0x00, 0x00, 0x00, 0x01, 0xFF, 0xFF, + 0xFF, 0x00, 0x00, 0xFF, 0xFF, 0xFF, + 0x9D, 0x1C, 0x1C, 0x1C, 0x1C, 0x1C, + 0x1C, 0x9D, 0xDF, 0xDF, 0xDF, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +# elif defined(OLED_LOGO_LOOSE) + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xE3, 0xC1, 0xC1, 0x00, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0x00, 0xFF, 0x00, 0x00, 0x80, 0x00, + 0x1C, 0x3E, 0x7F, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0x22, 0x22, + 0x22, 0x22, 0x22, 0x22, 0x22, 0x22, + 0x22, 0x22, 0x22, 0x14, 0x14, 0x14, + 0x14, 0x14, 0x08, 0x08, 0x00, 0x00, + 0xFF, 0xFF, 0xFF, 0x80, 0x80, 0x80, + 0x80, 0x80, 0x80, 0x80, 0x80, 0x00, + 0xFF, 0xFF, 0xFF, 0xFF, 0x80, 0xBE, + 0x80, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, + 0xFF, 0xFF, 0xFF, 0xFF, 0x81, 0xBD, + 0x81, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, + 0x8F, 0x9F, 0x9C, 0x9C, 0x9C, 0x9C, + 0x9C, 0x9C, 0x9C, 0xFC, 0xF8, 0x00, + 0xFF, 0xFF, 0xFF, 0x9C, 0x9C, 0x9C, + 0x9C, 0x9C, 0x9C, 0x80, 0x80, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +# elif defined(OLED_LOGO_SKEEB) + 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x01, 0x03, 0x07, + 0x0F, 0x0F, 0x0F, 0x0F, 0x08, 0x08, + 0x0F, 0x0F, 0x0E, 0x0E, 0x0F, 0x0F, + 0x08, 0x08, 0x0F, 0x0F, 0x08, 0x08, + 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, + 0x08, 0x08, 0x0F, 0x0F, 0x09, 0x09, + 0x09, 0x09, 0xF9, 0xF9, 0x09, 0x09, + 0x08, 0x08, 0x0F, 0x0F, 0x0F, 0x0F, + 0x0F, 0x0F, 0x08, 0x08, 0x0F, 0x0F, + 0x0F, 0x0F, 0x0F, 0x0F, 0x09, 0x09, + 0x09, 0x09, 0x09, 0x09, 0x09, 0x09, + 0x09, 0x09, 0x0F, 0x0F, 0x08, 0x08, + 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, + 0x08, 0x08, 0x0F, 0x0F, 0x0F, 0x0F, + 0x07, 0x03, 0x01, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, +# else + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x49, 0x49, 0x49, 0xFF, 0xFF, 0xFF, + 0xFF, 0xE0, 0xDF, 0xBF, 0xBF, 0x00, + 0xBF, 0xBF, 0xDF, 0xE0, 0xFF, 0xFF, + 0xFF, 0xFF, 0x49, 0x49, 0x49, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x1F, 0x3F, + 0x60, 0x60, 0xE0, 0xBF, 0x1F, 0x00, + 0x7F, 0x7F, 0x07, 0x1E, 0x38, 0x1E, + 0x07, 0x7F, 0x7F, 0x00, 0x7F, 0x7F, + 0x0E, 0x1F, 0x3B, 0x71, 0x60, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x7F, 0x7F, + 0x0C, 0x0C, 0x0C, 0x00, 0x7E, 0x7E, + 0x00, 0x7F, 0x7E, 0x03, 0x03, 0x00, + 0x7F, 0x7E, 0x03, 0x03, 0x7E, 0x7E, + 0x03, 0x03, 0x7F, 0x7E, 0x00, 0x0F, + 0x3E, 0x70, 0x3C, 0x06, 0x3C, 0x70, + 0x3E, 0x0F, 0x00, 0x32, 0x7B, 0x49, + 0x49, 0x3F, 0x7E, 0x00, 0x7F, 0x7E, + 0x03, 0x03, 0x00, 0x1E, 0x3F, 0x69, + 0x69, 0x6F, 0x26, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +# endif + +// second icon section + 0x0F, 0x1F, 0x3F, 0x7F, 0x7F, 0x7F, + 0x7F, 0x7F, 0x3F, 0x1E, 0x0C, 0x00, + 0x1F, 0x1F, 0x1F, 0x3F, 0x00, 0x3F, + 0x3F, 0x3F, 0x7F, 0x7F, 0x7F, 0x00, + 0x30, 0x7B, 0x7F, 0x78, 0x30, 0x20, + 0x20, 0x30, 0x78, 0x7F, 0x3B, 0x00, + 0x03, 0x00, 0x0F, 0x7F, 0x0F, 0x0F, + 0x0F, 0x7F, 0x0F, 0x00, 0x03, 0x00, + 0x00, 0x44, 0x28, 0xFF, 0x5A, 0x24, + 0xF0, 0xFE, 0xF1, 0x91, 0xF6, 0xF0, + 0xF0, 0xFC, 0xF2, 0x92, 0xFC, 0xF0, + +// bottom logo section +# if defined(OLED_LOGO_GMK_BAD) + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x01, 0x03, 0x03, 0x03, 0x07, + 0x07, 0x07, 0x07, 0x03, 0x03, 0x03, + 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x06, 0x07, 0x07, 0x07, 0x01, 0x00, + 0x00, 0x00, 0x07, 0x07, 0x07, 0x01, + 0x00, 0x00, 0x00, 0x07, 0x07, 0x07, + 0x07, 0x00, 0x00, 0x00, 0x00, 0x07, + 0x07, 0x07, 0x07, 0x00, 0x00, 0x00, + 0x00, 0x03, 0x07, 0x07, 0x07, 0x06, + 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, + 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, + 0x07, 0x07, 0x03, 0x01, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x03, 0x07, + 0x07, 0x07, 0x07, 0x03, 0x07, 0x07, + 0x07, 0x07, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x03, 0x07, 0x07, 0x07, + 0x07, 0x03, 0x07, 0x07, 0x07, 0x07, + 0x00, 0x00, 0x00, 0x00, 0x01, 0x07, + 0x07, 0x07, 0x01, 0x00, 0x00, 0x00, +# elif defined(OLED_LOGO_HUE_MANITEE) + 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, + 0x03, 0x07, 0x07, 0x07, 0x07, 0x01, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x03, 0x07, 0x07, + 0x03, 0x00, 0x00, 0x02, 0x04, 0x00, + 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x03, 0x03, 0x03, 0x03, + 0x03, 0x03, 0x03, 0x03, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x03, 0x03, 0x03, 0x03, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, + 0x03, 0x03, 0x03, 0x03, 0x03, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x03, 0x03, 0x00, 0x00, 0x00, 0x00, + 0x03, 0x03, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +# elif defined(OLED_LOGO_CORNE) + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x03, 0x0F, 0x1F, + 0x3F, 0x3F, 0x3F, 0x3F, 0x1F, 0x1F, + 0x3F, 0x3F, 0x7F, 0x7F, 0x7F, 0x3F, + 0x3F, 0x1F, 0x3F, 0x7F, 0x7F, 0x7F, + 0x7F, 0x7C, 0x78, 0x78, 0x38, 0x1C, + 0x0F, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x01, 0x03, 0x07, 0x07, + 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, + 0x03, 0x01, 0x00, 0x00, 0x00, 0x00, + 0x01, 0x03, 0x07, 0x07, 0x07, 0x07, + 0x07, 0x07, 0x07, 0x07, 0x03, 0x01, + 0x00, 0x00, 0x00, 0x07, 0x07, 0x07, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x07, 0x07, 0x07, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x07, 0x07, + 0x07, 0x00, 0x00, 0x00, 0x01, 0x03, + 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, + 0x07, 0x07, 0x03, 0x01, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +# elif defined(OLED_LOGO_LOOSE) + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x01, 0x03, 0x07, 0x0F, + 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x00, + 0x1F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, + 0x20, 0x47, 0x48, 0x50, 0x40, 0x41, + 0x42, 0x24, 0x30, 0x3F, 0x3F, 0x3F, + 0x3F, 0x3F, 0x3F, 0x3F, 0x31, 0x31, + 0x11, 0x51, 0x11, 0x11, 0x4A, 0x0A, + 0x2A, 0x0A, 0x44, 0x64, 0x50, 0x70, + 0x50, 0x70, 0x50, 0x70, 0x50, 0x70, + 0x53, 0x73, 0x53, 0x73, 0x53, 0x73, + 0x53, 0x73, 0x53, 0x73, 0x53, 0x70, + 0x50, 0x71, 0x53, 0x73, 0x53, 0x73, + 0x53, 0x73, 0x53, 0x71, 0x50, 0x70, + 0x50, 0x71, 0x53, 0x73, 0x53, 0x73, + 0x53, 0x73, 0x53, 0x71, 0x50, 0x70, + 0x53, 0x73, 0x53, 0x73, 0x53, 0x73, + 0x53, 0x73, 0x53, 0x73, 0x51, 0x70, + 0x53, 0x73, 0x53, 0x73, 0x53, 0x73, + 0x53, 0x73, 0x53, 0x73, 0x53, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +# elif defined(OLED_LOGO_SKEEB) + 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, + 0xFF, 0x08, 0x08, 0x08, 0x08, 0x08, + 0x08, 0x08, 0x08, 0x08, 0x08, 0xFF, + 0x08, 0x08, 0x0F, 0x0F, 0x08, 0x08, + 0x03, 0x04, 0x08, 0x10, 0x20, 0x40, + 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, + 0x40, 0x20, 0x10, 0x08, 0x04, 0x03, + 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, + 0x00, 0x00, 0xFF, 0xFF, 0x00, 0x00, + 0x80, 0xC0, 0xE0, 0xF0, 0xF8, 0xF8, + 0xF8, 0xF8, 0xF8, 0xF8, 0xF8, 0xF8, + 0xF8, 0xF8, 0xF0, 0xE0, 0xC0, 0x80, + 0x01, 0x02, 0xFC, 0xF8, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, +#else + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x01, 0x01, 0x01, 0x07, 0x0F, 0x0F, + 0x7F, 0x0F, 0x7F, 0x0F, 0x0F, 0x7E, + 0x0F, 0x0F, 0x7F, 0x0F, 0x7F, 0x0F, + 0x0F, 0x07, 0x01, 0x01, 0x01, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x01, 0x01, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +#endif + +// third icon section + 0x1F, 0x05, 0x00, 0x02, 0x1F, 0x00, + 0x1F, 0x05, 0x00, 0x1D, 0x17, 0x00, + 0x1F, 0x05, 0x00, 0x15, 0x1F, 0x00, + 0x1F, 0x05, 0x00, 0x07, 0x1C, 0x00, + 0x1F, 0x05, 0x00, 0x17, 0x1D, 0x00, + 0x1F, 0x05, 0x00, 0x1F, 0x1D, 0x00, + 0x1F, 0x05, 0x00, 0x01, 0x1F, 0x00, + 0x1F, 0x05, 0x00, 0x1F, 0x1F, 0x00, + 0x1F, 0x05, 0x00, 0x07, 0x1F, 0x00, + 0x1F, 0x05, 0x00, 0x70, 0x77, 0x00, + 0x1F, 0x05, 0x00, 0x00, 0x77, 0x00, + +// fourth icon section + 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, 0x30, 0x18, 0x0C, + 0x06, 0x0C, 0x18, 0x30, 0x00, 0x00, + 0x00, 0x00, 0x06, 0x06, 0x06, 0x0C, + 0x18, 0x30, 0x66, 0x66, 0x66, 0x00, + 0x00, 0x00, 0x00, 0x08, 0x0C, 0x7E, + 0x7F, 0x7E, 0x0C, 0x08, 0x00, 0x00, + 0x00, 0x00, 0x77, 0x77, 0x77, 0x00, + 0x77, 0x77, 0x77, 0x00, 0x00, 0x00, + 0x00, 0x00, 0xE7, 0xA5, 0xFF, 0x24, + 0x24, 0xFF, 0xA5, 0xE7, 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, + 0x00, 0x00, 0x00, 0x3E, 0x4A, 0x4F, + 0x4A, 0x3E, 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, 0x1C, 0x14, 0x1C, 0x08, + 0x18, 0x08, 0x18, 0x00, 0x00, 0x00, + 0x00, 0x70, 0xC8, 0xEE, 0xF9, 0x70, + 0x1F, 0x05, 0x00, 0x10, 0x77, 0x40, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + }; +// clang-format on +#endif diff --git a/users/drashna/oled/oled_stuff.c b/users/drashna/oled/oled_stuff.c new file mode 100644 index 0000000000..9ee2cbfed8 --- /dev/null +++ b/users/drashna/oled/oled_stuff.c @@ -0,0 +1,445 @@ +/* Copyright 2020 Christopher Courtney, aka Drashna Jael're (@drashna) + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#include "drashna.h" +#ifdef CUSTOM_UNICODE_ENABLE +# include "process_unicode_common.h" +#endif +#include + +extern bool host_driver_disabled; + +#ifndef KEYLOGGER_LENGTH +// # ifdef OLED_DISPLAY_128X64 +# define KEYLOGGER_LENGTH ((uint8_t)(OLED_DISPLAY_HEIGHT / OLED_FONT_WIDTH)) +// # else +// # define KEYLOGGER_LENGTH (uint8_t *(OLED_DISPLAY_WIDTH / OLED_FONT_HEIGHT)) +// # endif +#endif + +uint32_t oled_timer = 0; +static char keylog_str[KEYLOGGER_LENGTH + 1] = {0}; +static uint16_t log_timer = 0; + +// clang-format off +static const char PROGMEM code_to_name[256] = { +// 0 1 2 3 4 5 6 7 8 9 A B c D E F + ' ', ' ', ' ', ' ', 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', // 0x + 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z', '1', '2', // 1x + '3', '4', '5', '6', '7', '8', '9', '0', 20, 19, 27, 26, 22, '-', '=', '[', // 2x + ']','\\', '#', ';','\'', '`', ',', '.', '/', 128,0xD5,0xD6,0xD7,0xD8,0xD9,0xDA, // 3x + 0xDB,0xDC,0xDD,0xDE,0XDF,0xFB,'P', 'S', 19, ' ', 17, 30, 16, 16, 31, 26, // 4x + 27, 25, 24, 'N', '/', '*', '-', '+', 23, '1', '2', '3', '4', '5', '6', '7', // 5x + '8', '9', '0', '.','\\', 'A', 0, '=', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', // 6x + ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', // 7x + ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', // 8x + ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', // 9x + ' ', ' ', ' ', ' ', ' ', 0, ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', // Ax + ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', // Bx + ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', // Cx + ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', // Dx + 'C', 'S', 'A', 'C', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', 24, 26, 24, // Ex + 25,0x9D,0x9D,0x9D,0x9D,0x9D,0x9D,0x9D,0x9D, 24, 25, 27, 26, ' ', ' ', ' ' // Fx +}; +// clang-format on + +void add_keylog(uint16_t keycode, keyrecord_t *record) { + if ((keycode >= QK_MOD_TAP && keycode <= QK_MOD_TAP_MAX) || (keycode >= QK_LAYER_TAP && keycode <= QK_LAYER_TAP_MAX) || (keycode >= QK_MODS && keycode <= QK_MODS_MAX)) { + if (((keycode & 0xFF) == KC_BSPC) && mod_config(get_mods() | get_oneshot_mods()) & MOD_MASK_CTRL) { + memset(keylog_str, ' ', sizeof(keylog_str) - 1); + return; + } + if (record->tap.count) { + keycode &= 0xFF; + } else if (keycode > 0xFF) { + return; + } + } + if (keycode > 0xFF) { + return; + } + + for (uint8_t i = 1; i < KEYLOGGER_LENGTH; i++) { + keylog_str[i - 1] = keylog_str[i]; + } + + if (keycode < (sizeof(code_to_name) / sizeof(char))) { + keylog_str[(KEYLOGGER_LENGTH - 1)] = pgm_read_byte(&code_to_name[keycode]); + } + + log_timer = timer_read(); +} + +bool process_record_user_oled(uint16_t keycode, keyrecord_t *record) { + if (record->event.pressed) { +#ifdef OLED_ENABLE + oled_timer = timer_read32(); + add_keylog(keycode, record); +#endif + } + return true; +} + +void update_log(void) { + if (timer_elapsed(log_timer) > 750) { + // add_keylog(0); + } +} + +void render_keylogger_status(void) { + oled_write_P(PSTR(OLED_RENDER_KEYLOGGER), false); + oled_write(keylog_str, false); +} + +void render_default_layer_state(void) { + oled_write_P(PSTR(OLED_RENDER_LAYOUT_NAME), false); + switch (get_highest_layer(default_layer_state)) { + case _QWERTY: + oled_write_P(PSTR(OLED_RENDER_LAYOUT_QWERTY), false); + break; + case _COLEMAK_DH: + oled_write_P(PSTR(OLED_RENDER_LAYOUT_COLEMAK_DH), false); + break; + case _COLEMAK: + oled_write_P(PSTR(OLED_RENDER_LAYOUT_COLEMAK), false); + break; + case _DVORAK: + oled_write_P(PSTR(OLED_RENDER_LAYOUT_DVORAK), false); + break; + } +#ifdef OLED_DISPLAY_128X64 + oled_advance_page(true); +#endif +} + +void render_layer_state(void) { + oled_write_P(PSTR(OLED_RENDER_LAYER_NAME), false); +#ifdef OLED_DISPLAY_128X64 + oled_write_P(PSTR(" "), false); +#endif + oled_write_P(PSTR(OLED_RENDER_LAYER_LOWER), layer_state_is(_LOWER)); +#ifdef OLED_DISPLAY_128X64 + oled_write_P(PSTR(" "), false); +#endif + oled_write_P(PSTR(OLED_RENDER_LAYER_RAISE), layer_state_is(_RAISE)); +#ifdef OLED_DISPLAY_128X64 + oled_advance_page(true); + oled_write_P(PSTR(" "), false); + oled_write_P(PSTR("GamePad"), layer_state_is(_GAMEPAD)); + oled_write_P(PSTR(" "), false); + oled_write_P(PSTR("Diablo"), layer_state_is(_DIABLO)); + oled_write_P(PSTR(" "), false); + oled_write_P(PSTR("Mouse"), layer_state_is(_MOUSE)); +#endif +} + +void render_keylock_status(uint8_t led_usb_state) { + oled_write_P(PSTR(OLED_RENDER_LOCK_NAME), false); +#if !defined(OLED_DISPLAY_128X64) + oled_write_P(PSTR(" "), false); +#endif + oled_write_P(PSTR(OLED_RENDER_LOCK_NUML), led_usb_state & (1 << USB_LED_NUM_LOCK)); + oled_write_P(PSTR(" "), false); + oled_write_P(PSTR(OLED_RENDER_LOCK_CAPS), led_usb_state & (1 << USB_LED_CAPS_LOCK)); +#if defined(OLED_DISPLAY_128X64) + oled_write_P(PSTR(" "), false); + oled_write_P(PSTR(OLED_RENDER_LOCK_SCLK), led_usb_state & (1 << USB_LED_SCROLL_LOCK)); +#endif +} + +void render_matrix_scan_rate(void) { +#ifdef DEBUG_MATRIX_SCAN_RATE + char matrix_rate[5]; + uint16_t n = get_matrix_scan_rate(); + matrix_rate[4] = '\0'; + matrix_rate[3] = '0' + n % 10; + matrix_rate[2] = (n /= 10) % 10 ? '0' + (n) % 10 : (n / 10) % 10 ? '0' : ' '; + matrix_rate[1] = n / 10 ? '0' + n / 10 : ' '; + matrix_rate[0] = ' '; + oled_write_P(PSTR("MS:"), false); + oled_write(matrix_rate, false); +#endif +} + +void render_mod_status(uint8_t modifiers) { + static const char PROGMEM mod_status[5][3] = {{0xE8, 0xE9, 0}, {0xE4, 0xE5, 0}, {0xE6, 0xE7, 0}, {0xEA, 0xEB, 0}, {0xEC, 0xED, 0}}; + oled_write_P(PSTR(OLED_RENDER_MODS_NAME), false); +#if defined(OLED_DISPLAY_128X64) + oled_write_P(mod_status[0], (modifiers & MOD_BIT(KC_LSHIFT))); + oled_write_P(mod_status[!keymap_config.swap_lctl_lgui ? 3 : 4], (modifiers & MOD_BIT(KC_LGUI))); + oled_write_P(mod_status[2], (modifiers & MOD_BIT(KC_LALT))); + oled_write_P(mod_status[1], (modifiers & MOD_BIT(KC_LCTL))); + oled_write_P(mod_status[1], (modifiers & MOD_BIT(KC_RCTL))); + oled_write_P(mod_status[2], (modifiers & MOD_BIT(KC_RALT))); + oled_write_P(mod_status[!keymap_config.swap_lctl_lgui ? 3 : 4], (modifiers & MOD_BIT(KC_RGUI))); + oled_write_P(mod_status[0], (modifiers & MOD_BIT(KC_RSHIFT))); +#else + oled_write_P(mod_status[0], (modifiers & MOD_MASK_SHIFT)); + oled_write_P(mod_status[!keymap_config.swap_lctl_lgui ? 3 : 4], (modifiers & MOD_MASK_GUI)); + oled_write_P(PSTR(" "), false); + oled_write_P(mod_status[2], (modifiers & MOD_MASK_ALT)); + oled_write_P(mod_status[1], (modifiers & MOD_MASK_CTRL)); +#endif +} + +#ifdef SWAP_HANDS_ENABLE +extern bool swap_hands; +#endif + +void render_bootmagic_status(void) { + /* Show Ctrl-Gui Swap options */ + static const char PROGMEM logo[][2][3] = { + {{0x97, 0x98, 0}, {0xb7, 0xb8, 0}}, + {{0x95, 0x96, 0}, {0xb5, 0xb6, 0}}, + }; + + bool is_bootmagic_on; +#ifdef OLED_DISPLAY_128X64 + is_bootmagic_on = !keymap_config.swap_lctl_lgui; +#else + is_bootmagic_on = keymap_config.swap_lctl_lgui; +#endif + + oled_write_P(PSTR(OLED_RENDER_BOOTMAGIC_NAME), false); +#ifdef OLED_DISPLAY_128X64 + if (keymap_config.swap_lctl_lgui) +#else + oled_write_P(PSTR(" "), false); +#endif + { + oled_write_P(logo[1][0], is_bootmagic_on); +#ifdef OLED_DISPLAY_128X64 + } else { +#endif + oled_write_P(logo[0][0], !is_bootmagic_on); + } +#ifndef OLED_DISPLAY_128X64 + oled_write_P(PSTR(" "), false); + oled_write_P(logo[1][1], is_bootmagic_on); + oled_write_P(logo[0][1], !is_bootmagic_on); +#endif + oled_write_P(PSTR(" "), false); + oled_write_P(PSTR(OLED_RENDER_BOOTMAGIC_NKRO), keymap_config.nkro); + oled_write_P(PSTR(" "), false); +#ifdef AUTOCORRECTION_ENABLE + oled_write_P(PSTR("CRCT"), userspace_config.autocorrection); +#else + oled_write_P(PSTR(OLED_RENDER_BOOTMAGIC_NOGUI), keymap_config.no_gui); +#endif +#ifdef OLED_DISPLAY_128X64 + oled_advance_page(true); + oled_write_P(PSTR("Magic"), false); + oled_write_P(PSTR(" "), false); + if (keymap_config.swap_lctl_lgui) { + oled_write_P(logo[1][1], is_bootmagic_on); + } else { + oled_write_P(logo[0][1], !is_bootmagic_on); + } +#endif + oled_write_P(PSTR(" "), false); + oled_write_P(PSTR(OLED_RENDER_BOOTMAGIC_ONESHOT), !is_oneshot_enabled()); +#ifdef SWAP_HANDS_ENABLE + oled_write_P(PSTR(" "), false); + oled_write_P(PSTR(OLED_RENDER_BOOTMAGIC_SWAP), swap_hands); +#endif +#ifdef OLED_DISPLAY_128X64 + oled_advance_page(true); +#endif +} + +#if defined(POINTING_DEVICE_ENABLE) +extern bool tap_toggling; +#endif + +void render_user_status(void) { +#ifdef AUDIO_ENABLE + bool is_audio_on = false, is_clicky_on = false; +# ifdef SPLIT_KEYBOARD + + is_audio_on = user_state.audio_enable; + is_clicky_on = user_state.audio_clicky_enable; +# else + is_audio_on = is_audio_on(); + is_clicky_on = is_clicky_on(); +# endif +#endif + oled_write_P(PSTR(OLED_RENDER_USER_NAME), false); +#if !defined(OLED_DISPLAY_128X64) + oled_write_P(PSTR(" "), false); +#endif +#if defined(RGB_MATRIX_ENABLE) + oled_write_P(PSTR(OLED_RENDER_USER_ANIM), userspace_config.rgb_matrix_idle_anim); +# if !defined(OLED_DISPLAY_128X64) + oled_write_P(PSTR(" "), false); +# endif +#elif defined(POINTING_DEVICE_ENABLE) + static const char PROGMEM mouse_lock[3] = {0xF2, 0xF3, 0}; + oled_write_P(mouse_lock, tap_toggling); +#endif +#ifdef AUDIO_ENABLE + static const char PROGMEM audio_status[2][3] = {{0xE0, 0xE1, 0}, {0xE2, 0xE3, 0}}; + oled_write_P(audio_status[is_audio_on], false); + +# ifdef AUDIO_CLICKY + static const char PROGMEM audio_clicky_status[2][3] = {{0xF4, 0xF5, 0}, {0xF6, 0xF7, 0}}; + oled_write_P(audio_clicky_status[is_clicky_on && is_audio_on], false); +# if !defined(OLED_DISPLAY_128X64) + oled_write_P(PSTR(" "), false); +# endif +# endif +#endif + + static const char PROGMEM rgb_layer_status[2][3] = {{0xEE, 0xEF, 0}, {0xF0, 0xF1, 0}}; + oled_write_P(rgb_layer_status[userspace_config.rgb_layer_change], false); + static const char PROGMEM cat_mode[2][3] = {{0xF8, 0xF9, 0}, {0xF6, 0xF7, 0}}; + oled_write_P(cat_mode[0], host_driver_disabled); +#if defined(CUSTOM_UNICODE_ENABLE) + static const char PROGMEM uc_mod_status[5][3] = {{0xEA, 0xEB, 0}, {0xEC, 0xED, 0}}; + oled_write_P(uc_mod_status[get_unicode_input_mode() == UC_MAC], false); +#endif + if (userspace_config.nuke_switch) { +#if !defined(OLED_DISPLAY_128X64) + oled_write_P(PSTR(" "), false); +#endif + static const char PROGMEM nukem_good[2] = {0xFA, 0}; + oled_write_P(nukem_good, false); +#if !defined(OLED_DISPLAY_128X64) + oled_advance_page(true); +#endif + } +#if defined(OLED_DISPLAY_128X64) + oled_advance_page(true); +#endif +} + +void oled_driver_render_logo(void) { + // clang-format off + static const char PROGMEM qmk_logo[] = { + 0x80,0x81,0x82,0x83,0x84,0x85,0x86,0x87,0x88,0x89,0x8a,0x8b,0x8c,0x8d,0x8e,0x8f,0x90,0x91,0x92,0x93,0x94, + 0xa0,0xa1,0xa2,0xa3,0xa4,0xa5,0xa6,0xa7,0xa8,0xa9,0xaa,0xab,0xac,0xad,0xae,0xaf,0xb0,0xb1,0xb2,0xb3,0xb4, + 0xc0,0xc1,0xc2,0xc3,0xc4,0xc5,0xc6,0xc7,0xc8,0xc9,0xca,0xcb,0xcc,0xcd,0xce,0xcf,0xd0,0xd1,0xd2,0xd3,0xd4,0}; + // clang-format on + oled_write_P(qmk_logo, false); +} + +void render_wpm(uint8_t padding) { +#ifdef WPM_ENABLE + + oled_write_P(PSTR(OLED_RENDER_WPM_COUNTER), false); + if (padding) { + for (uint8_t n = padding; n > 0; n--) { + oled_write_P(PSTR(" "), false); + } + } + oled_write(get_u8_str(get_current_wpm(), ' '), false); +#endif +} + +#if defined(KEYBOARD_handwired_tractyl_manuform) || defined(KEYBOARD_bastardkb_charybdis) +extern kb_config_data_t kb_config; +void render_pointing_dpi_status(uint8_t padding) { + oled_write_P(PSTR("CPI:"), false); + if (padding) { + for (uint8_t n = padding - 1; n > 0; n--) { + oled_write_P(PSTR(" "), false); + } + } + + oled_write(get_u16_str(kb_config.device_cpi, ' '), false); +} +#endif + +__attribute__((weak)) void oled_driver_render_logo_right(void) { +#if defined(OLED_DISPLAY_128X64) + oled_driver_render_logo(); + render_default_layer_state(); + oled_set_cursor(0, 4); +#else + render_default_layer_state(); +#endif +} + +__attribute__((weak)) void oled_driver_render_logo_left(void) { +#if defined(OLED_DISPLAY_128X64) + oled_driver_render_logo(); +# ifdef DEBUG_MATRIX_SCAN_RATE + render_matrix_scan_rate(); +# elif defined(WPM_ENABLE) + render_wpm(0); +# endif + oled_write_P(PSTR(" "), false); +# if defined(KEYBOARD_handwired_tractyl_manuform) || defined(KEYBOARD_bastardkb_charybdis) + render_pointing_dpi_status(1); +# endif + oled_set_cursor(0, 4); +#else + render_default_layer_state(); +#endif +} + +void render_status_secondary(void) { + oled_driver_render_logo_right(); + /* Show Keyboard Layout */ + render_layer_state(); + render_mod_status(get_mods() | get_oneshot_mods()); +#if !defined(OLED_DISPLAY_128X64) && defined(WPM_ENABLE) && !defined(CONVERT_TO_PROTON_C) + render_wpm(2); +#endif + // render_keylock_status(host_keyboard_leds()); +} + +void render_status_main(void) { + oled_driver_render_logo_left(); + + /* Show Keyboard Layout */ + // render_keylock_status(host_keyboard_leds()); + render_bootmagic_status(); + render_user_status(); + + // render_keylogger_status(); +} + +__attribute__((weak)) oled_rotation_t oled_init_keymap(oled_rotation_t rotation) { return rotation; } + +oled_rotation_t oled_init_user(oled_rotation_t rotation) { + memset(keylog_str, ' ', sizeof(keylog_str) - 1); + + return oled_init_keymap(rotation); +} + +bool oled_task_user(void) { + update_log(); + + if (is_keyboard_master()) { + if (timer_elapsed32(oled_timer) > 30000) { + oled_off(); + return false; + } else { + oled_on(); + } + } + if (is_keyboard_left()) { + render_status_main(); // Renders the current keyboard state (layer, lock, caps, scroll, etc) + } else { + render_status_secondary(); + } + if (is_keyboard_master()) { + render_keylogger_status(); + } else { + render_keylock_status(host_keyboard_leds()); + } + return false; +} diff --git a/users/drashna/oled/oled_stuff.h b/users/drashna/oled/oled_stuff.h new file mode 100644 index 0000000000..8795684d6a --- /dev/null +++ b/users/drashna/oled/oled_stuff.h @@ -0,0 +1,131 @@ +/* Copyright 2020 Christopher Courtney, aka Drashna Jael're (@drashna) + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#pragma once + +#include "quantum.h" +#include "oled_driver.h" + +void oled_driver_render_logo(void); +bool process_record_user_oled(uint16_t keycode, keyrecord_t *record); +oled_rotation_t oled_init_keymap(oled_rotation_t rotation); +extern uint32_t oled_timer; +void render_keylogger_status(void); +void render_default_layer_state(void); +void render_layer_state(void); +void render_keylock_status(uint8_t led_usb_state); +void render_matrix_scan_rate(void); +void render_mod_status(uint8_t modifiers); +void render_bootmagic_status(void); +void render_user_status(void); +void oled_driver_render_logo(void); +void render_wpm(uint8_t padding); +void render_pointing_dpi_status(uint8_t padding); +void oled_driver_render_logo_left(void); +void oled_driver_render_logo_right(void); + +#ifdef OLED_DISPLAY_128X64 +# define OLED_RENDER_KEYLOGGER "Keylogger: " + +# define OLED_RENDER_LAYOUT_NAME "Layout: " +# define OLED_RENDER_LAYOUT_QWERTY "Qwerty" +# define OLED_RENDER_LAYOUT_COLEMAK_DH "Colemak-DH" +# define OLED_RENDER_LAYOUT_COLEMAK "Colemak" +# define OLED_RENDER_LAYOUT_DVORAK "Dvorak" +# define OLED_RENDER_LAYOUT_WORKMAN "Workman" +# define OLED_RENDER_LAYOUT_NORMAN "Norman" +# define OLED_RENDER_LAYOUT_MALTRON "Matron" +# define OLED_RENDER_LAYOUT_EUCALYN "Eucalyn" +# define OLED_RENDER_LAYOUT_CARPLAX "Carplax" + +# define OLED_RENDER_LAYER_NAME "Layer:" +# define OLED_RENDER_LAYER_LOWER "Lower" +# define OLED_RENDER_LAYER_RAISE "Raise" +# define OLED_RENDER_LAYER_ADJUST "Adjust" +# define OLED_RENDER_LAYER_MODS "Mods" + +# define OLED_RENDER_LOCK_NAME "Lock: " +# define OLED_RENDER_LOCK_NUML "NUML" +# define OLED_RENDER_LOCK_CAPS "CAPS" +# define OLED_RENDER_LOCK_SCLK "SCLK" + +# define OLED_RENDER_MODS_NAME "Mods:" +# define OLED_RENDER_MODS_SFT "Sft" +# define OLED_RENDER_MODS_CTL "Ctl" +# define OLED_RENDER_MODS_ALT "Alt" +# define OLED_RENDER_MODS_GUI "GUI" + +# define OLED_RENDER_BOOTMAGIC_NAME "Boot " +# define OLED_RENDER_BOOTMAGIC_NKRO "NKRO" +# define OLED_RENDER_BOOTMAGIC_NOGUI "nGUI" +# define OLED_RENDER_BOOTMAGIC_GRV "GRV" +# define OLED_RENDER_BOOTMAGIC_ONESHOT "1SHT" +# define OLED_RENDER_BOOTMAGIC_SWAP "SWAP" +# define OLED_RENDER_BOOTMAGIC_CAPS "CAPS" + +# define OLED_RENDER_USER_NAME "USER:" +# define OLED_RENDER_USER_ANIM "Anim" +# define OLED_RENDER_USER_LAYR "Layr" +# define OLED_RENDER_USER_NUKE "Nuke" + +# define OLED_RENDER_WPM_COUNTER "WPM: " +#else +# define OLED_RENDER_KEYLOGGER "KLogr" + +# define OLED_RENDER_LAYOUT_NAME "Lyout" +# define OLED_RENDER_LAYOUT_QWERTY " QRTY" +# define OLED_RENDER_LAYOUT_COLEMAK_DH " cmDH" +# define OLED_RENDER_LAYOUT_COLEMAK " COLE" +# define OLED_RENDER_LAYOUT_DVORAK " DVRK" +# define OLED_RENDER_LAYOUT_WORKMAN " WKMN" +# define OLED_RENDER_LAYOUT_NORMAN " NORM" +# define OLED_RENDER_LAYOUT_MALTRON " MLTN" +# define OLED_RENDER_LAYOUT_EUCALYN " ECLN" +# define OLED_RENDER_LAYOUT_CARPLAX " CRPX" + +# define OLED_RENDER_LAYER_NAME "LAYER" +# define OLED_RENDER_LAYER_LOWER "Lower" +# define OLED_RENDER_LAYER_RAISE "Raise" +# define OLED_RENDER_LAYER_ADJUST "Adjst" +# define OLED_RENDER_LAYER_MODS " Mods" + +# define OLED_RENDER_LOCK_NAME "Lock:" +# define OLED_RENDER_LOCK_NUML "NumL" +# define OLED_RENDER_LOCK_CAPS "CapL" +# define OLED_RENDER_LOCK_SCLK "ScrL" + +# define OLED_RENDER_MODS_NAME "Mods: " +# define OLED_RENDER_MODS_SFT "Shft" +# define OLED_RENDER_MODS_CTL "Ctrl" +# define OLED_RENDER_MODS_ALT "Alt\n" +# define OLED_RENDER_MODS_GUI "GUI\n" + +# define OLED_RENDER_BOOTMAGIC_NAME "BTMGK" +# define OLED_RENDER_BOOTMAGIC_NKRO "NKRO" +# define OLED_RENDER_BOOTMAGIC_NOGUI "nGUI" +# define OLED_RENDER_BOOTMAGIC_GRV "GRV" +# define OLED_RENDER_BOOTMAGIC_ONESHOT "1SHT" +# define OLED_RENDER_BOOTMAGIC_SWAP "SWAP" +# define OLED_RENDER_BOOTMAGIC_CAPS "CAPS" + +# define OLED_RENDER_USER_NAME "USER:" +# define OLED_RENDER_USER_ANIM "Anim" +# define OLED_RENDER_USER_LAYR "Layr" +# define OLED_RENDER_USER_NUKE "Nuke" + +# define OLED_RENDER_WPM_COUNTER "WPM: " + +#endif diff --git a/users/drashna/oled_stuff.c b/users/drashna/oled_stuff.c deleted file mode 100644 index 2c92ac6e90..0000000000 --- a/users/drashna/oled_stuff.c +++ /dev/null @@ -1,441 +0,0 @@ -/* Copyright 2020 Christopher Courtney, aka Drashna Jael're (@drashna) - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -#include "drashna.h" -#ifdef CUSTOM_UNICODE_ENABLE -# include "process_unicode_common.h" -#endif -#include - -extern bool host_driver_disabled; - -#ifndef KEYLOGGER_LENGTH -// # ifdef OLED_DISPLAY_128X64 -# define KEYLOGGER_LENGTH ((uint8_t)(OLED_DISPLAY_HEIGHT / OLED_FONT_WIDTH)) -// # else -// # define KEYLOGGER_LENGTH (uint8_t *(OLED_DISPLAY_WIDTH / OLED_FONT_HEIGHT)) -// # endif -#endif - -uint32_t oled_timer = 0; -static char keylog_str[KEYLOGGER_LENGTH + 1] = {0}; -static uint16_t log_timer = 0; - -// clang-format off -static const char PROGMEM code_to_name[256] = { -// 0 1 2 3 4 5 6 7 8 9 A B c D E F - ' ', ' ', ' ', ' ', 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', // 0x - 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z', '1', '2', // 1x - '3', '4', '5', '6', '7', '8', '9', '0', 20, 19, 27, 26, 22, '-', '=', '[', // 2x - ']','\\', '#', ';','\'', '`', ',', '.', '/', 128,0xD5,0xD6,0xD7,0xD8,0xD9,0xDA, // 3x - 0xDB,0xDC,0xDD,0xDE,0XDF,0xFB,'P', 'S', 19, ' ', 17, 30, 16, 16, 31, 26, // 4x - 27, 25, 24, 'N', '/', '*', '-', '+', 23, '1', '2', '3', '4', '5', '6', '7', // 5x - '8', '9', '0', '.','\\', 'A', 0, '=', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', // 6x - ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', // 7x - ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', // 8x - ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', // 9x - ' ', ' ', ' ', ' ', ' ', 0, ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', // Ax - ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', // Bx - ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', // Cx - ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', // Dx - 'C', 'S', 'A', 'C', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', 24, 26, 24, // Ex - 25,0x9D,0x9D,0x9D,0x9D,0x9D,0x9D,0x9D,0x9D, 24, 25, 27, 26, ' ', ' ', ' ' // Fx -}; -// clang-format on - -void add_keylog(uint16_t keycode, keyrecord_t *record) { - if ((keycode >= QK_MOD_TAP && keycode <= QK_MOD_TAP_MAX) || (keycode >= QK_LAYER_TAP && keycode <= QK_LAYER_TAP_MAX) || (keycode >= QK_MODS && keycode <= QK_MODS_MAX)) { - if (((keycode & 0xFF) == KC_BSPC) && mod_config(get_mods() | get_oneshot_mods()) & MOD_MASK_CTRL) { - memset(keylog_str, ' ', sizeof(keylog_str) - 1); - return; - } - if (record->tap.count) { - keycode &= 0xFF; - } else if (keycode > 0xFF) { - return; - } - } - if (keycode > 0xFF) { - return; - } - - for (uint8_t i = 1; i < KEYLOGGER_LENGTH; i++) { - keylog_str[i - 1] = keylog_str[i]; - } - - if (keycode < (sizeof(code_to_name) / sizeof(char))) { - keylog_str[(KEYLOGGER_LENGTH - 1)] = pgm_read_byte(&code_to_name[keycode]); - } - - log_timer = timer_read(); -} - -bool process_record_user_oled(uint16_t keycode, keyrecord_t *record) { - if (record->event.pressed) { -#ifdef OLED_ENABLE - oled_timer = timer_read32(); - add_keylog(keycode, record); -#endif - } - return true; -} - -void update_log(void) { - if (timer_elapsed(log_timer) > 750) { - // add_keylog(0); - } -} - -void render_keylogger_status(void) { - oled_write_P(PSTR(OLED_RENDER_KEYLOGGER), false); - oled_write(keylog_str, false); -} - -void render_default_layer_state(void) { - oled_write_P(PSTR(OLED_RENDER_LAYOUT_NAME), false); - switch (get_highest_layer(default_layer_state)) { - case _QWERTY: - oled_write_P(PSTR(OLED_RENDER_LAYOUT_QWERTY), false); - break; - case _COLEMAK_DH: - oled_write_P(PSTR(OLED_RENDER_LAYOUT_COLEMAK_DH), false); - break; - case _COLEMAK: - oled_write_P(PSTR(OLED_RENDER_LAYOUT_COLEMAK), false); - break; - case _DVORAK: - oled_write_P(PSTR(OLED_RENDER_LAYOUT_DVORAK), false); - break; - } -#ifdef OLED_DISPLAY_128X64 - oled_advance_page(true); -#endif -} - -void render_layer_state(void) { - oled_write_P(PSTR(OLED_RENDER_LAYER_NAME), false); -#ifdef OLED_DISPLAY_128X64 - oled_write_P(PSTR(" "), false); -#endif - oled_write_P(PSTR(OLED_RENDER_LAYER_LOWER), layer_state_is(_LOWER)); -#ifdef OLED_DISPLAY_128X64 - oled_write_P(PSTR(" "), false); -#endif - oled_write_P(PSTR(OLED_RENDER_LAYER_RAISE), layer_state_is(_RAISE)); -#ifdef OLED_DISPLAY_128X64 - oled_advance_page(true); - oled_write_P(PSTR(" "), false); - oled_write_P(PSTR("GamePad"), layer_state_is(_GAMEPAD)); - oled_write_P(PSTR(" "), false); - oled_write_P(PSTR("Diablo"), layer_state_is(_DIABLO)); - oled_write_P(PSTR(" "), false); - oled_write_P(PSTR("Mouse"), layer_state_is(_MOUSE)); -#endif -} - -void render_keylock_status(uint8_t led_usb_state) { - oled_write_P(PSTR(OLED_RENDER_LOCK_NAME), false); -#if !defined(OLED_DISPLAY_128X64) - oled_write_P(PSTR(" "), false); -#endif - oled_write_P(PSTR(OLED_RENDER_LOCK_NUML), led_usb_state & (1 << USB_LED_NUM_LOCK)); - oled_write_P(PSTR(" "), false); - oled_write_P(PSTR(OLED_RENDER_LOCK_CAPS), led_usb_state & (1 << USB_LED_CAPS_LOCK)); -#if defined(OLED_DISPLAY_128X64) - oled_write_P(PSTR(" "), false); - oled_write_P(PSTR(OLED_RENDER_LOCK_SCLK), led_usb_state & (1 << USB_LED_SCROLL_LOCK)); -#endif -} - -void render_matrix_scan_rate(void) { -#ifdef DEBUG_MATRIX_SCAN_RATE - char matrix_rate[5]; - uint16_t n = get_matrix_scan_rate(); - matrix_rate[4] = '\0'; - matrix_rate[3] = '0' + n % 10; - matrix_rate[2] = (n /= 10) % 10 ? '0' + (n) % 10 : (n / 10) % 10 ? '0' : ' '; - matrix_rate[1] = n / 10 ? '0' + n / 10 : ' '; - matrix_rate[0] = ' '; - oled_write_P(PSTR("MS:"), false); - oled_write(matrix_rate, false); -#endif -} - -void render_mod_status(uint8_t modifiers) { - static const char PROGMEM mod_status[5][3] = {{0xE8, 0xE9, 0}, {0xE4, 0xE5, 0}, {0xE6, 0xE7, 0}, {0xEA, 0xEB, 0}, {0xEC, 0xED, 0}}; - oled_write_P(PSTR(OLED_RENDER_MODS_NAME), false); -#if defined(OLED_DISPLAY_128X64) - oled_write_P(mod_status[0], (modifiers & MOD_BIT(KC_LSHIFT))); - oled_write_P(mod_status[!keymap_config.swap_lctl_lgui ? 3 : 4], (modifiers & MOD_BIT(KC_LGUI))); - oled_write_P(mod_status[2], (modifiers & MOD_BIT(KC_LALT))); - oled_write_P(mod_status[1], (modifiers & MOD_BIT(KC_LCTL))); - oled_write_P(mod_status[1], (modifiers & MOD_BIT(KC_RCTL))); - oled_write_P(mod_status[2], (modifiers & MOD_BIT(KC_RALT))); - oled_write_P(mod_status[!keymap_config.swap_lctl_lgui ? 3 : 4], (modifiers & MOD_BIT(KC_RGUI))); - oled_write_P(mod_status[0], (modifiers & MOD_BIT(KC_RSHIFT))); -#else - oled_write_P(mod_status[0], (modifiers & MOD_MASK_SHIFT)); - oled_write_P(mod_status[!keymap_config.swap_lctl_lgui ? 3 : 4], (modifiers & MOD_MASK_GUI)); - oled_write_P(PSTR(" "), false); - oled_write_P(mod_status[2], (modifiers & MOD_MASK_ALT)); - oled_write_P(mod_status[1], (modifiers & MOD_MASK_CTRL)); -#endif -} - -#ifdef SWAP_HANDS_ENABLE -extern bool swap_hands; -#endif - -void render_bootmagic_status(void) { - /* Show Ctrl-Gui Swap options */ - static const char PROGMEM logo[][2][3] = { - {{0x97, 0x98, 0}, {0xb7, 0xb8, 0}}, - {{0x95, 0x96, 0}, {0xb5, 0xb6, 0}}, - }; - - bool is_bootmagic_on; -#ifdef OLED_DISPLAY_128X64 - is_bootmagic_on = !keymap_config.swap_lctl_lgui; -#else - is_bootmagic_on = keymap_config.swap_lctl_lgui; -#endif - - oled_write_P(PSTR(OLED_RENDER_BOOTMAGIC_NAME), false); -#ifdef OLED_DISPLAY_128X64 - if (keymap_config.swap_lctl_lgui) -#else - oled_write_P(PSTR(" "), false); -#endif - { - oled_write_P(logo[1][0], is_bootmagic_on); -#ifdef OLED_DISPLAY_128X64 - } else { -#endif - oled_write_P(logo[0][0], !is_bootmagic_on); - } -#ifndef OLED_DISPLAY_128X64 - oled_write_P(PSTR(" "), false); - oled_write_P(logo[1][1], is_bootmagic_on); - oled_write_P(logo[0][1], !is_bootmagic_on); -#endif - oled_write_P(PSTR(" "), false); - oled_write_P(PSTR(OLED_RENDER_BOOTMAGIC_NKRO), keymap_config.nkro); - oled_write_P(PSTR(" "), false); - oled_write_P(PSTR(OLED_RENDER_BOOTMAGIC_NOGUI), keymap_config.no_gui); -#ifdef OLED_DISPLAY_128X64 - oled_advance_page(true); - oled_write_P(PSTR("Magic"), false); - oled_write_P(PSTR(" "), false); - if (keymap_config.swap_lctl_lgui) { - oled_write_P(logo[1][1], is_bootmagic_on); - } else { - oled_write_P(logo[0][1], !is_bootmagic_on); - } -#endif - oled_write_P(PSTR(" "), false); - oled_write_P(PSTR(OLED_RENDER_BOOTMAGIC_ONESHOT), !is_oneshot_enabled()); -#ifdef SWAP_HANDS_ENABLE - oled_write_P(PSTR(" "), false); - oled_write_P(PSTR(OLED_RENDER_BOOTMAGIC_SWAP), swap_hands); -#endif -#ifdef OLED_DISPLAY_128X64 - oled_advance_page(true); -#endif -} - -#if defined(POINTING_DEVICE_ENABLE) -extern bool tap_toggling; -#endif - -void render_user_status(void) { -#ifdef AUDIO_ENABLE - bool is_audio_on = false, is_clicky_on = false; -# ifdef SPLIT_KEYBOARD - - is_audio_on = user_state.audio_enable; - is_clicky_on = user_state.audio_clicky_enable; -# else - is_audio_on = is_audio_on(); - is_clicky_on = is_clicky_on(); -# endif -#endif - oled_write_P(PSTR(OLED_RENDER_USER_NAME), false); -#if !defined(OLED_DISPLAY_128X64) - oled_write_P(PSTR(" "), false); -#endif -#if defined(RGB_MATRIX_ENABLE) - oled_write_P(PSTR(OLED_RENDER_USER_ANIM), userspace_config.rgb_matrix_idle_anim); -# if !defined(OLED_DISPLAY_128X64) - oled_write_P(PSTR(" "), false); -# endif -#elif defined(POINTING_DEVICE_ENABLE) - static const char PROGMEM mouse_lock[3] = {0xF2, 0xF3, 0}; - oled_write_P(mouse_lock, tap_toggling); -#endif -#ifdef AUDIO_ENABLE - static const char PROGMEM audio_status[2][3] = {{0xE0, 0xE1, 0}, {0xE2, 0xE3, 0}}; - oled_write_P(audio_status[is_audio_on], false); - -# ifdef AUDIO_CLICKY - static const char PROGMEM audio_clicky_status[2][3] = {{0xF4, 0xF5, 0}, {0xF6, 0xF7, 0}}; - oled_write_P(audio_clicky_status[is_clicky_on && is_audio_on], false); -# if !defined(OLED_DISPLAY_128X64) - oled_write_P(PSTR(" "), false); -# endif -# endif -#endif - - static const char PROGMEM rgb_layer_status[2][3] = {{0xEE, 0xEF, 0}, {0xF0, 0xF1, 0}}; - oled_write_P(rgb_layer_status[userspace_config.rgb_layer_change], false); - static const char PROGMEM cat_mode[2][3] = {{0xF8, 0xF9, 0}, {0xF6, 0xF7, 0}}; - oled_write_P(cat_mode[0], host_driver_disabled); -#if defined(CUSTOM_UNICODE_ENABLE) - static const char PROGMEM uc_mod_status[5][3] = {{0xEA, 0xEB, 0}, {0xEC, 0xED, 0}}; - oled_write_P(uc_mod_status[get_unicode_input_mode() == UC_MAC], false); -#endif - if (userspace_config.nuke_switch) { -#if !defined(OLED_DISPLAY_128X64) - oled_write_P(PSTR(" "), false); -#endif - static const char PROGMEM nukem_good[2] = {0xFA, 0}; - oled_write_P(nukem_good, false); -#if !defined(OLED_DISPLAY_128X64) - oled_advance_page(true); -#endif - } -#if defined(OLED_DISPLAY_128X64) - oled_advance_page(true); -#endif -} - -void oled_driver_render_logo(void) { - // clang-format off - static const char PROGMEM qmk_logo[] = { - 0x80,0x81,0x82,0x83,0x84,0x85,0x86,0x87,0x88,0x89,0x8a,0x8b,0x8c,0x8d,0x8e,0x8f,0x90,0x91,0x92,0x93,0x94, - 0xa0,0xa1,0xa2,0xa3,0xa4,0xa5,0xa6,0xa7,0xa8,0xa9,0xaa,0xab,0xac,0xad,0xae,0xaf,0xb0,0xb1,0xb2,0xb3,0xb4, - 0xc0,0xc1,0xc2,0xc3,0xc4,0xc5,0xc6,0xc7,0xc8,0xc9,0xca,0xcb,0xcc,0xcd,0xce,0xcf,0xd0,0xd1,0xd2,0xd3,0xd4,0}; - // clang-format on - oled_write_P(qmk_logo, false); -} - -void render_wpm(uint8_t padding) { -#ifdef WPM_ENABLE - - oled_write_P(PSTR(OLED_RENDER_WPM_COUNTER), false); - if (padding) { - for (uint8_t n = padding; n > 0; n--) { - oled_write_P(PSTR(" "), false); - } - } - oled_write(get_u8_str(get_current_wpm(), ' '), false); -#endif -} - -#if defined(KEYBOARD_handwired_tractyl_manuform_5x6_right) -extern kb_config_data_t kb_config; -void render_pointing_dpi_status(uint8_t padding) { - oled_write_P(PSTR("CPI:"), false); - if (padding) { - for (uint8_t n = padding - 1; n > 0; n--) { - oled_write_P(PSTR(" "), false); - } - } - - oled_write(get_u16_str(kb_config.device_cpi, ' '), false); -} -#endif - -__attribute__((weak)) void oled_driver_render_logo_right(void) { -#if defined(OLED_DISPLAY_128X64) - oled_driver_render_logo(); - render_default_layer_state(); - oled_set_cursor(0, 4); -#else - render_default_layer_state(); -#endif -} - -__attribute__((weak)) void oled_driver_render_logo_left(void) { -#if defined(OLED_DISPLAY_128X64) - oled_driver_render_logo(); -# ifdef DEBUG_MATRIX_SCAN_RATE - render_matrix_scan_rate(); -# elif defined(WPM_ENABLE) - render_wpm(0); -# endif - oled_write_P(PSTR(" "), false); -# if defined(KEYBOARD_handwired_tractyl_manuform_5x6_right) - render_pointing_dpi_status(1); -# endif - oled_set_cursor(0, 4); -#else - render_default_layer_state(); -#endif -} - -void render_status_secondary(void) { - oled_driver_render_logo_right(); - /* Show Keyboard Layout */ - render_layer_state(); - render_mod_status(get_mods() | get_oneshot_mods()); -#if !defined(OLED_DISPLAY_128X64) && defined(WPM_ENABLE) && !defined(CONVERT_TO_PROTON_C) - render_wpm(2); -#endif - // render_keylock_status(host_keyboard_leds()); -} - -void render_status_main(void) { - oled_driver_render_logo_left(); - - /* Show Keyboard Layout */ - // render_keylock_status(host_keyboard_leds()); - render_bootmagic_status(); - render_user_status(); - - // render_keylogger_status(); -} - -__attribute__((weak)) oled_rotation_t oled_init_keymap(oled_rotation_t rotation) { return rotation; } - -oled_rotation_t oled_init_user(oled_rotation_t rotation) { - memset(keylog_str, ' ', sizeof(keylog_str) - 1); - - return oled_init_keymap(rotation); -} - -bool oled_task_user(void) { - update_log(); - - if (is_keyboard_master()) { - if (timer_elapsed32(oled_timer) > 30000) { - oled_off(); - return false; - } else { - oled_on(); - } - } - if (is_keyboard_left()) { - render_status_main(); // Renders the current keyboard state (layer, lock, caps, scroll, etc) - } else { - render_status_secondary(); - } - if (is_keyboard_master()) { - render_keylogger_status(); - } else { - render_keylock_status(host_keyboard_leds()); - } - return false; -} diff --git a/users/drashna/oled_stuff.h b/users/drashna/oled_stuff.h deleted file mode 100644 index 8795684d6a..0000000000 --- a/users/drashna/oled_stuff.h +++ /dev/null @@ -1,131 +0,0 @@ -/* Copyright 2020 Christopher Courtney, aka Drashna Jael're (@drashna) - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -#pragma once - -#include "quantum.h" -#include "oled_driver.h" - -void oled_driver_render_logo(void); -bool process_record_user_oled(uint16_t keycode, keyrecord_t *record); -oled_rotation_t oled_init_keymap(oled_rotation_t rotation); -extern uint32_t oled_timer; -void render_keylogger_status(void); -void render_default_layer_state(void); -void render_layer_state(void); -void render_keylock_status(uint8_t led_usb_state); -void render_matrix_scan_rate(void); -void render_mod_status(uint8_t modifiers); -void render_bootmagic_status(void); -void render_user_status(void); -void oled_driver_render_logo(void); -void render_wpm(uint8_t padding); -void render_pointing_dpi_status(uint8_t padding); -void oled_driver_render_logo_left(void); -void oled_driver_render_logo_right(void); - -#ifdef OLED_DISPLAY_128X64 -# define OLED_RENDER_KEYLOGGER "Keylogger: " - -# define OLED_RENDER_LAYOUT_NAME "Layout: " -# define OLED_RENDER_LAYOUT_QWERTY "Qwerty" -# define OLED_RENDER_LAYOUT_COLEMAK_DH "Colemak-DH" -# define OLED_RENDER_LAYOUT_COLEMAK "Colemak" -# define OLED_RENDER_LAYOUT_DVORAK "Dvorak" -# define OLED_RENDER_LAYOUT_WORKMAN "Workman" -# define OLED_RENDER_LAYOUT_NORMAN "Norman" -# define OLED_RENDER_LAYOUT_MALTRON "Matron" -# define OLED_RENDER_LAYOUT_EUCALYN "Eucalyn" -# define OLED_RENDER_LAYOUT_CARPLAX "Carplax" - -# define OLED_RENDER_LAYER_NAME "Layer:" -# define OLED_RENDER_LAYER_LOWER "Lower" -# define OLED_RENDER_LAYER_RAISE "Raise" -# define OLED_RENDER_LAYER_ADJUST "Adjust" -# define OLED_RENDER_LAYER_MODS "Mods" - -# define OLED_RENDER_LOCK_NAME "Lock: " -# define OLED_RENDER_LOCK_NUML "NUML" -# define OLED_RENDER_LOCK_CAPS "CAPS" -# define OLED_RENDER_LOCK_SCLK "SCLK" - -# define OLED_RENDER_MODS_NAME "Mods:" -# define OLED_RENDER_MODS_SFT "Sft" -# define OLED_RENDER_MODS_CTL "Ctl" -# define OLED_RENDER_MODS_ALT "Alt" -# define OLED_RENDER_MODS_GUI "GUI" - -# define OLED_RENDER_BOOTMAGIC_NAME "Boot " -# define OLED_RENDER_BOOTMAGIC_NKRO "NKRO" -# define OLED_RENDER_BOOTMAGIC_NOGUI "nGUI" -# define OLED_RENDER_BOOTMAGIC_GRV "GRV" -# define OLED_RENDER_BOOTMAGIC_ONESHOT "1SHT" -# define OLED_RENDER_BOOTMAGIC_SWAP "SWAP" -# define OLED_RENDER_BOOTMAGIC_CAPS "CAPS" - -# define OLED_RENDER_USER_NAME "USER:" -# define OLED_RENDER_USER_ANIM "Anim" -# define OLED_RENDER_USER_LAYR "Layr" -# define OLED_RENDER_USER_NUKE "Nuke" - -# define OLED_RENDER_WPM_COUNTER "WPM: " -#else -# define OLED_RENDER_KEYLOGGER "KLogr" - -# define OLED_RENDER_LAYOUT_NAME "Lyout" -# define OLED_RENDER_LAYOUT_QWERTY " QRTY" -# define OLED_RENDER_LAYOUT_COLEMAK_DH " cmDH" -# define OLED_RENDER_LAYOUT_COLEMAK " COLE" -# define OLED_RENDER_LAYOUT_DVORAK " DVRK" -# define OLED_RENDER_LAYOUT_WORKMAN " WKMN" -# define OLED_RENDER_LAYOUT_NORMAN " NORM" -# define OLED_RENDER_LAYOUT_MALTRON " MLTN" -# define OLED_RENDER_LAYOUT_EUCALYN " ECLN" -# define OLED_RENDER_LAYOUT_CARPLAX " CRPX" - -# define OLED_RENDER_LAYER_NAME "LAYER" -# define OLED_RENDER_LAYER_LOWER "Lower" -# define OLED_RENDER_LAYER_RAISE "Raise" -# define OLED_RENDER_LAYER_ADJUST "Adjst" -# define OLED_RENDER_LAYER_MODS " Mods" - -# define OLED_RENDER_LOCK_NAME "Lock:" -# define OLED_RENDER_LOCK_NUML "NumL" -# define OLED_RENDER_LOCK_CAPS "CapL" -# define OLED_RENDER_LOCK_SCLK "ScrL" - -# define OLED_RENDER_MODS_NAME "Mods: " -# define OLED_RENDER_MODS_SFT "Shft" -# define OLED_RENDER_MODS_CTL "Ctrl" -# define OLED_RENDER_MODS_ALT "Alt\n" -# define OLED_RENDER_MODS_GUI "GUI\n" - -# define OLED_RENDER_BOOTMAGIC_NAME "BTMGK" -# define OLED_RENDER_BOOTMAGIC_NKRO "NKRO" -# define OLED_RENDER_BOOTMAGIC_NOGUI "nGUI" -# define OLED_RENDER_BOOTMAGIC_GRV "GRV" -# define OLED_RENDER_BOOTMAGIC_ONESHOT "1SHT" -# define OLED_RENDER_BOOTMAGIC_SWAP "SWAP" -# define OLED_RENDER_BOOTMAGIC_CAPS "CAPS" - -# define OLED_RENDER_USER_NAME "USER:" -# define OLED_RENDER_USER_ANIM "Anim" -# define OLED_RENDER_USER_LAYR "Layr" -# define OLED_RENDER_USER_NUKE "Nuke" - -# define OLED_RENDER_WPM_COUNTER "WPM: " - -#endif diff --git a/users/drashna/pointing/pointing.c b/users/drashna/pointing/pointing.c new file mode 100644 index 0000000000..0198a8ae23 --- /dev/null +++ b/users/drashna/pointing/pointing.c @@ -0,0 +1,136 @@ +/* Copyright 2020 Christopher Courtney, aka Drashna Jael're (@drashna) + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#include "pointing.h" + +static uint16_t mouse_timer = 0; +static uint16_t mouse_debounce_timer = 0; +static uint8_t mouse_keycode_tracker = 0; +bool tap_toggling = false, enable_acceleration = false; + +#ifdef TAPPING_TERM_PER_KEY +# define TAP_CHECK get_tapping_term(KC_BTN1, NULL) +#else +# ifndef TAPPING_TERM +# define TAPPING_TERM 200 +# endif +# define TAP_CHECK TAPPING_TERM +#endif + +__attribute__((weak)) report_mouse_t pointing_device_task_keymap(report_mouse_t mouse_report) { + return mouse_report; +} + +report_mouse_t pointing_device_task_user(report_mouse_t mouse_report) { + int8_t x = mouse_report.x, y = mouse_report.y; + mouse_report.x = 0; + mouse_report.y = 0; + + if (x != 0 && y != 0) { + mouse_timer = timer_read(); +#ifdef OLED_ENABLE + oled_timer = timer_read32(); +#endif + if (timer_elapsed(mouse_debounce_timer) > TAP_CHECK) { + if (enable_acceleration) { + x = (x > 0 ? x * x / 16 + x : -x * x / 16 + x); + y = (y > 0 ? y * y / 16 + y : -y * y / 16 + y); + } + mouse_report.x = x; + mouse_report.y = y; + if (!layer_state_is(_MOUSE)) { + layer_on(_MOUSE); + } + } + } + return pointing_device_task_keymap(mouse_report); +} + +void matrix_scan_pointing(void) { + if (timer_elapsed(mouse_timer) > 650 && layer_state_is(_MOUSE) && !mouse_keycode_tracker && !tap_toggling) { + layer_off(_MOUSE); + } + if (tap_toggling) { + if (!layer_state_is(_MOUSE)) { + layer_on(_MOUSE); + } + } +} + +bool process_record_pointing(uint16_t keycode, keyrecord_t* record) { + switch (keycode) { + case TT(_MOUSE): + if (record->event.pressed) { + mouse_keycode_tracker++; + } else { +#if TAPPING_TOGGLE != 0 + if (record->tap.count == TAPPING_TOGGLE) { + tap_toggling ^= 1; +# if TAPPING_TOGGLE == 1 + if (!tap_toggling) mouse_keycode_tracker -= record->tap.count + 1; +# else + if (!tap_toggling) mouse_keycode_tracker -= record->tap.count; +# endif + } else { + mouse_keycode_tracker--; + } +#endif + } + mouse_timer = timer_read(); + break; + case TG(_MOUSE): + if (record->event.pressed) { + tap_toggling ^= 1; + } + break; + case MO(_MOUSE): +#if defined(KEYBOARD_ploopy) || defined(KEYBOARD_handwired_tractyl_manuform) + case DPI_CONFIG: +#elif defined(KEYBOARD_bastardkb_charybdis) + case SAFE_RANGE ... (CHARYBDIS_SAFE_RANGE-1): +#endif + case KC_MS_UP ... KC_MS_WH_RIGHT: + record->event.pressed ? mouse_keycode_tracker++ : mouse_keycode_tracker--; + mouse_timer = timer_read(); + break; + case KC_ACCEL: + enable_acceleration = record->event.pressed; + record->event.pressed ? mouse_keycode_tracker++ : mouse_keycode_tracker--; + mouse_timer = timer_read(); + break; + default: + if (IS_NOEVENT(record->event)) break; + if ((keycode >= QK_LAYER_TAP && keycode <= QK_LAYER_TAP_MAX) && (((keycode >> 0x8) & 0xF) == _MOUSE)) { + record->event.pressed ? mouse_keycode_tracker++ : mouse_keycode_tracker--; + mouse_timer = timer_read(); + break; + } + if (layer_state_is(_MOUSE) && !mouse_keycode_tracker) { + layer_off(_MOUSE); + } + mouse_keycode_tracker = 0; + mouse_debounce_timer = timer_read(); + break; + } + return true; +} + +layer_state_t layer_state_set_pointing(layer_state_t state) { + if (layer_state_cmp(state, _GAMEPAD) || layer_state_cmp(state, _DIABLO)) { + state |= ((layer_state_t)1 << _MOUSE); + } + return state; +} diff --git a/users/drashna/pointing/pointing.h b/users/drashna/pointing/pointing.h new file mode 100644 index 0000000000..4ad16eeff3 --- /dev/null +++ b/users/drashna/pointing/pointing.h @@ -0,0 +1,23 @@ +/* Copyright 2020 Christopher Courtney, aka Drashna Jael're (@drashna) + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#include "drashna.h" + +report_mouse_t pointing_device_task_keymap(report_mouse_t mouse_report); +void matrix_scan_pointing(void); +bool process_record_pointing(uint16_t keycode, keyrecord_t* record); +layer_state_t layer_state_set_pointing(layer_state_t state); +extern bool tap_toggling, enable_acceleration; diff --git a/users/drashna/process_records.c b/users/drashna/process_records.c deleted file mode 100644 index de572d8933..0000000000 --- a/users/drashna/process_records.c +++ /dev/null @@ -1,205 +0,0 @@ -/* Copyright 2020 Christopher Courtney, aka Drashna Jael're (@drashna) - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -#include "drashna.h" -#include "version.h" - -uint16_t copy_paste_timer; -bool host_driver_disabled = false; -// Defines actions tor my global custom keycodes. Defined in drashna.h file -// Then runs the _keymap's record handier if not processed here - -__attribute__((weak)) bool process_record_keymap(uint16_t keycode, keyrecord_t *record) { return true; } -__attribute__((weak)) bool process_record_secrets(uint16_t keycode, keyrecord_t *record) { return true; } -bool process_record_user(uint16_t keycode, keyrecord_t *record) { - // If console is enabled, it will print the matrix position and status of each key pressed -#ifdef KEYLOGGER_ENABLE - uprintf("KL: kc: 0x%04X, col: %2u, row: %2u, pressed: %b, time: %5u, int: %b, count: %u\n", keycode, record->event.key.col, record->event.key.row, record->event.pressed, record->event.time, record->tap.interrupted, record->tap.count); -#endif // KEYLOGGER_ENABLE -#ifdef OLED_ENABLE - process_record_user_oled(keycode, record); -#endif // OLED - - if (!(process_record_keymap(keycode, record) && process_record_secrets(keycode, record) -#ifdef RGB_MATRIX_ENABLE - && process_record_user_rgb_matrix(keycode, record) -#endif -#ifdef RGBLIGHT_ENABLE - && process_record_user_rgb_light(keycode, record) -#endif -#ifdef CUSTOM_UNICODE_ENABLE - && process_record_unicode(keycode, record) -#endif - && true)) { - return false; - } - - switch (keycode) { - case FIRST_DEFAULT_LAYER_KEYCODE ... LAST_DEFAULT_LAYER_KEYCODE: - if (record->event.pressed) { - uint8_t mods = mod_config(get_mods() | get_oneshot_mods()); - if (!mods) { - set_single_persistent_default_layer(keycode - FIRST_DEFAULT_LAYER_KEYCODE); -#if LAST_DEFAULT_LAYER_KEYCODE > (FIRST_DEFAULT_LAYER_KEYCODE + 3) - } else if (mods & MOD_MASK_SHIFT) { - set_single_persistent_default_layer(keycode - FIRST_DEFAULT_LAYER_KEYCODE + 4); -# if LAST_DEFAULT_LAYER_KEYCODE > (FIRST_DEFAULT_LAYER_KEYCODE + 7) - - } else if (mods & MOD_MASK_CTRL) { - set_single_persistent_default_layer(keycode - FIRST_DEFAULT_LAYER_KEYCODE + 8); -# endif -#endif - } - } - break; - - case KC_MAKE: // Compiles the firmware, and adds the flash command based on keyboard bootloader - if (!record->event.pressed) { -#ifndef MAKE_BOOTLOADER - uint8_t temp_mod = mod_config(get_mods()); - uint8_t temp_osm = mod_config(get_oneshot_mods()); - clear_mods(); - clear_oneshot_mods(); -#endif - send_string_with_delay_P(PSTR("qmk"), TAP_CODE_DELAY); -#ifndef MAKE_BOOTLOADER - if ((temp_mod | temp_osm) & MOD_MASK_SHIFT) -#endif - { - send_string_with_delay_P(PSTR(" flash "), TAP_CODE_DELAY); -#ifndef MAKE_BOOTLOADER - } else { - send_string_with_delay_P(PSTR(" compile "), TAP_CODE_DELAY); -#endif - } - send_string_with_delay_P(PSTR("-kb " QMK_KEYBOARD " -km " QMK_KEYMAP), TAP_CODE_DELAY); -#ifdef CONVERT_TO_PROTON_C - send_string_with_delay_P(PSTR(" -e CTPC=yes"), TAP_CODE_DELAY); -#endif - send_string_with_delay_P(PSTR(SS_TAP(X_ENTER)), TAP_CODE_DELAY); - } - break; - - case VRSN: // Prints firmware version - if (record->event.pressed) { - send_string_with_delay_P(PSTR(QMK_KEYBOARD "/" QMK_KEYMAP " @ " QMK_VERSION ", Built on: " QMK_BUILDDATE), TAP_CODE_DELAY); - } - break; - - case KC_DIABLO_CLEAR: // reset all Diablo timers, disabling them -#ifdef TAP_DANCE_ENABLE - if (record->event.pressed) { - for (uint8_t index = 0; index < 4; index++) { - diablo_timer[index].key_interval = 0; - } - } -#endif // TAP_DANCE_ENABLE - break; - - case KC_CCCV: // One key copy/paste - if (record->event.pressed) { - copy_paste_timer = timer_read(); - } else { - if (timer_elapsed(copy_paste_timer) > TAPPING_TERM) { // Hold, copy - tap_code16(LCTL(KC_C)); - } else { // Tap, paste - tap_code16(LCTL(KC_V)); - } - } - break; - case KC_RGB_T: // This allows me to use underglow as layer indication, or as normal -#if defined(RGBLIGHT_ENABLE) || defined(RGB_MATRIX_ENABLE) - if (record->event.pressed) { - userspace_config.rgb_layer_change ^= 1; - dprintf("rgblight layer change [EEPROM]: %u\n", userspace_config.rgb_layer_change); - eeconfig_update_user(userspace_config.raw); - if (userspace_config.rgb_layer_change) { -# if defined(RGBLIGHT_ENABLE) && defined(RGB_MATRIX_ENABLE) - rgblight_enable_noeeprom(); -# endif - layer_state_set(layer_state); // This is needed to immediately set the layer color (looks better) -# if defined(RGBLIGHT_ENABLE) && defined(RGB_MATRIX_ENABLE) - } else { - rgblight_disable_noeeprom(); -# endif - } - } -#endif // RGBLIGHT_ENABLE - break; - -#if defined(RGBLIGHT_ENABLE) || defined(RGB_MATRIX_ENABLE) - case RGB_TOG: - // Split keyboards need to trigger on key-up for edge-case issue -# ifndef SPLIT_KEYBOARD - if (record->event.pressed) { -# else - if (!record->event.pressed) { -# endif -# if defined(RGBLIGHT_ENABLE) && !defined(RGBLIGHT_DISABLE_KEYCODES) - rgblight_toggle(); -# endif -# if defined(RGB_MATRIX_ENABLE) && !defined(RGB_MATRIX_DISABLE_KEYCODES) - rgb_matrix_toggle(); -# endif - } - return false; - break; - case RGB_MODE_FORWARD ... RGB_MODE_GRADIENT: // quantum_keycodes.h L400 for definitions - if (record->event.pressed) { - bool is_eeprom_updated; -# if defined(RGBLIGHT_ENABLE) && !defined(RGBLIGHT_DISABLE_KEYCODES) - // This disables layer indication, as it's assumed that if you're changing this ... you want that disabled - if (userspace_config.rgb_layer_change) { - userspace_config.rgb_layer_change = false; - dprintf("rgblight layer change [EEPROM]: %u\n", userspace_config.rgb_layer_change); - is_eeprom_updated = true; - } -# endif -# if defined(RGB_MATRIX_ENABLE) && defined(RGB_MATRIX_FRAMEBUFFER_EFFECTS) - if (userspace_config.rgb_matrix_idle_anim) { - userspace_config.rgb_matrix_idle_anim = false; - dprintf("RGB Matrix Idle Animation [EEPROM]: %u\n", userspace_config.rgb_matrix_idle_anim); - is_eeprom_updated = true; - } -# endif - if (is_eeprom_updated) { - eeconfig_update_user(userspace_config.raw); - } - } - break; -#endif - case KEYLOCK: { - static host_driver_t *host_driver = 0; - - if (record->event.pressed) { - if (host_get_driver()) { - host_driver = host_get_driver(); - clear_keyboard(); - host_set_driver(0); - host_driver_disabled = true; - } else { - host_set_driver(host_driver); - host_driver_disabled = false; - } - } - break; - } - } - return true; -} - -__attribute__((weak)) void post_process_record_keymap(uint16_t keycode, keyrecord_t *record) {} -void post_process_record_user(uint16_t keycode, keyrecord_t *record) { post_process_record_keymap(keycode, record); } diff --git a/users/drashna/process_records.h b/users/drashna/process_records.h deleted file mode 100644 index d8c198a2d4..0000000000 --- a/users/drashna/process_records.h +++ /dev/null @@ -1,139 +0,0 @@ -/* Copyright 2020 Christopher Courtney, aka Drashna Jael're (@drashna) - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -#pragma once -#include "drashna.h" - -#if defined(KEYBOARD_handwired_tractyl_manuform_5x6_right) -# define PLACEHOLDER_SAFE_RANGE KEYMAP_SAFE_RANGE -#else -# define PLACEHOLDER_SAFE_RANGE SAFE_RANGE -#endif - -enum userspace_custom_keycodes { - VRSN = PLACEHOLDER_SAFE_RANGE, // Prints QMK Firmware and board info - KC_QWERTY, // Sets default layer to QWERTY - FIRST_DEFAULT_LAYER_KEYCODE = KC_QWERTY, // Sets default layer to QWERTY - KC_COLEMAK_DH, // Sets default layer to COLEMAK - KC_COLEMAK, // Sets default layer to COLEMAK - KC_DVORAK, // Sets default layer to DVORAK - LAST_DEFAULT_LAYER_KEYCODE = KC_DVORAK, // Sets default layer to WORKMAN - KC_DIABLO_CLEAR, // Clears all Diablo Timers - KC_MAKE, // Run keyboard's customized make command - KC_RGB_T, // Toggles RGB Layer Indication mode - RGB_IDL, // RGB Idling animations - KC_SECRET_1, // test1 - KC_SECRET_2, // test2 - KC_SECRET_3, // test3 - KC_SECRET_4, // test4 - KC_SECRET_5, // test5 - KC_CCCV, // Hold to copy, tap to paste - KC_NUKE, // NUCLEAR LAUNCH DETECTED!!! - UC_FLIP, // (ಠ痊ಠ)┻━┻ - UC_TABL, // ┬─┬ノ( º _ ºノ) - UC_SHRG, // ¯\_(ツ)_/¯ - UC_DISA, // ಠ_ಠ - UC_IRNY, - UC_CLUE, - KEYLOCK, // Locks keyboard by unmounting driver - KC_NOMODE, - KC_WIDE, - KC_SCRIPT, - KC_BLOCKS, - KC_REGIONAL, - KC_AUSSIE, - KC_ZALGO, - NEW_SAFE_RANGE // use "NEWPLACEHOLDER for keymap specific codes -}; - -bool process_record_secrets(uint16_t keycode, keyrecord_t *record); -bool process_record_keymap(uint16_t keycode, keyrecord_t *record); -void post_process_record_keymap(uint16_t keycode, keyrecord_t *record); -#ifdef CUSTOM_UNICODE_ENABLE -bool process_record_unicode(uint16_t keycode, keyrecord_t *record); -#endif - -#define LOWER MO(_LOWER) -#define RAISE MO(_RAISE) -#define ADJUST MO(_ADJUST) -#define TG_MODS OS_TOGG -#define TG_GAME TG(_GAMEPAD) -#define TG_DBLO TG(_DIABLO) -#define OS_LWR OSL(_LOWER) -#define OS_RSE OSL(_RAISE) - -#define KC_SEC1 KC_SECRET_1 -#define KC_SEC2 KC_SECRET_2 -#define KC_SEC3 KC_SECRET_3 -#define KC_SEC4 KC_SECRET_4 -#define KC_SEC5 KC_SECRET_5 - -#define QWERTY KC_QWERTY -#define DVORAK KC_DVORAK -#define COLEMAK KC_COLEMAK -#define COLEMAKDH KC_COLEMAK_DH - -#define DEFLYR1 FIRST_DEFAULT_LAYER_KEYCODE -#define DEFLYR2 (FIRST_DEFAULT_LAYER_KEYCODE + 1) -#define DEFLYR3 (FIRST_DEFAULT_LAYER_KEYCODE + 2) -#define DEFLYR4 (FIRST_DEFAULT_LAYER_KEYCODE + 3) -#if LAST_DEFAULT_LAYER_KEYCODE > (FIRST_DEFAULT_LAYER_KEYCODE + 3) -# define DEFLYR5 (FIRST_DEFAULT_LAYER_KEYCODE + 4) -# define DEFLYR6 (FIRST_DEFAULT_LAYER_KEYCODE + 5) -# define DEFLYR7 (FIRST_DEFAULT_LAYER_KEYCODE + 6) -# define DEFLYR8 (FIRST_DEFAULT_LAYER_KEYCODE + 7) -# if LAST_DEFAULT_LAYER_KEYCODE > (FIRST_DEFAULT_LAYER_KEYCODE + 7) -# define DEFLYR9 (FIRST_DEFAULT_LAYER_KEYCODE + 8) -# define DEFLYR10 (FIRST_DEFAULT_LAYER_KEYCODE + 9) -# define DEFLYR11 (FIRST_DEFAULT_LAYER_KEYCODE + 10) -# define DEFLYR12 (FIRST_DEFAULT_LAYER_KEYCODE + 11) -# endif -#endif - -#define KC_RESET RESET -#define KC_RST KC_RESET - -#ifdef SWAP_HANDS_ENABLE -# define KC_C1R3 SH_T(KC_TAB) -#elif defined(DRASHNA_LP) -# define KC_C1R3 TG(_GAMEPAD) -#else // SWAP_HANDS_ENABLE -# define KC_C1R3 KC_TAB -#endif // SWAP_HANDS_ENABLE - -#define BK_LWER LT(_LOWER, KC_BSPC) -#define SP_LWER LT(_LOWER, KC_SPC) -#define DL_RAIS LT(_RAISE, KC_DEL) -#define ET_RAIS LT(_RAISE, KC_ENTER) - -/* OSM keycodes, to keep things clean and easy to change */ -#define KC_MLSF OSM(MOD_LSFT) -#define KC_MRSF OSM(MOD_RSFT) - -#define OS_LGUI OSM(MOD_LGUI) -#define OS_RGUI OSM(MOD_RGUI) -#define OS_LSFT OSM(MOD_LSFT) -#define OS_RSFT OSM(MOD_RSFT) -#define OS_LCTL OSM(MOD_LCTL) -#define OS_RCTL OSM(MOD_RCTL) -#define OS_LALT OSM(MOD_LALT) -#define OS_RALT OSM(MOD_RALT) -#define OS_MEH OSM(MOD_MEH) -#define OS_HYPR OSM(MOD_HYPR) - -#define ALT_APP ALT_T(KC_APP) - -#define MG_NKRO MAGIC_TOGGLE_NKRO diff --git a/users/drashna/readme.md b/users/drashna/readme.md index d98d1d0a6b..b8d10aada2 100644 --- a/users/drashna/readme.md +++ b/users/drashna/readme.md @@ -2,12 +2,12 @@ This is my personal userspace file. Most of my code exists here, as it's heavily shared. -* [RGB Customization](readme_rgb.md) -* [Diablo Tap Dancing](readme_tap_dance.md) -* [Keymap Wrappers](readme_wrappers.md) -* [Custom Function Handlers](readme_handlers.md) -* [Secret Macros](readme_secrets.md) -* [Custom Keycodes](readme_keycodes.md) +* [RGB Customization](readme/rgb.md) +* [Diablo Tap Dancing](readme/tap_dance.md) +* [Keymap Wrappers](readme/wrappers.md) +* [Custom Function Handlers](readme/handlers.md) +* [Secret Macros](readme/secrets.md) +* [Custom Keycodes](readme/keycodes.md) ## Pro Micro Hacking diff --git a/users/drashna/readme/handlers.md b/users/drashna/readme/handlers.md new file mode 100644 index 0000000000..4abaf51473 --- /dev/null +++ b/users/drashna/readme/handlers.md @@ -0,0 +1,97 @@ +# Custom Userspace Function handlers + +Specifically QMK works by using customized handlers for everything. This allows for multiple levels of customization. + +`matrix_scan` calls `matrix_scan_quantum`, which calls `matrix_scan_kb`, which calls `matrix_scan_user`. +`process_record` calls a bunch of stuff, but eventually calls `process_record_kb` which calls `process_record_user` +The same goes for `matrix_init`, `layer_state_set`, `led_set`, and a few other functions. + +All (most) `_user` functions are handled here, in the userspace instead. To allow keyboard specific configuration, I've created `_keymap` functions that can be called by the keymap.c files instead. + +This allows for keyboard specific configuration while maintaining the ability to customize the board. + +My [Ergodox EZ Keymap](https://github.com/qmk/qmk_firmware/blob/master/layouts/community/ergodox/drashna/keymap.c) is a good example of this, as it uses the LEDs as modifier indicators. + +But for a list: + +```c +__attribute__ ((weak)) +void matrix_init_keymap(void) {} + +void matrix_init_user(void) { + matrix_init_keymap(); +} + +__attribute__((weak)) +void keyboard_post_init_keymap(void){ } + +void keyboard_post_init_user(void){ + keyboard_post_init_keymap(); +} + +__attribute__ ((weak)) +void matrix_scan_keymap(void) {} + +void matrix_scan_user(void) { + matrix_scan_keymap(); +} + + +__attribute__ ((weak)) +bool process_record_keymap(uint16_t keycode, keyrecord_t *record) { + return true; +} + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + return process_record_keymap(keycode, record); +} + + +__attribute__ ((weak)) +layer_state_t layer_state_set_keymap (layer_state_t state) { + return state; +} + +layer_state_t layer_state_set_user (layer_state_t state) { + return layer_state_set_keymap (state); +} + + +__attribute__ ((weak)) +void led_set_keymap(uint8_t usb_led) {} + +void led_set_user(uint8_t usb_led) { + led_set_keymap(usb_led); +} + + +__attribute__ ((weak)) +void suspend_power_down_keymap(void) {} + +void suspend_power_down_user(void) { + suspend_power_down_keymap(); +} + + +__attribute__ ((weak)) +void suspend_wakeup_init_keymap(void) {} + +void suspend_wakeup_init_user(void) { + suspend_wakeup_init_keymap(); +} + + +__attribute__ ((weak)) +void shutdown_keymap(void) {} + +void shutdown_user (void) { + shutdown_keymap(); +} + +__attribute__ ((weak)) +void eeconfig_init_keymap(void) {} + +void eeconfig_init_user(void) { + eeconfig_init_keymap(); +} +``` diff --git a/users/drashna/readme/keycodes.md b/users/drashna/readme/keycodes.md new file mode 100644 index 0000000000..af4dd54bc0 --- /dev/null +++ b/users/drashna/readme/keycodes.md @@ -0,0 +1,10 @@ + +# Custom Keycodes + +Keycodes are defined in the drashna.h file and need to be included in the keymap.c files, so that they can be used there. + +A bunch of macros are present and are only included on boards that are not the Ergodox EZ or Orthodox, as they are not needed for those boards. + +Included is a custom macro for compiling my keyboards. This includes the bootloader target (`:teensy`, `:avrdude`, or `:dfu`), and keeps RGBLIGHT, AUDIO enabled, if it previously was (regardless of the rules file). + +This also includes a modified RESET keycode as well, that sets the underglow to red. diff --git a/users/drashna/readme/rgb.md b/users/drashna/readme/rgb.md new file mode 100644 index 0000000000..acf01b051e --- /dev/null +++ b/users/drashna/readme/rgb.md @@ -0,0 +1,43 @@ +# Layer Indication Code + +At least for RGB Light, the `layer_state_set` function is used to detect the current highest layer, and change the underglow based on that layer. + +This works for both the regular layers, and for the default layers, too. + +I use the sethsv variants of the commands, so that different modes can be used, as well. + +RGB Matrix uses a custom, per board implementation, at the moment. + +# RGB Light Startup Animation + +On startup, if enabled, the board will cycle through the entire hue wheel, starting and ending on the default layer color. + +```c +void keyboard_post_init_rgb(void) { +#if defined(RGBLIGHT_ENABLE) && defined(RGBLIGHT_STARTUP_ANIMATION) + if (userspace_config.rgb_layer_change) { rgblight_enable_noeeprom(); } + if (rgblight_config.enable) { + layer_state_set_user(layer_state); + uint16_t old_hue = rgblight_config.hue; + rgblight_mode_noeeprom(RGBLIGHT_MODE_STATIC_LIGHT); + for (uint16_t i = 255; i > 0; i--) { + rgblight_sethsv_noeeprom( ( i + old_hue) % 255, 255, 255); + matrix_scan(); + wait_ms(10); + } + } +#endif + layer_state_set_user(layer_state); +} +``` + +This could probably benefit from some cleanup and better handling. + + +# RGB Light Twinkling + +This enables random twinkling of the LEDs when typing. + +# RGB Light Mod Indicators + +Allows feedback of which mods (oneshot or otherwise) are enabled. diff --git a/users/drashna/readme/secrets.md b/users/drashna/readme/secrets.md new file mode 100644 index 0000000000..a9408dc2ef --- /dev/null +++ b/users/drashna/readme/secrets.md @@ -0,0 +1,123 @@ +# Secret Macros + +With help from gitter and Colinta, this adds the ability to add hidden macros from other users. + +First, I have several files that are hidden/excluded from Git/GitHub. These contain everything needed for the macros. To hide these files, open `.git/info/exclude` and add `secrets.c` and `secrets.h` to that file, below the comments. + +And this requires `KC_SECRET_1` through `KC_SECRET_5` to be added in your keycode enum (usually in your `.h` file) the keycodes for the new macros. + +## Git Exclusion + +To prevent `git` from seeing, or committing the secret files, you can exclude them. What's the point of having secrets if they're posted on GitHub for everyone to see!?! + +You can do this with the `.git/info/exclude` file, so that it's only ignored locally. Unfortunately, that means it's not consistently handled on each system. + +However, if you create a `.gitignore` file in the same folder, you keep things consistent between every system that the code is checked out on. + +```c +secrets.c +secrets.h +``` + +## secrets.c + +Here is the magic. This handles including the "secrets", and adding the custom macros to send them. + +```c +#include "drashna.h" // replace with your keymap's "h" file, or whatever file stores the keycodes + +#if (__has_include("secrets.h") && !defined(NO_SECRETS)) +#include "secrets.h" +#else +// `PROGMEM const char secret[][x]` may work better, but it takes up more space in the firmware +// And I'm not familiar enough to know which is better or why... +static const char * const secret[] = { + "test1", + "test2", + "test3", + "test4", + "test5" +}; +#endif + +bool process_record_secrets(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + case KC_SECRET_1 ... KC_SECRET_5: // Secrets! Externally defined strings, not stored in repo + if (!record->event.pressed) { + clear_oneshot_layer_state(ONESHOT_OTHER_KEY_PRESSED); + send_string_with_delay(secret[keycode - KC_SECRET_1], MACRO_TIMER); + } + return false; + break; + } + return true; +} +``` + +## secrets.h + +Now, for the actual secrets! The file needs to look like + +```c +static const char * secrets[] = { + "secret1", + "secret2", + "secret3", + "secret4", + "secret5" +}; +``` + +Replacing the strings with the codes that you need. + +## Process Record + +In whichever file you have your `process_record_*` function in, you will want to add this to the top: + +```c +__attribute__ ((weak)) +bool process_record_secrets(uint16_t keycode, keyrecord_t *record) { + return true; +} +``` + +This is so that the function can be called here, and replaced in the `secrets.c` file, and so it won't error out if it doesn't exist. + +And then, in the `process_record_user` function, assuming you have `return process_record_keymap(keycode, record)` here, you'll want to replace the "final" return with the following. Otherwise, you want to replace the `return true;` with `return process_record_secrets(keycode, record);` + +```c +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + // your existing macro code here. + return process_record_keymap(keycode, record) && process_record_secrets(keycode, record); +} +``` + +## rules.mk + +Here, you want your `/users//rules.mk` file to "detect" the existence of the `secrets.c` file, and only add it if the file exists. + +Additionally, to ensure that it's not added or processed in any way, it checks to see if `NO_SECRETS` is set. This way, if you run `make keyboard:name NO_SECRETS=yes`, it will remove the feature altogether. + +```make +ifneq ($(strip $(NO_SECRETS)), yes) + ifneq ("$(wildcard $(USER_PATH)/secrets.c)","") + SRC += secrets.c + endif +endif +``` + +Alternately, if you want to make sure that you can disable the function without messing with the file, you need to add this to your `/users//rules.mk`, so that it catches the flag: + +```make +ifneq ("$(wildcard $(USER_PATH)/secrets.c)","") + SRC += secrets.c +endif + +ifeq ($(strip $(NO_SECRETS)), yes) + OPT_DEFS += -DNO_SECRETS +endif +``` + +## Extras + +Additionally, because this file isn't present in the repo at all, you could add additional functionality that nobody else will see. diff --git a/users/drashna/readme/tap_dance.md b/users/drashna/readme/tap_dance.md new file mode 100644 index 0000000000..a61dd1f2b0 --- /dev/null +++ b/users/drashna/readme/tap_dance.md @@ -0,0 +1,119 @@ +# Diablo Tap Dances + +My [Tap Dance](https://github.com/qmk/qmk_firmware/blob/master/users/drashna/tap_dances.c) file includes the tap dance declarations, and everything needed for them. + +This is used for making Diablo 3 much easier to plan, especially at high rift levels. + +This works by using Tap Dances. The taps don't actually "do anything". Instead, it sets up the interval for how often to send specific keypresses. As you can tell, this makes automating things very easy. + +For critics that think this is cheating, just search "[diablo 3 num lock auto cast](http://lmgtfy.com/?q=diablo+3+numlock+autocast)". This is just a simpler method, that doesn't require a numpad. + + +## Custom Tap Dance Type +The real fun here is that the tap dances use a custom defined Tap Dance type: + +```c +#define ACTION_TAP_DANCE_DIABLO(index, keycode) { \ + .fn = { NULL, (void *)diablo_tapdance_master, NULL }, \ + .user_data = (void *)&((diable_keys_t) { index, keycode }), \ + } +``` +This lets me set an index and keycode for the tap dance. This isn't the cool part yet, but this allows for the really cool stuff. + +The Index is needed because I don't know how to handle it otherwise. + +## The Actual Dances + +These are the custom defined dances that I'm using. It sets up everything for later, using the above custom dance type. + +```c +//Tap Dance Definitions, sets the index and the keycode. +qk_tap_dance_action_t tap_dance_actions[] = { + // tap once to disable, and more to enable timed micros + [TD_D3_1] = ACTION_TAP_DANCE_DIABLO(0, KC_1), + [TD_D3_2] = ACTION_TAP_DANCE_DIABLO(1, KC_2), + [TD_D3_3] = ACTION_TAP_DANCE_DIABLO(2, KC_3), + [TD_D3_4] = ACTION_TAP_DANCE_DIABLO(3, KC_4), +}; +``` + +## Custom Data Structures + +First, to get this all working, there are a couple of things that need to be set up. In a header file (or you could put it into the keymap), you need to create a couple of custom structures: + +```c +typedef struct { + uint16_t timer; + uint8_t key_interval; + uint8_t keycode; +} diablo_timer_t; + +typedef struct { + uint8_t index; + uint8_t keycode; +} diable_keys_t; +``` + +The first structure is for tracking each key that is being used. The second is to pass data from the Tap Dance action array to the actual function that we will need. + + +## Custom Arrays + +To facilitate things, you will need a couple of arrays in your `c` file. + +```c +//define diablo macro timer variables +diablo_timer_t diablo_timer[4]; + +// Set the default intervals. Always start with 0 so that it will disable on first hit. +// Otherwise, you will need to hit a bunch of times, or hit the "clear" command +uint8_t diablo_times[] = { 0, 1, 3, 5, 10, 30 }; +``` + +The first one (`diablo_timer`) is what keeps track of the timer used for the keys, the interval that it uses, and the actual keycode. This makes managing it a lot easier. + +The second array is a list of predefined intervals, in seconds. You can add more here, or remove entries. It doesn't matter how long the array is, as this is computed automatically. + +## The Magic - Part 1: Master function + +The first part of the magic here is the `diablo_tapdance_master` function. The Tap Dance feature calls this function, directly, and passes some data to the function. Namely, it passes the array of the index and the keycode (`diablo_keys_t` from above). This sets the keycode and the interval for the specific index of `diabolo_timer` based on the number of taps. If you hit it more than the number of items in the array, then it zeroes out the interval, disabling it. + +```c +// Cycle through the times for the macro, starting at 0, for disabled. +void diablo_tapdance_master(qk_tap_dance_state_t *state, void *user_data) { + diable_keys_t *diablo_keys = (diable_keys_t *)user_data; + // Sets the keycode based on the index + diablo_timer[diablo_keys->index].keycode = diablo_keys->keycode; + + // if the tapdance is hit more than the number of elemints in the array, reset + if (state->count >= (sizeof(diablo_times) / sizeof(uint8_t) ) ) { + diablo_timer[diablo_keys->index].key_interval = 0; + reset_tap_dance(state); + } else { // else set the interval (tapdance count starts at 1, array starts at 0, so offset by one) + diablo_timer[diablo_keys->index].key_interval = diablo_times[state->count - 1]; + } +} +``` + +## The Magic - Part 2: The Coup de Grace + +The real core here is the `run_diablo_macro_check()` function. You need to call this from `matrix_scan_user`, as this handles the timer check. + +Specifically, it runs a check for each index of the timer. It checks to see if it's enabled, and if enough time has passed. If enough time has passed, it resets the timer, and will tap the keycode that you set for that index, but only if the Diablo layer is enabled. + +```c +// Checks each of the 4 timers/keys to see if enough time has elapsed +void run_diablo_macro_check(void) { + for (uint8_t index = 0; index < NUM_OF_DIABLO_KEYS; index++) { + // if key_interval is 0, it's disabled, so only run if it's set. If it's set, check the timer. + if ( diablo_timer[index].key_interval && timer_elapsed( diablo_timer[index].timer ) > ( diablo_timer[index].key_interval * 1000 ) ) { + // reset the timer, since enough time has passed + diablo_timer[index].timer = timer_read(); + // send keycode ONLY if we're on the diablo layer. + if (IS_LAYER_ON(_DIABLO)) { + tap_code(diablo_timer[index].keycode); + } + } + } +} +``` diff --git a/users/drashna/readme/wrappers.md b/users/drashna/readme/wrappers.md new file mode 100644 index 0000000000..fd62ff1609 --- /dev/null +++ b/users/drashna/readme/wrappers.md @@ -0,0 +1,11 @@ +## Keyboard Layout Templates + +This borrows from @jola5's "Not quite neo" code. This allows me to maintain blocks of keymaps in the userspace, so that I can modify the userspace, and this is reflected in all of the keyboards that use it, at once. + +This makes adding tap/hold mods, or other special keycodes or functions to all keyboards super easy, as it's done to all of them at once. + +The caveat here is that the keymap needs a processor/wrapper, as it doesn't like the substitutions. However, this is as simple as just pushing it through a define. For instance: + +`#define LAYOUT_ergodox_wrapper(...) LAYOUT_ergodox(__VA_ARGS__)` + +Once that's been done and you've switched the keymaps to use the "wrapper", it will read the substitution blocks just fine. diff --git a/users/drashna/readme_handlers.md b/users/drashna/readme_handlers.md deleted file mode 100644 index 4abaf51473..0000000000 --- a/users/drashna/readme_handlers.md +++ /dev/null @@ -1,97 +0,0 @@ -# Custom Userspace Function handlers - -Specifically QMK works by using customized handlers for everything. This allows for multiple levels of customization. - -`matrix_scan` calls `matrix_scan_quantum`, which calls `matrix_scan_kb`, which calls `matrix_scan_user`. -`process_record` calls a bunch of stuff, but eventually calls `process_record_kb` which calls `process_record_user` -The same goes for `matrix_init`, `layer_state_set`, `led_set`, and a few other functions. - -All (most) `_user` functions are handled here, in the userspace instead. To allow keyboard specific configuration, I've created `_keymap` functions that can be called by the keymap.c files instead. - -This allows for keyboard specific configuration while maintaining the ability to customize the board. - -My [Ergodox EZ Keymap](https://github.com/qmk/qmk_firmware/blob/master/layouts/community/ergodox/drashna/keymap.c) is a good example of this, as it uses the LEDs as modifier indicators. - -But for a list: - -```c -__attribute__ ((weak)) -void matrix_init_keymap(void) {} - -void matrix_init_user(void) { - matrix_init_keymap(); -} - -__attribute__((weak)) -void keyboard_post_init_keymap(void){ } - -void keyboard_post_init_user(void){ - keyboard_post_init_keymap(); -} - -__attribute__ ((weak)) -void matrix_scan_keymap(void) {} - -void matrix_scan_user(void) { - matrix_scan_keymap(); -} - - -__attribute__ ((weak)) -bool process_record_keymap(uint16_t keycode, keyrecord_t *record) { - return true; -} - -bool process_record_user(uint16_t keycode, keyrecord_t *record) { - return process_record_keymap(keycode, record); -} - - -__attribute__ ((weak)) -layer_state_t layer_state_set_keymap (layer_state_t state) { - return state; -} - -layer_state_t layer_state_set_user (layer_state_t state) { - return layer_state_set_keymap (state); -} - - -__attribute__ ((weak)) -void led_set_keymap(uint8_t usb_led) {} - -void led_set_user(uint8_t usb_led) { - led_set_keymap(usb_led); -} - - -__attribute__ ((weak)) -void suspend_power_down_keymap(void) {} - -void suspend_power_down_user(void) { - suspend_power_down_keymap(); -} - - -__attribute__ ((weak)) -void suspend_wakeup_init_keymap(void) {} - -void suspend_wakeup_init_user(void) { - suspend_wakeup_init_keymap(); -} - - -__attribute__ ((weak)) -void shutdown_keymap(void) {} - -void shutdown_user (void) { - shutdown_keymap(); -} - -__attribute__ ((weak)) -void eeconfig_init_keymap(void) {} - -void eeconfig_init_user(void) { - eeconfig_init_keymap(); -} -``` diff --git a/users/drashna/readme_keycodes.md b/users/drashna/readme_keycodes.md deleted file mode 100644 index af4dd54bc0..0000000000 --- a/users/drashna/readme_keycodes.md +++ /dev/null @@ -1,10 +0,0 @@ - -# Custom Keycodes - -Keycodes are defined in the drashna.h file and need to be included in the keymap.c files, so that they can be used there. - -A bunch of macros are present and are only included on boards that are not the Ergodox EZ or Orthodox, as they are not needed for those boards. - -Included is a custom macro for compiling my keyboards. This includes the bootloader target (`:teensy`, `:avrdude`, or `:dfu`), and keeps RGBLIGHT, AUDIO enabled, if it previously was (regardless of the rules file). - -This also includes a modified RESET keycode as well, that sets the underglow to red. diff --git a/users/drashna/readme_rgb.md b/users/drashna/readme_rgb.md deleted file mode 100644 index acf01b051e..0000000000 --- a/users/drashna/readme_rgb.md +++ /dev/null @@ -1,43 +0,0 @@ -# Layer Indication Code - -At least for RGB Light, the `layer_state_set` function is used to detect the current highest layer, and change the underglow based on that layer. - -This works for both the regular layers, and for the default layers, too. - -I use the sethsv variants of the commands, so that different modes can be used, as well. - -RGB Matrix uses a custom, per board implementation, at the moment. - -# RGB Light Startup Animation - -On startup, if enabled, the board will cycle through the entire hue wheel, starting and ending on the default layer color. - -```c -void keyboard_post_init_rgb(void) { -#if defined(RGBLIGHT_ENABLE) && defined(RGBLIGHT_STARTUP_ANIMATION) - if (userspace_config.rgb_layer_change) { rgblight_enable_noeeprom(); } - if (rgblight_config.enable) { - layer_state_set_user(layer_state); - uint16_t old_hue = rgblight_config.hue; - rgblight_mode_noeeprom(RGBLIGHT_MODE_STATIC_LIGHT); - for (uint16_t i = 255; i > 0; i--) { - rgblight_sethsv_noeeprom( ( i + old_hue) % 255, 255, 255); - matrix_scan(); - wait_ms(10); - } - } -#endif - layer_state_set_user(layer_state); -} -``` - -This could probably benefit from some cleanup and better handling. - - -# RGB Light Twinkling - -This enables random twinkling of the LEDs when typing. - -# RGB Light Mod Indicators - -Allows feedback of which mods (oneshot or otherwise) are enabled. diff --git a/users/drashna/readme_secrets.md b/users/drashna/readme_secrets.md deleted file mode 100644 index a9408dc2ef..0000000000 --- a/users/drashna/readme_secrets.md +++ /dev/null @@ -1,123 +0,0 @@ -# Secret Macros - -With help from gitter and Colinta, this adds the ability to add hidden macros from other users. - -First, I have several files that are hidden/excluded from Git/GitHub. These contain everything needed for the macros. To hide these files, open `.git/info/exclude` and add `secrets.c` and `secrets.h` to that file, below the comments. - -And this requires `KC_SECRET_1` through `KC_SECRET_5` to be added in your keycode enum (usually in your `.h` file) the keycodes for the new macros. - -## Git Exclusion - -To prevent `git` from seeing, or committing the secret files, you can exclude them. What's the point of having secrets if they're posted on GitHub for everyone to see!?! - -You can do this with the `.git/info/exclude` file, so that it's only ignored locally. Unfortunately, that means it's not consistently handled on each system. - -However, if you create a `.gitignore` file in the same folder, you keep things consistent between every system that the code is checked out on. - -```c -secrets.c -secrets.h -``` - -## secrets.c - -Here is the magic. This handles including the "secrets", and adding the custom macros to send them. - -```c -#include "drashna.h" // replace with your keymap's "h" file, or whatever file stores the keycodes - -#if (__has_include("secrets.h") && !defined(NO_SECRETS)) -#include "secrets.h" -#else -// `PROGMEM const char secret[][x]` may work better, but it takes up more space in the firmware -// And I'm not familiar enough to know which is better or why... -static const char * const secret[] = { - "test1", - "test2", - "test3", - "test4", - "test5" -}; -#endif - -bool process_record_secrets(uint16_t keycode, keyrecord_t *record) { - switch (keycode) { - case KC_SECRET_1 ... KC_SECRET_5: // Secrets! Externally defined strings, not stored in repo - if (!record->event.pressed) { - clear_oneshot_layer_state(ONESHOT_OTHER_KEY_PRESSED); - send_string_with_delay(secret[keycode - KC_SECRET_1], MACRO_TIMER); - } - return false; - break; - } - return true; -} -``` - -## secrets.h - -Now, for the actual secrets! The file needs to look like - -```c -static const char * secrets[] = { - "secret1", - "secret2", - "secret3", - "secret4", - "secret5" -}; -``` - -Replacing the strings with the codes that you need. - -## Process Record - -In whichever file you have your `process_record_*` function in, you will want to add this to the top: - -```c -__attribute__ ((weak)) -bool process_record_secrets(uint16_t keycode, keyrecord_t *record) { - return true; -} -``` - -This is so that the function can be called here, and replaced in the `secrets.c` file, and so it won't error out if it doesn't exist. - -And then, in the `process_record_user` function, assuming you have `return process_record_keymap(keycode, record)` here, you'll want to replace the "final" return with the following. Otherwise, you want to replace the `return true;` with `return process_record_secrets(keycode, record);` - -```c -bool process_record_user(uint16_t keycode, keyrecord_t *record) { - // your existing macro code here. - return process_record_keymap(keycode, record) && process_record_secrets(keycode, record); -} -``` - -## rules.mk - -Here, you want your `/users//rules.mk` file to "detect" the existence of the `secrets.c` file, and only add it if the file exists. - -Additionally, to ensure that it's not added or processed in any way, it checks to see if `NO_SECRETS` is set. This way, if you run `make keyboard:name NO_SECRETS=yes`, it will remove the feature altogether. - -```make -ifneq ($(strip $(NO_SECRETS)), yes) - ifneq ("$(wildcard $(USER_PATH)/secrets.c)","") - SRC += secrets.c - endif -endif -``` - -Alternately, if you want to make sure that you can disable the function without messing with the file, you need to add this to your `/users//rules.mk`, so that it catches the flag: - -```make -ifneq ("$(wildcard $(USER_PATH)/secrets.c)","") - SRC += secrets.c -endif - -ifeq ($(strip $(NO_SECRETS)), yes) - OPT_DEFS += -DNO_SECRETS -endif -``` - -## Extras - -Additionally, because this file isn't present in the repo at all, you could add additional functionality that nobody else will see. diff --git a/users/drashna/readme_tap_dance.md b/users/drashna/readme_tap_dance.md deleted file mode 100644 index a61dd1f2b0..0000000000 --- a/users/drashna/readme_tap_dance.md +++ /dev/null @@ -1,119 +0,0 @@ -# Diablo Tap Dances - -My [Tap Dance](https://github.com/qmk/qmk_firmware/blob/master/users/drashna/tap_dances.c) file includes the tap dance declarations, and everything needed for them. - -This is used for making Diablo 3 much easier to plan, especially at high rift levels. - -This works by using Tap Dances. The taps don't actually "do anything". Instead, it sets up the interval for how often to send specific keypresses. As you can tell, this makes automating things very easy. - -For critics that think this is cheating, just search "[diablo 3 num lock auto cast](http://lmgtfy.com/?q=diablo+3+numlock+autocast)". This is just a simpler method, that doesn't require a numpad. - - -## Custom Tap Dance Type -The real fun here is that the tap dances use a custom defined Tap Dance type: - -```c -#define ACTION_TAP_DANCE_DIABLO(index, keycode) { \ - .fn = { NULL, (void *)diablo_tapdance_master, NULL }, \ - .user_data = (void *)&((diable_keys_t) { index, keycode }), \ - } -``` -This lets me set an index and keycode for the tap dance. This isn't the cool part yet, but this allows for the really cool stuff. - -The Index is needed because I don't know how to handle it otherwise. - -## The Actual Dances - -These are the custom defined dances that I'm using. It sets up everything for later, using the above custom dance type. - -```c -//Tap Dance Definitions, sets the index and the keycode. -qk_tap_dance_action_t tap_dance_actions[] = { - // tap once to disable, and more to enable timed micros - [TD_D3_1] = ACTION_TAP_DANCE_DIABLO(0, KC_1), - [TD_D3_2] = ACTION_TAP_DANCE_DIABLO(1, KC_2), - [TD_D3_3] = ACTION_TAP_DANCE_DIABLO(2, KC_3), - [TD_D3_4] = ACTION_TAP_DANCE_DIABLO(3, KC_4), -}; -``` - -## Custom Data Structures - -First, to get this all working, there are a couple of things that need to be set up. In a header file (or you could put it into the keymap), you need to create a couple of custom structures: - -```c -typedef struct { - uint16_t timer; - uint8_t key_interval; - uint8_t keycode; -} diablo_timer_t; - -typedef struct { - uint8_t index; - uint8_t keycode; -} diable_keys_t; -``` - -The first structure is for tracking each key that is being used. The second is to pass data from the Tap Dance action array to the actual function that we will need. - - -## Custom Arrays - -To facilitate things, you will need a couple of arrays in your `c` file. - -```c -//define diablo macro timer variables -diablo_timer_t diablo_timer[4]; - -// Set the default intervals. Always start with 0 so that it will disable on first hit. -// Otherwise, you will need to hit a bunch of times, or hit the "clear" command -uint8_t diablo_times[] = { 0, 1, 3, 5, 10, 30 }; -``` - -The first one (`diablo_timer`) is what keeps track of the timer used for the keys, the interval that it uses, and the actual keycode. This makes managing it a lot easier. - -The second array is a list of predefined intervals, in seconds. You can add more here, or remove entries. It doesn't matter how long the array is, as this is computed automatically. - -## The Magic - Part 1: Master function - -The first part of the magic here is the `diablo_tapdance_master` function. The Tap Dance feature calls this function, directly, and passes some data to the function. Namely, it passes the array of the index and the keycode (`diablo_keys_t` from above). This sets the keycode and the interval for the specific index of `diabolo_timer` based on the number of taps. If you hit it more than the number of items in the array, then it zeroes out the interval, disabling it. - -```c -// Cycle through the times for the macro, starting at 0, for disabled. -void diablo_tapdance_master(qk_tap_dance_state_t *state, void *user_data) { - diable_keys_t *diablo_keys = (diable_keys_t *)user_data; - // Sets the keycode based on the index - diablo_timer[diablo_keys->index].keycode = diablo_keys->keycode; - - // if the tapdance is hit more than the number of elemints in the array, reset - if (state->count >= (sizeof(diablo_times) / sizeof(uint8_t) ) ) { - diablo_timer[diablo_keys->index].key_interval = 0; - reset_tap_dance(state); - } else { // else set the interval (tapdance count starts at 1, array starts at 0, so offset by one) - diablo_timer[diablo_keys->index].key_interval = diablo_times[state->count - 1]; - } -} -``` - -## The Magic - Part 2: The Coup de Grace - -The real core here is the `run_diablo_macro_check()` function. You need to call this from `matrix_scan_user`, as this handles the timer check. - -Specifically, it runs a check for each index of the timer. It checks to see if it's enabled, and if enough time has passed. If enough time has passed, it resets the timer, and will tap the keycode that you set for that index, but only if the Diablo layer is enabled. - -```c -// Checks each of the 4 timers/keys to see if enough time has elapsed -void run_diablo_macro_check(void) { - for (uint8_t index = 0; index < NUM_OF_DIABLO_KEYS; index++) { - // if key_interval is 0, it's disabled, so only run if it's set. If it's set, check the timer. - if ( diablo_timer[index].key_interval && timer_elapsed( diablo_timer[index].timer ) > ( diablo_timer[index].key_interval * 1000 ) ) { - // reset the timer, since enough time has passed - diablo_timer[index].timer = timer_read(); - // send keycode ONLY if we're on the diablo layer. - if (IS_LAYER_ON(_DIABLO)) { - tap_code(diablo_timer[index].keycode); - } - } - } -} -``` diff --git a/users/drashna/readme_wrappers.md b/users/drashna/readme_wrappers.md deleted file mode 100644 index fd62ff1609..0000000000 --- a/users/drashna/readme_wrappers.md +++ /dev/null @@ -1,11 +0,0 @@ -## Keyboard Layout Templates - -This borrows from @jola5's "Not quite neo" code. This allows me to maintain blocks of keymaps in the userspace, so that I can modify the userspace, and this is reflected in all of the keyboards that use it, at once. - -This makes adding tap/hold mods, or other special keycodes or functions to all keyboards super easy, as it's done to all of them at once. - -The caveat here is that the keymap needs a processor/wrapper, as it doesn't like the substitutions. However, this is as simple as just pushing it through a define. For instance: - -`#define LAYOUT_ergodox_wrapper(...) LAYOUT_ergodox(__VA_ARGS__)` - -Once that's been done and you've switched the keymaps to use the "wrapper", it will read the substitution blocks just fine. diff --git a/users/drashna/rgb/rgb_matrix_stuff.c b/users/drashna/rgb/rgb_matrix_stuff.c new file mode 100644 index 0000000000..97811092c1 --- /dev/null +++ b/users/drashna/rgb/rgb_matrix_stuff.c @@ -0,0 +1,97 @@ +/* Copyright 2020 Christopher Courtney, aka Drashna Jael're (@drashna) + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#include "drashna.h" +#include "rgb_matrix.h" +#include "lib/lib8tion/lib8tion.h" +extern led_config_t g_led_config; + +static uint32_t hypno_timer; + +void rgb_matrix_layer_helper(uint8_t hue, uint8_t sat, uint8_t val, uint8_t mode, uint8_t speed, uint8_t led_type, uint8_t led_min, uint8_t led_max) { + HSV hsv = {hue, sat, val}; + if (hsv.v > rgb_matrix_get_val()) { + hsv.v = rgb_matrix_get_val(); + } + + switch (mode) { + case 1: // breathing + { + uint16_t time = scale16by8(g_rgb_timer, speed / 8); + hsv.v = scale8(abs8(sin8(time) - 128) * 2, hsv.v); + RGB rgb = hsv_to_rgb(hsv); + for (uint8_t i = 0; i < DRIVER_LED_TOTAL; i++) { + if (HAS_FLAGS(g_led_config.flags[i], led_type)) { + RGB_MATRIX_INDICATOR_SET_COLOR(i, rgb.r, rgb.g, rgb.b); + } + } + break; + } + default: // Solid Color + { + RGB rgb = hsv_to_rgb(hsv); + for (uint8_t i = 0; i < DRIVER_LED_TOTAL; i++) { + if (HAS_FLAGS(g_led_config.flags[i], led_type)) { + RGB_MATRIX_INDICATOR_SET_COLOR(i, rgb.r, rgb.g, rgb.b); + } + } + break; + } + } +} + +__attribute__((weak)) void rgb_matrix_indicator_keymap(void) {} + +void matrix_scan_rgb_matrix(void) { +#if defined(RGB_MATRIX_FRAMEBUFFER_EFFECTS) + if (userspace_config.rgb_matrix_idle_anim && rgb_matrix_get_mode() == RGB_MATRIX_TYPING_HEATMAP && sync_timer_elapsed32(hypno_timer) > 15000) { + rgb_matrix_mode_noeeprom(RGB_MATRIX_REST_MODE); + } +#endif + rgb_matrix_indicator_keymap(); +} + +void keyboard_post_init_rgb_matrix(void) { +#if defined(RGB_MATRIX_FRAMEBUFFER_EFFECTS) + if (userspace_config.rgb_matrix_idle_anim) { + rgb_matrix_mode_noeeprom(RGB_MATRIX_REST_MODE); + } +#endif +} + +bool process_record_user_rgb_matrix(uint16_t keycode, keyrecord_t *record) { +#if defined(RGB_MATRIX_FRAMEBUFFER_EFFECTS) + hypno_timer = sync_timer_read32(); + if (userspace_config.rgb_matrix_idle_anim && rgb_matrix_get_mode() == RGB_MATRIX_REST_MODE) { + rgb_matrix_mode_noeeprom(RGB_MATRIX_TYPING_HEATMAP); + } +#endif + switch (keycode) { + case RGB_IDL: // This allows me to use underglow as layer indication, or as normal +#if defined(RGB_MATRIX_ENABLE) && defined(RGB_MATRIX_FRAMEBUFFER_EFFECTS) + if (record->event.pressed) { + userspace_config.rgb_matrix_idle_anim ^= 1; + dprintf("RGB Matrix Idle Animation [EEPROM]: %u\n", userspace_config.rgb_matrix_idle_anim); + eeconfig_update_user(userspace_config.raw); + if (userspace_config.rgb_matrix_idle_anim) { + rgb_matrix_mode_noeeprom(RGB_MATRIX_TYPING_HEATMAP); + } + } +#endif + break; + } + return true; +} diff --git a/users/drashna/rgb/rgb_matrix_stuff.h b/users/drashna/rgb/rgb_matrix_stuff.h new file mode 100644 index 0000000000..b86f2f6514 --- /dev/null +++ b/users/drashna/rgb/rgb_matrix_stuff.h @@ -0,0 +1,25 @@ +/* Copyright 2020 Christopher Courtney, aka Drashna Jael're (@drashna) + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#pragma once +#include "quantum.h" + +bool process_record_user_rgb_matrix(uint16_t keycode, keyrecord_t *record); +void keyboard_post_init_rgb_matrix(void); +void matrix_scan_rgb_matrix(void); + +void rgb_matrix_set_color_all(uint8_t red, uint8_t green, uint8_t blue); +void rgb_matrix_layer_helper(uint8_t hue, uint8_t sat, uint8_t val, uint8_t mode, uint8_t speed, uint8_t led_type, uint8_t led_min, uint8_t led_max); diff --git a/users/drashna/rgb/rgb_stuff.c b/users/drashna/rgb/rgb_stuff.c new file mode 100644 index 0000000000..15108bde04 --- /dev/null +++ b/users/drashna/rgb/rgb_stuff.c @@ -0,0 +1,132 @@ +/* Copyright 2020 Christopher Courtney, aka Drashna Jael're (@drashna) + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#ifdef RGBLIGHT_ENABLE + +# include "drashna.h" +# include "rgb_stuff.h" +# include "eeprom.h" + +bool has_initialized; + +void rgblight_sethsv_default_helper(uint8_t index) { rgblight_sethsv_at(rgblight_get_hue(), rgblight_get_sat(), rgblight_get_val(), index); } +void rgblight_set_hsv_and_mode(uint8_t hue, uint8_t sat, uint8_t val, uint8_t mode) { + rgblight_sethsv_noeeprom(hue, sat, val); + // wait_us(175); // Add a slight delay between color and mode to ensure it's processed correctly + rgblight_mode_noeeprom(mode); +} + +bool process_record_user_rgb_light(uint16_t keycode, keyrecord_t *record) { return true; } + +# if defined(RGBLIGHT_STARTUP_ANIMATION) +static bool is_enabled; +static bool is_rgblight_startup; +static HSV old_hsv; +static uint8_t old_mode; +static uint16_t rgblight_startup_loop_timer; +# endif + +void keyboard_post_init_rgb_light(void) { +# if defined(RGBLIGHT_STARTUP_ANIMATION) + is_enabled = rgblight_is_enabled(); + if (userspace_config.rgb_layer_change) { + layer_state_set_rgb_light(layer_state); + } + old_hsv = rgblight_get_hsv(); + old_mode = rgblight_get_mode(); + rgblight_mode_noeeprom(RGBLIGHT_MODE_STATIC_LIGHT); + is_rgblight_startup = true; +# endif + if (userspace_config.rgb_layer_change) { + layer_state_set_rgb_light(layer_state); + } +} + +void matrix_scan_rgb_light(void) { +# if defined(RGBLIGHT_STARTUP_ANIMATION) + if (is_rgblight_startup && is_keyboard_master()) { + if (sync_timer_elapsed(rgblight_startup_loop_timer) > 10) { + static uint8_t counter; + counter++; + rgblight_sethsv_noeeprom((counter + old_hsv.h) % 255, 255, 255); + rgblight_startup_loop_timer = sync_timer_read(); + if (counter == 255) { + is_rgblight_startup = false; + if (userspace_config.rgb_layer_change) { + layer_state_set_rgb_light(layer_state); + } else { + rgblight_set_hsv_and_mode(old_hsv.h, old_hsv.s, old_hsv.v, old_mode); + } + if (!is_enabled) { + rgblight_disable_noeeprom(); + } + } + } + } +# endif +} + +layer_state_t layer_state_set_rgb_light(layer_state_t state) { +# ifdef RGBLIGHT_ENABLE + if (userspace_config.rgb_layer_change) { + switch (get_highest_layer(state | default_layer_state)) { + case _MOUSE: // mouse + if (!layer_state_cmp(state, _GAMEPAD) && !layer_state_cmp(state, _DIABLO)) { +# if defined(RGBLIGHT_EFFECT_TWINKLE) + rgblight_set_hsv_and_mode(HSV_CHARTREUSE, RGBLIGHT_MODE_TWINKLE + 5); +# else + rgblight_set_hsv_and_mode(HSV_CHARTREUSE, RGBLIGHT_MODE_BREATHING + 3); +# endif + } + break; + case _MEDIA: + rgblight_set_hsv_and_mode(HSV_CHARTREUSE, RGBLIGHT_MODE_KNIGHT + 1); + break; + case _GAMEPAD: + rgblight_set_hsv_and_mode(HSV_ORANGE, RGBLIGHT_MODE_SNAKE + 2); + break; + case _DIABLO: + rgblight_set_hsv_and_mode(HSV_RED, RGBLIGHT_MODE_BREATHING + 3); + break; + case _RAISE: + rgblight_set_hsv_and_mode(HSV_YELLOW, RGBLIGHT_MODE_BREATHING + 3); + break; + case _LOWER: + rgblight_set_hsv_and_mode(HSV_GREEN, RGBLIGHT_MODE_BREATHING + 3); + break; + case _ADJUST: + rgblight_set_hsv_and_mode(HSV_RED, RGBLIGHT_MODE_KNIGHT + 2); + break; + case _DEFAULT_LAYER_1: + rgblight_set_hsv_and_mode(DEFAULT_LAYER_1_HSV, RGBLIGHT_MODE_STATIC_LIGHT); + break; + case _DEFAULT_LAYER_2: + rgblight_set_hsv_and_mode(DEFAULT_LAYER_2_HSV, RGBLIGHT_MODE_STATIC_LIGHT); + break; + case _DEFAULT_LAYER_3: + rgblight_set_hsv_and_mode(DEFAULT_LAYER_3_HSV, RGBLIGHT_MODE_STATIC_LIGHT); + break; + case _DEFAULT_LAYER_4: + rgblight_set_hsv_and_mode(DEFAULT_LAYER_4_HSV, RGBLIGHT_MODE_STATIC_LIGHT); + break; + } + } +# endif // RGBLIGHT_ENABLE + + return state; +} + +#endif diff --git a/users/drashna/rgb/rgb_stuff.h b/users/drashna/rgb/rgb_stuff.h new file mode 100644 index 0000000000..af1acdde71 --- /dev/null +++ b/users/drashna/rgb/rgb_stuff.h @@ -0,0 +1,25 @@ +/* Copyright 2020 Christopher Courtney, aka Drashna Jael're (@drashna) + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#pragma once +#include "quantum.h" + +bool process_record_user_rgb_light(uint16_t keycode, keyrecord_t *record); +void keyboard_post_init_rgb_light(void); +void matrix_scan_rgb_light(void); +layer_state_t layer_state_set_rgb_light(layer_state_t state); +layer_state_t default_layer_state_set_rgb_light(layer_state_t state); +void rgblight_sethsv_default_helper(uint8_t index); diff --git a/users/drashna/rgb_matrix_stuff.c b/users/drashna/rgb_matrix_stuff.c deleted file mode 100644 index 97811092c1..0000000000 --- a/users/drashna/rgb_matrix_stuff.c +++ /dev/null @@ -1,97 +0,0 @@ -/* Copyright 2020 Christopher Courtney, aka Drashna Jael're (@drashna) - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -#include "drashna.h" -#include "rgb_matrix.h" -#include "lib/lib8tion/lib8tion.h" -extern led_config_t g_led_config; - -static uint32_t hypno_timer; - -void rgb_matrix_layer_helper(uint8_t hue, uint8_t sat, uint8_t val, uint8_t mode, uint8_t speed, uint8_t led_type, uint8_t led_min, uint8_t led_max) { - HSV hsv = {hue, sat, val}; - if (hsv.v > rgb_matrix_get_val()) { - hsv.v = rgb_matrix_get_val(); - } - - switch (mode) { - case 1: // breathing - { - uint16_t time = scale16by8(g_rgb_timer, speed / 8); - hsv.v = scale8(abs8(sin8(time) - 128) * 2, hsv.v); - RGB rgb = hsv_to_rgb(hsv); - for (uint8_t i = 0; i < DRIVER_LED_TOTAL; i++) { - if (HAS_FLAGS(g_led_config.flags[i], led_type)) { - RGB_MATRIX_INDICATOR_SET_COLOR(i, rgb.r, rgb.g, rgb.b); - } - } - break; - } - default: // Solid Color - { - RGB rgb = hsv_to_rgb(hsv); - for (uint8_t i = 0; i < DRIVER_LED_TOTAL; i++) { - if (HAS_FLAGS(g_led_config.flags[i], led_type)) { - RGB_MATRIX_INDICATOR_SET_COLOR(i, rgb.r, rgb.g, rgb.b); - } - } - break; - } - } -} - -__attribute__((weak)) void rgb_matrix_indicator_keymap(void) {} - -void matrix_scan_rgb_matrix(void) { -#if defined(RGB_MATRIX_FRAMEBUFFER_EFFECTS) - if (userspace_config.rgb_matrix_idle_anim && rgb_matrix_get_mode() == RGB_MATRIX_TYPING_HEATMAP && sync_timer_elapsed32(hypno_timer) > 15000) { - rgb_matrix_mode_noeeprom(RGB_MATRIX_REST_MODE); - } -#endif - rgb_matrix_indicator_keymap(); -} - -void keyboard_post_init_rgb_matrix(void) { -#if defined(RGB_MATRIX_FRAMEBUFFER_EFFECTS) - if (userspace_config.rgb_matrix_idle_anim) { - rgb_matrix_mode_noeeprom(RGB_MATRIX_REST_MODE); - } -#endif -} - -bool process_record_user_rgb_matrix(uint16_t keycode, keyrecord_t *record) { -#if defined(RGB_MATRIX_FRAMEBUFFER_EFFECTS) - hypno_timer = sync_timer_read32(); - if (userspace_config.rgb_matrix_idle_anim && rgb_matrix_get_mode() == RGB_MATRIX_REST_MODE) { - rgb_matrix_mode_noeeprom(RGB_MATRIX_TYPING_HEATMAP); - } -#endif - switch (keycode) { - case RGB_IDL: // This allows me to use underglow as layer indication, or as normal -#if defined(RGB_MATRIX_ENABLE) && defined(RGB_MATRIX_FRAMEBUFFER_EFFECTS) - if (record->event.pressed) { - userspace_config.rgb_matrix_idle_anim ^= 1; - dprintf("RGB Matrix Idle Animation [EEPROM]: %u\n", userspace_config.rgb_matrix_idle_anim); - eeconfig_update_user(userspace_config.raw); - if (userspace_config.rgb_matrix_idle_anim) { - rgb_matrix_mode_noeeprom(RGB_MATRIX_TYPING_HEATMAP); - } - } -#endif - break; - } - return true; -} diff --git a/users/drashna/rgb_matrix_stuff.h b/users/drashna/rgb_matrix_stuff.h deleted file mode 100644 index b86f2f6514..0000000000 --- a/users/drashna/rgb_matrix_stuff.h +++ /dev/null @@ -1,25 +0,0 @@ -/* Copyright 2020 Christopher Courtney, aka Drashna Jael're (@drashna) - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -#pragma once -#include "quantum.h" - -bool process_record_user_rgb_matrix(uint16_t keycode, keyrecord_t *record); -void keyboard_post_init_rgb_matrix(void); -void matrix_scan_rgb_matrix(void); - -void rgb_matrix_set_color_all(uint8_t red, uint8_t green, uint8_t blue); -void rgb_matrix_layer_helper(uint8_t hue, uint8_t sat, uint8_t val, uint8_t mode, uint8_t speed, uint8_t led_type, uint8_t led_min, uint8_t led_max); diff --git a/users/drashna/rgb_stuff.c b/users/drashna/rgb_stuff.c deleted file mode 100644 index 15108bde04..0000000000 --- a/users/drashna/rgb_stuff.c +++ /dev/null @@ -1,132 +0,0 @@ -/* Copyright 2020 Christopher Courtney, aka Drashna Jael're (@drashna) - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -#ifdef RGBLIGHT_ENABLE - -# include "drashna.h" -# include "rgb_stuff.h" -# include "eeprom.h" - -bool has_initialized; - -void rgblight_sethsv_default_helper(uint8_t index) { rgblight_sethsv_at(rgblight_get_hue(), rgblight_get_sat(), rgblight_get_val(), index); } -void rgblight_set_hsv_and_mode(uint8_t hue, uint8_t sat, uint8_t val, uint8_t mode) { - rgblight_sethsv_noeeprom(hue, sat, val); - // wait_us(175); // Add a slight delay between color and mode to ensure it's processed correctly - rgblight_mode_noeeprom(mode); -} - -bool process_record_user_rgb_light(uint16_t keycode, keyrecord_t *record) { return true; } - -# if defined(RGBLIGHT_STARTUP_ANIMATION) -static bool is_enabled; -static bool is_rgblight_startup; -static HSV old_hsv; -static uint8_t old_mode; -static uint16_t rgblight_startup_loop_timer; -# endif - -void keyboard_post_init_rgb_light(void) { -# if defined(RGBLIGHT_STARTUP_ANIMATION) - is_enabled = rgblight_is_enabled(); - if (userspace_config.rgb_layer_change) { - layer_state_set_rgb_light(layer_state); - } - old_hsv = rgblight_get_hsv(); - old_mode = rgblight_get_mode(); - rgblight_mode_noeeprom(RGBLIGHT_MODE_STATIC_LIGHT); - is_rgblight_startup = true; -# endif - if (userspace_config.rgb_layer_change) { - layer_state_set_rgb_light(layer_state); - } -} - -void matrix_scan_rgb_light(void) { -# if defined(RGBLIGHT_STARTUP_ANIMATION) - if (is_rgblight_startup && is_keyboard_master()) { - if (sync_timer_elapsed(rgblight_startup_loop_timer) > 10) { - static uint8_t counter; - counter++; - rgblight_sethsv_noeeprom((counter + old_hsv.h) % 255, 255, 255); - rgblight_startup_loop_timer = sync_timer_read(); - if (counter == 255) { - is_rgblight_startup = false; - if (userspace_config.rgb_layer_change) { - layer_state_set_rgb_light(layer_state); - } else { - rgblight_set_hsv_and_mode(old_hsv.h, old_hsv.s, old_hsv.v, old_mode); - } - if (!is_enabled) { - rgblight_disable_noeeprom(); - } - } - } - } -# endif -} - -layer_state_t layer_state_set_rgb_light(layer_state_t state) { -# ifdef RGBLIGHT_ENABLE - if (userspace_config.rgb_layer_change) { - switch (get_highest_layer(state | default_layer_state)) { - case _MOUSE: // mouse - if (!layer_state_cmp(state, _GAMEPAD) && !layer_state_cmp(state, _DIABLO)) { -# if defined(RGBLIGHT_EFFECT_TWINKLE) - rgblight_set_hsv_and_mode(HSV_CHARTREUSE, RGBLIGHT_MODE_TWINKLE + 5); -# else - rgblight_set_hsv_and_mode(HSV_CHARTREUSE, RGBLIGHT_MODE_BREATHING + 3); -# endif - } - break; - case _MEDIA: - rgblight_set_hsv_and_mode(HSV_CHARTREUSE, RGBLIGHT_MODE_KNIGHT + 1); - break; - case _GAMEPAD: - rgblight_set_hsv_and_mode(HSV_ORANGE, RGBLIGHT_MODE_SNAKE + 2); - break; - case _DIABLO: - rgblight_set_hsv_and_mode(HSV_RED, RGBLIGHT_MODE_BREATHING + 3); - break; - case _RAISE: - rgblight_set_hsv_and_mode(HSV_YELLOW, RGBLIGHT_MODE_BREATHING + 3); - break; - case _LOWER: - rgblight_set_hsv_and_mode(HSV_GREEN, RGBLIGHT_MODE_BREATHING + 3); - break; - case _ADJUST: - rgblight_set_hsv_and_mode(HSV_RED, RGBLIGHT_MODE_KNIGHT + 2); - break; - case _DEFAULT_LAYER_1: - rgblight_set_hsv_and_mode(DEFAULT_LAYER_1_HSV, RGBLIGHT_MODE_STATIC_LIGHT); - break; - case _DEFAULT_LAYER_2: - rgblight_set_hsv_and_mode(DEFAULT_LAYER_2_HSV, RGBLIGHT_MODE_STATIC_LIGHT); - break; - case _DEFAULT_LAYER_3: - rgblight_set_hsv_and_mode(DEFAULT_LAYER_3_HSV, RGBLIGHT_MODE_STATIC_LIGHT); - break; - case _DEFAULT_LAYER_4: - rgblight_set_hsv_and_mode(DEFAULT_LAYER_4_HSV, RGBLIGHT_MODE_STATIC_LIGHT); - break; - } - } -# endif // RGBLIGHT_ENABLE - - return state; -} - -#endif diff --git a/users/drashna/rgb_stuff.h b/users/drashna/rgb_stuff.h deleted file mode 100644 index af1acdde71..0000000000 --- a/users/drashna/rgb_stuff.h +++ /dev/null @@ -1,25 +0,0 @@ -/* Copyright 2020 Christopher Courtney, aka Drashna Jael're (@drashna) - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -#pragma once -#include "quantum.h" - -bool process_record_user_rgb_light(uint16_t keycode, keyrecord_t *record); -void keyboard_post_init_rgb_light(void); -void matrix_scan_rgb_light(void); -layer_state_t layer_state_set_rgb_light(layer_state_t state); -layer_state_t default_layer_state_set_rgb_light(layer_state_t state); -void rgblight_sethsv_default_helper(uint8_t index); diff --git a/users/drashna/rules.mk b/users/drashna/rules.mk index bd661e00a5..32afae22c9 100644 --- a/users/drashna/rules.mk +++ b/users/drashna/rules.mk @@ -1,5 +1,5 @@ SRC += $(USER_PATH)/drashna.c \ - $(USER_PATH)/process_records.c + $(USER_PATH)/keyrecords/process_records.c ifneq ($(PLATFORM),CHIBIOS) ifneq ($(strip $(LTO_SUPPORTED)), no) @@ -10,8 +10,8 @@ SPACE_CADET_ENABLE = no GRAVE_ESC_ENABLE = no ifneq ($(strip $(NO_SECRETS)), yes) - ifneq ("$(wildcard $(USER_PATH)/secrets.c)","") - SRC += $(USER_PATH)/secrets.c + ifneq ("$(wildcard $(USER_PATH)/keyrecords/secrets.c)","") + SRC += $(USER_PATH)/keyrecords/secrets.c endif ifeq ($(strip $(NO_SECRETS)), lite) OPT_DEFS += -DNO_SECRETS @@ -25,20 +25,20 @@ ifeq ($(strip $(CUSTOM_UNICODE_ENABLE)), yes) UCIS_ENABLE = no UNICODE_COMMON = yes OPT_DEFS += -DCUSTOM_UNICODE_ENABLE - SRC += unicoooode.c + SRC += $(USER_PATH)/keyrecords/unicode.c endif CUSTOM_TAP_DANCE ?= yes ifeq ($(strip $(CUSTOM_TAP_DANCE)), yes) ifeq ($(strip $(TAP_DANCE_ENABLE)), yes) - SRC += $(USER_PATH)/tap_dances.c + SRC += $(USER_PATH)/keyrecords/tap_dances.c endif endif CUSTOM_RGBLIGHT ?= yes ifeq ($(strip $(RGBLIGHT_ENABLE)), yes) ifeq ($(strip $(CUSTOM_RGBLIGHT)), yes) - SRC += $(USER_PATH)/rgb_stuff.c + SRC += $(USER_PATH)/rgb/rgb_stuff.c ifeq ($(strip $(RGBLIGHT_NOEEPROM)), yes) OPT_DEFS += -DRGBLIGHT_NOEEPROM endif @@ -51,7 +51,7 @@ endif CUSTOM_RGB_MATRIX ?= yes ifeq ($(strip $(RGB_MATRIX_ENABLE)), yes) ifeq ($(strip $(CUSTOM_RGB_MATRIX)), yes) - SRC += $(USER_PATH)/rgb_matrix_stuff.c + SRC += $(USER_PATH)/rgb/rgb_matrix_stuff.c endif endif @@ -76,24 +76,36 @@ endif CUSTOM_OLED_DRIVER ?= yes ifeq ($(strip $(OLED_ENABLE)), yes) ifeq ($(strip $(CUSTOM_OLED_DRIVER)), yes) - SRC += $(USER_PATH)/oled_stuff.c + SRC += $(USER_PATH)/oled/oled_stuff.c OPT_DEFS += -DCUSTOM_OLED_DRIVER_CODE endif endif -ifeq ($(strip $(PIMORONI_TRACKBALL_ENABLE)), yes) - POINTING_DEVICE_ENABLE := yes - OPT_DEFS += -DPIMORONI_TRACKBALL_ENABLE - SRC += drivers/sensors/pimoroni_trackball.c - QUANTUM_LIB_SRC += i2c_master.c +CUSTOM_POINTING_DEVICE ?= yes +ifeq ($(strip $(POINTING_DEVICE_ENABLE)), yes) + ifeq ($(strip $(CUSTOM_POINTING_DEVICE)), yes) + SRC += $(USER_PATH)/pointing/pointing.c + endif endif CUSTOM_SPLIT_TRANSPORT_SYNC ?= yes ifeq ($(strip $(CUSTOM_SPLIT_TRANSPORT_SYNC)), yes) ifeq ($(strip $(SPLIT_KEYBOARD)), yes) - QUANTUM_LIB_SRC += $(USER_PATH)/transport_sync.c + QUANTUM_LIB_SRC += $(USER_PATH)/split/transport_sync.c OPT_DEFS += -DCUSTOM_SPLIT_TRANSPORT_SYNC endif endif # DEBUG_MATRIX_SCAN_RATE_ENABLE = api + +AUTOCORRECTION_ENABLE ?= yes +ifeq ($(strip $(AUTOCORRECTION_ENABLE)), yes) + SRC += $(USER_PATH)/keyrecords/autocorrection/autocorrection.c + OPT_DEFS += -DAUTOCORRECTION_ENABLE +endif + +CAPS_WORD_ENABLE ?= yes +ifeq ($(strip $(CAPS_WORD_ENABLE)), yes) + SRC += $(USER_PATH)/keyrecords/caps_word.c + OPT_DEFS += -DCAPS_WORD_ENABLE +endif diff --git a/users/drashna/split/transport_sync.c b/users/drashna/split/transport_sync.c new file mode 100644 index 0000000000..cee3f04c8f --- /dev/null +++ b/users/drashna/split/transport_sync.c @@ -0,0 +1,174 @@ +/* Copyright 2020 Christopher Courtney, aka Drashna Jael're (@drashna) + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#include "transport_sync.h" +#include "transactions.h" +#include + +#ifdef CUSTOM_UNICODE_ENABLE +#include "process_unicode_common.h" +extern unicode_config_t unicode_config; +#endif +#ifdef AUDIO_ENABLE +# include "audio.h" +extern audio_config_t audio_config; +extern bool delayed_tasks_run; +#endif +#if defined(POINTING_DEVICE_ENABLE) && defined(KEYBOARD_handwired_tractyl_manuform) +extern bool tap_toggling; +#endif +#ifdef SWAP_HANDS_ENABLE +extern bool swap_hands; +#endif +extern userspace_config_t userspace_config; +extern bool host_driver_disabled; + +uint16_t transport_keymap_config = 0; +uint32_t transport_userspace_config = 0, transport_user_state = 0; + +user_runtime_config_t user_state; + +void user_state_sync(uint8_t initiator2target_buffer_size, const void* initiator2target_buffer, uint8_t target2initiator_buffer_size, void* target2initiator_buffer) { + if (initiator2target_buffer_size == sizeof(transport_user_state)) { + memcpy(&transport_user_state, initiator2target_buffer, initiator2target_buffer_size); + } +} +void user_keymap_sync(uint8_t initiator2target_buffer_size, const void* initiator2target_buffer, uint8_t target2initiator_buffer_size, void* target2initiator_buffer) { + if (initiator2target_buffer_size == sizeof(transport_keymap_config)) { + memcpy(&transport_keymap_config, initiator2target_buffer, initiator2target_buffer_size); + } +} +void user_config_sync(uint8_t initiator2target_buffer_size, const void* initiator2target_buffer, uint8_t target2initiator_buffer_size, void* target2initiator_buffer) { + if (initiator2target_buffer_size == sizeof(transport_userspace_config)) { + memcpy(&transport_userspace_config, initiator2target_buffer, initiator2target_buffer_size); + } +} + +void keyboard_post_init_transport_sync(void) { + // Register keyboard state sync split transaction + transaction_register_rpc(RPC_ID_USER_STATE_SYNC, user_state_sync); + transaction_register_rpc(RPC_ID_USER_KEYMAP_SYNC, user_keymap_sync); + transaction_register_rpc(RPC_ID_USER_CONFIG_SYNC, user_config_sync); +} + +void user_transport_update(void) { + if (is_keyboard_master()) { + transport_keymap_config = keymap_config.raw; + transport_userspace_config = userspace_config.raw; +#ifdef AUDIO_ENABLE + user_state.audio_enable = is_audio_on(); + user_state.audio_clicky_enable = is_clicky_on(); +#endif +#if defined(POINTING_DEVICE_ENABLE) && defined(KEYBOARD_handwired_tractyl_manuform) + user_state.tap_toggling = tap_toggling; +#endif +#ifdef UNICODE_ENABLE + user_state.unicode_mode = unicode_config.input_mode; +#endif +#ifdef SWAP_HANDS_ENABLE + user_state.swap_hands = swap_hands; +#endif + user_state.host_driver_disabled = host_driver_disabled; + + transport_user_state = user_state.raw; + } else { + keymap_config.raw = transport_keymap_config; + userspace_config.raw = transport_userspace_config; + user_state.raw = transport_user_state; +#ifdef UNICODE_ENABLE + unicode_config.input_mode = user_state.unicode_mode; +#endif +#if defined(POINTING_DEVICE_ENABLE) && defined(KEYBOARD_handwired_tractyl_manuform) + tap_toggling = user_state.tap_toggling; +#endif +#ifdef SWAP_HANDS_ENABLE + swap_hands = user_state.swap_hands; +#endif + host_driver_disabled = user_state.host_driver_disabled; + } +} + +void user_transport_sync(void) { + if (is_keyboard_master()) { + // Keep track of the last state, so that we can tell if we need to propagate to slave + static uint16_t last_keymap = 0; + static uint32_t last_config = 0, last_sync[3], last_user_state = 0; + bool needs_sync = false; + + // Check if the state values are different + if (memcmp(&transport_user_state, &last_user_state, sizeof(transport_user_state))) { + needs_sync = true; + memcpy(&last_user_state, &transport_user_state, sizeof(transport_user_state)); + } + // Send to slave every 500ms regardless of state change + if (timer_elapsed32(last_sync[0]) > 250) { + needs_sync = true; + } + + // Perform the sync if requested + if (needs_sync) { + if (transaction_rpc_send(RPC_ID_USER_STATE_SYNC, sizeof(user_state), &user_state)) { + last_sync[0] = timer_read32(); + } + needs_sync = false; + } + + // Check if the state values are different + if (memcmp(&transport_keymap_config, &last_keymap, sizeof(transport_keymap_config))) { + needs_sync = true; + memcpy(&last_keymap, &transport_keymap_config, sizeof(transport_keymap_config)); + } + + // Send to slave every 500ms regardless of state change + if (timer_elapsed32(last_sync[1]) > 250) { + needs_sync = true; + } + + // Perform the sync if requested + if (needs_sync) { + if (transaction_rpc_send(RPC_ID_USER_KEYMAP_SYNC, sizeof(transport_keymap_config), &transport_keymap_config)) { + last_sync[1] = timer_read32(); + } + needs_sync = false; + } + + // Check if the state values are different + if (memcmp(&user_state, &last_config, sizeof(transport_userspace_config))) { + needs_sync = true; + memcpy(&last_config, &user_state, sizeof(transport_userspace_config)); + } + + // Send to slave every 500ms regardless of state change + if (timer_elapsed32(last_sync[2]) > 250) { + needs_sync = true; + } + + // Perform the sync if requested + if (needs_sync) { + if (transaction_rpc_send(RPC_ID_USER_CONFIG_SYNC, sizeof(transport_userspace_config), &transport_userspace_config)) { + last_sync[2] = timer_read32(); + } + } + } +} + +void housekeeping_task_user(void) { + // Update kb_state so we can send to slave + user_transport_update(); + + // Data sync from master to slave + user_transport_sync(); +} diff --git a/users/drashna/split/transport_sync.h b/users/drashna/split/transport_sync.h new file mode 100644 index 0000000000..70b6ea522b --- /dev/null +++ b/users/drashna/split/transport_sync.h @@ -0,0 +1,36 @@ + +/* Copyright 2020 Christopher Courtney, aka Drashna Jael're (@drashna) + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#pragma once + +#include "drashna.h" + +typedef union { + uint32_t raw; + struct { + bool audio_enable :1; + bool audio_clicky_enable :1; + bool tap_toggling :1; + bool unicode_mode :1; + bool swap_hands :1; + bool host_driver_disabled :1; + }; +} user_runtime_config_t; + +extern user_runtime_config_t user_state; + +void keyboard_post_init_transport_sync(void); diff --git a/users/drashna/tap_dances.c b/users/drashna/tap_dances.c deleted file mode 100644 index 01873489d8..0000000000 --- a/users/drashna/tap_dances.c +++ /dev/null @@ -1,72 +0,0 @@ -/* Copyright 2020 Christopher Courtney, aka Drashna Jael're (@drashna) - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -#include "tap_dances.h" - -#define NUM_OF_DIABLO_KEYS 4 -// define diablo macro timer variables -diablo_timer_t diablo_timer[NUM_OF_DIABLO_KEYS]; - -// Set the default intervals. Always start with 0 so that it will disable on first hit. -// Otherwise, you will need to hit a bunch of times, or hit the "clear" command -uint8_t diablo_times[] = {0, 1, 3, 5, 10, 30}; - -// Cycle through the times for the macro, starting at 0, for disabled. -void diablo_tapdance_master(qk_tap_dance_state_t *state, void *user_data) { - diable_keys_t *diablo_keys = (diable_keys_t *)user_data; - // Sets the keycode based on the index - diablo_timer[diablo_keys->index].keycode = diablo_keys->keycode; - - // if the tapdance is hit more than the number of elemints in the array, reset - if (state->count >= (sizeof(diablo_times) / sizeof(uint8_t))) { - diablo_timer[diablo_keys->index].key_interval = 0; - reset_tap_dance(state); - } else { // else set the interval (tapdance count starts at 1, array starts at 0, so offset by one) - diablo_timer[diablo_keys->index].key_interval = diablo_times[state->count - 1]; - } -} - -// clang-format off -// One function to rule them all!! Where the Magic Sauce lies -#define ACTION_TAP_DANCE_DIABLO(index, keycode) { \ - .fn = { NULL, (void *)diablo_tapdance_master, NULL }, \ - .user_data = (void *)&((diable_keys_t) { index, keycode }), \ - } -// clang-format on - -// Tap Dance Definitions, sets the index and the keycode. -qk_tap_dance_action_t tap_dance_actions[] = { - // tap once to disable, and more to enable timed micros - [TD_D3_1] = ACTION_TAP_DANCE_DIABLO(0, KC_1), - [TD_D3_2] = ACTION_TAP_DANCE_DIABLO(1, KC_2), - [TD_D3_3] = ACTION_TAP_DANCE_DIABLO(2, KC_3), - [TD_D3_4] = ACTION_TAP_DANCE_DIABLO(3, KC_4), -}; - -// Checks each of the 4 timers/keys to see if enough time has elapsed -void run_diablo_macro_check(void) { - for (uint8_t index = 0; index < NUM_OF_DIABLO_KEYS; index++) { - // if key_interval is 0, it's disabled, so only run if it's set. If it's set, check the timer. - if (diablo_timer[index].key_interval && timer_elapsed(diablo_timer[index].timer) > (diablo_timer[index].key_interval * 1000)) { - // reset the timer, since enough time has passed - diablo_timer[index].timer = timer_read(); - // send keycode ONLY if we're on the diablo layer. - if (IS_LAYER_ON(_DIABLO)) { - tap_code(diablo_timer[index].keycode); - } - } - } -} diff --git a/users/drashna/tap_dances.h b/users/drashna/tap_dances.h deleted file mode 100644 index 81e462ce29..0000000000 --- a/users/drashna/tap_dances.h +++ /dev/null @@ -1,44 +0,0 @@ -/* Copyright 2020 Christopher Courtney, aka Drashna Jael're (@drashna) - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -#pragma once -#include "drashna.h" - -// define diablo macro timer variables -extern uint8_t diablo_times[]; -typedef struct { - uint16_t timer; - uint8_t key_interval; - uint8_t keycode; -} diablo_timer_t; - -typedef struct { - uint8_t index; - uint8_t keycode; -} diable_keys_t; - -extern diablo_timer_t diablo_timer[]; - -void run_diablo_macro_check(void); - -#ifdef TAP_DANCE_ENABLE -enum { - TD_D3_1 = 0, - TD_D3_2, - TD_D3_3, - TD_D3_4, -}; -#endif // TAP_DANCE_ENABLE diff --git a/users/drashna/transport_sync.c b/users/drashna/transport_sync.c deleted file mode 100644 index cee3f04c8f..0000000000 --- a/users/drashna/transport_sync.c +++ /dev/null @@ -1,174 +0,0 @@ -/* Copyright 2020 Christopher Courtney, aka Drashna Jael're (@drashna) - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -#include "transport_sync.h" -#include "transactions.h" -#include - -#ifdef CUSTOM_UNICODE_ENABLE -#include "process_unicode_common.h" -extern unicode_config_t unicode_config; -#endif -#ifdef AUDIO_ENABLE -# include "audio.h" -extern audio_config_t audio_config; -extern bool delayed_tasks_run; -#endif -#if defined(POINTING_DEVICE_ENABLE) && defined(KEYBOARD_handwired_tractyl_manuform) -extern bool tap_toggling; -#endif -#ifdef SWAP_HANDS_ENABLE -extern bool swap_hands; -#endif -extern userspace_config_t userspace_config; -extern bool host_driver_disabled; - -uint16_t transport_keymap_config = 0; -uint32_t transport_userspace_config = 0, transport_user_state = 0; - -user_runtime_config_t user_state; - -void user_state_sync(uint8_t initiator2target_buffer_size, const void* initiator2target_buffer, uint8_t target2initiator_buffer_size, void* target2initiator_buffer) { - if (initiator2target_buffer_size == sizeof(transport_user_state)) { - memcpy(&transport_user_state, initiator2target_buffer, initiator2target_buffer_size); - } -} -void user_keymap_sync(uint8_t initiator2target_buffer_size, const void* initiator2target_buffer, uint8_t target2initiator_buffer_size, void* target2initiator_buffer) { - if (initiator2target_buffer_size == sizeof(transport_keymap_config)) { - memcpy(&transport_keymap_config, initiator2target_buffer, initiator2target_buffer_size); - } -} -void user_config_sync(uint8_t initiator2target_buffer_size, const void* initiator2target_buffer, uint8_t target2initiator_buffer_size, void* target2initiator_buffer) { - if (initiator2target_buffer_size == sizeof(transport_userspace_config)) { - memcpy(&transport_userspace_config, initiator2target_buffer, initiator2target_buffer_size); - } -} - -void keyboard_post_init_transport_sync(void) { - // Register keyboard state sync split transaction - transaction_register_rpc(RPC_ID_USER_STATE_SYNC, user_state_sync); - transaction_register_rpc(RPC_ID_USER_KEYMAP_SYNC, user_keymap_sync); - transaction_register_rpc(RPC_ID_USER_CONFIG_SYNC, user_config_sync); -} - -void user_transport_update(void) { - if (is_keyboard_master()) { - transport_keymap_config = keymap_config.raw; - transport_userspace_config = userspace_config.raw; -#ifdef AUDIO_ENABLE - user_state.audio_enable = is_audio_on(); - user_state.audio_clicky_enable = is_clicky_on(); -#endif -#if defined(POINTING_DEVICE_ENABLE) && defined(KEYBOARD_handwired_tractyl_manuform) - user_state.tap_toggling = tap_toggling; -#endif -#ifdef UNICODE_ENABLE - user_state.unicode_mode = unicode_config.input_mode; -#endif -#ifdef SWAP_HANDS_ENABLE - user_state.swap_hands = swap_hands; -#endif - user_state.host_driver_disabled = host_driver_disabled; - - transport_user_state = user_state.raw; - } else { - keymap_config.raw = transport_keymap_config; - userspace_config.raw = transport_userspace_config; - user_state.raw = transport_user_state; -#ifdef UNICODE_ENABLE - unicode_config.input_mode = user_state.unicode_mode; -#endif -#if defined(POINTING_DEVICE_ENABLE) && defined(KEYBOARD_handwired_tractyl_manuform) - tap_toggling = user_state.tap_toggling; -#endif -#ifdef SWAP_HANDS_ENABLE - swap_hands = user_state.swap_hands; -#endif - host_driver_disabled = user_state.host_driver_disabled; - } -} - -void user_transport_sync(void) { - if (is_keyboard_master()) { - // Keep track of the last state, so that we can tell if we need to propagate to slave - static uint16_t last_keymap = 0; - static uint32_t last_config = 0, last_sync[3], last_user_state = 0; - bool needs_sync = false; - - // Check if the state values are different - if (memcmp(&transport_user_state, &last_user_state, sizeof(transport_user_state))) { - needs_sync = true; - memcpy(&last_user_state, &transport_user_state, sizeof(transport_user_state)); - } - // Send to slave every 500ms regardless of state change - if (timer_elapsed32(last_sync[0]) > 250) { - needs_sync = true; - } - - // Perform the sync if requested - if (needs_sync) { - if (transaction_rpc_send(RPC_ID_USER_STATE_SYNC, sizeof(user_state), &user_state)) { - last_sync[0] = timer_read32(); - } - needs_sync = false; - } - - // Check if the state values are different - if (memcmp(&transport_keymap_config, &last_keymap, sizeof(transport_keymap_config))) { - needs_sync = true; - memcpy(&last_keymap, &transport_keymap_config, sizeof(transport_keymap_config)); - } - - // Send to slave every 500ms regardless of state change - if (timer_elapsed32(last_sync[1]) > 250) { - needs_sync = true; - } - - // Perform the sync if requested - if (needs_sync) { - if (transaction_rpc_send(RPC_ID_USER_KEYMAP_SYNC, sizeof(transport_keymap_config), &transport_keymap_config)) { - last_sync[1] = timer_read32(); - } - needs_sync = false; - } - - // Check if the state values are different - if (memcmp(&user_state, &last_config, sizeof(transport_userspace_config))) { - needs_sync = true; - memcpy(&last_config, &user_state, sizeof(transport_userspace_config)); - } - - // Send to slave every 500ms regardless of state change - if (timer_elapsed32(last_sync[2]) > 250) { - needs_sync = true; - } - - // Perform the sync if requested - if (needs_sync) { - if (transaction_rpc_send(RPC_ID_USER_CONFIG_SYNC, sizeof(transport_userspace_config), &transport_userspace_config)) { - last_sync[2] = timer_read32(); - } - } - } -} - -void housekeeping_task_user(void) { - // Update kb_state so we can send to slave - user_transport_update(); - - // Data sync from master to slave - user_transport_sync(); -} diff --git a/users/drashna/transport_sync.h b/users/drashna/transport_sync.h deleted file mode 100644 index 70b6ea522b..0000000000 --- a/users/drashna/transport_sync.h +++ /dev/null @@ -1,36 +0,0 @@ - -/* Copyright 2020 Christopher Courtney, aka Drashna Jael're (@drashna) - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -#pragma once - -#include "drashna.h" - -typedef union { - uint32_t raw; - struct { - bool audio_enable :1; - bool audio_clicky_enable :1; - bool tap_toggling :1; - bool unicode_mode :1; - bool swap_hands :1; - bool host_driver_disabled :1; - }; -} user_runtime_config_t; - -extern user_runtime_config_t user_state; - -void keyboard_post_init_transport_sync(void); diff --git a/users/drashna/unicoooode.c b/users/drashna/unicoooode.c deleted file mode 100644 index 0e276dec17..0000000000 --- a/users/drashna/unicoooode.c +++ /dev/null @@ -1,282 +0,0 @@ -/* Copyright 2020 @tzarc - * 2021 Christopher Courtney, aka Drashna Jael're (@drashna) - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -#include "drashna.h" -#include "process_unicode_common.h" - -uint16_t typing_mode; - -void tap_code16_nomods(uint8_t kc) { - uint8_t temp_mod = get_mods(); - clear_mods(); - clear_oneshot_mods(); - tap_code16(kc); - set_mods(temp_mod); -} - -void tap_unicode_glyph_nomods(uint32_t glyph) { - uint8_t temp_mod = get_mods(); - clear_mods(); - clear_oneshot_mods(); - register_unicode(glyph); - set_mods(temp_mod); -} - -typedef uint32_t (*translator_function_t)(bool is_shifted, uint32_t keycode); - -#define DEFINE_UNICODE_RANGE_TRANSLATOR(translator_name, lower_alpha, upper_alpha, zero_glyph, number_one, space_glyph) \ - static inline uint32_t translator_name(bool is_shifted, uint32_t keycode) { \ - switch (keycode) { \ - case KC_A ... KC_Z: \ - return (is_shifted ? upper_alpha : lower_alpha) + keycode - KC_A; \ - case KC_0: \ - return zero_glyph; \ - case KC_1 ... KC_9: \ - return (number_one + keycode - KC_1); \ - case KC_SPACE: \ - return space_glyph; \ - } \ - return keycode; \ - } - -#define DEFINE_UNICODE_LUT_TRANSLATOR(translator_name, ...) \ - static inline uint32_t translator_name(bool is_shifted, uint32_t keycode) { \ - static const uint32_t translation[] = {__VA_ARGS__}; \ - uint32_t ret = keycode; \ - if ((keycode - KC_A) < (sizeof(translation) / sizeof(uint32_t))) { \ - ret = translation[keycode - KC_A]; \ - } \ - return ret; \ - } - -bool process_record_glyph_replacement(uint16_t keycode, keyrecord_t *record, translator_function_t translator) { - uint8_t temp_mod = get_mods(); - uint8_t temp_osm = get_oneshot_mods(); - bool is_shifted = (temp_mod | temp_osm) & MOD_MASK_SHIFT; - if (((temp_mod | temp_osm) & (MOD_MASK_CTRL | MOD_MASK_ALT | MOD_MASK_GUI)) == 0) { - if (KC_A <= keycode && keycode <= KC_Z) { - if (record->event.pressed) { - tap_unicode_glyph_nomods(translator(is_shifted, keycode)); - } - return false; - } else if (KC_1 <= keycode && keycode <= KC_0) { - if (is_shifted) { // skip shifted numbers, so that we can still use symbols etc. - return process_record_keymap(keycode, record); - } - if (record->event.pressed) { - register_unicode(translator(is_shifted, keycode)); - } - return false; - } else if (keycode == KC_SPACE) { - if (record->event.pressed) { - register_unicode(translator(is_shifted, keycode)); - } - return false; - } - } - return true; -} - -DEFINE_UNICODE_RANGE_TRANSLATOR(unicode_range_translator_wide, 0xFF41, 0xFF21, 0xFF10, 0xFF11, 0x2003); -DEFINE_UNICODE_RANGE_TRANSLATOR(unicode_range_translator_script, 0x1D4EA, 0x1D4D0, 0x1D7CE, 0x1D7C1, 0x2002); -DEFINE_UNICODE_RANGE_TRANSLATOR(unicode_range_translator_boxes, 0x1F170, 0x1F170, '0', '1', 0x2002); -DEFINE_UNICODE_RANGE_TRANSLATOR(unicode_range_translator_regional, 0x1F1E6, 0x1F1E6, '0', '1', 0x2003); - -DEFINE_UNICODE_LUT_TRANSLATOR(unicode_lut_translator_aussie, - 0x0250, // a - 'q', // b - 0x0254, // c - 'p', // d - 0x01DD, // e - 0x025F, // f - 0x0183, // g - 0x0265, // h - 0x1D09, // i - 0x027E, // j - 0x029E, // k - 'l', // l - 0x026F, // m - 'u', // n - 'o', // o - 'd', // p - 'b', // q - 0x0279, // r - 's', // s - 0x0287, // t - 'n', // u - 0x028C, // v - 0x028D, // w - 0x2717, // x - 0x028E, // y - 'z', // z - 0x0269, // 1 - 0x3139, // 2 - 0x0190, // 3 - 0x3123, // 4 - 0x03DB, // 5 - '9', // 6 - 0x3125, // 7 - '8', // 8 - '6', // 9 - '0' // 0 -); - -bool process_record_aussie(uint16_t keycode, keyrecord_t *record) { - bool is_shifted = (get_mods() | get_oneshot_mods()) & MOD_MASK_SHIFT; - if ((KC_A <= keycode) && (keycode <= KC_0)) { - if (record->event.pressed) { - if (!process_record_glyph_replacement(keycode, record, unicode_lut_translator_aussie)) { - tap_code16_nomods(KC_LEFT); - return false; - } - } - } else if (record->event.pressed && keycode == KC_SPACE) { - tap_code16_nomods(KC_SPACE); - tap_code16_nomods(KC_LEFT); - return false; - } else if (record->event.pressed && keycode == KC_ENTER) { - tap_code16_nomods(KC_END); - tap_code16_nomods(KC_ENTER); - return false; - } else if (record->event.pressed && keycode == KC_HOME) { - tap_code16_nomods(KC_END); - return false; - } else if (record->event.pressed && keycode == KC_END) { - tap_code16_nomods(KC_HOME); - return false; - } else if (record->event.pressed && keycode == KC_BSPC) { - tap_code16_nomods(KC_DELT); - return false; - } else if (record->event.pressed && keycode == KC_DELT) { - tap_code16_nomods(KC_BSPC); - return false; - } else if (record->event.pressed && keycode == KC_QUOT) { - tap_unicode_glyph_nomods(is_shifted ? 0x201E : 0x201A); - tap_code16_nomods(KC_LEFT); - return false; - } else if (record->event.pressed && keycode == KC_COMMA) { - tap_unicode_glyph_nomods(is_shifted ? '<' : 0x2018); - tap_code16_nomods(KC_LEFT); - return false; - } else if (record->event.pressed && keycode == KC_DOT) { - tap_unicode_glyph_nomods(is_shifted ? '>' : 0x02D9); - tap_code16_nomods(KC_LEFT); - return false; - } else if (record->event.pressed && keycode == KC_SLASH) { - tap_unicode_glyph_nomods(is_shifted ? 0x00BF : '/'); - tap_code16_nomods(KC_LEFT); - return false; - } - return true; -} - -bool process_record_zalgo(uint16_t keycode, keyrecord_t *record) { - if ((KC_A <= keycode) && (keycode <= KC_0)) { - if (record->event.pressed) { - tap_code16_nomods(keycode); - - int number = (rand() % (8 + 1 - 2)) + 2; - for (int index = 0; index < number; index++) { - uint16_t hex = (rand() % (0x036F + 1 - 0x0300)) + 0x0300; - register_unicode(hex); - } - - return false; - } - } - return true; -} - -bool process_record_unicode(uint16_t keycode, keyrecord_t *record) { - switch (keycode) { - case UC_FLIP: // (ノಠ痊ಠ)ノ彡┻━┻ - if (record->event.pressed) { - send_unicode_string("(ノಠ痊ಠ)ノ彡┻━┻"); - } - break; - - case UC_TABL: // ┬─┬ノ( º _ ºノ) - if (record->event.pressed) { - send_unicode_string("┬─┬ノ( º _ ºノ)"); - } - break; - - case UC_SHRG: // ¯\_(ツ)_/¯ - if (record->event.pressed) { - send_unicode_string("¯\\_(ツ)_/¯"); - } - break; - - case UC_DISA: // ಠ_ಠ - if (record->event.pressed) { - send_unicode_string("ಠ_ಠ"); - } - break; - - case UC_IRNY: // ⸮ - if (record->event.pressed) { - register_unicode(0x2E2E); - } - break; - case UC_CLUE: // ‽ - if (record->event.pressed) { - register_unicode(0x203D); - } - break; - case KC_NOMODE ... KC_ZALGO: - if (record->event.pressed) { - if (typing_mode != keycode) { - typing_mode = keycode; - } else { - typing_mode = 0; - } - } - break; - - break; - } - if (((keycode >= QK_MOD_TAP && keycode <= QK_MOD_TAP_MAX) || (keycode >= QK_LAYER_TAP && keycode <= QK_LAYER_TAP_MAX)) && record->tap.count) { - keycode &= 0xFF; - } - - if (typing_mode == KC_WIDE) { - if (((KC_A <= keycode) && (keycode <= KC_0)) || keycode == KC_SPACE) { - return process_record_glyph_replacement(keycode, record, unicode_range_translator_wide); - } - } else if (typing_mode == KC_SCRIPT) { - if (((KC_A <= keycode) && (keycode <= KC_0)) || keycode == KC_SPACE) { - return process_record_glyph_replacement(keycode, record, unicode_range_translator_script); - } - } else if (typing_mode == KC_BLOCKS) { - if (((KC_A <= keycode) && (keycode <= KC_0)) || keycode == KC_SPACE) { - return process_record_glyph_replacement(keycode, record, unicode_range_translator_boxes); - } - } else if (typing_mode == KC_REGIONAL) { - if (((KC_A <= keycode) && (keycode <= KC_0)) || keycode == KC_SPACE) { - if (!process_record_glyph_replacement(keycode, record, unicode_range_translator_regional)) { - wait_us(500); - tap_unicode_glyph_nomods(0x200C); - return false; - } - } - } else if (typing_mode == KC_AUSSIE) { - return process_record_aussie(keycode, record); - } else if (typing_mode == KC_ZALGO) { - return process_record_zalgo(keycode, record); - } - return true; -} diff --git a/users/drashna/wrappers.h b/users/drashna/wrappers.h deleted file mode 100644 index c1ae815579..0000000000 --- a/users/drashna/wrappers.h +++ /dev/null @@ -1,278 +0,0 @@ -/* Copyright 2020 Christopher Courtney, aka Drashna Jael're (@drashna) - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -#pragma once -#include "drashna.h" -/* -Since our quirky block definitions are basically a list of comma separated -arguments, we need a wrapper in order for these definitions to be -expanded before being used as arguments to the LAYOUT_xxx macro. -*/ - -/* -Blocks for each of the four major keyboard layouts -Organized so we can quickly adapt and modify all of them -at once, rather than for each keyboard, one at a time. -And this allows for much cleaner blocks in the keymaps. -For instance Tap/Hold for Control on all of the layouts - -NOTE: These are all the same length. If you do a search/replace - then you need to add/remove underscores to keep the - lengths consistent. -*/ -// clang-format off -#define _________________QWERTY_L1_________________ KC_Q, KC_W, KC_E, KC_R, KC_T -#define _________________QWERTY_L2_________________ KC_A, KC_S, KC_D, KC_F, KC_G -#define _________________QWERTY_L3_________________ KC_Z, KC_X, KC_C, KC_V, KC_B - -#define _________________QWERTY_R1_________________ KC_Y, KC_U, KC_I, KC_O, KC_P -#define _________________QWERTY_R2_________________ KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT -#define _________________QWERTY_R3_________________ KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH - - -#define _________________COLEMAK_L1________________ KC_Q, KC_W, KC_F, KC_P, KC_G -#define _________________COLEMAK_L2________________ KC_A, KC_R, KC_S, KC_T, KC_D -#define _________________COLEMAK_L3________________ KC_Z, KC_X, KC_C, KC_V, KC_B - -#define _________________COLEMAK_R1________________ KC_J, KC_L, KC_U, KC_Y, KC_SCLN -#define _________________COLEMAK_R2________________ KC_H, KC_N, KC_E, KC_I, KC_O, KC_QUOT -#define _________________COLEMAK_R3________________ KC_K, KC_M, KC_COMM, KC_DOT, KC_SLSH - -#define ______________COLEMAK_MOD_DH_L1____________ KC_Q, KC_W, KC_F, KC_P, KC_B -#define ______________COLEMAK_MOD_DH_L2____________ KC_A, KC_R, KC_S, KC_T, KC_G -#define ______________COLEMAK_MOD_DH_L3____________ KC_Z, KC_X, KC_C, KC_D, KC_V - -#define ______________COLEMAK_MOD_DH_R1____________ KC_J, KC_L, KC_U, KC_Y, KC_SCLN -#define ______________COLEMAK_MOD_DH_R2____________ KC_M, KC_N, KC_E, KC_I, KC_O, KC_QUOT -#define ______________COLEMAK_MOD_DH_R3____________ KC_K, KC_H, KC_COMM, KC_DOT, KC_SLASH - - -#define _________________DVORAK_L1_________________ KC_QUOT, KC_COMM, KC_DOT, KC_P, KC_Y -#define _________________DVORAK_L2_________________ KC_A, KC_O, KC_E, KC_U, KC_I -#define _________________DVORAK_L3_________________ KC_SCLN, KC_Q, KC_J, KC_K, KC_X - -#define _________________DVORAK_R1_________________ KC_F, KC_G, KC_C, KC_R, KC_L -#define _________________DVORAK_R2_________________ KC_D, KC_H, KC_T, KC_N, KC_S, KC_SLSH -#define _________________DVORAK_R3_________________ KC_B, KC_M, KC_W, KC_V, KC_Z - - -#define ________________DVORAK_AU_L1_______________ KC_QUOT, KC_COMM, KC_DOT, KC_P, KC_Y -#define ________________DVORAK_AU_L2_______________ KC_O, KC_A, KC_E, KC_I, KC_U -#define ________________DVORAK_AU_L3_______________ KC_SCLN, KC_Q, KC_J, KC_K, KC_X - -#define ________________DVORAK_AU_R1_______________ KC_F, KC_G, KC_C, KC_R, KC_L -#define ________________DVORAK_AU_R2_______________ KC_D, KC_H, KC_T, KC_N, KC_S, KC_SLSH -#define ________________DVORAK_AU_R3_______________ KC_B, KC_M, KC_W, KC_V, KC_Z - -#define _________________WORKMAN_L1________________ KC_Q, KC_D, KC_R, KC_W, KC_B -#define _________________WORKMAN_L2________________ KC_A, KC_S, KC_H, KC_T, KC_G -#define _________________WORKMAN_L3________________ KC_Z, KC_X, KC_M, KC_C, KC_V - -#define _________________WORKMAN_R1________________ KC_J, KC_F, KC_U, KC_P, KC_SCLN -#define _________________WORKMAN_R2________________ KC_Y, KC_N, KC_E, KC_O, KC_I, KC_QUOT -#define _________________WORKMAN_R3________________ KC_K, KC_L, KC_COMM, KC_DOT, KC_SLSH - - -#define _________________NORMAN_L1_________________ KC_Q, KC_W, KC_D, KC_F, KC_K -#define _________________NORMAN_L2_________________ KC_A, KC_S, KC_E, KC_T, KC_G -#define _________________NORMAN_L3_________________ KC_Z, KC_X, KC_C, KC_V, KC_B - -#define _________________NORMAN_R1_________________ KC_J, KC_U, KC_R, KC_L, KC_SCLN -#define _________________NORMAN_R2_________________ KC_Y, KC_N, KC_I, KC_O, KC_U, KC_QUOT -#define _________________NORMAN_R3_________________ KC_P, KC_M, KC_COMM, KC_DOT, KC_SLSH - - -#define _________________MALTRON_L1________________ KC_Q, KC_P, KC_Y, KC_C, KC_B -#define _________________MALTRON_L2________________ KC_A, KC_N, KC_I, KC_S, KC_F -#define _________________MALTRON_L3________________ KC_SCLN, KC_SLSH, KC_J, KC_G, KC_COMM - -#define _________________MALTRON_R1________________ KC_V, KC_M, KC_U, KC_Z, KC_L -#define _________________MALTRON_R2________________ KC_D, KC_T, KC_D, KC_O, KC_R, KC_QUOT -#define _________________MALTRON_R3________________ KC_DOT, KC_W, KC_K, KC_MINS, KC_X - - -#define _________________EUCALYN_L1________________ KC_Q, KC_W, KC_COMM, KC_DOT, KC_SCLN -#define _________________EUCALYN_L2________________ KC_A, KC_O, KC_E, KC_I, KC_U -#define _________________EUCALYN_L3________________ KC_Z, KC_X, KC_C, KC_V, KC_F - -#define _________________EUCALYN_R1________________ KC_M, KC_R, KC_D, KC_Y, KC_P -#define _________________EUCALYN_R2________________ KC_G, KC_T, KC_K, KC_S, KC_N, KC_QUOT -#define _________________EUCALYN_R3________________ KC_B, KC_H, KC_J, KC_L, KC_SLSH - -// Qwerty-like -#define _____________CARPLAX_QFMLWY_L1_____________ KC_Q, KC_F, KC_M, KC_L, KC_W -#define _____________CARPLAX_QFMLWY_L2_____________ KC_D, KC_S, KC_T, KC_N, KC_R -#define _____________CARPLAX_QFMLWY_L3_____________ KC_Z, KC_V, KC_G, KC_C, KC_X - -#define _____________CARPLAX_QFMLWY_R1_____________ KC_Y, KC_U, KC_O, KC_B, KC_J -#define _____________CARPLAX_QFMLWY_R2_____________ KC_I, KC_A, KC_E, KC_H, KC_SCLN, KC_QUOT -#define _____________CARPLAX_QFMLWY_R3_____________ KC_P, KC_K, KC_COMM, KC_DOT, KC_SLSH - -// Colemak like -#define _____________CARPLAX_QGMLWB_L1_____________ KC_Q, KC_G, KC_M, KC_L, KC_W -#define _____________CARPLAX_QGMLWB_L2_____________ KC_D, KC_S, KC_T, KC_N, KC_R -#define _____________CARPLAX_QGMLWB_L3_____________ KC_Z, KC_X, KC_C, KC_F, KC_J - -#define _____________CARPLAX_QGMLWB_R1_____________ KC_B, KC_Y, KC_U, KC_V, KC_SCLN -#define _____________CARPLAX_QGMLWB_R2_____________ KC_I, KC_A, KC_E, KC_O, KC_H, KC_QUOT -#define _____________CARPLAX_QGMLWB_R3_____________ KC_K, KC_P, KC_COMM, KC_DOT, KC_SLSH - -// colemak like, zxcv fixed -#define _____________CARPLAX_QGMLWY_L1_____________ KC_Q, KC_G, KC_M, KC_L, KC_W -#define _____________CARPLAX_QGMLWY_L2_____________ KC_D, KC_S, KC_T, KC_N, KC_R -#define _____________CARPLAX_QGMLWY_L3_____________ KC_Z, KC_X, KC_C, KC_V, KC_J - -#define _____________CARPLAX_QGMLWY_R1_____________ KC_Y, KC_F, KC_U, KC_B, KC_SCLN -#define _____________CARPLAX_QGMLWY_R2_____________ KC_I, KC_A, KC_E, KC_O, KC_H, KC_QUOT -#define _____________CARPLAX_QGMLWY_R3_____________ KC_K, KC_P, KC_COMM, KC_DOT, KC_SLSH - -// teeheehee -#define _____________CARPLAX_TNWCLR_L1_____________ KC_T, KC_N, KC_W, KC_C, KC_L -#define _____________CARPLAX_TNWCLR_L2_____________ KC_S, KC_K, KC_J, KC_X, KC_G -#define _____________CARPLAX_TNWCLR_L3_____________ KC_E, KC_O, KC_D, KC_I, KC_A - -#define _____________CARPLAX_TNWCLR_R1_____________ KC_R, KC_B, KC_F, KC_M, KC_H -#define _____________CARPLAX_TNWCLR_R2_____________ KC_P, KC_Q, KC_Z, KC_V, KC_SCLN, KC_QUOT -#define _____________CARPLAX_TNWCLR_R3_____________ KC_U, KC_Y, KC_COMM, KC_DOT, KC_SLSH - - -#define _________________WHITE_R1__________________ KC_V, KC_Y, KC_D, KC_COMM, KC_QUOT -#define _________________WHITE_R2__________________ KC_A, KC_T, KC_H, KC_E, KC_B -#define _________________WHITE_R3__________________ KC_P, KC_K, KC_G, KC_W, KC_Q - -#define _________________WHITE_L1__________________ KC_INT1, KC_J, KC_M, KC_L, KC_U -#define _________________WHITE_L2__________________ KC_MINS, KC_C, KC_S, KC_N, KC_O, KC_I -#define _________________WHITE_L3__________________ KC_X, KC_R, KC_F, KC_DOT, KC_Z - - -#define _________________HALMAK_L1_________________ KC_W, KC_L, KC_R, KC_B, KC_Z -#define _________________HALMAK_L2_________________ KC_S, KC_H, KC_N, KC_T, KC_COMM -#define _________________HALMAK_L3_________________ KC_F, KC_M, KC_V, KC_V, KC_SLASH - -#define _________________HALMAK_R1_________________ KC_SCLN, KC_Q, KC_U, KC_D, KC_J -#define _________________HALMAK_R2_________________ KC_DOT, KC_A, KC_E, KC_O, KC_I, KC_QUOTE -#define _________________HALMAK_R3_________________ KC_G, KC_P, KC_X, KC_K, KC_Y - - -#define __________________ISRT_L1__________________ KC_W, KC_C, KC_L, KC_M, KC_K -#define __________________ISRT_L2__________________ KC_I, KC_S, KC_R, KC_T, KC_G -#define __________________ISRT_L3__________________ KC_Q, KC_V, KC_W, KC_D, KC_J - -#define __________________ISRT_R1__________________ KC_Z, KC_F, KC_U, KC_COMM, KC_QUOTE -#define __________________ISRT_R2__________________ KC_P, KC_N, KC_E, KC_A, KC_O, KC_SCLN -#define __________________ISRT_R3__________________ KC_B, KC_H, KC_SLSH, KC_DOT, KC_X - - -#define __________________SOUL_L1__________________ KC_Q, KC_W, KC_L, KC_D, KC_P -#define __________________SOUL_L2__________________ KC_A, KC_S, KC_R, KC_T, KC_G -#define __________________SOUL_L3__________________ KC_Z, KC_X, KC_C, KC_V, KC_J - -#define __________________SOUL_R1__________________ KC_K, KC_M, KC_U, KC_Y, KC_SCLN -#define __________________SOUL_R2__________________ KC_F, KC_N, KC_E, KC_I, KC_O, KC_QUOTE -#define __________________SOUL_R3__________________ KC_B, KC_H, KC_COMM, KC_DOT, KC_SLSH - - -#define __________________NIRO_L1__________________ KC_Q, KC_W, KC_U, KC_D, KC_P -#define __________________NIRO_L2__________________ KC_A, KC_S, KC_E, KC_T, KC_G -#define __________________NIRO_L3__________________ KC_Z, KC_X, KC_C, KC_V, KC_B - -#define __________________NIRO_R1__________________ KC_J, KC_F, KC_Y, KC_L, KC_SCLN -#define __________________NIRO_R2__________________ KC_H, KC_N, KC_I, KC_R, KC_O, KC_QUOTE -#define __________________NIRO_R3__________________ KC_K, KC_M, KC_COMM, KC_DOT, KC_SLSH - - -#define _________________ASSET_L1__________________ KC_Q, KC_W, KC_J, KC_F, KC_G -#define _________________ASSET_L2__________________ KC_A, KC_S, KC_E, KC_T, KC_D -#define _________________ASSET_L3__________________ KC_Z, KC_X, KC_C, KC_V, KC_B - -#define _________________ASSET_R1__________________ KC_Y, KC_P, KC_U, KC_L, KC_SCLN -#define _________________ASSET_R2__________________ KC_H, KC_N, KC_I, KC_O, KC_R, KC_QUOTE -#define _________________ASSET_R3__________________ KC_K, KC_M, KC_COMM, KC_DOT, KC_SLSH - - -#define _________________MTGAP_L1__________________ KC_Y, KC_P, KC_O, KC_U, KC_J -#define _________________MTGAP_L2__________________ KC_I, KC_N, KC_E, KC_A, KC_COMM -#define _________________MTGAP_L3__________________ KC_Q, KC_Z, KC_SLSH, KC_DOT, KC_SCLN - -#define _________________MTGAP_R1__________________ KC_K, KC_D, KC_L, KC_C, KC_W -#define _________________MTGAP_R2__________________ KC_M, KC_H, KC_T, KC_S, KC_R, KC_QUOTE -#define _________________MTGAP_R3__________________ KC_B, KC_F, KC_G, KC_V, KC_X - - -#define _________________MINIMAK_L1________________ KC_Q, KC_W, KC_D, KC_R, KC_K -#define _________________MINIMAK_L2________________ KC_A, KC_S, KC_T, KC_F, KC_G -#define _________________MINIMAK_L3________________ KC_Z, KC_X, KC_C, KC_V, KC_B - -#define _________________MINIMAK_R1________________ KC_Y, KC_U, KC_I, KC_O, KC_P -#define _________________MINIMAK_R2________________ KC_H, KC_J, KC_E, KC_L, KC_SCLN, KC_QUOT -#define _________________MINIMAK_R3________________ KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH - - -#define ________________MINIMAK_8_L1_______________ KC_Q, KC_W, KC_D, KC_R, KC_K -#define ________________MINIMAK_8_L2_______________ KC_A, KC_S, KC_T, KC_F, KC_G -#define ________________MINIMAK_8_L3_______________ KC_Z, KC_X, KC_C, KC_V, KC_B - -#define ________________MINIMAK_8_R1_______________ KC_Y, KC_U, KC_I, KC_L, KC_P -#define ________________MINIMAK_8_R2_______________ KC_H, KC_N, KC_E, KC_O, KC_SCLN, KC_QUOT -#define ________________MINIMAK_8_R3_______________ KC_J, KC_M, KC_COMM, KC_DOT, KC_SLSH - - -#define _______________MINIMAK_12_L1_______________ KC_Q, KC_W, KC_D, KC_F, KC_K -#define _______________MINIMAK_12_L2_______________ KC_A, KC_S, KC_T, KC_R, KC_G -#define _______________MINIMAK_12_L3_______________ KC_Z, KC_X, KC_C, KC_V, KC_B - -#define _______________MINIMAK_12_R1_______________ KC_Y, KC_U, KC_I, KC_L, KC_SCLN -#define _______________MINIMAK_12_R2_______________ KC_H, KC_N, KC_E, KC_O, KC_P, KC_QUOT -#define _______________MINIMAK_12_R3_______________ KC_J, KC_M, KC_COMM, KC_DOT, KC_SLSH - - -#define ________________NUMBER_LEFT________________ KC_1, KC_2, KC_3, KC_4, KC_5 -#define ________________NUMBER_RIGHT_______________ KC_6, KC_7, KC_8, KC_9, KC_0 -#define _________________FUNC_LEFT_________________ KC_F1, KC_F2, KC_F3, KC_F4, KC_F5 -#define _________________FUNC_RIGHT________________ KC_F6, KC_F7, KC_F8, KC_F9, KC_F10 - -#define ___________________BLANK___________________ _______, _______, _______, _______, _______ - - -#define _________________LOWER_L1__________________ KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC -#define _________________LOWER_L2__________________ _________________FUNC_LEFT_________________ -#define _________________LOWER_L3__________________ _________________FUNC_RIGHT________________ - -#define _________________LOWER_R1__________________ KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN -#define _________________LOWER_R2__________________ _______, KC_UNDS, KC_PLUS, KC_LCBR, KC_RCBR -#define _________________LOWER_R3__________________ _______, KC_HOME, KC_PGDN, KC_PGUP, KC_END - - - -#define _________________RAISE_L1__________________ ________________NUMBER_LEFT________________ -#define _________________RAISE_L2__________________ ___________________BLANK___________________ -#define _________________RAISE_L3__________________ ___________________BLANK___________________ - -#define _________________RAISE_R1__________________ ________________NUMBER_RIGHT_______________ -#define _________________RAISE_R2__________________ _______, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC -#define _________________RAISE_R3__________________ _______, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT - - - -#define _________________ADJUST_L1_________________ RGB_MOD, RGB_HUI, RGB_SAI, RGB_VAI, RGB_TOG -#define _________________ADJUST_L2_________________ MU_TOG , CK_TOGG, AU_ON, AU_OFF, CG_NORM -#define _________________ADJUST_L3_________________ RGB_RMOD,RGB_HUD,RGB_SAD, RGB_VAD, KC_RGB_T - -#define _________________ADJUST_R1_________________ KC_SEC1, KC_SEC2, KC_SEC3, KC_SEC4, KC_SEC5 -#define _________________ADJUST_R2_________________ CG_SWAP, DEFLYR1, DEFLYR2, DEFLYR3, DEFLYR4 -#define _________________ADJUST_R3_________________ MG_NKRO, KC_MUTE, KC_VOLD, KC_VOLU, KC_MNXT - -// clang-format on -- cgit v1.2.3