From 3a3e5abac992712a8bb4e9b61430f5fc62dc6043 Mon Sep 17 00:00:00 2001 From: Drashna Jaelre Date: Wed, 31 May 2023 11:44:06 -0700 Subject: [Keymap] Drashna Keymap updates for 0.21.0 (#21073) --- users/drashna/bootmagic_better.c | 2 +- users/drashna/callbacks.c | 107 ++-- users/drashna/config.h | 21 +- users/drashna/drashna.c | 114 +++- users/drashna/drashna.h | 28 +- users/drashna/eeconfig_users.c | 53 ++ users/drashna/eeconfig_users.h | 12 + users/drashna/keyrecords/dynamic_macros.c | 283 ++++++++++ users/drashna/keyrecords/dynamic_macros.h | 50 ++ users/drashna/keyrecords/process_records.c | 68 +-- users/drashna/keyrecords/process_records.h | 88 +-- users/drashna/keyrecords/tapping.c | 5 + users/drashna/keyrecords/unicode.c | 10 + users/drashna/keyrecords/unicode.h | 1 + users/drashna/keyrecords/wrappers.h | 2 +- users/drashna/oled/drashna_font.h | 394 +------------ users/drashna/oled/oled_assets.h | 207 +++++++ users/drashna/oled/oled_config.h | 33 +- users/drashna/oled/oled_stuff.c | 421 +++++--------- users/drashna/oled/oled_stuff.h | 7 +- users/drashna/oled/rules.mk | 12 + users/drashna/oled/sh110x.c | 860 ----------------------------- users/drashna/pointing/pointing.c | 33 +- users/drashna/pointing/pointing.h | 1 + users/drashna/post_config.h | 4 +- users/drashna/rgb/rgb_matrix_config.h | 2 +- users/drashna/rgb/rgb_matrix_stuff.c | 44 +- users/drashna/rgb/rgb_matrix_stuff.h | 2 + users/drashna/rgb/rgb_stuff.c | 42 ++ users/drashna/rgb/rgb_stuff.h | 3 + users/drashna/rules.mk | 65 +-- users/drashna/split/split_config.h | 8 +- users/drashna/split/transport_sync.c | 28 +- users/drashna/split/transport_sync.h | 1 - 34 files changed, 1253 insertions(+), 1758 deletions(-) create mode 100644 users/drashna/eeconfig_users.c create mode 100644 users/drashna/eeconfig_users.h create mode 100644 users/drashna/keyrecords/dynamic_macros.c create mode 100644 users/drashna/keyrecords/dynamic_macros.h create mode 100644 users/drashna/oled/oled_assets.h create mode 100644 users/drashna/oled/rules.mk delete mode 100644 users/drashna/oled/sh110x.c (limited to 'users') diff --git a/users/drashna/bootmagic_better.c b/users/drashna/bootmagic_better.c index ffd2e609ae..fa1078e37d 100644 --- a/users/drashna/bootmagic_better.c +++ b/users/drashna/bootmagic_better.c @@ -28,7 +28,7 @@ void bootmagic_lite(void) { if (!is_keyboard_left()) { row = BOOTMAGIC_LITE_ROW_RIGHT; col = BOOTMAGIC_LITE_COLUMN_RIGHT; -#if defined(BOOTMAGIC_LITE_EEPROM_ROW) && defined(BOOTMAGIC_LITE_EEPROM_COLUMN) && defined(BOOTMAGIC_LITE_EEPROM_ROW_RIGHT) && defined(BOOTMAGIC_LITE_EEPROM_COLUMN_RIGHT) +# if defined(BOOTMAGIC_LITE_EEPROM_ROW) && defined(BOOTMAGIC_LITE_EEPROM_COLUMN) && defined(BOOTMAGIC_LITE_EEPROM_ROW_RIGHT) && defined(BOOTMAGIC_LITE_EEPROM_COLUMN_RIGHT) row_e = BOOTMAGIC_LITE_EEPROM_ROW_RIGHT; col_e = BOOTMAGIC_LITE_EEPROM_COLUMN_RIGHT; # endif diff --git a/users/drashna/callbacks.c b/users/drashna/callbacks.c index 568f56c8d1..cab7e5278f 100644 --- a/users/drashna/callbacks.c +++ b/users/drashna/callbacks.c @@ -3,6 +3,9 @@ #include "drashna.h" +#ifdef CUSTOM_DYNAMIC_MACROS_ENABLE +# include "keyrecords/dynamic_macros.h" +#endif #ifdef I2C_SCANNER_ENABLE void housekeeping_task_i2c_scanner(void); void keyboard_post_init_i2c(void); @@ -10,7 +13,10 @@ void keyboard_post_init_i2c(void); __attribute__((weak)) void keyboard_pre_init_keymap(void) {} void keyboard_pre_init_user(void) { - userspace_config.raw = eeconfig_read_user(); + eeconfig_read_user_config(&userspace_config.raw); + if (!userspace_config.check) { + eeconfig_init_user(); + } keyboard_pre_init_keymap(); } // Add reconfigurable functions here, for keymap customization @@ -24,58 +30,8 @@ void keyboard_pre_init_user(void) { void keyboard_post_init_qp(void); #endif -#ifdef OS_DETECTION_ENABLE -os_variant_t os_type; - -uint32_t startup_exec(uint32_t trigger_time, void *cb_arg) { - /* do something */ - - if (is_keyboard_master()) { - os_type = detected_host_os(); - if (os_type) { - bool is_mac = (os_type == OS_MACOS) || (os_type == OS_IOS); - keymap_config.swap_lctl_lgui = keymap_config.swap_rctl_rgui = is_mac; -# ifdef UNICODE_COMMON_ENABLE - uint8_t mode = is_mac ? UNICODE_MODE_MACOS : UNICODE_MODE_WINCOMPOSE; - if (mode != get_unicode_input_mode()) { - set_unicode_input_mode(mode); - } -# endif - switch (os_type) { - case OS_UNSURE: - xprintf("unknown OS Detected\n"); - break; - case OS_LINUX: - xprintf("Linux Detected\n"); - break; - case OS_WINDOWS: - xprintf("Windows Detected\n"); - break; -# if 0 - case OS_WINDOWS_UNSURE: - xprintf("Windows? Detected\n"); - break; -# endif - case OS_MACOS: - xprintf("MacOS Detected\n"); - break; - case OS_IOS: - xprintf("iOS Detected\n"); - break; -# if 0 - case OS_PS5: - xprintf("PlayStation 5 Detected\n"); - break; - case OS_HANDHELD: - xprintf("Nintend Switch/Quest 2 Detected\n"); - break; -# endif - } - } - } - - return os_type ? 0 : 500; -} +#if defined(OS_DETECTION_ENABLE) && defined(DEFERRED_EXEC_ENABLE) +uint32_t startup_exec(uint32_t trigger_time, void *cb_arg); #endif __attribute__((weak)) void keyboard_post_init_keymap(void) {} @@ -103,8 +59,10 @@ void keyboard_post_init_user(void) { DDRB &= ~(1 << 0); PORTB &= ~(1 << 0); #endif - -#ifdef OS_DETECTION_ENABLE +#ifdef CUSTOM_DYNAMIC_MACROS_ENABLE + dynamic_macro_init(); +#endif +#if defined(OS_DETECTION_ENABLE) && defined(DEFERRED_EXEC_ENABLE) defer_exec(100, startup_exec, NULL); #endif @@ -153,9 +111,6 @@ void suspend_power_down_user(void) { __attribute__((weak)) void suspend_wakeup_init_keymap(void) {} void suspend_wakeup_init_user(void) { -#ifdef OLED_ENABLE - oled_timer_reset(); -#endif suspend_wakeup_init_keymap(); } @@ -217,6 +172,11 @@ layer_state_t layer_state_set_user(layer_state_t state) { __attribute__((weak)) layer_state_t default_layer_state_set_keymap(layer_state_t state) { return state; } + +#if defined(AUDIO_ENABLE) && defined(DEFAULT_LAYER_SONGS) +static float default_layer_songs[][MAX_LAYER][2] = DEFAULT_LAYER_SONGS; +#endif + layer_state_t default_layer_state_set_user(layer_state_t state) { if (!is_keyboard_master()) { return state; @@ -226,6 +186,21 @@ layer_state_t default_layer_state_set_user(layer_state_t state) { #if defined(CUSTOM_RGBLIGHT) state = default_layer_state_set_rgb_light(state); #endif + + static bool has_init_been_ran = false; + // We don't want to run this the first time it's called, since it's read from eeeprom and called + // as part of the startup process. But after that, it's okay. + if (has_init_been_ran) { +#if defined(AUDIO_ENABLE) && defined(DEFAULT_LAYER_SONGS) + if (get_highest_layer(state) < MAX_LAYER) { + PLAY_SONG(default_layer_songs[get_highest_layer(state)]); + } +#endif + eeconfig_update_default_layer(state); + } else { + has_init_been_ran = true; + } + return state; } @@ -238,11 +213,23 @@ __attribute__((weak)) void eeconfig_init_keymap(void) {} void eeconfig_init_user(void) { userspace_config.raw = 0; userspace_config.rgb_layer_change = true; - userspace_config.autocorrection = true; - eeconfig_update_user(userspace_config.raw); + userspace_config.check = true; +#if defined(OLED_ENABLE) + userspace_config.oled_brightness = OLED_BRIGHTNESS; +#else + userspace_config.oled_brightness = 255; +#endif + eeconfig_update_user_config(&userspace_config.raw); eeconfig_init_keymap(); } +void eeconfig_init_user_datablock(void) { +#if (EECONFIG_USER_DATA_SIZE) > 4 + uint8_t eeconfig_empty_temp[(EECONFIG_USER_DATA_SIZE)-4] = {0}; + eeconfig_update_user_data(eeconfig_empty_temp); +#endif +} + #ifdef SPLIT_KEYBOARD __attribute__((weak)) void matrix_slave_scan_keymap(void) {} void matrix_slave_scan_user(void) { diff --git a/users/drashna/config.h b/users/drashna/config.h index b4aa1283eb..ec9bbf1afb 100644 --- a/users/drashna/config.h +++ b/users/drashna/config.h @@ -3,9 +3,6 @@ #pragma once -// Use custom magic number so that when switching branches, EEPROM always gets reset -#define EECONFIG_MAGIC_NUMBER (uint16_t)0x1339 - #ifdef IS_COMMAND # undef IS_COMMAND #endif @@ -43,7 +40,6 @@ # define WPM_ESTIMATED_WORD_SIZE 5 #endif - #define UNICODE_SELECTED_MODES UNICODE_MODE_WINCOMPOSE, UNICODE_MODE_MACOS #ifndef ONESHOT_TAP_TOGGLE @@ -98,7 +94,22 @@ # define C15 PAL_LINE(GPIOC, 15) #endif - #define ENABLE_COMPILE_KEYCODE #define BOTH_SHIFTS_TURNS_ON_CAPS_WORD + +/* --- PRINTF_BYTE_TO_BINARY macro's --- */ +#define PRINTF_BINARY_PATTERN_INT8 "%c%c%c%c%c%c%c%c" +#define PRINTF_BYTE_TO_BINARY_INT8(i) (((i)&0x80ll) ? '1' : '0'), (((i)&0x40ll) ? '1' : '0'), (((i)&0x20ll) ? '1' : '0'), (((i)&0x10ll) ? '1' : '0'), (((i)&0x08ll) ? '1' : '0'), (((i)&0x04ll) ? '1' : '0'), (((i)&0x02ll) ? '1' : '0'), (((i)&0x01ll) ? '1' : '0') + +#define PRINTF_BINARY_PATTERN_INT16 PRINTF_BINARY_PATTERN_INT8 " " PRINTF_BINARY_PATTERN_INT8 +#define PRINTF_BYTE_TO_BINARY_INT16(i) PRINTF_BYTE_TO_BINARY_INT8((i) >> 8), PRINTF_BYTE_TO_BINARY_INT8(i) +#define PRINTF_BINARY_PATTERN_INT32 PRINTF_BINARY_PATTERN_INT16 " " PRINTF_BINARY_PATTERN_INT16 +#define PRINTF_BYTE_TO_BINARY_INT32(i) PRINTF_BYTE_TO_BINARY_INT16((i) >> 16), PRINTF_BYTE_TO_BINARY_INT16(i) +#define PRINTF_BINARY_PATTERN_INT64 PRINTF_BINARY_PATTERN_INT32 " " PRINTF_BINARY_PATTERN_INT32 +#define PRINTF_BYTE_TO_BINARY_INT64(i) PRINTF_BYTE_TO_BINARY_INT32((i) >> 32), PRINTF_BYTE_TO_BINARY_INT32(i) +/* --- end macros --- */ + +#ifndef EECONFIG_USER_DATA_SIZE +# define EECONFIG_USER_DATA_SIZE 8 +#endif diff --git a/users/drashna/drashna.c b/users/drashna/drashna.c index 259810c70f..cad6db8f3d 100644 --- a/users/drashna/drashna.c +++ b/users/drashna/drashna.c @@ -2,6 +2,8 @@ // SPDX-License-Identifier: GPL-2.0-or-later #include "drashna.h" +#include +#include userspace_config_t userspace_config; @@ -139,7 +141,7 @@ float autocorrect_song[][2] = SONG(PLOVER_GOODBYE_SOUND); # endif # endif -bool apply_autocorrect(uint8_t backspaces, const char* str) { +bool apply_autocorrect(uint8_t backspaces, const char *str) { if (layer_state_is(_GAMEPAD)) { return false; } @@ -188,7 +190,7 @@ void oneshot_locked_mods_changed_user(uint8_t mods) { # endif #endif -void format_layer_bitmap_string(char* buffer, layer_state_t state, layer_state_t default_state) { +void format_layer_bitmap_string(char *buffer, layer_state_t state, layer_state_t default_state) { for (int i = 0; i < 16; i++) { if (i == 0 || i == 4 || i == 8 || i == 12) { *buffer = ' '; @@ -207,3 +209,111 @@ void format_layer_bitmap_string(char* buffer, layer_state_t state, layer_state_t } *buffer = 0; } + +#if defined(OS_DETECTION_ENABLE) && defined(DEFERRED_EXEC_ENABLE) +os_variant_t os_type; + +uint32_t startup_exec(uint32_t trigger_time, void *cb_arg) { + if (is_keyboard_master()) { + os_type = detected_host_os(); + if (os_type) { + bool is_mac = (os_type == OS_MACOS) || (os_type == OS_IOS); + if (keymap_config.swap_lctl_lgui != is_mac) { + keymap_config.swap_lctl_lgui = keymap_config.swap_rctl_rgui = is_mac; + eeconfig_update_keymap(keymap_config.raw); + } +# ifdef UNICODE_COMMON_ENABLE + set_unicode_input_mode_soft(keymap_config.swap_lctl_lgui ? UNICODE_MODE_MACOS : UNICODE_MODE_WINCOMPOSE); +# endif + switch (os_type) { + case OS_UNSURE: + xprintf("unknown OS Detected\n"); + break; + case OS_LINUX: + xprintf("Linux Detected\n"); + break; + case OS_WINDOWS: + xprintf("Windows Detected\n"); + break; +# if 0 + case OS_WINDOWS_UNSURE: + xprintf("Windows? Detected\n"); + break; +# endif + case OS_MACOS: + xprintf("MacOS Detected\n"); + break; + case OS_IOS: + xprintf("iOS Detected\n"); + break; +# if 0 + case OS_PS5: + xprintf("PlayStation 5 Detected\n"); + break; + case OS_HANDHELD: + xprintf("Nintend Switch/Quest 2 Detected\n"); + break; +# endif + } + } + } + + return os_type ? 0 : 500; +} +#endif + +static host_driver_t *host_driver = 0; +static bool host_driver_disabled = false; + +void set_keyboard_lock(bool status) { + if (!status && !host_get_driver()) { + host_set_driver(host_driver); + } else if (status && host_get_driver()) { + host_driver = host_get_driver(); + clear_keyboard(); + host_set_driver(0); + } else if (status) { + clear_keyboard(); + } + + host_driver_disabled = status; +} + +void toggle_keyboard_lock(void) { + set_keyboard_lock(!host_driver_disabled); +} + +bool get_keyboard_lock(void) { + return host_driver_disabled; +} + +const char *get_layer_name_string(layer_state_t state, bool alt_name) { + switch (get_highest_layer(state)) { + case _QWERTY: + return alt_name ? "Num Pad" : "QWERTY"; + case _COLEMAK: + return "Colemak"; + case _COLEMAK_DH: + return "Colemak-DH"; + case _DVORAK: + return "Dvorak"; + case _GAMEPAD: + return "Gamepad"; + case _DIABLO: + return "Diablo"; + case _DIABLOII: + return "Diablo II"; + case _MOUSE: + return alt_name ? "Macros" : "Mouse"; + case _MEDIA: + return "Media"; + case _LOWER: + return "Lower"; + case _RAISE: + return "Raise"; + case _ADJUST: + return "Adjust"; + default: + return "Unknown"; + } +} diff --git a/users/drashna/drashna.h b/users/drashna/drashna.h index 4e2a4d5acb..49cdf6ca21 100644 --- a/users/drashna/drashna.h +++ b/users/drashna/drashna.h @@ -4,7 +4,7 @@ #pragma once #include QMK_KEYBOARD_H -#include "eeprom.h" +#include "eeconfig_users.h" #include "keyrecords/wrappers.h" #include "keyrecords/process_records.h" #include "callbacks.h" @@ -30,6 +30,9 @@ #ifdef OS_DETECTION_ENABLE # include "os_detection.h" #endif +#ifdef UNICODE_COMMON_ENABLE +# include "keyrecords/unicode.h" +#endif /* Define layer names */ enum userspace_layers { @@ -88,14 +91,25 @@ void format_layer_bitmap_string(char* buffer, layer_state_t state, layer_state_t typedef union { uint32_t raw; struct { - bool rgb_layer_change :1; - bool is_overwatch :1; - bool nuke_switch :1; - bool swapped_numbers :1; - bool rgb_matrix_idle_anim :1; - bool autocorrection :1; + bool rgb_layer_change :1; + bool is_overwatch :1; + bool nuke_switch :1; + bool swapped_numbers :1; + bool rgb_matrix_idle_anim :1; + bool mouse_jiggler :1; + uint8_t align_reserved :2; + uint8_t oled_brightness :8; + uint32_t reserved :15; + bool check :1; }; } userspace_config_t; // clang-format on +_Static_assert(sizeof(userspace_config_t) == sizeof(uint32_t), "Userspace EECONFIG out of spec."); + extern userspace_config_t userspace_config; + +void set_keyboard_lock(bool enable); +bool get_keyboard_lock(void); +void toggle_keyboard_lock(void); +const char* get_layer_name_string(layer_state_t state, bool alt_name); diff --git a/users/drashna/eeconfig_users.c b/users/drashna/eeconfig_users.c new file mode 100644 index 0000000000..8e0f1f10b6 --- /dev/null +++ b/users/drashna/eeconfig_users.c @@ -0,0 +1,53 @@ +// Copyright 2023 Christopher Courtney, aka Drashna Jael're (@drashna) +// SPDX-License-Identifier: GPL-2.0-or-later + +#include "eeconfig_users.h" +#include "eeprom.h" +#include "eeconfig.h" +#include + +#if (TOTAL_EEPROM_BYTE_COUNT - 1) < EECONFIG_SIZE && !defined(KEYBOARD_input_club_ergodox_infinity) +# error "More eeprom configured than is available." +#endif +#if (EECONFIG_USER_DATA_SIZE) != 0 && (EECONFIG_USER_DATA_SIZE) < 4 +# error "Not enough EEPROM configured for user config." +#endif + +#if (EECONFIG_USER_DATA_SIZE) == 0 +# define EECONFIG_USER_TEMP EECONFIG_USER +#else +# define EECONFIG_USER_TEMP (uint32_t *)(EECONFIG_USER_DATABLOCK) +#endif + +void eeconfig_read_user_config(uint32_t *data) { +#if (EECONFIG_USER_DATA_SIZE) > 0 + if (!eeconfig_is_user_datablock_valid()) { + memset(data, 0, 4); + } else +#endif + eeprom_read_block(data, EECONFIG_USER_TEMP, 4); +} + +void eeconfig_update_user_config(const uint32_t *data) { + eeprom_update_block(data, EECONFIG_USER_TEMP, 4); +#if (EECONFIG_USER_DATA_SIZE) > 0 + eeprom_update_dword(EECONFIG_USER, (EECONFIG_USER_DATA_VERSION)); +#endif +} + +void eeconfig_read_user_data(void *data) { +#if (EECONFIG_USER_DATA_SIZE) > 4 + if (eeconfig_is_user_datablock_valid()) { + eeprom_read_block(data, EECONFIG_USER_DATABLOCK + 4, (EECONFIG_USER_DATA_SIZE)-4); + } else { + memset(data, 0, (EECONFIG_USER_DATA_SIZE)); + } +#endif +} + +void eeconfig_update_user_data(const void *data) { +#if (EECONFIG_USER_DATA_SIZE) > 4 + eeprom_update_dword(EECONFIG_USER, (EECONFIG_USER_DATA_VERSION)); + eeprom_update_block(data, EECONFIG_USER_DATABLOCK + 4, (EECONFIG_USER_DATA_SIZE)-4); +#endif +} diff --git a/users/drashna/eeconfig_users.h b/users/drashna/eeconfig_users.h new file mode 100644 index 0000000000..c9b230df9c --- /dev/null +++ b/users/drashna/eeconfig_users.h @@ -0,0 +1,12 @@ +// Copyright 2023 Christopher Courtney, aka Drashna Jael're (@drashna) +// SPDX-License-Identifier: GPL-2.0-or-later + +#pragma once + +#include + +void eeconfig_read_user_config(uint32_t *data); +void eeconfig_update_user_config(const uint32_t *data); + +void eeconfig_read_user_data(void *data); +void eeconfig_update_user_data(const void *data); diff --git a/users/drashna/keyrecords/dynamic_macros.c b/users/drashna/keyrecords/dynamic_macros.c new file mode 100644 index 0000000000..43c2336cb6 --- /dev/null +++ b/users/drashna/keyrecords/dynamic_macros.c @@ -0,0 +1,283 @@ +// Copyright 2016 Jack Humbert +// Copyright 2019 Wojciech Siewierski < wojciech dot siewierski at onet dot pl > +// Copyright 2023 Christopher Courtney, aka Drashna Jael're (@drashna) +// SPDX-License-Identifier: GPL-2.0-or-later + +#include "keyrecords/dynamic_macros.h" +#include "keyrecords/process_records.h" +#include "wait.h" +#include "debug.h" +#include "eeprom.h" +#include "eeconfig.h" +#include + +static uint8_t macro_id = 255; +static uint8_t recording_state = STATE_NOT_RECORDING; + +#if EECONFIG_USER_DATA_SIZE < 4 +# error "EECONFIG_USER_DATA_SIZE not set. Don't step on others eeprom." +#endif +#ifndef DYNAMIC_MACRO_EEPROM_BLOCK0_ADDR +# define DYNAMIC_MACRO_EEPROM_BLOCK0_ADDR (uint8_t*)(EECONFIG_USER_DATABLOCK + 4) +#endif + +dynamic_macro_t dynamic_macros[DYNAMIC_MACRO_COUNT]; +_Static_assert((sizeof(dynamic_macros)) <= (EECONFIG_USER_DATA_SIZE - 4), "User Data Size must be large enough to host all macros"); + +__attribute__((weak)) void dynamic_macro_record_start_user(void) {} + +__attribute__((weak)) void dynamic_macro_play_user(uint8_t macro_id) {} + +__attribute__((weak)) void dynamic_macro_record_key_user(uint8_t macro_id, keyrecord_t* record) {} + +__attribute__((weak)) void dynamic_macro_record_end_user(uint8_t macro_id) {} + +/** + * @brief Gets the current macro ID + * + * @return uint8_t + */ +uint8_t dynamic_macro_get_current_id(void) { + return macro_id; +} + +/** + * @brief Gets the current recording state + * + * @return uint8_t + */ +uint8_t dynamic_macro_get_recording_state(void) { + return recording_state; +} + +/** + * Start recording of the dynamic macro. + * + * @param macro_id[in] The id of macro to be recorded + */ +bool dynamic_macro_record_start(uint8_t macro_id) { + if (macro_id >= (uint8_t)(DYNAMIC_MACRO_COUNT)) { + return false; + } + dprintf("dynamic macro recording: started for slot %d\n", macro_id); + + dynamic_macro_record_start_user(); + + clear_keyboard(); + layer_clear(); + + dynamic_macros[macro_id].length = 0; + return true; +} + +/** + * Play the dynamic macro. + * + * @param macro_id[in] The id of macro to be played + */ +void dynamic_macro_play(uint8_t macro_id) { + if (macro_id >= (uint8_t)(DYNAMIC_MACRO_COUNT)) { + return; + } + + dprintf("dynamic macro: slot %d playback, length %d\n", macro_id, dynamic_macros[macro_id].length); + + layer_state_t saved_layer_state = layer_state; + + clear_keyboard(); + layer_clear(); + + for (uint8_t i = 0; i < dynamic_macros[macro_id].length; ++i) { + process_record(&dynamic_macros[macro_id].events[i]); + } + + clear_keyboard(); + + layer_state_set(saved_layer_state); + + dynamic_macro_play_user(macro_id); +} + +/** + * Record a single key in a dynamic macro. + * + * @param macro_id[in] The start of the used macro buffer. + * @param record[in] The current keypress. + */ +void dynamic_macro_record_key(uint8_t macro_id, keyrecord_t* record) { + dynamic_macro_t* macro = &dynamic_macros[macro_id]; + uint8_t length = macro->length; + + /* If we've just started recording, ignore all the key releases. */ + if (!record->event.pressed && length == 0) { + dprintln("dynamic macro: ignoring a leading key-up event"); + return; + } + + if (length < DYNAMIC_MACRO_SIZE) { + macro->events[length] = *record; + macro->length = ++length; + } else { + dynamic_macro_record_key_user(macro_id, record); + } + + dprintf("dynamic macro: slot %d length: %d/%d\n", macro_id, length, DYNAMIC_MACRO_SIZE); +} + +/** + * End recording of the dynamic macro. Essentially just update the + * pointer to the end of the macro. + */ +void dynamic_macro_record_end(uint8_t macro_id) { + if (macro_id >= (uint8_t)(DYNAMIC_MACRO_COUNT)) { + return; + } + dynamic_macro_record_end_user(macro_id); + + dynamic_macro_t* macro = &dynamic_macros[macro_id]; + uint8_t length = macro->length; + + keyrecord_t* events_begin = &(macro->events[0]); + keyrecord_t* events_pointer = &(macro->events[length - 1]); + + dprintf("dynamic_macro: macro length before trimming: %d\n", macro->length); + while (events_pointer != events_begin && (events_pointer)->event.pressed) { + dprintln("dynamic macro: trimming a trailing key-down event"); + --(macro->length); + --events_pointer; + } + + macro->checksum = dynamic_macro_calc_crc(macro); + dynamic_macro_save_eeprom(macro_id); + + dprintf("dynamic macro: slot %d saved, length: %d\n", macro_id, length); +} + +bool process_record_dynamic_macro(uint16_t keycode, keyrecord_t* record) { + if (STATE_NOT_RECORDING == recording_state) { + /* Program key pressed to request programming mode */ + if (keycode == DYN_MACRO_PROG && record->event.pressed) { + // dynamic_macro_led_blink(); + + recording_state = STATE_RECORD_KEY_PRESSED; + dprintf("dynamic macro: programming key pressed, waiting for macro slot selection. %d\n", recording_state); + + return false; + } + /* Macro key pressed to request macro playback */ + if (IS_DYN_KEYCODE(keycode) && record->event.pressed) { + dynamic_macro_play(keycode - DYN_MACRO_KEY00); + + return false; + } + + /* Non-dynamic macro key, process it elsewhere. */ + return true; + } else if (STATE_RECORD_KEY_PRESSED == recording_state) { + /* Program key pressed again before a macro selector key, cancel macro recording. + Blink leds to indicate cancelation. */ + if (keycode == DYN_MACRO_PROG && record->event.pressed) { + // dynamic_macro_led_blink(); + + recording_state = STATE_NOT_RECORDING; + dprintf("dynamic macro: programming key pressed, programming mode canceled. %d\n", recording_state); + + return false; + } else if (IS_DYN_KEYCODE(keycode) && record->event.pressed) { + macro_id = keycode - DYN_MACRO_KEY00; + + if (dynamic_macro_record_start(macro_id)) { + /* Macro slot selected, enter recording state. */ + recording_state = STATE_CURRENTLY_RECORDING; + } else { + recording_state = STATE_NOT_RECORDING; + } + + return false; + } + /* Ignore any non-macro key press while in RECORD_KEY_PRESSED state. */ + return false; + } else if (STATE_CURRENTLY_RECORDING == recording_state) { + /* Program key pressed to request end of macro recording. */ + if (keycode == DYN_MACRO_PROG && record->event.pressed) { + dynamic_macro_record_end(macro_id); + recording_state = STATE_NOT_RECORDING; + + return false; + } + /* Don't record other macro key presses. */ + else if (IS_DYN_KEYCODE(keycode) && record->event.pressed) { + dprintln("dynamic macro: playback key ignored in programming mode."); + return false; + } + /* Non-macro keypress that should be recorded */ + else { + dynamic_macro_record_key(macro_id, record); + + /* Don't output recorded keypress. */ + return false; + } + } + + return true; +} + +static inline uint16_t crc16_update(uint16_t crc, uint8_t a) { + crc ^= a; + for (uint8_t i = 0; i < 8; ++i) { + if (crc & 1) + crc = (crc >> 1) ^ 0xA001; + else + crc = (crc >> 1); + } + return crc; +} + +uint16_t dynamic_macro_calc_crc(dynamic_macro_t* macro) { + uint16_t crc = 0; + uint8_t* data = (uint8_t*)macro; + + for (uint16_t i = 0; i < DYNAMIC_MACRO_CRC_LENGTH; ++i) { + crc = crc16_update(crc, *(data++)); + } + return crc; +} + +inline void* dynamic_macro_eeprom_macro_addr(uint8_t macro_id) { + return DYNAMIC_MACRO_EEPROM_BLOCK0_ADDR + sizeof(dynamic_macro_t) * macro_id; +} + +void dynamic_macro_load_eeprom_all(void) { + for (uint8_t i = 0; i < DYNAMIC_MACRO_COUNT; ++i) { + dynamic_macro_load_eeprom(i); + } +} + +void dynamic_macro_load_eeprom(uint8_t macro_id) { + dynamic_macro_t* dst = &dynamic_macros[macro_id]; + + eeprom_read_block(dst, dynamic_macro_eeprom_macro_addr(macro_id), sizeof(dynamic_macro_t)); + + /* Validate checksum, ifchecksum is NOT valid for macro, set its length to 0 to prevent its use. */ + if (dynamic_macro_calc_crc(dst) != dst->checksum) { + dprintf("dynamic macro: slot %d not loaded, checksum mismatch\n", macro_id); + dst->length = 0; + + return; + } + + dprintf("dynamic macro: slot %d loaded from eeprom, checksum okay\n", macro_id); +} + +void dynamic_macro_save_eeprom(uint8_t macro_id) { + dynamic_macro_t* src = &dynamic_macros[macro_id]; + + eeprom_update_block(src, dynamic_macro_eeprom_macro_addr(macro_id), sizeof(dynamic_macro_t)); + dprintf("dynamic macro: slot %d saved to eeprom\n", macro_id); +} + +void dynamic_macro_init(void) { + /* zero out macro blocks */ + memset(&dynamic_macros, 0, DYNAMIC_MACRO_COUNT * sizeof(dynamic_macro_t)); + dynamic_macro_load_eeprom_all(); +} diff --git a/users/drashna/keyrecords/dynamic_macros.h b/users/drashna/keyrecords/dynamic_macros.h new file mode 100644 index 0000000000..5eefb9b268 --- /dev/null +++ b/users/drashna/keyrecords/dynamic_macros.h @@ -0,0 +1,50 @@ +// Copyright 2016 Jack Humbert +// Copyright 2019 Wojciech Siewierski < wojciech dot siewierski at onet dot pl > +// Copyright 2023 Christopher Courtney, aka Drashna Jael're (@drashna) +// SPDX-License-Identifier: GPL-2.0-or-later + +#pragma once + +#include "action.h" +#include "action_layer.h" + +#ifndef DYNAMIC_MACRO_COUNT +# define DYNAMIC_MACRO_COUNT 8 +#endif + +#ifndef DYNAMIC_MACRO_SIZE +# define DYNAMIC_MACRO_SIZE 64 +#endif + +enum dynamic_macro_recording_state { + STATE_NOT_RECORDING, + STATE_RECORD_KEY_PRESSED, + STATE_CURRENTLY_RECORDING, +}; + +typedef struct { + keyrecord_t events[DYNAMIC_MACRO_SIZE]; + uint8_t length; + uint16_t checksum; +} dynamic_macro_t; + +void dynamic_macro_init(void); +bool dynamic_macro_record_start(uint8_t macro_id); +void dynamic_macro_play(uint8_t macro_id); +void dynamic_macro_record_key(uint8_t macro_id, keyrecord_t* record); +void dynamic_macro_record_end(uint8_t macro_id); +bool process_record_dynamic_macro(uint16_t keycode, keyrecord_t* record); + +void dynamic_macro_record_start_user(void); +void dynamic_macro_play_user(uint8_t macro_id); +void dynamic_macro_record_key_user(uint8_t macro_id, keyrecord_t* record); +void dynamic_macro_record_end_user(uint8_t macro_id); + +#define DYNAMIC_MACRO_CRC_LENGTH (sizeof(dynamic_macro_t) - sizeof(uint16_t)) +#define IS_DYN_KEYCODE(keycode) (keycode >= DYN_MACRO_KEY00 && keycode <= DYN_MACRO_KEY15) + +uint16_t dynamic_macro_calc_crc(dynamic_macro_t* macro); +void dynamic_macro_load_eeprom_all(void); +void dynamic_macro_load_eeprom(uint8_t macro_id); +void dynamic_macro_save_eeprom(uint8_t macro_id); +bool dynamic_macro_header_correct(void); diff --git a/users/drashna/keyrecords/process_records.c b/users/drashna/keyrecords/process_records.c index 99d95c3dff..d8d45dcac9 100644 --- a/users/drashna/keyrecords/process_records.c +++ b/users/drashna/keyrecords/process_records.c @@ -6,9 +6,11 @@ #ifdef OS_DETECTION_ENABLE # include "os_detection.h" #endif +#ifdef CUSTOM_DYNAMIC_MACROS_ENABLE +# include "keyrecords/dynamic_macros.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 @@ -55,30 +57,15 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { #endif #if defined(CUSTOM_POINTING_DEVICE) && process_record_pointing(keycode, record) +#endif +#ifdef CUSTOM_DYNAMIC_MACROS_ENABLE + && process_record_dynamic_macro(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 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); @@ -111,7 +98,7 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { 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); + eeconfig_update_user_config(&userspace_config.raw); if (userspace_config.rgb_layer_change) { # if defined(CUSTOM_RGB_MATRIX) rgb_matrix_set_flags(LED_FLAG_UNDERGLOW | LED_FLAG_KEYLIGHT | LED_FLAG_INDICATOR); @@ -168,38 +155,16 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { } # endif if (is_eeprom_updated) { - eeconfig_update_user(userspace_config.raw); + eeconfig_update_user_config(&userspace_config.raw); } } break; #endif - case KEYLOCK: { - static host_driver_t *host_driver = 0; - + case KEYLOCK: 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; - } + toggle_keyboard_lock(); } break; - } - case OLED_LOCK: { -#if defined(OLED_ENABLE) && defined(CUSTOM_OLED_DRIVER) - extern bool is_oled_locked; - if (record->event.pressed) { - is_oled_locked = !is_oled_locked; - if (is_oled_locked) { - oled_on(); - } - } -#endif - } break; #if defined(OS_DETECTION_ENABLE) && defined(OS_DETECTION_DEBUG_ENABLE) case STORE_SETUPS: if (record->event.pressed) { @@ -218,5 +183,18 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { __attribute__((weak)) void post_process_record_keymap(uint16_t keycode, keyrecord_t *record) {} void post_process_record_user(uint16_t keycode, keyrecord_t *record) { +#if defined(OS_DETECTION_ENABLE) && defined(UNICODE_COMMON_ENABLE) + switch (keycode) { + case QK_MAGIC_SWAP_LCTL_LGUI: + case QK_MAGIC_SWAP_RCTL_RGUI: + case QK_MAGIC_SWAP_CTL_GUI: + case QK_MAGIC_UNSWAP_LCTL_LGUI: + case QK_MAGIC_UNSWAP_RCTL_RGUI: + case QK_MAGIC_UNSWAP_CTL_GUI: + case QK_MAGIC_TOGGLE_CTL_GUI: + set_unicode_input_mode_soft(keymap_config.swap_lctl_lgui ? UNICODE_MODE_MACOS : UNICODE_MODE_WINCOMPOSE); + break; + } +#endif post_process_record_keymap(keycode, record); } diff --git a/users/drashna/keyrecords/process_records.h b/users/drashna/keyrecords/process_records.h index 8073b7adb0..0137976580 100644 --- a/users/drashna/keyrecords/process_records.h +++ b/users/drashna/keyrecords/process_records.h @@ -5,27 +5,21 @@ #include "drashna.h" enum userspace_custom_keycodes { - VRSN = QK_USER, // 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_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, // ಠ_ಠ + VRSN = QK_USER, // Prints QMK Firmware and board info + KC_DIABLO_CLEAR, // Clears all Diablo Timers + 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 @@ -40,11 +34,33 @@ enum userspace_custom_keycodes { KC_COMIC, KC_ACCEL, OLED_LOCK, + OLED_BRIGHTNESS_INC, + OLED_BRIGHTNESS_DEC, STORE_SETUPS, PRINT_SETUPS, - USER_SAFE_RANGE, // use "NEWPLACEHOLDER for keymap specific codes + PD_JIGGLER, + + DYN_MACRO_PROG, + DYN_MACRO_KEY00, + DYN_MACRO_KEY01, + DYN_MACRO_KEY02, + DYN_MACRO_KEY03, + DYN_MACRO_KEY04, + DYN_MACRO_KEY05, + DYN_MACRO_KEY06, + DYN_MACRO_KEY07, + DYN_MACRO_KEY08, + DYN_MACRO_KEY09, + DYN_MACRO_KEY10, + DYN_MACRO_KEY11, + DYN_MACRO_KEY12, + DYN_MACRO_KEY13, + DYN_MACRO_KEY14, + DYN_MACRO_KEY15, + + USER_SAFE_RANGE, }; bool process_record_secrets(uint16_t keycode, keyrecord_t *record); @@ -69,27 +85,15 @@ bool process_record_unicode(uint16_t keycode, keyrecord_t *record); #define KC_SEC4 KC_SECRET_4 #define KC_SEC5 KC_SECRET_5 +#define KC_QWERTY DF(_QWERTY) +#define KC_COLEMAK_DH DF(_COLEMAK_DH) +#define KC_COLEMAK DF(_COLEMAK) +#define KC_DVORAK DF(_DVORAK) + #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 CLMKDH KC_COLEMAK_DH #ifdef SWAP_HANDS_ENABLE # define KC_C1R3 SH_T(KC_TAB) @@ -140,3 +144,7 @@ We use custom codes here, so we can substitute the right stuff # define KC_D3_3 KC_3 # define KC_D3_4 KC_4 #endif // TAP_DANCE_ENABLE + +#define OL_LOCK OLED_LOCK +#define OL_BINC OLED_BRIGHTNESS_INC +#define OL_BDEC OLED_BRIGHTNESS_DEC diff --git a/users/drashna/keyrecords/tapping.c b/users/drashna/keyrecords/tapping.c index 6a26a02aca..d4a0e16112 100644 --- a/users/drashna/keyrecords/tapping.c +++ b/users/drashna/keyrecords/tapping.c @@ -5,9 +5,14 @@ #ifdef TAPPING_TERM_PER_KEY __attribute__((weak)) uint16_t get_tapping_term(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { case BK_LWER: return TAPPING_TERM + 25; + case QK_MOD_TAP ... QK_MOD_TAP_MAX: + if (QK_MOD_TAP_GET_MODS(keycode) & MOD_LGUI) { + return 300; + } default: return TAPPING_TERM; } diff --git a/users/drashna/keyrecords/unicode.c b/users/drashna/keyrecords/unicode.c index 16390074ca..a4687d3e59 100644 --- a/users/drashna/keyrecords/unicode.c +++ b/users/drashna/keyrecords/unicode.c @@ -434,3 +434,13 @@ bool process_record_unicode(uint16_t keycode, keyrecord_t *record) { void keyboard_post_init_unicode(void) { unicode_input_mode_init(); } + +/** + * @brief Set the unicode input mode without extra functionality + * + * @param input_mode + */ +void set_unicode_input_mode_soft(uint8_t input_mode) { + unicode_config.input_mode = input_mode; + unicode_input_mode_set_kb(input_mode); +} diff --git a/users/drashna/keyrecords/unicode.h b/users/drashna/keyrecords/unicode.h index 43c2db89c0..fe95e78c3a 100644 --- a/users/drashna/keyrecords/unicode.h +++ b/users/drashna/keyrecords/unicode.h @@ -18,3 +18,4 @@ enum unicode_typing_modes { extern uint8_t unicode_typing_mode; extern const PROGMEM char unicode_mode_str[UNCODES_MODE_END][13]; +void set_unicode_input_mode_soft(uint8_t input_mode); diff --git a/users/drashna/keyrecords/wrappers.h b/users/drashna/keyrecords/wrappers.h index 31efad5f6e..b298ef0628 100644 --- a/users/drashna/keyrecords/wrappers.h +++ b/users/drashna/keyrecords/wrappers.h @@ -260,7 +260,7 @@ NOTE: These are all the same length. If you do a search/replace #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_R2_________________ CG_SWAP, QWERTY, CLMKDH, COLEMAK, DVORAK #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 index 7ba03c4c13..cef1fc4969 100644 --- a/users/drashna/oled/drashna_font.h +++ b/users/drashna/oled/drashna_font.h @@ -3,14 +3,7 @@ // additional fonts from // https://github.com/datacute/TinyOLED-Fonts -#if __has_include("oled_font.h") -# include "oled_font.h" -#else - -// additional fonts from -// https://github.com/datacute/TinyOLED-Fonts - -# include "progmem.h" +#include "progmem.h" // clang-format off static const unsigned char font[] PROGMEM = { @@ -895,7 +888,7 @@ static const unsigned char font[] PROGMEM = { 0x38, 0x44, 0x44, 0x28, 0x7F, 0x00, 0x38, 0x54, 0x54, 0x54, 0x18, 0x00, 0x00, 0x08, 0x7E, 0x09, 0x02, 0x00, - 0x18, 0x24, 0x24, 0x1C, 0x78, 0x00, + 0x18, 0xA4, 0xA4, 0x9C, 0x78, 0x00, 0x7F, 0x08, 0x04, 0x04, 0x78, 0x00, 0x00, 0x44, 0x7D, 0x40, 0x00, 0x00, 0x20, 0x40, 0x40, 0x3D, 0x00, 0x00, @@ -904,8 +897,8 @@ static const unsigned char font[] PROGMEM = { 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, + 0xFC, 0x18, 0x24, 0x24, 0x18, 0x00, + 0x18, 0x24, 0x24, 0x18, 0xFC, 0x00, 0x7C, 0x08, 0x04, 0x04, 0x08, 0x00, 0x48, 0x54, 0x54, 0x54, 0x24, 0x00, 0x04, 0x04, 0x3F, 0x44, 0x24, 0x00, @@ -923,139 +916,27 @@ static const unsigned char font[] PROGMEM = { # 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, @@ -1071,272 +952,49 @@ static const unsigned char font[] PROGMEM = { 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, + +// 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 + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 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, @@ -1351,7 +1009,6 @@ static const unsigned char font[] PROGMEM = { 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, @@ -1391,14 +1048,13 @@ static const unsigned char font[] PROGMEM = { 0x6A, 0x60, 0x40, 0x00, 0x00, 0x00, 0x00, 0x04, 0x42, 0x69, 0x65, 0x65, 0x65, 0x69, 0x42, 0x04, 0x00, 0x00, + 0x06, 0x0F, 0x09, 0x0F, 0x06, 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, 0x06, 0x09, 0x59, 0x01, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, }; // clang-format on -#endif diff --git a/users/drashna/oled/oled_assets.h b/users/drashna/oled/oled_assets.h new file mode 100644 index 0000000000..36dfc7762c --- /dev/null +++ b/users/drashna/oled/oled_assets.h @@ -0,0 +1,207 @@ +// Copyright 2023 Christopher Courtney, aka Drashna Jael're (@drashna) +// SPDX-License-Identifier: GPL-2.0-or-later + +#pragma once + +// 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 + ' ',0x9E,0x9E, ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ',0x9D,0x9D,0x9D,0x9D, // Cx + 0x9D,0x9D,0x9D,0x9D,0x9D,0x9D,0x9D,0x9D,0x9D,0x9D,0x9D,0x9D,0x9D,0x9D,0x9D,0x9D, // Dx + 'C', 'S', 'A', 'G', 'C', 'S', 'A', 'G', ' ', ' ', ' ', ' ', ' ', 24, 26, 24, // Ex + 25, ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', 24, 25, 27, 26, ' ', ' ', ' ' // Fx +}; + +static const char PROGMEM gmk_bad_logo[384] = { + 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, 0x