diff options
71 files changed, 1598 insertions, 2204 deletions
diff --git a/keyboards/adafruit/macropad/keymaps/drashna/config.h b/keyboards/adafruit/macropad/keymaps/drashna/config.h new file mode 100644 index 0000000000..4d85f039be --- /dev/null +++ b/keyboards/adafruit/macropad/keymaps/drashna/config.h | |||
| @@ -0,0 +1,7 @@ | |||
| 1 | // Copyright 2023 Christopher Courtney, aka Drashna Jael're (@drashna) <drashna@live.com> | ||
| 2 | // SPDX-License-Identifier: GPL-2.0-or-later | ||
| 3 | |||
| 4 | #pragma once | ||
| 5 | |||
| 6 | #define PICO_XOSC_STARTUP_DELAY_MULTIPLIER 64 | ||
| 7 | #define TAPPING_TERM 499 | ||
diff --git a/keyboards/adafruit/macropad/keymaps/drashna/keymap.c b/keyboards/adafruit/macropad/keymaps/drashna/keymap.c new file mode 100644 index 0000000000..d87e4afd66 --- /dev/null +++ b/keyboards/adafruit/macropad/keymaps/drashna/keymap.c | |||
| @@ -0,0 +1,100 @@ | |||
| 1 | // Copyright 2023 Christopher Courtney, aka Drashna Jael're (@drashna) <drashna@live.com> | ||
| 2 | // SPDX-License-Identifier: GPL-2.0-or-later | ||
| 3 | |||
| 4 | #include "drashna.h" | ||
| 5 | |||
| 6 | // clang-format off | ||
| 7 | const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { | ||
| 8 | [0] = LAYOUT( | ||
| 9 | LT(1,KC_MUTE), | ||
| 10 | KC_ENT, KC_0, KC_BSPC, | ||
| 11 | KC_7, KC_8, KC_9, | ||
| 12 | KC_4, KC_5, KC_6, | ||
| 13 | KC_1, KC_2, KC_3 | ||
| 14 | ), | ||
| 15 | [1] = LAYOUT( | ||
| 16 | _______, | ||
| 17 | CK_TOGG, AU_TOGG, _______, | ||
| 18 | _______, _______, _______, | ||
| 19 | _______, _______, _______, | ||
| 20 | _______, _______, _______ | ||
| 21 | ), | ||
| 22 | }; | ||
| 23 | // clang-format on | ||
| 24 | |||
| 25 | #ifdef ENCODER_MAP_ENABLE | ||
| 26 | const uint16_t PROGMEM encoder_map[][NUM_ENCODERS][NUM_DIRECTIONS] = { | ||
| 27 | [0] = {ENCODER_CCW_CW(KC_VOLD, KC_VOLU)}, | ||
| 28 | [1] = {ENCODER_CCW_CW(RGB_RMOD, RGB_MOD)}, | ||
| 29 | }; | ||
| 30 | #endif | ||
| 31 | |||
| 32 | void render_oled_title(bool side) { | ||
| 33 | oled_write_P(PSTR(" Macropad "), true); | ||
| 34 | } | ||
| 35 | |||
| 36 | void render_rgb_mode(uint8_t col, uint8_t line); | ||
| 37 | |||
| 38 | void l_render_keylock_status(led_t led_usb_state, uint8_t col, uint8_t line) { | ||
| 39 | oled_set_cursor(col, line); | ||
| 40 | #ifdef CAPS_WORD_ENABLE | ||
| 41 | led_usb_state.caps_lock |= is_caps_word_on(); | ||
| 42 | #endif | ||
| 43 | oled_write_P(PSTR(OLED_RENDER_LOCK_NUML), led_usb_state.num_lock); | ||
| 44 | oled_write_P(PSTR(" "), false); | ||
| 45 | oled_write_P(PSTR(OLED_RENDER_LOCK_CAPS), led_usb_state.caps_lock); | ||
| 46 | oled_write_P(PSTR(" "), false); | ||
| 47 | oled_write_P(PSTR(OLED_RENDER_LOCK_SCLK), led_usb_state.scroll_lock); | ||
| 48 | } | ||
| 49 | |||
| 50 | bool oled_task_keymap(void) { | ||
| 51 | oled_write_raw_P(header_image, sizeof(header_image)); | ||
| 52 | oled_set_cursor(0, 1); | ||
| 53 | oled_write_raw_P(row_2_image, sizeof(row_2_image)); | ||
| 54 | oled_set_cursor(4, 0); | ||
| 55 | render_oled_title(false); | ||
| 56 | |||
| 57 | render_kitty(0, 2); | ||
| 58 | render_matrix_scan_rate(1, 7, 2); | ||
| 59 | |||
| 60 | #ifdef AUDIO_ENABLE | ||
| 61 | oled_set_cursor(7, 4); | ||
| 62 | bool l_is_audio_on = is_audio_on(); | ||
| 63 | |||
| 64 | static const char PROGMEM audio_status[2][3] = {{0xE0, 0xE1, 0}, {0xE2, 0xE3, 0}}; | ||
| 65 | oled_write_P(audio_status[l_is_audio_on], false); | ||
| 66 | |||
| 67 | # ifdef AUDIO_CLICKY | ||
| 68 | bool l_is_clicky_on = is_clicky_on(); | ||
| 69 | static const char PROGMEM audio_clicky_status[2][3] = {{0xF4, 0xF5, 0}, {0xF6, 0xF7, 0}}; | ||
| 70 | oled_write_P(audio_clicky_status[l_is_clicky_on && l_is_audio_on], false); | ||
| 71 | # endif | ||
| 72 | #endif | ||
| 73 | |||
| 74 | static const char PROGMEM cat_mode[3] = {0xF8, 0xF9, 0}; | ||
| 75 | oled_write_P(cat_mode, get_keyboard_lock()); | ||
| 76 | |||
| 77 | #ifdef RGB_MATIRX_ENABLE | ||
| 78 | static const char PROGMEM rgb_layer_status[2][3] = {{0xEE, 0xEF, 0}, {0xF0, 0xF1, 0}}; | ||
| 79 | oled_write_P(rgb_layer_status[rgb_matrix_is_enabled()], false); | ||
| 80 | #endif | ||
| 81 | |||
| 82 | #ifdef HAPTIC_ENABLE | ||
| 83 | static const char PROGMEM nukem_good[2] = {0xFA, 0}; | ||
| 84 | oled_write_P(haptic_get_enable() ? nukem_good : PSTR(" "), false); | ||
| 85 | #endif | ||
| 86 | |||
| 87 | l_render_keylock_status(host_keyboard_led_state(), 7, 5); | ||
| 88 | render_rgb_mode(1, 6); | ||
| 89 | |||
| 90 | for (uint8_t i = 1; i < 7; i++) { | ||
| 91 | oled_set_cursor(0, i); | ||
| 92 | oled_write_raw_P(display_border, sizeof(display_border)); | ||
| 93 | oled_set_cursor(21, i); | ||
| 94 | oled_write_raw_P(display_border, sizeof(display_border)); | ||
| 95 | } | ||
| 96 | oled_set_cursor(0, 7); | ||
| 97 | oled_write_raw_P(footer_image, sizeof(footer_image)); | ||
| 98 | |||
| 99 | return false; | ||
| 100 | } | ||
diff --git a/keyboards/adafruit/macropad/keymaps/drashna/rules.mk b/keyboards/adafruit/macropad/keymaps/drashna/rules.mk new file mode 100644 index 0000000000..ea090a5756 --- /dev/null +++ b/keyboards/adafruit/macropad/keymaps/drashna/rules.mk | |||
| @@ -0,0 +1,3 @@ | |||
| 1 | ENCODER_MAP_ENABLE = yes | ||
| 2 | DEBUG_MATRIX_SCAN_RATE_ENABLE = api | ||
| 3 | WPM_ENABLE = yes | ||
diff --git a/keyboards/bastardkb/charybdis/3x5/keymaps/drashna/keymap.c b/keyboards/bastardkb/charybdis/3x5/keymaps/drashna/keymap.c index 02cb89fe65..e458a84373 100644 --- a/keyboards/bastardkb/charybdis/3x5/keymaps/drashna/keymap.c +++ b/keyboards/bastardkb/charybdis/3x5/keymaps/drashna/keymap.c | |||
| @@ -82,29 +82,3 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { | |||
| 82 | EE_CLR, KC_NUKE, _______, _______, QK_BOOT | 82 | EE_CLR, KC_NUKE, _______, _______, QK_BOOT |
| 83 | ), | 83 | ), |
| 84 | }; | 84 | }; |
| 85 | |||
| 86 | #if defined(KEYBOARD_bastardkb_charybdis_3x5_blackpill) | ||
| 87 | void keyboard_pre_init_keymap(void) { | ||
| 88 | setPinInputHigh(A0); | ||
| 89 | } | ||
| 90 | |||
| 91 | void housekeeping_task_keymap(void) { | ||
| 92 | if (!readPin(A0)) { | ||
| 93 | reset_keyboard(); | ||
| 94 | } | ||
| 95 | } | ||
| 96 | |||
| 97 | # ifdef USB_VBUS_PIN | ||
| 98 | bool usb_vbus_state(void) { | ||
| 99 | setPinInputLow(USB_VBUS_PIN); | ||
| 100 | wait_us(5); | ||
| 101 | return readPin(USB_VBUS_PIN); | ||
| 102 | } | ||
| 103 | # endif | ||
| 104 | |||
| 105 | void matrix_output_unselect_delay(uint8_t line, bool key_pressed) { | ||
| 106 | for (int32_t i = 0; i < 40; i++) { | ||
| 107 | __asm__ volatile("nop" ::: "memory"); | ||
| 108 | } | ||
| 109 | } | ||
| 110 | #endif | ||
diff --git a/keyboards/bastardkb/charybdis/3x5/keymaps/drashna/rules.mk b/keyboards/bastardkb/charybdis/3x5/keymaps/drashna/rules.mk index ff4ede45ca..029b4a498b 100644 --- a/keyboards/bastardkb/charybdis/3x5/keymaps/drashna/rules.mk +++ b/keyboards/bastardkb/charybdis/3x5/keymaps/drashna/rules.mk | |||
| @@ -40,6 +40,4 @@ ifeq ($(strip $(OVERLOAD_FEATURES)), yes) | |||
| 40 | CUSTOM_UNICODE_ENABLE = yes | 40 | CUSTOM_UNICODE_ENABLE = yes |
| 41 | CUSTOM_POINTING_DEVICE = yes | 41 | CUSTOM_POINTING_DEVICE = yes |
| 42 | CUSTOM_SPLIT_TRANSPORT_SYNC = yes | 42 | CUSTOM_SPLIT_TRANSPORT_SYNC = yes |
| 43 | |||
| 44 | DEBOUNCE_TYPE = asym_eager_defer_pk | ||
| 45 | endif | 43 | endif |
diff --git a/keyboards/bastardkb/charybdis/4x6/keymaps/drashna/config.h b/keyboards/bastardkb/charybdis/4x6/keymaps/drashna/config.h index 07c4bfc008..7fa9826125 100644 --- a/keyboards/bastardkb/charybdis/4x6/keymaps/drashna/config.h +++ b/keyboards/bastardkb/charybdis/4x6/keymaps/drashna/config.h | |||
| @@ -65,3 +65,5 @@ | |||
| 65 | #define BOOTMAGIC_LITE_EEPROM_COLUMN 0 | 65 | #define BOOTMAGIC_LITE_EEPROM_COLUMN 0 |
| 66 | #define BOOTMAGIC_LITE_EEPROM_ROW_RIGHT 1 | 66 | #define BOOTMAGIC_LITE_EEPROM_ROW_RIGHT 1 |
| 67 | #define BOOTMAGIC_LITE_EEPROM_COLUMN_RIGHT 0 | 67 | #define BOOTMAGIC_LITE_EEPROM_COLUMN_RIGHT 0 |
| 68 | |||
| 69 | #define DEBOUNCE 15 | ||
diff --git a/keyboards/bastardkb/charybdis/4x6/keymaps/drashna/keymap.c b/keyboards/bastardkb/charybdis/4x6/keymaps/drashna/keymap.c index 85bb2bc77f..31d1e92a7f 100644 --- a/keyboards/bastardkb/charybdis/4x6/keymaps/drashna/keymap.c +++ b/keyboards/bastardkb/charybdis/4x6/keymaps/drashna/keymap.c | |||
| @@ -83,7 +83,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { | |||
| 83 | SFT_T(KC_SPACE), ALT_T(KC_Q), _______ | 83 | SFT_T(KC_SPACE), ALT_T(KC_Q), _______ |
| 84 | ), | 84 | ), |
| 85 | [_MOUSE] = LAYOUT_charybdis_4x6( | 85 | [_MOUSE] = LAYOUT_charybdis_4x6( |
| 86 | _______, _______, _______, _______, _______, _______, _______, DPI_RMOD,DPI_MOD, S_D_RMOD,S_D_MOD, _______, | 86 | _______, _______, _______, _______, _______, _______, _______, DPI_RMOD,DPI_MOD, S_D_RMOD,S_D_MOD, PD_JIGGLER, |
| 87 | _______, _______, _______, _______, _______, _______, KC_WH_U, _______, _______, _______, _______, DRGSCRL, | 87 | _______, _______, _______, _______, _______, _______, KC_WH_U, _______, _______, _______, _______, DRGSCRL, |
| 88 | _______, _______, _______, _______, _______, _______, KC_WH_D, KC_BTN1, KC_BTN3, KC_BTN2, KC_BTN6, SNIPING, | 88 | _______, _______, _______, _______, _______, _______, KC_WH_D, KC_BTN1, KC_BTN3, KC_BTN2, KC_BTN6, SNIPING, |
| 89 | _______, _______, _______, _______, _______, _______, KC_BTN7, KC_BTN4, KC_BTN5, KC_BTN8, _______, _______, | 89 | _______, _______, _______, _______, _______, _______, KC_BTN7, KC_BTN4, KC_BTN5, KC_BTN8, _______, _______, |
| @@ -130,28 +130,6 @@ void keyboard_post_init_keymap(void) { | |||
| 130 | void keyboard_pre_init_keymap(void) { | 130 | void keyboard_pre_init_keymap(void) { |
| 131 | setPinInputHigh(A0); | 131 | setPinInputHigh(A0); |
| 132 | } | 132 | } |
| 133 | |||
| 134 | void housekeeping_task_keymap(void) { | ||
| 135 | if (!readPin(A0)) { | ||
| 136 | reset_keyboard(); | ||
| 137 | } | ||
| 138 | } | ||
| 139 | #endif | ||
| 140 | |||
| 141 | #ifdef USB_VBUS_PIN | ||
| 142 | bool usb_vbus_state(void) { | ||
| 143 | setPinInputLow(USB_VBUS_PIN); | ||
| 144 | wait_us(5); | ||
| 145 | return readPin(USB_VBUS_PIN); | ||
| 146 | } | ||
| 147 | #endif | ||
| 148 | |||
| 149 | #if defined(KEYBOARD_bastardkb_charybdis_4x6_blackpill) | ||
| 150 | void matrix_output_unselect_delay(uint8_t line, bool key_pressed) { | ||
| 151 | for (int32_t i = 0; i < 40; i++) { | ||
| 152 | __asm__ volatile("nop" ::: "memory"); | ||
| 153 | } | ||
| 154 | } | ||
| 155 | #endif | 133 | #endif |
| 156 | 134 | ||
| 157 | #ifdef SWAP_HANDS_ENABLE | 135 | #ifdef SWAP_HANDS_ENABLE |
diff --git a/keyboards/bastardkb/charybdis/4x6/keymaps/drashna/rules.mk b/keyboards/bastardkb/charybdis/4x6/keymaps/drashna/rules.mk index 0b7759f156..ef6b7cd24b 100644 --- a/keyboards/bastardkb/charybdis/4x6/keymaps/drashna/rules.mk +++ b/keyboards/bastardkb/charybdis/4x6/keymaps/drashna/rules.mk | |||
| @@ -1,6 +1,7 @@ | |||
| 1 | CUSTOM_UNICODE_ENABLE = no | 1 | CUSTOM_UNICODE_ENABLE = no |
| 2 | CUSTOM_POINTING_DEVICE = no | 2 | CUSTOM_POINTING_DEVICE = no |
| 3 | CUSTOM_SPLIT_TRANSPORT_SYNC = no | 3 | CUSTOM_SPLIT_TRANSPORT_SYNC = no |
| 4 | PER_KEY_TAPPING = yes | ||
| 4 | 5 | ||
| 5 | ifeq ($(strip $(KEYBOARD)), bastardkb/charybdis/4x6/blackpill) | 6 | ifeq ($(strip $(KEYBOARD)), bastardkb/charybdis/4x6/blackpill) |
| 6 | # MCU name | 7 | # MCU name |
| @@ -16,16 +17,13 @@ ifeq ($(strip $(KEYBOARD)), bastardkb/charybdis/4x6/blackpill) | |||
| 16 | OVERLOAD_FEATURES = yes | 17 | OVERLOAD_FEATURES = yes |
| 17 | endif | 18 | endif |
| 18 | 19 | ||
| 19 | ifeq ($(strip $(KEYBOARD)), bastardkb/charybdis/4x6/v2/stemcell) | ||
| 20 | OVERLOAD_FEATURES = yes | ||
| 21 | endif | ||
| 22 | ifeq ($(strip $(KEYBOARD)), bastardkb/charybdis/4x6/v2/splinky) | ||
| 23 | OVERLOAD_FEATURES = yes | ||
| 24 | endif | ||
| 25 | ifeq ($(strip $(MCU)), atmega32u4) | 20 | ifeq ($(strip $(MCU)), atmega32u4) |
| 26 | LTO_ENABLE = yes | 21 | LTO_ENABLE = yes |
| 27 | BOOTLOADER = qmk-hid | 22 | BOOTLOADER = qmk-hid |
| 28 | BOOTLOADER_SIZE = 512 | 23 | BOOTLOADER_SIZE = 512 |
| 24 | EXTRAKEY_ENABLE = no | ||
| 25 | else | ||
| 26 | OVERLOAD_FEATURES = yes | ||
| 29 | endif | 27 | endif |
| 30 | 28 | ||
| 31 | ifeq ($(strip $(OVERLOAD_FEATURES)), yes) | 29 | ifeq ($(strip $(OVERLOAD_FEATURES)), yes) |
| @@ -43,7 +41,6 @@ ifeq ($(strip $(OVERLOAD_FEATURES)), yes) | |||
| 43 | CAPS_WORD_ENABLE = yes | 41 | CAPS_WORD_ENABLE = yes |
| 44 | SWAP_HANDS_ENABLE = yes | 42 | SWAP_HANDS_ENABLE = yes |
| 45 | TAP_DANCE_ENABLE = yes | 43 | TAP_DANCE_ENABLE = yes |
| 46 | DEBOUNCE_TYPE = asym_eager_defer_pk | ||
| 47 | WPM_ENABLE = yes | 44 | WPM_ENABLE = yes |
| 48 | LTO_ENABLE = no | 45 | LTO_ENABLE = no |
| 49 | # OPT = 3 | 46 | # OPT = 3 |
diff --git a/keyboards/bastardkb/dilemma/3x5_2/keymaps/drashna/config.h b/keyboards/bastardkb/dilemma/3x5_2/keymaps/drashna/config.h index d7b1351d89..7c46c83310 100644 --- a/keyboards/bastardkb/dilemma/3x5_2/keymaps/drashna/config.h +++ b/keyboards/bastardkb/dilemma/3x5_2/keymaps/drashna/config.h | |||
| @@ -6,3 +6,5 @@ | |||
| 6 | #define CIRQUE_PINNACLE_TAP_ENABLE | 6 | #define CIRQUE_PINNACLE_TAP_ENABLE |
| 7 | #define POINTING_DEVICE_GESTURES_CURSOR_GLIDE_ENABLE | 7 | #define POINTING_DEVICE_GESTURES_CURSOR_GLIDE_ENABLE |
| 8 | #define POINTING_DEVICE_GESTURES_SCROLL_ENABLE | 8 | #define POINTING_DEVICE_GESTURES_SCROLL_ENABLE |
| 9 | |||
| 10 | #define OLED_DISPLAY_128X128 | ||
diff --git a/keyboards/bastardkb/dilemma/3x5_2/keymaps/drashna/keymap.c b/keyboards/bastardkb/dilemma/3x5_2/keymaps/drashna/keymap.c index d80d006796..bf75e97841 100644 --- a/keyboards/bastardkb/dilemma/3x5_2/keymaps/drashna/keymap.c +++ b/keyboards/bastardkb/dilemma/3x5_2/keymaps/drashna/keymap.c | |||
| @@ -84,14 +84,6 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { | |||
| 84 | ), | 84 | ), |
| 85 | }; | 85 | }; |
| 86 | 86 | ||
| 87 | |||
| 88 | void matrix_output_unselect_delay(uint8_t line, bool key_pressed) { | ||
| 89 | for (int32_t i = 0; i < 40; i++) { | ||
| 90 | __asm__ volatile("nop" ::: "memory"); | ||
| 91 | } | ||
| 92 | } | ||
| 93 | |||
| 94 | |||
| 95 | #if defined(OLED_ENABLE) && defined(OLED_DISPLAY_128X128) | 87 | #if defined(OLED_ENABLE) && defined(OLED_DISPLAY_128X128) |
| 96 | # ifdef UNICODE_COMMON_ENABLE | 88 | # ifdef UNICODE_COMMON_ENABLE |
| 97 | # include "process_unicode_common.h" | 89 | # include "process_unicode_common.h" |
| @@ -100,8 +92,6 @@ void matrix_output_unselect_delay(uint8_t line, bool key_pressed) { | |||
| 100 | 92 | ||
| 101 | extern const char PROGMEM display_border[3]; | 93 | extern const char PROGMEM display_border[3]; |
| 102 | 94 | ||
| 103 | |||
| 104 | extern uint32_t oled_timer; | ||
| 105 | extern bool is_oled_enabled; | 95 | extern bool is_oled_enabled; |
| 106 | 96 | ||
| 107 | 97 | ||
diff --git a/keyboards/bastardkb/dilemma/3x5_2/keymaps/drashna/rules.mk b/keyboards/bastardkb/dilemma/3x5_2/keymaps/drashna/rules.mk index 41d73bc49a..a1be9cb8fd 100644 --- a/keyboards/bastardkb/dilemma/3x5_2/keymaps/drashna/rules.mk +++ b/keyboards/bastardkb/dilemma/3x5_2/keymaps/drashna/rules.mk | |||
| @@ -5,4 +5,3 @@ CONSOLE_ENABLE = yes | |||
| 5 | KEYLOGGER_ENABLE = no | 5 | KEYLOGGER_ENABLE = no |
| 6 | WPM_ENABLE = yes | 6 | WPM_ENABLE = yes |
| 7 | OLED_ENABLE = yes | 7 | OLED_ENABLE = yes |
| 8 | OLED_DRIVER = custom | ||
diff --git a/keyboards/handwired/tractyl_manuform/4x6_right/keymaps/drashna/rules.mk b/keyboards/handwired/tractyl_manuform/4x6_right/keymaps/drashna/rules.mk index 7fef013a38..d2d2a9b874 100644 --- a/keyboards/handwired/tractyl_manuform/4x6_right/keymaps/drashna/rules.mk +++ b/keyboards/handwired/tractyl_manuform/4x6_right/keymaps/drashna/rules.mk | |||
| @@ -6,4 +6,3 @@ TAP_DANCE_ENABLE = yes | |||
| 6 | UNICODE_ENABLE = yes | 6 | UNICODE_ENABLE = yes |
| 7 | OLED_ENABLE = yes | 7 | OLED_ENABLE = yes |
| 8 | WPM_ENABLE = yes | 8 | WPM_ENABLE = yes |
| 9 | # DEBOUNCE_TYPE = sym_eager_pk | ||
diff --git a/keyboards/handwired/tractyl_manuform/5x6_right/f411/config.h b/keyboards/handwired/tractyl_manuform/5x6_right/f411/config.h index 2ab49de9fa..73ea40fb76 100644 --- a/keyboards/handwired/tractyl_manuform/5x6_right/f411/config.h +++ b/keyboards/handwired/tractyl_manuform/5x6_right/f411/config.h | |||
| @@ -32,10 +32,10 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. | |||
| 32 | #define WS2812_PWM_TARGET_PERIOD 800000 | 32 | #define WS2812_PWM_TARGET_PERIOD 800000 |
| 33 | 33 | ||
| 34 | 34 | ||
| 35 | #define RGBLED_NUM 52 | 35 | #define RGBLED_NUM 57 |
| 36 | #define RGBLIGHT_SPLIT | 36 | #define RGBLIGHT_SPLIT |
| 37 | #define RGBLED_SPLIT \ | 37 | #define RGBLED_SPLIT \ |
| 38 | { 26, 26 } | 38 | { 26, 31 } |
| 39 | 39 | ||
| 40 | #define DEBUG_LED_PIN C13 | 40 | #define DEBUG_LED_PIN C13 |
| 41 | 41 | ||
diff --git a/keyboards/handwired/tractyl_manuform/5x6_right/f411/post_config.h b/keyboards/handwired/tractyl_manuform/5x6_right/f411/post_config.h deleted file mode 100644 index 0e33129e1a..0000000000 --- a/keyboards/handwired/tractyl_manuform/5x6_right/f411/post_config.h +++ /dev/null | |||
| @@ -1,20 +0,0 @@ | |||
| 1 | // Copyright 2020 Christopher Courtney, aka Drashna Jael're (@drashna) <drashna@live.com> | ||
| 2 | // SPDX-License-Identifier: GPL-2.0-or-later | ||
| 3 | |||
| 4 | #pragma once | ||
| 5 | |||
| 6 | #ifndef RGBLIGHT_LIMIT_VAL | ||
| 7 | # if defined(OLED_ENABLE) | ||
| 8 | # define RGBLIGHT_LIMIT_VAL 100 | ||
| 9 | # else | ||
| 10 | # define RGBLIGHT_LIMIT_VAL 150 | ||
| 11 | # endif | ||
| 12 | #endif | ||
| 13 | |||
| 14 | #ifndef OLED_BRIGHTNESS | ||
| 15 | # ifdef RGBLIGHT_ENABLE | ||
| 16 | # define OLED_BRIGHTNESS 80 | ||
| 17 | # else | ||
| 18 | # define OLED_BRIGHTNESS 150 | ||
| 19 | # endif | ||
| 20 | #endif | ||
diff --git a/keyboards/handwired/tractyl_manuform/5x6_right/keymaps/drashna/config.h b/keyboards/handwired/tractyl_manuform/5x6_right/keymaps/drashna/config.h index f159a69174..a449a126d6 100644 --- a/keyboards/handwired/tractyl_manuform/5x6_right/keymaps/drashna/config.h +++ b/keyboards/handwired/tractyl_manuform/5x6_right/keymaps/drashna/config.h | |||
| @@ -16,21 +16,21 @@ | |||
| 16 | 16 | ||
| 17 | #pragma once | 17 | #pragma once |
| 18 | 18 | ||
| 19 | #define DEBOUNCE 45 | 19 | #undef OLED_DISPLAY_128X64 |
| 20 | 20 | #define OLED_DISPLAY_128X128 | |
| 21 | #ifdef OLED_DRIVER_SH1107 | 21 | #define OLED_BRIGHTNESS 200 |
| 22 | # undef OLED_DISPLAY_128X64 | ||
| 23 | #endif | ||
| 24 | 22 | ||
| 25 | #define CHARYBDIS_MINIMUM_DEFAULT_DPI 1200 | 23 | #define CHARYBDIS_MINIMUM_DEFAULT_DPI 1200 |
| 26 | #define CHARYBDIS_DEFAULT_DPI_CONFIG_STEP 200 | 24 | #define CHARYBDIS_DEFAULT_DPI_CONFIG_STEP 200 |
| 27 | #define CHARYBDIS_MINIMUM_SNIPING_DPI 400 | 25 | #define CHARYBDIS_MINIMUM_SNIPING_DPI 400 |
| 28 | #define CHARYBDIS_SNIPING_DPI_CONFIG_STEP 200 | 26 | #define CHARYBDIS_SNIPING_DPI_CONFIG_STEP 200 |
| 29 | 27 | ||
| 30 | #define ENCODER_DEFAULT_POS 0x3 | ||
| 31 | |||
| 32 | |||
| 33 | #define BOOTMAGIC_LITE_EEPROM_ROW 1 | 28 | #define BOOTMAGIC_LITE_EEPROM_ROW 1 |
| 34 | #define BOOTMAGIC_LITE_EEPROM_COLUMN 0 | 29 | #define BOOTMAGIC_LITE_EEPROM_COLUMN 0 |
| 35 | #define BOOTMAGIC_LITE_EEPROM_ROW_RIGHT 7 | 30 | #define BOOTMAGIC_LITE_EEPROM_ROW_RIGHT 7 |
| 36 | #define BOOTMAGIC_LITE_EEPROM_COLUMN_RIGHT 5 | 31 | #define BOOTMAGIC_LITE_EEPROM_COLUMN_RIGHT 5 |
| 32 | |||
| 33 | |||
| 34 | #define FB_ERM_LRA 0 | ||
| 35 | #define DRV_GREETING alert_750ms | ||
| 36 | #define DRV_MODE_DEFAULT buzz | ||
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 93d3529edb..380e17fb09 100644 --- a/keyboards/handwired/tractyl_manuform/5x6_right/keymaps/drashna/keymap.c +++ b/keyboards/handwired/tractyl_manuform/5x6_right/keymaps/drashna/keymap.c | |||
| @@ -90,8 +90,8 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { | |||
| 90 | KC_LCTL, KC_V, _______, _______ | 90 | KC_LCTL, KC_V, _______, _______ |
| 91 | ), | 91 | ), |
| 92 | [_MOUSE] = LAYOUT_5x6_right( | 92 | [_MOUSE] = LAYOUT_5x6_right( |
| 93 | _______, _______, _______, _______, _______, _______, DRGSCRL, DPI_RMOD,DPI_MOD, S_D_RMOD,S_D_MOD, SNP_TOG, | 93 | _______, _______, _______, _______, _______, _______, _______, DPI_RMOD,DPI_MOD, S_D_RMOD,S_D_MOD, PD_JIGGLER, |
| 94 | _______, _______, _______, _______, _______, _______, KC_WH_U, _______, _______, _______, _______, _______, | 94 | _______, _______, _______, _______, _______, _______, KC_WH_U, _______, _______, _______, _______, DRGSCRL, |
| 95 | _______, _______, _______, _______, _______, _______, KC_WH_D, KC_BTN1, KC_BTN3, KC_BTN2, KC_BTN6, SNIPING, | 95 | _______, _______, _______, _______, _______, _______, KC_WH_D, KC_BTN1, KC_BTN3, KC_BTN2, KC_BTN6, SNIPING, |
| 96 | _______, _______, _______, _______, _______, _______, KC_BTN7, KC_BTN4, KC_BTN5, KC_BTN8, _______, _______, | 96 | _______, _______, _______, _______, _______, _______, KC_BTN7, KC_BTN4, KC_BTN5, KC_BTN8, _______, _______, |
| 97 | _______, _______, _______, _______, | 97 | _______, _______, _______, _______, |
| @@ -115,7 +115,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { | |||
| 115 | _______, _________________RAISE_L2__________________, _________________RAISE_R2__________________, KC_BSLS, | 115 | _______, _________________RAISE_L2__________________, _________________RAISE_R2__________________, KC_BSLS, |
| 116 | _______, _________________RAISE_L3__________________, _________________RAISE_R3__________________, _______, | 116 | _______, _________________RAISE_L3__________________, _________________RAISE_R3__________________, _______, |
| 117 | _______, _______, _______, _______, | 117 | _______, _______, _______, _______, |
| 118 | _______, _______, _______, | 118 | OL_LOCK, _______, _______, |
| 119 | _______, _______, _______, | 119 | _______, _______, _______, |
| 120 | _______, _______, _______, _______ | 120 | _______, _______, _______, _______ |
| 121 | ), | 121 | ), |
| @@ -126,96 +126,35 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { | |||
| 126 | UC_NEXT, _________________ADJUST_L3_________________, _________________ADJUST_R3_________________, KC_MPLY, | 126 | UC_NEXT, _________________ADJUST_L3_________________, _________________ADJUST_R3_________________, KC_MPLY, |
| 127 | TG(_DIABLOII), AUTO_CTN, TG_GAME, TG_DBLO, | 127 | TG(_DIABLOII), AUTO_CTN, TG_GAME, TG_DBLO, |
| 128 | _______, QK_RBT, KC_NUKE, | 128 | _______, QK_RBT, KC_NUKE, |
| 129 | _______, _______, _______, | 129 | HF_TOGG, _______, _______, |
| 130 | _______, _______, KC_NUKE, _______ | 130 | _______, _______, KC_NUKE, _______ |
| 131 | ), | 131 | ), |
| 132 | }; | 132 | }; |
| 133 | // clang-format on | 133 | // clang-format on |
| 134 | 134 | ||
| 135 | #ifdef ENCODER_ENABLE | 135 | #ifdef ENCODER_MAP_ENABLE |
| 136 | # ifdef ENCODER_MAP_ENABLE | ||
| 137 | // clang-format off | 136 | // clang-format off |
| 138 | const uint16_t PROGMEM encoder_map[][NUM_ENCODERS][NUM_DIRECTIONS] = { | 137 | const uint16_t PROGMEM encoder_map[][NUM_ENCODERS][NUM_DIRECTIONS] = { |
| 139 | [_DEFAULT_LAYER_1] = { ENCODER_CCW_CW( KC_VOLD, KC_VOLU ), ENCODER_CCW_CW( KC_WH_D, KC_WH_U ) }, | 138 | [_DEFAULT_LAYER_1] = { ENCODER_CCW_CW( KC_VOLU, KC_VOLD ), ENCODER_CCW_CW( KC_WH_U, KC_WH_D ) }, |
| 140 | [_DEFAULT_LAYER_2] = { ENCODER_CCW_CW( _______, _______ ), ENCODER_CCW_CW( _______, _______ ) }, | 139 | [_DEFAULT_LAYER_2] = { ENCODER_CCW_CW( _______, _______ ), ENCODER_CCW_CW( _______, _______ ) }, |
| 141 | [_DEFAULT_LAYER_3] = { ENCODER_CCW_CW( _______, _______ ), ENCODER_CCW_CW( _______, _______ ) }, | 140 | [_DEFAULT_LAYER_3] = { ENCODER_CCW_CW( _______, _______ ), ENCODER_CCW_CW( _______, _______ ) }, |
| 142 | [_DEFAULT_LAYER_4] = { ENCODER_CCW_CW( _______, _______ ), ENCODER_CCW_CW( _______, _______ ) }, | 141 | [_DEFAULT_LAYER_4] = { ENCODER_CCW_CW( _______, _______ ), ENCODER_CCW_CW( _______, _______ ) }, |
| 143 | [_GAMEPAD] = { ENCODER_CCW_CW( _______, _______ ), ENCODER_CCW_CW( _______, _______ ) }, | 142 | [_GAMEPAD] = { ENCODER_CCW_CW( _______, _______ ), ENCODER_CCW_CW( _______, _______ ) }, |
| 144 | [_DIABLO] = { ENCODER_CCW_CW( _______, _______ ), ENCODER_CCW_CW( _______, _______ ) }, | 143 | [_DIABLO] = { ENCODER_CCW_CW( _______, _______ ), ENCODER_CCW_CW( _______, _______ ) }, |
| 145 | [_MOUSE] = { ENCODER_CCW_CW( _______, _______ ), ENCODER_CCW_CW( KC_WH_D, KC_WH_U ) }, | 144 | [_MOUSE] = { ENCODER_CCW_CW( _______, _______ ), ENCODER_CCW_CW( _______, _______ ) }, |
| 146 | [_MEDIA] = { ENCODER_CCW_CW( _______, _______ ), ENCODER_CCW_CW( _______, _______ ) }, | 145 | [_MEDIA] = { ENCODER_CCW_CW( _______, _______ ), ENCODER_CCW_CW( _______, _______ ) }, |
| 147 | [_RAISE] = { ENCODER_CCW_CW( _______, _______ ), ENCODER_CCW_CW( KC_PGDN, KC_PGUP ) }, | 146 | [_RAISE] = { ENCODER_CCW_CW( OL_BINC, OL_BDEC ), ENCODER_CCW_CW( KC_PGDN, KC_PGUP ) }, |
| 148 | [_LOWER] = { ENCODER_CCW_CW( RGB_MOD, RGB_RMOD), ENCODER_CCW_CW( RGB_HUD, RGB_HUI ) }, | 147 | [_LOWER] = { ENCODER_CCW_CW( RGB_MOD, RGB_RMOD), ENCODER_CCW_CW( RGB_HUI, RGB_HUD ) }, |
| 149 | [_ADJUST] = { ENCODER_CCW_CW( CK_DOWN, CK_UP ), ENCODER_CCW_CW( _______, _______ ) }, | 148 | [_ADJUST] = { ENCODER_CCW_CW( CK_UP, CK_DOWN ), ENCODER_CCW_CW( _______, _______ ) }, |
| 150 | }; | 149 | }; |
| 151 | // clang-format on | 150 | // clang-format on |
| 152 | # else | ||
| 153 | |||
| 154 | deferred_token encoder_token = INVALID_DEFERRED_TOKEN; | ||
| 155 | static int8_t last_direction = -1; | ||
| 156 | |||
| 157 | static uint32_t encoder_callback(uint32_t trigger_time, void *cb_arg) { | ||
| 158 | unregister_code(last_direction ? KC_WH_D : KC_WH_U); | ||
| 159 | last_direction = -1; | ||
| 160 | return 0; | ||
| 161 | } | ||
| 162 | |||
| 163 | bool encoder_update_user(uint8_t index, bool clockwise) { | ||
| 164 | # ifdef SWAP_HANDS_ENABLE | ||
| 165 | if (swap_hands) { | ||
| 166 | index ^= 1; | ||
| 167 | } | ||
| 168 | # endif | ||
| 169 | if (index == 0) { | ||
| 170 | tap_code_delay(clockwise ? KC_VOLD : KC_VOLU, 5); | ||
| 171 | } else if (index == 1) { | ||
| 172 | if (last_direction != clockwise || encoder_token == INVALID_DEFERRED_TOKEN) { | ||
| 173 | uint8_t keycode = clockwise ? KC_WH_D : KC_WH_U; | ||
| 174 | last_direction = clockwise; | ||
| 175 | if (encoder_token != INVALID_DEFERRED_TOKEN) { | ||
| 176 | if (cancel_deferred_exec(encoder_token)) { | ||
| 177 | encoder_token = INVALID_DEFERRED_TOKEN; | ||
| 178 | } | ||
| 179 | unregister_code(clockwise ? KC_WH_U : KC_WH_D); | ||
| 180 | } | ||
| 181 | register_code(keycode); | ||
| 182 | encoder_token = defer_exec(MOUSEKEY_WHEEL_DELAY + MOUSEKEY_WHEEL_INTERVAL, encoder_callback, NULL); | ||
| 183 | } else { | ||
| 184 | extend_deferred_exec(encoder_token, MOUSEKEY_WHEEL_INTERVAL); | ||
| 185 | } | ||
| 186 | } | ||
| 187 | return false; | ||
| 188 | } | ||
| 189 | # endif | ||
| 190 | #endif | 151 | #endif |
| 191 | 152 | ||
| 192 | #ifdef OLED_ENABLE | 153 | #ifdef OLED_ENABLE |
| 193 | # include "keyrecords/unicode.h" | ||
| 194 | |||
| 195 | oled_rotation_t oled_init_keymap(oled_rotation_t rotation) { | 154 | oled_rotation_t oled_init_keymap(oled_rotation_t rotation) { |
| 196 | return OLED_ROTATION_180; | 155 | return OLED_ROTATION_180; |
| 197 | } | 156 | } |
| 198 | 157 | ||
| 199 | void oled_render_large_display(bool side) { | ||
| 200 | if (side) { | ||
| 201 | render_wpm_graph(56, 64); | ||
| 202 | } else { | ||
| 203 | oled_advance_page(true); | ||
| 204 | oled_advance_page(true); | ||
| 205 | |||
| 206 | // clang-format off | ||
| 207 | static const char PROGMEM logo[] = { | ||
| 208 | 0x80, 0x81, 0x82, 0x83, 0x84, 0x85, 0x86, 0x87, 0x88, 0x89, 0x8A, 0x8B, 0x8C, 0x8D, 0x8E, 0x8F, 0x90, 0x91, 0x92, 0x93, 0x94, | ||
| 209 | 0xA0, 0xA1, 0xA2, 0xA3, 0xA4, 0xA5, 0xA6, 0xA7, 0xA8, 0xA9, 0xAA, 0xAB, 0xAC, 0xAD, 0xAE, 0xAF, 0xB0, 0xB1, 0xB2, 0xB3, 0xB4, | ||
| 210 | 0xC0, 0xC1, 0xC2, 0xC3, 0xC4, 0xC5, 0xC6, 0xC7, 0xC8, 0xC9, 0xCA, 0xCB, 0xCC, 0xCD, 0xCE, 0xCF, 0xD0, 0xD1, 0xD2, 0xD3, 0xD4, 0x00 | ||
| 211 | }; | ||
| 212 | // clang-format on | ||
| 213 | oled_write_P(logo, false); | ||
| 214 | |||
| 215 | render_unicode_mode(1, 14); | ||
| 216 | } | ||
| 217 | } | ||
| 218 | |||
| 219 | void render_oled_title(bool side) { | 158 | void render_oled_title(bool side) { |
| 220 | oled_write_P(side ? PSTR(" Tractyl ") : PSTR(" Manuform "), true); | 159 | oled_write_P(side ? PSTR(" Tractyl ") : PSTR(" Manuform "), true); |
| 221 | } | 160 | } |
diff --git a/keyboards/handwired/tractyl_manuform/5x6_right/keymaps/drashna/rules.mk b/keyboards/handwired/tractyl_manuform/5x6_right/keymaps/drashna/rules.mk index acec28fa6e..9f5341e973 100644 --- a/keyboards/handwired/tractyl_manuform/5x6_right/keymaps/drashna/rules.mk +++ b/keyboards/handwired/tractyl_manuform/5x6_right/keymaps/drashna/rules.mk | |||
| @@ -5,7 +5,6 @@ CUSTOM_BOOTMAGIC_ENABLE = no | |||
| 5 | CUSTOM_UNICODE_ENABLE = no | 5 | CUSTOM_UNICODE_ENABLE = no |
| 6 | HAPTIC_ENABLE = no | 6 | HAPTIC_ENABLE = no |
| 7 | OLED_ENABLE = no | 7 | OLED_ENABLE = no |
| 8 | OLED_DRIVER = custom | ||
| 9 | RGBLIGHT_ENABLE = no | 8 | RGBLIGHT_ENABLE = no |
| 10 | SWAP_HANDS_ENABLE = no | 9 | SWAP_HANDS_ENABLE = no |
| 11 | TAP_DANCE_ENABLE = no | 10 | TAP_DANCE_ENABLE = no |
| @@ -16,12 +15,14 @@ ifeq ($(strip $(KEYBOARD)), handwired/tractyl_manuform/5x6_right/elite_c) | |||
| 16 | BOOTLOADER_SIZE = 512 | 15 | BOOTLOADER_SIZE = 512 |
| 17 | CUSTOM_SPLIT_TRANSPORT_SYNC = no | 16 | CUSTOM_SPLIT_TRANSPORT_SYNC = no |
| 18 | LTO_ENABLE = yes | 17 | LTO_ENABLE = yes |
| 18 | MOUSEKEY_ENABLE = no | ||
| 19 | endif | 19 | endif |
| 20 | ifeq ($(strip $(KEYBOARD)), handwired/tractyl_manuform/5x6_right/arduinomicro) | 20 | ifeq ($(strip $(KEYBOARD)), handwired/tractyl_manuform/5x6_right/arduinomicro) |
| 21 | BOOTLOADER = qmk-hid | 21 | BOOTLOADER = qmk-hid |
| 22 | BOOTLOADER_SIZE = 512 | 22 | BOOTLOADER_SIZE = 512 |
| 23 | CUSTOM_SPLIT_TRANSPORT_SYNC = no | 23 | CUSTOM_SPLIT_TRANSPORT_SYNC = no |
| 24 | LTO_ENABLE = yes | 24 | LTO_ENABLE = yes |
| 25 | MOUSEKEY_ENABLE = no | ||
| 25 | endif | 26 | endif |
| 26 | ifeq ($(strip $(KEYBOARD)), handwired/tractyl_manuform/5x6_right/teensy2pp) | 27 | ifeq ($(strip $(KEYBOARD)), handwired/tractyl_manuform/5x6_right/teensy2pp) |
| 27 | AUTOCORRECT_ENABLE = no | 28 | AUTOCORRECT_ENABLE = no |
| @@ -33,8 +34,9 @@ ifeq ($(strip $(KEYBOARD)), handwired/tractyl_manuform/5x6_right/f411) | |||
| 33 | AUTOCORRECT_ENABLE = yes | 34 | AUTOCORRECT_ENABLE = yes |
| 34 | LTO_SUPPORTED = no | 35 | LTO_SUPPORTED = no |
| 35 | OVERLOAD_FEATURES = yes | 36 | OVERLOAD_FEATURES = yes |
| 37 | HAPTIC_ENABLE = yes | ||
| 38 | HAPTIC_DRIVER = DRV2605L | ||
| 36 | endif | 39 | endif |
| 37 | # DEBOUNCE_TYPE = sym_eager_pk | ||
| 38 | 40 | ||
| 39 | ifeq ($(strip $(OVERLOAD_FEATURES)), yes) | 41 | ifeq ($(strip $(OVERLOAD_FEATURES)), yes) |
| 40 | AUDIO_ENABLE = yes | 42 | AUDIO_ENABLE = yes |
diff --git a/keyboards/handwired/tractyl_manuform/5x6_right/teensy2pp/config.h b/keyboards/handwired/tractyl_manuform/5x6_right/teensy2pp/config.h index dd5da75821..ce8e65e924 100644 --- a/keyboards/handwired/tractyl_manuform/5x6_right/teensy2pp/config.h +++ b/keyboards/handwired/tractyl_manuform/5x6_right/teensy2pp/config.h | |||
| @@ -23,7 +23,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. | |||
| 23 | #define RGBLIGHT_SPLIT | 23 | #define RGBLIGHT_SPLIT |
| 24 | #define RGBLED_SPLIT \ | 24 | #define RGBLED_SPLIT \ |
| 25 | { 10, 10 } | 25 | { 10, 10 } |
| 26 | #define OLED_BRIGHTNESS 50 | 26 | #define RGBLIGHT_LIMIT_VAL 80 |
| 27 | 27 | ||
| 28 | #define DEBUG_LED_PIN D6 | 28 | #define DEBUG_LED_PIN D6 |
| 29 | 29 | ||
diff --git a/keyboards/handwired/tractyl_manuform/post_config.h b/keyboards/handwired/tractyl_manuform/post_config.h index c48518ddd3..b5d67132b2 100644 --- a/keyboards/handwired/tractyl_manuform/post_config.h +++ b/keyboards/handwired/tractyl_manuform/post_config.h | |||
| @@ -94,3 +94,19 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. | |||
| 94 | #ifndef DEBOUNCE | 94 | #ifndef DEBOUNCE |
| 95 | # define DEBOUNCE 5 | 95 | # define DEBOUNCE 5 |
| 96 | #endif | 96 | #endif |
| 97 | |||
| 98 | #if defined(RGBLIGHT_ENABLE) && !defined(RGBLIGHT_LIMIT_VAL) | ||
| 99 | # if defined(OLED_ENABLE) | ||
| 100 | # define RGBLIGHT_LIMIT_VAL 100 | ||
| 101 | # else | ||
| 102 | # define RGBLIGHT_LIMIT_VAL 150 | ||
| 103 | # endif | ||
| 104 | #endif | ||
| 105 | |||
| 106 | #if !defined(OLED_BRIGHTNESS) | ||
| 107 | # if defined(RGBLIGHT_ENABLE) || defined(RGB_MATRIX_ENABLE) | ||
| 108 | # define OLED_BRIGHTNESS 80 | ||
| 109 | # else | ||
| 110 | # define OLED_BRIGHTNESS 150 | ||
| 111 | # endif | ||
| 112 | #endif | ||
diff --git a/keyboards/maple_computing/c39/keymaps/drashna/keymap.c b/keyboards/maple_computing/c39/keymaps/drashna/keymap.c deleted file mode 100755 index 0c923983eb..0000000000 --- a/keyboards/maple_computing/c39/keymaps/drashna/keymap.c +++ /dev/null | |||
| @@ -1,83 +0,0 @@ | |||
| 1 | /* Copyright 2020 Christopher Courtney, aka Drashna Jael're (@drashna) <drashna@live.com> | ||
| 2 | * | ||
| 3 | * This program is free software: you can redistribute it and/or modify | ||
| 4 | * it under the terms of the GNU General Public License as published by | ||
| 5 | * the Free Software Foundation, either version 2 of the License, or | ||
| 6 | * (at your option) any later version. | ||
| 7 | * | ||
| 8 | * This program is distributed in the hope that it will be useful, | ||
| 9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| 11 | * GNU General Public License for more details. | ||
| 12 | * | ||
| 13 | * You should have received a copy of the GNU General Public License | ||
| 14 | * along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
| 15 | */ | ||
| 16 | |||
| 17 | #include "drashna.h" | ||
| 18 | |||
| 19 | /* | ||
| 20 | * The `LAYOUT_base` macro is a template to allow the use of identical | ||
| 21 | * modifiers for the default layouts (eg QWERTY, Colemak, Dvorak, etc), so | ||
| 22 | * that there is no need to set them up for each layout, and modify all of | ||
| 23 | * them if I want to change them. This helps to keep consistency and ease | ||
| 24 | * of use. K## is a placeholder to pass through the individual keycodes | ||
| 25 | */ | ||
| 26 | // clang-format off | ||
| 27 | #define LAYOUT_wrapper(...) LAYOUT(__VA_ARGS__) | ||
| 28 | #define LAYOUT_base( \ | ||
| 29 | K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, \ | ||
| 30 | K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, \ | ||
| 31 | K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A \ | ||
| 32 | ) \ | ||
| 33 | LAYOUT_wrapper( \ | ||
| 34 | KC_ESC, K01, K02, K03, K04, K05, KC_NO, K06, K07, K08, K09, K0A, KC_DEL, \ | ||
| 35 | ALT_T(KC_TAB), K11, K12, K13, K14, K15, KC_BSPC, K16, K17, K18, K19, K1A, RALT_T(K1B), \ | ||
| 36 | KC_MLSF, CTL_T(K21), K22, K23, K24, LT(_LOWER,K25), KC_SPC, LT(_RAISE,K26), K27, K28, K29, RCTL_T(K2A), KC_ENT \ | ||
| 37 | ) | ||
| 38 | #define LAYOUT_base_wrapper(...) LAYOUT_base(__VA_ARGS__) | ||
| 39 | |||
| 40 | const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { | ||
| 41 | |||
| 42 | [_DEFAULT_LAYER_1] = LAYOUT_base_wrapper( | ||
| 43 | _________________QWERTY_L1_________________, _________________QWERTY_R1_________________, | ||
| 44 | _________________QWERTY_L2_________________, _________________QWERTY_R2_________________, | ||
| 45 | _________________QWERTY_L3_________________, _________________QWERTY_R3_________________ | ||
| 46 | ), | ||
| 47 | |||
| 48 | [_DEFAULT_LAYER_2] = LAYOUT_base_wrapper( | ||
| 49 | ______________COLEMAK_MOD_DH_L1____________, ______________COLEMAK_MOD_DH_R1____________, | ||
| 50 | ______________COLEMAK_MOD_DH_L2____________, ______________COLEMAK_MOD_DH_R2____________, | ||
| 51 | ______________COLEMAK_MOD_DH_L3____________, ______________COLEMAK_MOD_DH_R3____________ | ||
| 52 | ), | ||
| 53 | [_DEFAULT_LAYER_3] = LAYOUT_base_wrapper( | ||
| 54 | _________________COLEMAK_L1________________, _________________COLEMAK_R1________________, | ||
| 55 | _________________COLEMAK_L2________________, _________________COLEMAK_R2________________, | ||
| 56 | _________________COLEMAK_L3________________, _________________COLEMAK_R3________________ | ||
| 57 | ), | ||
| 58 | |||
| 59 | [_DEFAULT_LAYER_4] = LAYOUT_base_wrapper( | ||
| 60 | _________________DVORAK_L1_________________, _________________DVORAK_R1_________________, | ||
| 61 | _________________DVORAK_L2_________________, _________________DVORAK_R2_________________, | ||
| 62 | _________________DVORAK_L3_________________, _________________DVORAK_R3_________________ | ||
| 63 | ), | ||
| 64 | |||
| 65 | [_LOWER] = LAYOUT_wrapper( | ||
| 66 | KC_TILD, _________________LOWER_L1__________________, _______, _________________LOWER_R1__________________, KC_BSPC, | ||
| 67 | KC_DEL, _________________LOWER_L2__________________, _______, _________________LOWER_R2__________________, KC_PIPE, | ||
| 68 | _______, _________________LOWER_L3__________________, _______, _________________LOWER_R3__________________, _______ | ||
| 69 | ), | ||
| 70 | |||
| 71 | [_RAISE] = LAYOUT_wrapper( | ||
| 72 | KC_GRV, _________________RAISE_L1__________________, _______, _________________RAISE_R1__________________, KC_BSPC, | ||
| 73 | KC_DEL, _________________RAISE_L2__________________, _______, _________________RAISE_R2__________________, KC_BSLS, | ||
| 74 | _______, _________________RAISE_L3__________________, _______, _________________RAISE_R3__________________, _______ | ||
| 75 | ), | ||
| 76 | |||
| 77 | [_ADJUST] = LAYOUT_wrapper( | ||
| 78 | QK_MAKE, _________________ADJUST_L1_________________, KC_NUKE, _________________ADJUST_R1_________________, QK_BOOT, | ||
| 79 | VRSN, _________________ADJUST_L2_________________, MG_NKRO, _________________ADJUST_R2_________________, EE_CLR, | ||
| 80 | TG_MODS, _________________ADJUST_L3_________________, KC_RGB_T,_________________ADJUST_R3_________________, RGB_IDL | ||
| 81 | ) | ||
| 82 | }; | ||
| 83 | // clang-format on | ||
diff --git a/keyboards/maple_computing/c39/keymaps/drashna/readme.md b/keyboards/maple_computing/c39/keymaps/drashna/readme.md deleted file mode 100755 index a8efbaa5fe..0000000000 --- a/keyboards/maple_computing/c39/keymaps/drashna/readme.md +++ /dev/null | |||
| @@ -1,3 +0,0 @@ | |||
| 1 | # @drashna's keymap for the C39 | ||
| 2 | |||
| 3 | HERE BE DRAGONS | ||
diff --git a/keyboards/maple_computing/c39/keymaps/drashna/rules.mk b/keyboards/maple_computing/c39/keymaps/drashna/rules.mk deleted file mode 100644 index a6575bbd93..0000000000 --- a/keyboards/maple_computing/c39/keymaps/drashna/rules.mk +++ /dev/null | |||
| @@ -1,19 +0,0 @@ | |||
| 1 | # MCU name | ||
| 2 | MCU = STM32F303 | ||
| 3 | BOARD = QMK_PROTON_C | ||
| 4 | |||
| 5 | # Bootloader selection | ||
| 6 | BOOTLOADER = stm32-dfu | ||
| 7 | |||
| 8 | BOOTMAGIC_ENABLE = yes # Enable Bootmagic Lite | ||
| 9 | MOUSEKEY_ENABLE = yes | ||
| 10 | EXTRAKEY_ENABLE = yes | ||
| 11 | CONSOLE_ENABLE = yes | ||
| 12 | COMMAND_ENABLE = yes | ||
| 13 | NKRO_ENABLE = yes | ||
| 14 | AUDIO_ENABLE = yes | ||
| 15 | UNICODE_ENABLE = yes | ||
| 16 | HAPTIC_ENABLE = yes | ||
| 17 | HAPTIC_DRIVER = SOLENOID | ||
| 18 | |||
| 19 | RGBLIGHT_STARTUP_ANIMATION = yes | ||
diff --git a/keyboards/moonlander/keymaps/drashna/keymap.c b/keyboards/moonlander/keymaps/drashna/keymap.c index 2f38ac790c..491283c37a 100644 --- a/keyboards/moonlander/keymaps/drashna/keymap.c +++ b/keyboards/moonlander/keymaps/drashna/keymap.c | |||
| @@ -156,7 +156,7 @@ bool process_record_keymap(uint16_t keycode, keyrecord_t *record) { | |||
| 156 | case KC_SWAP_NUM: | 156 | case KC_SWAP_NUM: |
| 157 | if (record->event.pressed) { | 157 | if (record->event.pressed) { |
| 158 | userspace_config.swapped_numbers ^= 1; | 158 | userspace_config.swapped_numbers ^= 1; |
| 159 | eeconfig_update_user(userspace_config.raw); | 159 | eeconfig_update_user_config(&userspace_config.raw); |
| 160 | unregister_code(KC_1); | 160 | unregister_code(KC_1); |
| 161 | unregister_code(KC_2); | 161 | unregister_code(KC_2); |
| 162 | } | 162 | } |
diff --git a/keyboards/moonlander/keymaps/drashna/rules.mk b/keyboards/moonlander/keymaps/drashna/rules.mk index 927d956e9d..45113afc71 100644 --- a/keyboards/moonlander/keymaps/drashna/rules.mk +++ b/keyboards/moonlander/keymaps/drashna/rules.mk | |||
| @@ -4,3 +4,5 @@ UNICODE_ENABLE = yes | |||
| 4 | UNICODEMAP_ENABLE = no | 4 | UNICODEMAP_ENABLE = no |
| 5 | AUTOCORRECT_ENABLE = yes | 5 | AUTOCORRECT_ENABLE = yes |
| 6 | CAPS_WORD_ENABLE = yes | 6 | CAPS_WORD_ENABLE = yes |
| 7 | |||
| 8 | BOOTLOADER = tinyuf2 | ||
diff --git a/keyboards/maple_computing/c39/keymaps/drashna/config.h b/keyboards/splitkb/kyria/keymaps/drashna/chconf.h index 5b4f82c9b1..1ee8438cdf 100644 --- a/keyboards/maple_computing/c39/keymaps/drashna/config.h +++ b/keyboards/splitkb/kyria/keymaps/drashna/chconf.h | |||
| @@ -1,4 +1,4 @@ | |||
| 1 | /* Copyright 2020 Christopher Courtney, aka Drashna Jael're (@drashna) <drashna@live.com> | 1 | /* Copyright 2020 QMK |
| 2 | * | 2 | * |
| 3 | * This program is free software: you can redistribute it and/or modify | 3 | * This program is free software: you can redistribute it and/or modify |
| 4 | * it under the terms of the GNU General Public License as published by | 4 | * it under the terms of the GNU General Public License as published by |
| @@ -16,19 +16,9 @@ | |||
| 16 | 16 | ||
| 17 | #pragma once | 17 | #pragma once |
| 18 | 18 | ||
| 19 | // place overrides here | 19 | #if defined(KEYBOARD_splitkb_kyria_rev3) |
| 20 | #undef MATRIX_COL_PINS | 20 | #define CH_CFG_ST_RESOLUTION 16 |
| 21 | #define MATRIX_COL_PINS \ | 21 | #define CH_CFG_ST_FREQUENCY 10000 |
| 22 | { A3, A2, A1, A0, B13, B14, B15, B9, B3, B2, B4, A10, A9 } | 22 | #endif |
| 23 | #undef MATRIX_ROW_PINS | ||
| 24 | #define MATRIX_ROW_PINS \ | ||
| 25 | { B7, B1, B0 } | ||
| 26 | 23 | ||
| 27 | #define WS2812_DI_PIN B10 | 24 | #include_next <chconf.h> |
| 28 | #define RGBLED_NUM 15 | ||
| 29 | |||
| 30 | #define SOLENOID_PIN B11 | ||
| 31 | |||
| 32 | #define AUDIO_PIN A5 | ||
| 33 | #define AUDIO_PIN_ALT A4 | ||
| 34 | #define AUDIO_PIN_ALT_AS_NEGATIVE | ||
diff --git a/keyboards/splitkb/kyria/keymaps/drashna/config.h b/keyboards/splitkb/kyria/keymaps/drashna/config.h index 2d1fbdcb02..702599605c 100644 --- a/keyboards/splitkb/kyria/keymaps/drashna/config.h +++ b/keyboards/splitkb/kyria/keymaps/drashna/config.h | |||
| @@ -19,10 +19,10 @@ | |||
| 19 | #define EE_HANDS | 19 | #define EE_HANDS |
| 20 | 20 | ||
| 21 | #ifdef OLED_ENABLE | 21 | #ifdef OLED_ENABLE |
| 22 | # ifdef OLED_DRIVER_SH1107 | 22 | # undef OLED_DISPLAY_128X64 |
| 23 | # undef OLED_DISPLAY_128X64 | 23 | # define OLED_DISPLAY_128X128 |
| 24 | # define OLED_DISPLAY_128X128 | 24 | # define OLED_PRE_CHARGE_PERIOD 0x22 |
| 25 | # endif | 25 | # define OLED_VCOM_DETECT 0x35 |
| 26 | #endif | 26 | #endif |
| 27 | 27 | ||
| 28 | #ifdef RGBLIGHT_ENABLE | 28 | #ifdef RGBLIGHT_ENABLE |
| @@ -36,12 +36,41 @@ | |||
| 36 | # define RGBLIGHT_LAYERS | 36 | # define RGBLIGHT_LAYERS |
| 37 | #endif | 37 | #endif |
| 38 | 38 | ||
| 39 | #define KEYLOGGER_LENGTH 10 | ||
| 40 | 39 | ||
| 41 | #define QMK_ESC_INPUT D4 | 40 | #define QMK_ESC_INPUT D4 |
| 42 | #define QMK_ESC_OUTPUT B2 | 41 | #define QMK_ESC_OUTPUT B2 |
| 43 | 42 | ||
| 44 | #ifndef KEYBOARD_splitkb_kyria_rev3 | 43 | #ifdef KEYBOARD_splitkb_kyria_rev3 |
| 44 | # define SERIAL_USART_FULL_DUPLEX // Enable full duplex operation mode. | ||
| 45 | # define SERIAL_USART_PIN_SWAP // Swap TX and RX pins if keyboard is master halve. | ||
| 46 | # define SERIAL_USART_DRIVER SD1 // USART driver of TX pin. default: SD1 | ||
| 47 | # define SERIAL_USART_TX_PAL_MODE 7 // Pin "alternate function", see the respective datasheet for the appropriate values for your MCU. default: 7 | ||
| 48 | # undef SOFT_SERIAL_PIN | ||
| 49 | # define SERIAL_USART_TX_PIN D3 | ||
| 50 | # define SERIAL_USART_RX_PIN D2 | ||
| 51 | |||
| 52 | # undef WS2812_DI_PIN | ||
| 53 | # define WS2812_DI_PIN PAL_LINE(GPIOA, 3) | ||
| 54 | # define WS2812_PWM_DRIVER PWMD2 // default: PWMD2 | ||
| 55 | # define WS2812_PWM_CHANNEL 4 // default: 2 | ||
| 56 | # define WS2812_PWM_PAL_MODE 1 // Pin "alternate function", see the respective datasheet for the appropriate values for your MCU. default: 2 | ||
| 57 | # define WS2812_DMA_STREAM STM32_DMA1_STREAM2 // DMA Stream for TIMx_UP, see the respective reference manual for the appropriate values for your MCU. | ||
| 58 | # define WS2812_DMA_CHANNEL 2 // DMA Channel for TIMx_UP, see the respective reference manual for the appropriate values for your MCU. | ||
| 59 | # define WS2812_DMAMUX_ID STM32_DMAMUX1_TIM2_UP // DMAMUX configuration for TIMx_UP -- only required if your MCU has a DMAMUX peripheral, see the respective reference manual for the appropriate values for your MCU. | ||
| 60 | |||
| 61 | # define BOOTMAGIC_LITE_ROW 0 | ||
| 62 | # define BOOTMAGIC_LITE_COLUMN 6 | ||
| 63 | # define BOOTMAGIC_LITE_ROW_RIGHT 4 | ||
| 64 | # define BOOTMAGIC_LITE_COLUMN_RIGHT 6 | ||
| 65 | |||
| 66 | # define BOOTMAGIC_LITE_EEPROM_ROW 1 | ||
| 67 | # define BOOTMAGIC_LITE_EEPROM_COLUMN 6 | ||
| 68 | # define BOOTMAGIC_LITE_EEPROM_ROW_RIGHT 5 | ||
| 69 | # define BOOTMAGIC_LITE_EEPROM_COLUMN_RIGHT 6 | ||
| 70 | # define SECURE_UNLOCK_SEQUENCE { {1, 5}, {1, 4}, {1, 3}, {1, 2} } | ||
| 71 | |||
| 72 | # define ENCODER_RESOLUTION 2 | ||
| 73 | #else | ||
| 45 | # define BOOTMAGIC_LITE_ROW 0 | 74 | # define BOOTMAGIC_LITE_ROW 0 |
| 46 | # define BOOTMAGIC_LITE_COLUMN 7 | 75 | # define BOOTMAGIC_LITE_COLUMN 7 |
| 47 | # define BOOTMAGIC_LITE_ROW_RIGHT 4 | 76 | # define BOOTMAGIC_LITE_ROW_RIGHT 4 |
| @@ -55,7 +84,7 @@ | |||
| 55 | 84 | ||
| 56 | #define SERIAL_USART_SPEED 921600 | 85 | #define SERIAL_USART_SPEED 921600 |
| 57 | 86 | ||
| 58 | #if defined(KEYBOARD_splitkb_kyria_rev1_proton_c) | 87 | #if defined(KEYBOARD_splitkb_kyria_rev1_proton_c) || defined(KEYBOARD_splitkb_kyria_rev3) |
| 59 | # define WEAR_LEVELING_BACKING_SIZE 16384 | 88 | # define WEAR_LEVELING_BACKING_SIZE 16384 |
| 60 | # define WEAR_LEVELING_LOGICAL_SIZE 8192 | 89 | # define WEAR_LEVELING_LOGICAL_SIZE 8192 |
| 61 | #endif | 90 | #endif |
diff --git a/keyboards/splitkb/kyria/keymaps/drashna/halconf.h b/keyboards/splitkb/kyria/keymaps/drashna/halconf.h new file mode 100644 index 0000000000..b23c85d0f1 --- /dev/null +++ b/keyboards/splitkb/kyria/keymaps/drashna/halconf.h | |||
| @@ -0,0 +1,24 @@ | |||
| 1 | /* Copyright 2020 QMK | ||
| 2 | * | ||
| 3 | * This program is free software: you can redistribute it and/or modify | ||
| 4 | * it under the terms of the GNU General Public License as published by | ||
| 5 | * the Free Software Foundation, either version 3 of the License, or | ||
| 6 | * (at your option) any later version. | ||
| 7 | * | ||
| 8 | * This program is distributed in the hope that it will be useful, | ||
| 9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| 11 | * GNU General Public License for more details. | ||
| 12 | * | ||
| 13 | * You should have received a copy of the GNU General Public License | ||
| 14 | * along with this program. If not, see <https://www.gnu.org/licenses/>. | ||
| 15 | */ | ||
| 16 | #pragma once | ||
| 17 | |||
| 18 | #if defined(KEYBOARD_splitkb_kyria_rev3) | ||
| 19 | # define HAL_USE_I2C TRUE | ||
| 20 | # define HAL_USE_PWM TRUE | ||
| 21 | # define HAL_USE_SERIAL TRUE | ||
| 22 | #endif | ||
| 23 | |||
| 24 | #include_next <halconf.h> | ||
diff --git a/keyboards/splitkb/kyria/keymaps/drashna/keymap.c b/keyboards/splitkb/kyria/keymaps/drashna/keymap.c index 34f6e0d8e2..5a2b886fe4 100644 --- a/keyboards/splitkb/kyria/keymaps/drashna/keymap.c +++ b/keyboards/splitkb/kyria/keymaps/drashna/keymap.c | |||
| @@ -32,7 +32,7 @@ | |||
| 32 | K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A \ | 32 | K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A \ |
| 33 | ) \ | 33 | ) \ |
| 34 | LAYOUT_wrapper( \ | 34 | LAYOUT_wrapper( \ |
| 35 | KC_ESC, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, KC_MINS, \ | 35 | SH_T(KC_ESC), K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, SH_T(KC_MINS), \ |
| 36 | LALT_T(KC_TAB), K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, RALT_T(K1B), \ | 36 | LALT_T(KC_TAB), K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, RALT_T(K1B), \ |
| 37 | OS_LSFT, CTL_T(K21), K22, K23, K24, K25, TG_GAME, MEH(KC_MINS), TG_DBLO, KC_CAPS, K26, K27, K28, K29, RCTL_T(K2A), OS_RSFT, \ | 37 | OS_LSFT, CTL_T(K21), K22, K23, K24, K25, TG_GAME, MEH(KC_MINS), TG_DBLO, KC_CAPS, K26, K27, K28, K29, RCTL_T(K2A), OS_RSFT, \ |
| 38 | KC_MUTE, OS_LALT, KC_GRV, KC_SPC, BK_LWER, DL_RAIS, KC_ENT, OS_RGUI, UC(0x03A8), UC(0x2E2E) \ | 38 | KC_MUTE, OS_LALT, KC_GRV, KC_SPC, BK_LWER, DL_RAIS, KC_ENT, OS_RGUI, UC(0x03A8), UC(0x2E2E) \ |
| @@ -126,7 +126,7 @@ void render_oled_title(bool side) { | |||
| 126 | } | 126 | } |
| 127 | 127 | ||
| 128 | oled_rotation_t oled_init_keymap(oled_rotation_t rotation) { | 128 | oled_rotation_t oled_init_keymap(oled_rotation_t rotation) { |
| 129 | # ifdef OLED_DRIVER_SH1107 | 129 | # ifdef OLED_DISPLAY_128X128 |
| 130 | return OLED_ROTATION_0; | 130 | return OLED_ROTATION_0; |
| 131 | # else | 131 | # else |
| 132 | return OLED_ROTATION_180; | 132 | return OLED_ROTATION_180; |
| @@ -155,7 +155,7 @@ void oled_render_large_display(bool side) { | |||
| 155 | } | 155 | } |
| 156 | #endif | 156 | #endif |
| 157 | 157 | ||
| 158 | #ifdef RGBLIGHT_LAYERS | 158 | #if defined(RGBLIGHT_ENABLE) && defined(RGBLIGHT_LAYERS) |
| 159 | const rgblight_segment_t PROGMEM shift_layers[] = RGBLIGHT_LAYER_SEGMENTS({8, 1, 120, 255, 255}, {18, 1, 120, 255, 255}); | 159 | const rgblight_segment_t PROGMEM shift_layers[] = RGBLIGHT_LAYER_SEGMENTS({8, 1, 120, 255, 255}, {18, 1, 120, 255, 255}); |
| 160 | const rgblight_segment_t PROGMEM control_layers[] = RGBLIGHT_LAYER_SEGMENTS({6, 1, 0, 255, 255}, {16, 1, 0, 255, 255}); | 160 | const rgblight_segment_t PROGMEM control_layers[] = RGBLIGHT_LAYER_SEGMENTS({6, 1, 0, 255, 255}, {16, 1, 0, 255, 255}); |
| 161 | const rgblight_segment_t PROGMEM alt_layers[] = RGBLIGHT_LAYER_SEGMENTS({2, 1, 240, 255, 255}, {17, 1, 250, 255, 255}); | 161 | const rgblight_segment_t PROGMEM alt_layers[] = RGBLIGHT_LAYER_SEGMENTS({2, 1, 240, 255, 255}, {17, 1, 250, 255, 255}); |
| @@ -174,12 +174,56 @@ void housekeeping_task_keymap(void) { | |||
| 174 | rgblight_set_layer_state(2, mods & MOD_MASK_ALT); | 174 | rgblight_set_layer_state(2, mods & MOD_MASK_ALT); |
| 175 | rgblight_set_layer_state(3, mods & MOD_MASK_GUI); | 175 | rgblight_set_layer_state(3, mods & MOD_MASK_GUI); |
| 176 | } | 176 | } |
| 177 | #endif | 177 | #elif defined(RGB_MATRIX_ENABLE) && defined(KEYBOARD_splitkb_kyria_rev3) |
| 178 | void keyboard_post_init_keymap(void) { | ||
| 179 | extern led_config_t g_led_config; | ||
| 180 | g_led_config.flags[30] = g_led_config.flags[24] = g_led_config.flags[18] = g_led_config.flags[12] = g_led_config.flags[11] = g_led_config.flags[10] = g_led_config.flags[9] = g_led_config.flags[8] = g_led_config.flags[7] = g_led_config.flags[6] = g_led_config.flags[37] = g_led_config.flags[38] = g_led_config.flags[39] = g_led_config.flags[40] = g_led_config.flags[41] = g_led_config.flags[42] = g_led_config.flags[43] = g_led_config.flags[49] = g_led_config.flags[55] = g_led_config.flags[61] = LED_FLAG_MODIFIER; | ||
| 181 | } | ||
| 182 | |||
| 183 | void check_default_layer(uint8_t mode, uint8_t type, uint8_t led_min, uint8_t led_max) { | ||
| 184 | switch (get_highest_layer(default_layer_state)) { | ||
| 185 | case _QWERTY: | ||
| 186 | rgb_matrix_layer_helper(DEFAULT_LAYER_1_HSV, mode, rgb_matrix_config.speed, type, led_min, led_max); | ||
| 187 | break; | ||
| 188 | case _COLEMAK_DH: | ||
| 189 | rgb_matrix_layer_helper(DEFAULT_LAYER_2_HSV, mode, rgb_matrix_config.speed, type, led_min, led_max); | ||
| 190 | break; | ||
| 191 | case _COLEMAK: | ||
| 192 | rgb_matrix_layer_helper(DEFAULT_LAYER_3_HSV, mode, rgb_matrix_config.speed, type, led_min, led_max); | ||
| 193 | break; | ||
| 194 | case _DVORAK: | ||
| 195 | rgb_matrix_layer_helper(DEFAULT_LAYER_4_HSV, mode, rgb_matrix_config.speed, type, led_min, led_max); | ||
| 196 | break; | ||
| 197 | } | ||
| 198 | } | ||
| 178 | 199 | ||
| 179 | #ifdef KEYBOARD_splitkb_kyria_rev1_proton_c | 200 | bool rgb_matrix_indicators_advanced_keymap(uint8_t led_min, uint8_t led_max) { |
| 180 | void matrix_output_unselect_delay(uint8_t line, bool key_pressed) { | 201 | if (userspace_config.rgb_layer_change) { |
| 181 | for (int32_t i = 0; i < 40; i++) { | 202 | switch (get_highest_layer(layer_state)) { |
| 182 | __asm__ volatile("nop" ::: "memory"); | 203 | case _GAMEPAD: |
| 204 | rgb_matrix_layer_helper(HSV_ORANGE, 0, rgb_matrix_config.speed, LED_FLAG_UNDERGLOW, led_min, led_max); | ||
| 205 | break; | ||
| 206 | case _DIABLO: | ||
| 207 | rgb_matrix_layer_helper(HSV_RED, 0, rgb_matrix_config.speed, LED_FLAG_UNDERGLOW, led_min, led_max); | ||
| 208 | break; | ||
| 209 | case _RAISE: | ||
| 210 | rgb_matrix_layer_helper(HSV_YELLOW, 0, rgb_matrix_config.speed, LED_FLAG_UNDERGLOW, led_min, led_max); | ||
| 211 | break; | ||
| 212 | case _LOWER: | ||
| 213 | rgb_matrix_layer_helper(HSV_GREEN, 0, rgb_matrix_config.speed, LED_FLAG_UNDERGLOW, led_min, led_max); | ||
| 214 | break; | ||
| 215 | case _ADJUST: | ||
| 216 | rgb_matrix_layer_helper(HSV_RED, 0, rgb_matrix_config.speed, LED_FLAG_UNDERGLOW, led_min, led_max); | ||
| 217 | break; | ||
| 218 | case _MOUSE: | ||
| 219 | rgb_matrix_layer_helper(HSV_PURPLE, 1, rgb_matrix_config.speed, LED_FLAG_UNDERGLOW, led_min, led_max); | ||
| 220 | break; | ||
| 221 | default: | ||
| 222 | check_default_layer(0, LED_FLAG_UNDERGLOW, led_min, led_max); | ||
| 223 | break; | ||
| 224 | } | ||
| 225 | check_default_layer(0, LED_FLAG_MODIFIER, led_min, led_max); | ||
| 183 | } | 226 | } |
| 227 | return false; | ||
| 184 | } | 228 | } |
| 185 | #endif | 229 | #endif |
diff --git a/keyboards/splitkb/kyria/keymaps/drashna/mcuconf.h b/keyboards/splitkb/kyria/keymaps/drashna/mcuconf.h new file mode 100644 index 0000000000..2bee30b342 --- /dev/null +++ b/keyboards/splitkb/kyria/keymaps/drashna/mcuconf.h | |||
| @@ -0,0 +1,35 @@ | |||
| 1 | /* Copyright 2020 Nick Brassel (tzarc) | ||
| 2 | * | ||
| 3 | * This program is free software: you can redistribute it and/or modify | ||
| 4 | * it under the terms of the GNU General Public License as published by | ||
| 5 | * the Free Software Foundation, either version 3 of the License, or | ||
| 6 | * (at your option) any later version. | ||
| 7 | * | ||
| 8 | * This program is distributed in the hope that it will be useful, | ||
| 9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| 11 | * GNU General Public License for more details. | ||
| 12 | * | ||
| 13 | * You should have received a copy of the GNU General Public License | ||
| 14 | * along with this program. If not, see <https://www.gnu.org/licenses/>. | ||
| 15 | */ | ||
| 16 | |||
| 17 | #pragma once | ||
| 18 | |||
| 19 | #include_next <mcuconf.h> | ||
| 20 | |||
| 21 | #if defined(KEYBOARD_splitkb_kyria_rev3) | ||
| 22 | # undef STM32_PWM_USE_ADVANCED | ||
| 23 | # define STM32_PWM_USE_ADVANCED TRUE | ||
| 24 | |||
| 25 | # undef STM32_PWM_USE_TIM2 | ||
| 26 | # define STM32_PWM_USE_TIM2 TRUE | ||
| 27 | # undef STM32_PWM_USE_TIM3 | ||
| 28 | # define STM32_PWM_USE_TIM3 FALSE | ||
| 29 | |||
| 30 | # undef STM32_SERIAL_USE_USART1 | ||
| 31 | # define STM32_SERIAL_USE_USART1 TRUE | ||
| 32 | |||
| 33 | # undef STM32_ST_USE_TIMER | ||
| 34 | # define STM32_ST_USE_TIMER 3 | ||
| 35 | #endif | ||
diff --git a/keyboards/splitkb/kyria/keymaps/drashna/rules.mk b/keyboards/splitkb/kyria/keymaps/drashna/rules.mk index 882a3fba09..bb872743b7 100644 --- a/keyboards/splitkb/kyria/keymaps/drashna/rules.mk +++ b/keyboards/splitkb/kyria/keymaps/drashna/rules.mk | |||
| @@ -11,6 +11,16 @@ KEY_LOCK_ENABLE = no | |||
| 11 | WPM_ENABLE = yes | 11 | WPM_ENABLE = yes |
| 12 | 12 | ||
| 13 | ifeq ($(strip $(KEYBOARD)), splitkb/kyria/rev1/proton_c) | 13 | ifeq ($(strip $(KEYBOARD)), splitkb/kyria/rev1/proton_c) |
| 14 | OVERLOAD_FEATURES = yes | ||
| 15 | endif | ||
| 16 | ifeq ($(strip $(KEYBOARD)), splitkb/kyria/rev3) | ||
| 17 | OVERLOAD_FEATURES = yes | ||
| 18 | CONVERT_TO = proton_c | ||
| 19 | WS2812_DRIVER = pwm | ||
| 20 | SERIAL_DRIVER = usart | ||
| 21 | endif | ||
| 22 | |||
| 23 | ifeq ($(strip $(OVERLOAD_FEATURES)), yes) | ||
| 14 | RGB_MATRIX_ENABLE = yes | 24 | RGB_MATRIX_ENABLE = yes |
| 15 | CONSOLE_ENABLE = yes # Console for debug | 25 | CONSOLE_ENABLE = yes # Console for debug |
| 16 | MOUSEKEY_ENABLE = yes # Mouse keys | 26 | MOUSEKEY_ENABLE = yes # Mouse keys |
| @@ -20,7 +30,8 @@ ifeq ($(strip $(KEYBOARD)), splitkb/kyria/rev1/proton_c) | |||
| 20 | ENCODER_MAP_ENABLE = yes | 30 | ENCODER_MAP_ENABLE = yes |
| 21 | AUTOCORRECT_ENABLE = yes | 31 | AUTOCORRECT_ENABLE = yes |
| 22 | CAPS_WORD_ENABLE = yes | 32 | CAPS_WORD_ENABLE = yes |
| 23 | OLED_DRIVER = custom | 33 | AUDIO_ENABLE = no |
| 34 | DEBUG_MATRIX_SCAN_RATE_ENABLE = api | ||
| 24 | else | 35 | else |
| 25 | LTO_ENABLE = yes | 36 | LTO_ENABLE = yes |
| 26 | BOOTLOADER = qmk-hid | 37 | BOOTLOADER = qmk-hid |
diff --git a/keyboards/splitkb/zima/keymaps/drashna/keymap.c b/keyboards/splitkb/zima/keymaps/drashna/keymap.c index de3d74474e..f7f3b54fbd 100644 --- a/keyboards/splitkb/zima/keymaps/drashna/keymap.c +++ b/keyboards/splitkb/zima/keymaps/drashna/keymap.c | |||
| @@ -143,13 +143,3 @@ bool process_record_user(uint16_t keycode, keyrecord_t* record) { | |||
| 143 | 143 | ||
| 144 | return true; | 144 | return true; |
| 145 | } | 145 | } |
| 146 | |||
| 147 | bool encoder_update_user(uint8_t index, bool clockwise) { | ||
| 148 | oled_timer = timer_read32(); | ||
| 149 | if (clockwise) { | ||
| 150 | tap_code_delay(KC_VOLU, 10); | ||
| 151 | } else { | ||
| 152 | tap_code_delay(KC_VOLD, 10); | ||
| 153 | } | ||
| 154 | return false; | ||
| 155 | } | ||
diff --git a/keyboards/splitkb/zima/keymaps/drashna/readme.md b/keyboards/splitkb/zima/keymaps/drashna/readme.md deleted file mode 100644 index 0f78f4bf18..0000000000 --- a/keyboards/splitkb/zima/keymaps/drashna/readme.md +++ /dev/null | |||
| @@ -1,7 +0,0 @@ | |||
| 1 | # The default keymap for zima | ||
| 2 | |||
| 3 | This includes support for the OLED and Encoder. However, the actual code is found in the `zima.c` file. This can be replaced by adding your own `oled_task_user(void)` and `encoder_update_user` functinons. These will replace what is in the keyboard, and allow you to customize these features. | ||
| 4 | |||
| 5 | The reason that this is done this way, is so that this functionality will work on the [QMK Configurator](https://config.qmk.fm/#/splitkb/zima/LAYOUT_ortho_4x3) | ||
| 6 | |||
| 7 | For reference, the code used for the oled and encoder defaults is in [zima.c](https://github.com/qmk/qmk_firmware/tree/master/keyboards/splitkb/zima/zima.c). | ||
diff --git a/keyboards/work_louder/work_board/keymaps/drashna/keymap.c b/keyboards/work_louder/work_board/keymaps/drashna/keymap.c index 99bbedfdcb..1747ab638e 100644 --- a/keyboards/work_louder/work_board/keymaps/drashna/keymap.c +++ b/keyboards/work_louder/work_board/keymaps/drashna/keymap.c | |||
| @@ -91,8 +91,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { | |||
| 91 | 91 | ||
| 92 | }; | 92 | }; |
| 93 | 93 | ||
| 94 | #ifdef ENCODER_ENABLE | 94 | #ifdef ENCODER_MAP_ENABLE |
| 95 | # ifdef ENCODER_MAP_ENABLE | ||
| 96 | const uint16_t PROGMEM encoder_map[][NUM_ENCODERS][NUM_DIRECTIONS] = { | 95 | const uint16_t PROGMEM encoder_map[][NUM_ENCODERS][NUM_DIRECTIONS] = { |
| 97 | [_DEFAULT_LAYER_1] = { { KC_DOWN, KC_UP } }, | 96 | [_DEFAULT_LAYER_1] = { { KC_DOWN, KC_UP } }, |
| 98 | [_DEFAULT_LAYER_2] = { { _______, _______ } }, | 97 | [_DEFAULT_LAYER_2] = { { _______, _______ } }, |
| @@ -107,23 +106,6 @@ const uint16_t PROGMEM encoder_map[][NUM_ENCODERS][NUM_DIRECTIONS] = { | |||
| 107 | [_ADJUST] = { { CK_DOWN, CK_UP } }, | 106 | [_ADJUST] = { { CK_DOWN, CK_UP } }, |
| 108 | }; | 107 | }; |
| 109 | // clang-format on | 108 | // clang-format on |
| 110 | # else | ||
| 111 | bool encoder_update_user(uint8_t index, bool clockwise) { | ||
| 112 | switch (get_highest_layer(layer_state)) { | ||
| 113 | case _RAISE: | ||
| 114 | clockwise ? rgblight_step() : rgblight_step_reverse(); | ||
| 115 | break; | ||
| 116 | case _LOWER: | ||
| 117 | clockwise ? rgb_matrix_step() : rgb_matrix_step_reverse(); | ||
| 118 | break; | ||
| 119 | default: | ||
| 120 | clockwise ? tap_code(KC_VOLU) : tap_code(KC_VOLD); | ||
| 121 | break; | ||
| 122 | } | ||
| 123 | return false; | ||
| 124 | } | ||
| 125 | # endif // ENCODER_ENABLE | ||
| 126 | |||
| 127 | #endif | 109 | #endif |
| 128 | 110 | ||
| 129 | bool rgb_matrix_indicators_advanced_keymap(uint8_t led_min, uint8_t led_max) { | 111 | bool rgb_matrix_indicators_advanced_keymap(uint8_t led_min, uint8_t led_max) { |
| @@ -133,8 +115,7 @@ bool rgb_matrix_indicators_advanced_keymap(uint8_t led_min, uint8_t led_max) { | |||
| 133 | #define THUMB_LED 6 | 115 | #define THUMB_LED 6 |
| 134 | #define RGB_MATRIX_INDICATOR_SET_COLOR_wrapper(...) RGB_MATRIX_INDICATOR_SET_COLOR(__VA_ARGS__) | 116 | #define RGB_MATRIX_INDICATOR_SET_COLOR_wrapper(...) RGB_MATRIX_INDICATOR_SET_COLOR(__VA_ARGS__) |
| 135 | 117 | ||
| 136 | extern bool host_driver_disabled; | 118 | if (get_keyboard_lock()) { |
| 137 | if (host_driver_disabled) { | ||
| 138 | RGB_MATRIX_INDICATOR_SET_COLOR_wrapper(THUMB_LED, RGB_OFF); | 119 | RGB_MATRIX_INDICATOR_SET_COLOR_wrapper(THUMB_LED, RGB_OFF); |
| 139 | } else { | 120 | } else { |
| 140 | switch (get_highest_layer(default_layer_state)) { | 121 | switch (get_highest_layer(default_layer_state)) { |
diff --git a/keyboards/work_louder/work_board/keymaps/drashna/rules.mk b/keyboards/work_louder/work_board/keymaps/drashna/rules.mk index 6a98d14daf..8bdc486929 100644 --- a/keyboards/work_louder/work_board/keymaps/drashna/rules.mk +++ b/keyboards/work_louder/work_board/keymaps/drashna/rules.mk | |||
| @@ -1,10 +1,10 @@ | |||
| 1 | BOOTMAGIC_ENABLE = yes # Enable Bootmagic Lite | 1 | BOOTMAGIC_ENABLE = yes |
| 2 | EXTRAKEY_ENABLE = yes | 2 | EXTRAKEY_ENABLE = yes |
| 3 | MOUSEKEY_ENABLE = yes | 3 | MOUSEKEY_ENABLE = yes |
| 4 | TAP_DANCE_ENABLE = no | 4 | TAP_DANCE_ENABLE = no |
| 5 | NKRO_ENABLE = yes | 5 | NKRO_ENABLE = yes |
| 6 | RGBLIGHT_STARTUP_ANIMATION = yes | 6 | RGBLIGHT_STARTUP_ANIMATION = no |
| 7 | ENCODER_MAP_ENABLE = yes | 7 | ENCODER_MAP_ENABLE = yes |
| 8 | 8 | ||
| 9 | AUTOCORRECT_ENABLE = no | 9 | AUTOCORRECT_ENABLE = no |
| 10 | CUSTOM_UNICODE_ENABLE = no | 10 | CUSTOM_UNICODE_ENABLE = no |
diff --git a/layouts/community/ergodox/drashna/keymap.c b/layouts/community/ergodox/drashna/keymap.c index 846bbc2351..1853b70071 100644 --- a/layouts/community/ergodox/drashna/keymap.c +++ b/layouts/community/ergodox/drashna/keymap.c | |||
| @@ -18,8 +18,6 @@ | |||
| 18 | 18 | ||
| 19 | enum more_custom_keycodes { | 19 | enum more_custom_keycodes { |
| 20 | KC_SWAP_NUM = USER_SAFE_RANGE, | 20 | KC_SWAP_NUM = USER_SAFE_RANGE, |
| 21 | PM_SCROLL, | ||
| 22 | PM_PRECISION, | ||
| 23 | }; | 21 | }; |
| 24 | 22 | ||
| 25 | // define layer change stuff for underglow indicator | 23 | // define layer change stuff for underglow indicator |
| @@ -44,9 +42,9 @@ bool skip_leds = false; | |||
| 44 | LAYOUT_ergodox_pretty_wrapper( \ | 42 | LAYOUT_ergodox_pretty_wrapper( \ |
| 45 | KC_ESC, ________________NUMBER_LEFT________________, UC_FLIP, UC_TABL, ________________NUMBER_RIGHT_______________, KC_MINS, \ | 43 | KC_ESC, ________________NUMBER_LEFT________________, UC_FLIP, UC_TABL, ________________NUMBER_RIGHT_______________, KC_MINS, \ |
| 46 | LALT_T(KC_TAB), K01, K02, K03, K04, K05, TG_DBLO, TG_DBLO, K06, K07, K08, K09, K0A, KC_BSLS, \ | 44 | LALT_T(KC_TAB), K01, K02, K03, K04, K05, TG_DBLO, TG_DBLO, K06, K07, K08, K09, K0A, KC_BSLS, \ |
| 47 | KC_C1R3, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, RALT_T(K1B), \ | 45 | KC_C1R3, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, RALT_T(K1B), \ |
| 48 | KC_MLSF, CTL_T(K21), K22, K23, K24, K25, TG_GAME, TG_GAME, K26, K27, K28, K29, RCTL_T(K2A), KC_MRSF, \ | 46 | KC_MLSF, CTL_T(K21), K22, K23, K24, K25, TG_GAME, TG_GAME, K26, K27, K28, K29, RCTL_T(K2A), KC_MRSF, \ |
| 49 | KC_GRV, OS_MEH, OS_HYPR, KC_LBRC, KC_RBRC, KC_BTN1, KC_BTN3, KC_BTN2, PM_SCROLL, PM_PRECISION, \ | 47 | KC_GRV, OS_MEH, OS_HYPR, KC_LBRC, KC_RBRC, KC_LEFT, KC_UP, KC_DOWN, KC_RGHT, KC_NO, \ |
| 50 | OS_LALT, OS_LGUI, OS_RGUI, CTL_T(KC_ESCAPE), \ | 48 | OS_LALT, OS_LGUI, OS_RGUI, CTL_T(KC_ESCAPE), \ |
| 51 | KC_APP, KC_MENU, \ | 49 | KC_APP, KC_MENU, \ |
| 52 | KC_SPC, LT(_LOWER, KC_BSPC), OS_LWR, OS_RSE, LT(_RAISE, KC_DEL), KC_ENT \ | 50 | KC_SPC, LT(_LOWER, KC_BSPC), OS_LWR, OS_RSE, LT(_RAISE, KC_DEL), KC_ENT \ |
| @@ -180,36 +178,6 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { | |||
| 180 | }; | 178 | }; |
| 181 | // clang-format on | 179 | // clang-format on |
| 182 | 180 | ||
| 183 | #ifdef PIMORONI_TRACKBALL_ENABLE | ||
| 184 | void run_trackball_cleanup(void) { | ||
| 185 | // if (trackball_is_scrolling()) { | ||
| 186 | // trackball_set_rgbw(RGB_CYAN, 0x00); | ||
| 187 | // } else if (trackball_get_precision() != 1.0) { | ||
| 188 | // trackball_set_rgbw(RGB_GREEN, 0x00); | ||
| 189 | // } else { | ||
| 190 | // trackball_set_rgbw(RGB_MAGENTA, 0x00); | ||
| 191 | // } | ||
| 192 | } | ||
| 193 | |||
| 194 | void keyboard_post_init_keymap(void) { | ||
| 195 | // trackball_set_precision(1.5); | ||
| 196 | // trackball_set_rgbw(RGB_MAGENTA, 0x00); | ||
| 197 | } | ||
| 198 | // void shutdown_keymap(void) { trackball_set_rgbw(RGB_RED, 0x00); } | ||
| 199 | |||
| 200 | static bool mouse_button_one, trackball_button_one; | ||
| 201 | |||
| 202 | void trackball_register_button(bool pressed, enum mouse_buttons button) { | ||
| 203 | report_mouse_t currentReport = pointing_device_get_report(); | ||
| 204 | if (pressed) { | ||
| 205 | currentReport.buttons |= button; | ||
| 206 | } else { | ||
| 207 | currentReport.buttons &= ~button; | ||
| 208 | } | ||
| 209 | pointing_device_set_report(currentReport); | ||
| 210 | } | ||
| 211 | #endif | ||
| 212 | |||
| 213 | bool process_record_keymap(uint16_t keycode, keyrecord_t *record) { | 181 | bool process_record_keymap(uint16_t keycode, keyrecord_t *record) { |
| 214 | switch (keycode) { | 182 | switch (keycode) { |
| 215 | case KC_1: | 183 | case KC_1: |
| @@ -235,40 +203,15 @@ bool process_record_keymap(uint16_t keycode, keyrecord_t *record) { | |||
| 235 | case KC_SWAP_NUM: | 203 | case KC_SWAP_NUM: |
| 236 | if (record->event.pressed) { | 204 | if (record->event.pressed) { |
| 237 | userspace_config.swapped_numbers ^= 1; | 205 | userspace_config.swapped_numbers ^= 1; |
| 238 | eeconfig_update_user(userspace_config.raw); | 206 | eeconfig_update_user_config(&userspace_config.raw); |
| 239 | } | 207 | } |
| 240 | break; | 208 | break; |
| 241 | #ifdef PIMORONI_TRACKBALL_ENABLE | ||
| 242 | case PM_SCROLL: | ||
| 243 | // trackball_set_scrolling(record->event.pressed); | ||
| 244 | run_trackball_cleanup(); | ||
| 245 | break; | ||
| 246 | case PM_PRECISION: | ||
| 247 | // if (record->event.pressed) { | ||
| 248 | // trackball_set_precision(1.5); | ||
| 249 | // } else { | ||
| 250 | // trackball_set_precision(1); | ||
| 251 | // } | ||
| 252 | // run_trackball_cleanup(); | ||
| 253 | break; | ||
| 254 | # if !defined(MOUSEKEY_ENABLE) | ||
| 255 | case KC_MS_BTN1: | ||
| 256 | mouse_button_one = record->event.pressed; | ||
| 257 | trackball_register_button(mouse_button_one | trackball_button_one, MOUSE_BTN1); | ||
| 258 | break; | ||
| 259 | case KC_MS_BTN2: | ||
| 260 | trackball_register_button(record->event.pressed, MOUSE_BTN2); | ||
| 261 | break; | ||
| 262 | case KC_MS_BTN3: | ||
| 263 | trackball_register_button(record->event.pressed, MOUSE_BTN3); | ||
| 264 | break; | ||
| 265 | # endif | ||
| 266 | #endif | ||
| 267 | } | 209 | } |
| 268 | return true; | 210 | return true; |
| 269 | } | 211 | } |
| 270 | 212 | ||
| 271 | void housekeeping_task_keymap(void) { // runs frequently to update info | 213 | void housekeeping_task_keymap(void) { // runs frequently to update info |
| 214 | #ifdef KEYBOARD_ergodox_ez | ||
| 272 | uint8_t modifiers = get_mods(); | 215 | uint8_t modifiers = get_mods(); |
| 273 | uint8_t led_usb_state = host_keyboard_leds(); | 216 | uint8_t led_usb_state = host_keyboard_leds(); |
| 274 | uint8_t one_shot = get_oneshot_mods(); | 217 | uint8_t one_shot = get_oneshot_mods(); |
| @@ -295,6 +238,7 @@ void housekeeping_task_keymap(void) { // runs frequently to update info | |||
| 295 | ergodox_right_led_3_set(10); | 238 | ergodox_right_led_3_set(10); |
| 296 | } | 239 | } |
| 297 | } | 240 | } |
| 241 | #endif | ||
| 298 | } | 242 | } |
| 299 | 243 | ||
| 300 | bool indicator_is_this_led_used_keyboard(uint8_t index) { | 244 | bool indicator_is_this_led_used_keyboard(uint8_t index) { |
diff --git a/layouts/community/ergodox/drashna/rules.mk b/layouts/community/ergodox/drashna/rules.mk index f5e9b500e0..072b70de19 100644 --- a/layouts/community/ergodox/drashna/rules.mk +++ b/layouts/community/ergodox/drashna/rules.mk | |||
| @@ -8,10 +8,13 @@ ifeq ($(strip $(KEYBOARD)), ergodox_ez) | |||
| 8 | RGB_MATRIX_ENABLE = yes | 8 | RGB_MATRIX_ENABLE = yes |
| 9 | INDICATOR_LIGHTS = no | 9 | INDICATOR_LIGHTS = no |
| 10 | RGBLIGHT_STARTUP_ANIMATION = yes | 10 | RGBLIGHT_STARTUP_ANIMATION = yes |
| 11 | PIMORONI_TRACKBALL_ENABLE = no | ||
| 12 | MOUSEKEY_ENABLE = no | ||
| 13 | endif | 11 | endif |
| 14 | 12 | ||
| 15 | UNICODE_ENABLE = no | 13 | UNICODE_ENABLE = no |
| 16 | UNICDOEMAP_ENABLE = no | 14 | UNICDOEMAP_ENABLE = no |
| 17 | CUSTOM_UNICODE_ENABLE = no | 15 | CUSTOM_UNICODE_ENABLE = no |
| 16 | |||
| 17 | ifeq ($(strip $(KEYBOARD)), hotdox76v2) | ||
| 18 | OLED_ENABLE = no | ||
| 19 | RGB_MATRIX_ENABLE = no | ||
| 20 | endif | ||
diff --git a/layouts/community/ortho_4x12/drashna/keymap.c b/layouts/community/ortho_4x12/drashna/keymap.c index cc84c132d9..475ccc5c3a 100644 --- a/layouts/community/ortho_4x12/drashna/keymap.c +++ b/layouts/community/ortho_4x12/drashna/keymap.c | |||
| @@ -237,34 +237,6 @@ void keyboard_post_init_keymap(void) { | |||
| 237 | } | 237 | } |
| 238 | #endif // RGB_MATRIX_INIT | 238 | #endif // RGB_MATRIX_INIT |
| 239 | 239 | ||
| 240 | #ifdef ENCODER_ENABLE | ||
| 241 | bool encoder_update_user(uint8_t index, bool clockwise) { | ||
| 242 | switch (get_highest_layer(layer_state)) { | ||
| 243 | case _RAISE: | ||
| 244 | clockwise ? tap_code(KC_VOLD) : tap_code(KC_VOLU); | ||
| 245 | break; | ||
| 246 | case _LOWER: | ||
| 247 | # ifdef RGB_MATRIX_ENABLE | ||
| 248 | clockwise ? rgb_matrix_step() : rgb_matrix_step_reverse(); | ||
| 249 | # else | ||
| 250 | clockwise ? tap_code(KC_PGDN) : tap_code(KC_PGUP); | ||
| 251 | # endif | ||
| 252 | break; | ||
| 253 | case _ADJUST: | ||
| 254 | # ifdef AUDIO_CLICKY | ||
| 255 | clockwise ? clicky_freq_up() : clicky_freq_down(); | ||
| 256 | # endif | ||
| 257 | break; | ||
| 258 | default: | ||
| 259 | clockwise ? tap_code(KC_DOWN) : tap_code(KC_UP); | ||
| 260 | } | ||
| 261 | # ifdef AUDIO_CLICKY | ||
| 262 | clicky_play(); | ||
| 263 | # endif | ||
| 264 | return true; | ||
| 265 | } | ||
| 266 | #endif // ENCODER_ENABLE | ||
| 267 | |||
| 268 | #ifdef KEYBOARD_planck_rev6 | 240 | #ifdef KEYBOARD_planck_rev6 |
| 269 | bool dip_switch_update_user(uint8_t index, bool active) { | 241 | bool dip_switch_update_user(uint8_t index, bool active) { |
| 270 | switch (index) { | 242 | switch (index) { |
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) { | |||
| 28 | if (!is_keyboard_left()) { | 28 | if (!is_keyboard_left()) { |
| 29 | row = BOOTMAGIC_LITE_ROW_RIGHT; | 29 | row = BOOTMAGIC_LITE_ROW_RIGHT; |
| 30 | col = BOOTMAGIC_LITE_COLUMN_RIGHT; | 30 | col = BOOTMAGIC_LITE_COLUMN_RIGHT; |
| 31 | #if defined(BOOTMAGIC_LITE_EEPROM_ROW) && defined(BOOTMAGIC_LITE_EEPROM_COLUMN) && defined(BOOTMAGIC_LITE_EEPROM_ROW_RIGHT) && defined(BOOTMAGIC_LITE_EEPROM_COLUMN_RIGHT) | 31 | # if defined(BOOTMAGIC_LITE_EEPROM_ROW) && defined(BOOTMAGIC_LITE_EEPROM_COLUMN) && defined(BOOTMAGIC_LITE_EEPROM_ROW_RIGHT) && defined(BOOTMAGIC_LITE_EEPROM_COLUMN_RIGHT) |
| 32 | row_e = BOOTMAGIC_LITE_EEPROM_ROW_RIGHT; | 32 | row_e = BOOTMAGIC_LITE_EEPROM_ROW_RIGHT; |
| 33 | col_e = BOOTMAGIC_LITE_EEPROM_COLUMN_RIGHT; | 33 | col_e = BOOTMAGIC_LITE_EEPROM_COLUMN_RIGHT; |
| 34 | # endif | 34 | # 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 @@ | |||
| 3 | 3 | ||
| 4 | #include "drashna.h" | 4 | #include "drashna.h" |
| 5 | 5 | ||
| 6 | #ifdef CUSTOM_DYNAMIC_MACROS_ENABLE | ||
| 7 | # include "keyrecords/dynamic_macros.h" | ||
| 8 | #endif | ||
| 6 | #ifdef I2C_SCANNER_ENABLE | 9 | #ifdef I2C_SCANNER_ENABLE |
| 7 | void housekeeping_task_i2c_scanner(void); | 10 | void housekeeping_task_i2c_scanner(void); |
| 8 | void keyboard_post_init_i2c(void); | 11 | void keyboard_post_init_i2c(void); |
| @@ -10,7 +13,10 @@ void keyboard_post_init_i2c(void); | |||
| 10 | 13 | ||
| 11 | __attribute__((weak)) void keyboard_pre_init_keymap(void) {} | 14 | __attribute__((weak)) void keyboard_pre_init_keymap(void) {} |
| 12 | void keyboard_pre_init_user(void) { | 15 | void keyboard_pre_init_user(void) { |
| 13 | userspace_config.raw = eeconfig_read_user(); | 16 | eeconfig_read_user_config(&userspace_config.raw); |
| 17 | if (!userspace_config.check) { | ||
| 18 | eeconfig_init_user(); | ||
| 19 | } | ||
| 14 | keyboard_pre_init_keymap(); | 20 | keyboard_pre_init_keymap(); |
| 15 | } | 21 | } |
| 16 | // Add reconfigurable functions here, for keymap customization | 22 | // Add reconfigurable functions here, for keymap customization |
| @@ -24,58 +30,8 @@ void keyboard_pre_init_user(void) { | |||
| 24 | void keyboard_post_init_qp(void); | 30 | void keyboard_post_init_qp(void); |
| 25 | #endif | 31 | #endif |
| 26 | 32 | ||
| 27 | #ifdef OS_DETECTION_ENABLE | 33 | #if defined(OS_DETECTION_ENABLE) && defined(DEFERRED_EXEC_ENABLE) |
| 28 | os_variant_t os_type; | 34 | uint32_t startup_exec(uint32_t trigger_time, void *cb_arg); |
| 29 | |||
| 30 | uint32_t startup_exec(uint32_t trigger_time, void *cb_arg) { | ||
| 31 | /* do something */ | ||
| 32 | |||
| 33 | if (is_keyboard_master()) { | ||
| 34 | os_type = detected_host_os(); | ||
| 35 | if (os_type) { | ||
| 36 | bool is_mac = (os_type == OS_MACOS) || (os_type == OS_IOS); | ||
| 37 | keymap_config.swap_lctl_lgui = keymap_config.swap_rctl_rgui = is_mac; | ||
| 38 | # ifdef UNICODE_COMMON_ENABLE | ||
| 39 | uint8_t mode = is_mac ? UNICODE_MODE_MACOS : UNICODE_MODE_WINCOMPOSE; | ||
| 40 | if (mode != get_unicode_input_mode()) { | ||
| 41 | set_unicode_input_mode(mode); | ||
| 42 | } | ||
| 43 | # endif | ||
| 44 | switch (os_type) { | ||
| 45 | case OS_UNSURE: | ||
| 46 | xprintf("unknown OS Detected\n"); | ||
| 47 | break; | ||
| 48 | case OS_LINUX: | ||
| 49 | xprintf("Linux Detected\n"); | ||
| 50 | break; | ||
| 51 | case OS_WINDOWS: | ||
| 52 | xprintf("Windows Detected\n"); | ||
| 53 | break; | ||
| 54 | # if 0 | ||
| 55 | case OS_WINDOWS_UNSURE: | ||
| 56 | xprintf("Windows? Detected\n"); | ||
| 57 | break; | ||
| 58 | # endif | ||
| 59 | case OS_MACOS: | ||
| 60 | xprintf("MacOS Detected\n"); | ||
| 61 | break; | ||
| 62 | case OS_IOS: | ||
| 63 | xprintf("iOS Detected\n"); | ||
| 64 | break; | ||
| 65 | # if 0 | ||
| 66 | case OS_PS5: | ||
| 67 | xprintf("PlayStation 5 Detected\n"); | ||
| 68 | break; | ||
| 69 | case OS_HANDHELD: | ||
| 70 | xprintf("Nintend Switch/Quest 2 Detected\n"); | ||
| 71 | break; | ||
| 72 | # endif | ||
| 73 | } | ||
| 74 | } | ||
| 75 | } | ||
| 76 | |||
| 77 | return os_type ? 0 : 500; | ||
| 78 | } | ||
| 79 | #endif | 35 | #endif |
| 80 | 36 | ||
| 81 | __attribute__((weak)) void keyboard_post_init_keymap(void) {} | 37 | __attribute__((weak)) void keyboard_post_init_keymap(void) {} |
| @@ -103,8 +59,10 @@ void keyboard_post_init_user(void) { | |||
| 103 | DDRB &= ~(1 << 0); | 59 | DDRB &= ~(1 << 0); |
| 104 | PORTB &= ~(1 << 0); | 60 | PORTB &= ~(1 << 0); |
| 105 | #endif | 61 | #endif |
| 106 | 62 | #ifdef CUSTOM_DYNAMIC_MACROS_ENABLE | |
| 107 | #ifdef OS_DETECTION_ENABLE | 63 | dynamic_macro_init(); |
| 64 | #endif | ||
| 65 | #if defined(OS_DETECTION_ENABLE) && defined(DEFERRED_EXEC_ENABLE) | ||
| 108 | defer_exec(100, startup_exec, NULL); | 66 | defer_exec(100, startup_exec, NULL); |
| 109 | #endif | 67 | #endif |
| 110 | 68 | ||
| @@ -153,9 +111,6 @@ void suspend_power_down_user(void) { | |||
| 153 | 111 | ||
| 154 | __attribute__((weak)) void suspend_wakeup_init_keymap(void) {} | 112 | __attribute__((weak)) void suspend_wakeup_init_keymap(void) {} |
| 155 | void suspend_wakeup_init_user(void) { | 113 | void suspend_wakeup_init_user(void) { |
| 156 | #ifdef OLED_ENABLE | ||
| 157 | oled_timer_reset(); | ||
| 158 | #endif | ||
| 159 | suspend_wakeup_init_keymap(); | 114 | suspend_wakeup_init_keymap(); |
| 160 | } | 115 | } |
| 161 | 116 | ||
| @@ -217,6 +172,11 @@ layer_state_t layer_state_set_user(layer_state_t state) { | |||
| 217 | __attribute__((weak)) layer_state_t default_layer_state_set_keymap(layer_state_t state) { | 172 | __attribute__((weak)) layer_state_t default_layer_state_set_keymap(layer_state_t state) { |
| 218 | return state; | 173 | return state; |
| 219 | } | 174 | } |
| 175 | |||
| 176 | #if defined(AUDIO_ENABLE) && defined(DEFAULT_LAYER_SONGS) | ||
| 177 | static float default_layer_songs[][MAX_LAYER][2] = DEFAULT_LAYER_SONGS; | ||
| 178 | #endif | ||
| 179 | |||
| 220 | layer_state_t default_layer_state_set_user(layer_state_t state) { | 180 | layer_state_t default_layer_state_set_user(layer_state_t state) { |
| 221 | if (!is_keyboard_master()) { | 181 | if (!is_keyboard_master()) { |
| 222 | return state; | 182 | return state; |
| @@ -226,6 +186,21 @@ layer_state_t default_layer_state_set_user(layer_state_t state) { | |||
| 226 | #if defined(CUSTOM_RGBLIGHT) | 186 | #if defined(CUSTOM_RGBLIGHT) |
| 227 | state = default_layer_state_set_rgb_light(state); | 187 | state = default_layer_state_set_rgb_light(state); |
| 228 | #endif | 188 | #endif |
| 189 | |||
| 190 | static bool has_init_been_ran = false; | ||
| 191 | // We don't want to run this the first time it's called, since it's read from eeeprom and called | ||
| 192 | // as part of the startup process. But after that, it's okay. | ||
| 193 | if (has_init_been_ran) { | ||
| 194 | #if defined(AUDIO_ENABLE) && defined(DEFAULT_LAYER_SONGS) | ||
| 195 | if (get_highest_layer(state) < MAX_LAYER) { | ||
| 196 | PLAY_SONG(default_layer_songs[get_highest_layer(state)]); | ||
| 197 | } | ||
| 198 | #endif | ||
| 199 | eeconfig_update_default_layer(state); | ||
| 200 | } else { | ||
| 201 | has_init_been_ran = true; | ||
| 202 | } | ||
| 203 | |||
| 229 | return state; | 204 | return state; |
| 230 | } | 205 | } |
| 231 | 206 | ||
| @@ -238,11 +213,23 @@ __attribute__((weak)) void eeconfig_init_keymap(void) {} | |||
| 238 | void eeconfig_init_user(void) { | 213 | void eeconfig_init_user(void) { |
| 239 | userspace_config.raw = 0; | 214 | userspace_config.raw = 0; |
| 240 | userspace_config.rgb_layer_change = true; | 215 | userspace_config.rgb_layer_change = true; |
| 241 | userspace_config.autocorrection = true; | 216 | userspace_config.check = true; |
| 242 | eeconfig_update_user(userspace_config.raw); | 217 | #if defined(OLED_ENABLE) |
| 218 | userspace_config.oled_brightness = OLED_BRIGHTNESS; | ||
| 219 | #else | ||
| 220 | userspace_config.oled_brightness = 255; | ||
| 221 | #endif | ||
| 222 | eeconfig_update_user_config(&userspace_config.raw); | ||
| 243 | eeconfig_init_keymap(); | 223 | eeconfig_init_keymap(); |
| 244 | } | 224 | } |
| 245 | 225 | ||
| 226 | void eeconfig_init_user_datablock(void) { | ||
| 227 | #if (EECONFIG_USER_DATA_SIZE) > 4 | ||
| 228 | uint8_t eeconfig_empty_temp[(EECONFIG_USER_DATA_SIZE)-4] = {0}; | ||
| 229 | eeconfig_update_user_data(eeconfig_empty_temp); | ||
| 230 | #endif | ||
| 231 | } | ||
| 232 | |||
| 246 | #ifdef SPLIT_KEYBOARD | 233 | #ifdef SPLIT_KEYBOARD |
| 247 | __attribute__((weak)) void matrix_slave_scan_keymap(void) {} | 234 | __attribute__((weak)) void matrix_slave_scan_keymap(void) {} |
| 248 | void matrix_slave_scan_user(void) { | 235 | 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 @@ | |||
| 3 | 3 | ||
| 4 | #pragma once | 4 | #pragma once |
| 5 | 5 | ||
| 6 | // Use custom magic number so that when switching branches, EEPROM always gets reset | ||
| 7 | #define EECONFIG_MAGIC_NUMBER (uint16_t)0x1339 | ||
| 8 | |||
| 9 | #ifdef IS_COMMAND | 6 | #ifdef IS_COMMAND |
| 10 | # undef IS_COMMAND | 7 | # undef IS_COMMAND |
| 11 | #endif | 8 | #endif |
| @@ -43,7 +40,6 @@ | |||
| 43 | # define WPM_ESTIMATED_WORD_SIZE 5 | 40 | # define WPM_ESTIMATED_WORD_SIZE 5 |
| 44 | #endif | 41 | #endif |
| 45 | 42 | ||
| 46 | |||
| 47 | #define UNICODE_SELECTED_MODES UNICODE_MODE_WINCOMPOSE, UNICODE_MODE_MACOS | 43 | #define UNICODE_SELECTED_MODES UNICODE_MODE_WINCOMPOSE, UNICODE_MODE_MACOS |
| 48 | 44 | ||
| 49 | #ifndef ONESHOT_TAP_TOGGLE | 45 | #ifndef ONESHOT_TAP_TOGGLE |
| @@ -98,7 +94,22 @@ | |||
| 98 | # define C15 PAL_LINE(GPIOC, 15) | 94 | # define C15 PAL_LINE(GPIOC, 15) |
| 99 | #endif | 95 | #endif |
| 100 | 96 | ||
| 101 | |||
| 102 | #define ENABLE_COMPILE_KEYCODE | 97 | #define ENABLE_COMPILE_KEYCODE |
| 103 | 98 | ||
| 104 | #define BOTH_SHIFTS_TURNS_ON_CAPS_WORD | 99 | #define BOTH_SHIFTS_TURNS_ON_CAPS_WORD |
| 100 | |||
| 101 | /* --- PRINTF_BYTE_TO_BINARY macro's --- */ | ||
| 102 | #define PRINTF_BINARY_PATTERN_INT8 "%c%c%c%c%c%c%c%c" | ||
| 103 | #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') | ||
| 104 | |||
| 105 | #define PRINTF_BINARY_PATTERN_INT16 PRINTF_BINARY_PATTERN_INT8 " " PRINTF_BINARY_PATTERN_INT8 | ||
| 106 | #define PRINTF_BYTE_TO_BINARY_INT16(i) PRINTF_BYTE_TO_BINARY_INT8((i) >> 8), PRINTF_BYTE_TO_BINARY_INT8(i) | ||
| 107 | #define PRINTF_BINARY_PATTERN_INT32 PRINTF_BINARY_PATTERN_INT16 " " PRINTF_BINARY_PATTERN_INT16 | ||
| 108 | #define PRINTF_BYTE_TO_BINARY_INT32(i) PRINTF_BYTE_TO_BINARY_INT16((i) >> 16), PRINTF_BYTE_TO_BINARY_INT16(i) | ||
| 109 | #define PRINTF_BINARY_PATTERN_INT64 PRINTF_BINARY_PATTERN_INT32 " " PRINTF_BINARY_PATTERN_INT32 | ||
| 110 | #define PRINTF_BYTE_TO_BINARY_INT64(i) PRINTF_BYTE_TO_BINARY_INT32((i) >> 32), PRINTF_BYTE_TO_BINARY_INT32(i) | ||
| 111 | /* --- end macros --- */ | ||
| 112 | |||
| 113 | #ifndef EECONFIG_USER_DATA_SIZE | ||
| 114 | # define EECONFIG_USER_DATA_SIZE 8 | ||
| 115 | #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 @@ | |||
| 2 | // SPDX-License-Identifier: GPL-2.0-or-later | 2 | // SPDX-License-Identifier: GPL-2.0-or-later |
| 3 | 3 | ||
| 4 | #include "drashna.h" | 4 | #include "drashna.h" |
| 5 | #include <stdio.h> | ||
| 6 | #include <ctype.h> | ||
| 5 | 7 | ||
| 6 | userspace_config_t userspace_config; | 8 | userspace_config_t userspace_config; |
| 7 | 9 | ||
| @@ -139,7 +141,7 @@ float autocorrect_song[][2] = SONG(PLOVER_GOODBYE_SOUND); | |||
| 139 | # endif | 141 | # endif |
| 140 | # endif | 142 | # endif |
| 141 | 143 | ||
| 142 | bool apply_autocorrect(uint8_t backspaces, const char* str) { | 144 | bool apply_autocorrect(uint8_t backspaces, const char *str) { |
| 143 | if (layer_state_is(_GAMEPAD)) { | 145 | if (layer_state_is(_GAMEPAD)) { |
| 144 | return false; | 146 | return false; |
| 145 | } | 147 | } |
| @@ -188,7 +190,7 @@ void oneshot_locked_mods_changed_user(uint8_t mods) { | |||
| 188 | # endif | 190 | # endif |
| 189 | #endif | 191 | #endif |
| 190 | 192 | ||
| 191 | void format_layer_bitmap_string(char* buffer, layer_state_t state, layer_state_t default_state) { | 193 | void format_layer_bitmap_string(char *buffer, layer_state_t state, layer_state_t default_state) { |
| 192 | for (int i = 0; i < 16; i++) { | 194 | for (int i = 0; i < 16; i++) { |
| 193 | if (i == 0 || i == 4 || i == 8 || i == 12) { | 195 | if (i == 0 || i == 4 || i == 8 || i == 12) { |
| 194 | *buffer = ' '; | 196 | *buffer = ' '; |
| @@ -207,3 +209,111 @@ void format_layer_bitmap_string(char* buffer, layer_state_t state, layer_state_t | |||
| 207 | } | 209 | } |
| 208 | *buffer = 0; | 210 | *buffer = 0; |
| 209 | } | 211 | } |
| 212 | |||
| 213 | #if defined(OS_DETECTION_ENABLE) && defined(DEFERRED_EXEC_ENABLE) | ||
| 214 | os_variant_t os_type; | ||
| 215 | |||
| 216 | uint32_t startup_exec(uint32_t trigger_time, void *cb_arg) { | ||
| 217 | if (is_keyboard_master()) { | ||
| 218 | os_type = detected_host_os(); | ||
| 219 | if (os_type) { | ||
| 220 | bool is_mac = (os_type == OS_MACOS) || (os_type == OS_IOS); | ||
| 221 | if (keymap_config.swap_lctl_lgui != is_mac) { | ||
| 222 | keymap_config.swap_lctl_lgui = keymap_config.swap_rctl_rgui = is_mac; | ||
| 223 | eeconfig_update_keymap(keymap_config.raw); | ||
| 224 | } | ||
| 225 | # ifdef UNICODE_COMMON_ENABLE | ||
| 226 | set_unicode_input_mode_soft(keymap_config.swap_lctl_lgui ? UNICODE_MODE_MACOS : UNICODE_MODE_WINCOMPOSE); | ||
| 227 | # endif | ||
| 228 | switch (os_type) { | ||
| 229 | case OS_UNSURE: | ||
| 230 | xprintf("unknown OS Detected\n"); | ||
| 231 | break; | ||
| 232 | case OS_LINUX: | ||
| 233 | xprintf("Linux Detected\n"); | ||
| 234 | break; | ||
| 235 | case OS_WINDOWS: | ||
| 236 | xprintf("Windows Detected\n"); | ||
| 237 | break; | ||
| 238 | # if 0 | ||
| 239 | case OS_WINDOWS_UNSURE: | ||
| 240 | xprintf("Windows? Detected\n"); | ||
| 241 | break; | ||
| 242 | # endif | ||
| 243 | case OS_MACOS: | ||
| 244 | xprintf("MacOS Detected\n"); | ||
| 245 | break; | ||
| 246 | case OS_IOS: | ||
| 247 | xprintf("iOS Detected\n"); | ||
| 248 | break; | ||
| 249 | # if 0 | ||
| 250 | case OS_PS5: | ||
| 251 | xprintf("PlayStation 5 Detected\n"); | ||
| 252 | break; | ||
| 253 | case OS_HANDHELD: | ||
| 254 | xprintf("Nintend Switch/Quest 2 Detected\n"); | ||
| 255 | break; | ||
| 256 | # endif | ||
| 257 | } | ||
| 258 | } | ||
| 259 | } | ||
| 260 | |||
| 261 | return os_type ? 0 : 500; | ||
| 262 | } | ||
| 263 | #endif | ||
| 264 | |||
| 265 | static host_driver_t *host_driver = 0; | ||
| 266 | static bool host_driver_disabled = false; | ||
| 267 | |||
| 268 | void set_keyboard_lock(bool status) { | ||
| 269 | if (!status && !host_get_driver()) { | ||
| 270 | host_set_driver(host_driver); | ||
| 271 | } else if (status && host_get_driver()) { | ||
| 272 | host_driver = host_get_driver(); | ||
| 273 | clear_keyboard(); | ||
| 274 | host_set_driver(0); | ||
| 275 | } else if (status) { | ||
| 276 | clear_keyboard(); | ||
| 277 | } | ||
| 278 | |||
| 279 | host_driver_disabled = status; | ||
| 280 | } | ||
| 281 | |||
| 282 | void toggle_keyboard_lock(void) { | ||
| 283 | set_keyboard_lock(!host_driver_disabled); | ||
| 284 | } | ||
| 285 | |||
| 286 | bool get_keyboard_lock(void) { | ||
| 287 | return host_driver_disabled; | ||
| 288 | } | ||
| 289 | |||
| 290 | const char *get_layer_name_string(layer_state_t state, bool alt_name) { | ||
| 291 | switch (get_highest_layer(state)) { | ||
| 292 | case _QWERTY: | ||
| 293 | return alt_name ? "Num Pad" : "QWERTY"; | ||
| 294 | case _COLEMAK: | ||
| 295 | return "Colemak"; | ||
| 296 | case _COLEMAK_DH: | ||
| 297 | return "Colemak-DH"; | ||
| 298 | case _DVORAK: | ||
| 299 | return "Dvorak"; | ||
| 300 | case _GAMEPAD: | ||
| 301 | return "Gamepad"; | ||
| 302 | case _DIABLO: | ||
| 303 | return "Diablo"; | ||
| 304 | case _DIABLOII: | ||
| 305 | return "Diablo II"; | ||
| 306 | case _MOUSE: | ||
| 307 | return alt_name ? "Macros" : "Mouse"; | ||
| 308 | case _MEDIA: | ||
| 309 | return "Media"; | ||
| 310 | case _LOWER: | ||
| 311 | return "Lower"; | ||
| 312 | case _RAISE: | ||
| 313 | return "Raise"; | ||
| 314 | case _ADJUST: | ||
| 315 | return "Adjust"; | ||
| 316 | default: | ||
| 317 | return "Unknown"; | ||
| 318 | } | ||
| 319 | } | ||
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 @@ | |||
| 4 | #pragma once | 4 | #pragma once |
| 5 | #include QMK_KEYBOARD_H | 5 | #include QMK_KEYBOARD_H |
| 6 | 6 | ||
| 7 | #include "eeprom.h" | 7 | #include "eeconfig_users.h" |
| 8 | #include "keyrecords/wrappers.h" | 8 | #include "keyrecords/wrappers.h" |
| 9 | #include "keyrecords/process_records.h" | 9 | #include "keyrecords/process_records.h" |
| 10 | #include "callbacks.h" | 10 | #include "callbacks.h" |
| @@ -30,6 +30,9 @@ | |||
| 30 | #ifdef OS_DETECTION_ENABLE | 30 | #ifdef OS_DETECTION_ENABLE |
| 31 | # include "os_detection.h" | 31 | # include "os_detection.h" |
| 32 | #endif | 32 | #endif |
| 33 | #ifdef UNICODE_COMMON_ENABLE | ||
| 34 | # include "keyrecords/unicode.h" | ||
| 35 | #endif | ||
| 33 | 36 | ||
| 34 | /* Define layer names */ | 37 | /* Define layer names */ |
| 35 | enum userspace_layers { | 38 | enum userspace_layers { |
| @@ -88,14 +91,25 @@ void format_layer_bitmap_string(char* buffer, layer_state_t state, layer_state_t | |||
| 88 | typedef union { | 91 | typedef union { |
| 89 | uint32_t raw; | 92 | uint32_t raw; |
| 90 | struct { | 93 | struct { |
| 91 | bool rgb_layer_change :1; | 94 | bool rgb_layer_change :1; |
| 92 | bool is_overwatch :1; | 95 | bool is_overwatch :1; |
| 93 | bool nuke_switch :1; | 96 | bool nuke_switch :1; |
| 94 | bool swapped_numbers :1; | 97 | bool swapped_numbers :1; |
| 95 | bool rgb_matrix_idle_anim :1; | 98 | bool rgb_matrix_idle_anim :1; |
| 96 | bool autocorrection :1; | 99 | bool mouse_jiggler :1; |
| 100 | uint8_t align_reserved :2; | ||
| 101 | uint8_t oled_brightness :8; | ||
| 102 | uint32_t reserved :15; | ||
| 103 | bool check :1; | ||
| 97 | }; | 104 | }; |
| 98 | } userspace_config_t; | 105 | } userspace_config_t; |
| 99 | // clang-format on | 106 | // clang-format on |
| 100 | 107 | ||
| 108 | _Static_assert(sizeof(userspace_config_t) == sizeof(uint32_t), "Userspace EECONFIG out of spec."); | ||
| 109 | |||
| 101 | extern userspace_config_t userspace_config; | 110 | extern userspace_config_t userspace_config; |
| 111 | |||
| 112 | void set_keyboard_lock(bool enable); | ||
| 113 | bool get_keyboard_lock(void); | ||
| 114 | void toggle_keyboard_lock(void); | ||
| 115 | 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 @@ | |||
| 1 | // Copyright 2023 Christopher Courtney, aka Drashna Jael're (@drashna) <drashna@live.com> | ||
| 2 | // SPDX-License-Identifier: GPL-2.0-or-later | ||
| 3 | |||
| 4 | #include "eeconfig_users.h" | ||
| 5 | #include "eeprom.h" | ||
| 6 | #include "eeconfig.h" | ||
| 7 | #include <string.h> | ||
| 8 | |||
| 9 | #if (TOTAL_EEPROM_BYTE_COUNT - 1) < EECONFIG_SIZE && !defined(KEYBOARD_input_club_ergodox_infinity) | ||
| 10 | # error "More eeprom configured than is available." | ||
| 11 | #endif | ||
| 12 | #if (EECONFIG_USER_DATA_SIZE) != 0 && (EECONFIG_USER_DATA_SIZE) < 4 | ||
| 13 | # error "Not enough EEPROM configured for user config." | ||
| 14 | #endif | ||
| 15 | |||
| 16 | #if (EECONFIG_USER_DATA_SIZE) == 0 | ||
| 17 | # define EECONFIG_USER_TEMP EECONFIG_USER | ||
| 18 | #else | ||
| 19 | # define EECONFIG_USER_TEMP (uint32_t *)(EECONFIG_USER_DATABLOCK) | ||
| 20 | #endif | ||
| 21 | |||
| 22 | void eeconfig_read_user_config(uint32_t *data) { | ||
| 23 | #if (EECONFIG_USER_DATA_SIZE) > 0 | ||
| 24 | if (!eeconfig_is_user_datablock_valid()) { | ||
| 25 | memset(data, 0, 4); | ||
| 26 | } else | ||
| 27 | #endif | ||
| 28 | eeprom_read_block(data, EECONFIG_USER_TEMP, 4); | ||
| 29 | } | ||
| 30 | |||
| 31 | void eeconfig_update_user_config(const uint32_t *data) { | ||
| 32 | eeprom_update_block(data, EECONFIG_USER_TEMP, 4); | ||
| 33 | #if (EECONFIG_USER_DATA_SIZE) > 0 | ||
| 34 | eeprom_update_dword(EECONFIG_USER, (EECONFIG_USER_DATA_VERSION)); | ||
| 35 | #endif | ||
| 36 | } | ||
| 37 | |||
| 38 | void eeconfig_read_user_data(void *data) { | ||
| 39 | #if (EECONFIG_USER_DATA_SIZE) > 4 | ||
| 40 | if (eeconfig_is_user_datablock_valid()) { | ||
| 41 | eeprom_read_block(data, EECONFIG_USER_DATABLOCK + 4, (EECONFIG_USER_DATA_SIZE)-4); | ||
| 42 | } else { | ||
| 43 | memset(data, 0, (EECONFIG_USER_DATA_SIZE)); | ||
| 44 | } | ||
| 45 | #endif | ||
| 46 | } | ||
| 47 | |||
| 48 | void eeconfig_update_user_data(const void *data) { | ||
| 49 | #if (EECONFIG_USER_DATA_SIZE) > 4 | ||
| 50 | eeprom_update_dword(EECONFIG_USER, (EECONFIG_USER_DATA_VERSION)); | ||
| 51 | eeprom_update_block(data, EECONFIG_USER_DATABLOCK + 4, (EECONFIG_USER_DATA_SIZE)-4); | ||
| 52 | #endif | ||
| 53 | } | ||
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 @@ | |||
| 1 | // Copyright 2023 Christopher Courtney, aka Drashna Jael're (@drashna) <drashna@live.com> | ||
| 2 | // SPDX-License-Identifier: GPL-2.0-or-later | ||
| 3 | |||
| 4 | #pragma once | ||
| 5 | |||
| 6 | #include <stdint.h> | ||
| 7 | |||
| 8 | void eeconfig_read_user_config(uint32_t *data); | ||
| 9 | void eeconfig_update_user_config(const uint32_t *data); | ||
| 10 | |||
| 11 | void eeconfig_read_user_data(void *data); | ||
| 12 | 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 @@ | |||
| 1 | // Copyright 2016 Jack Humbert | ||
| 2 | // Copyright 2019 Wojciech Siewierski < wojciech dot siewierski at onet dot pl > | ||
| 3 | // Copyright 2023 Christopher Courtney, aka Drashna Jael're (@drashna) <drashna@live.com> | ||
| 4 | // SPDX-License-Identifier: GPL-2.0-or-later | ||
| 5 | |||
| 6 | #include "keyrecords/dynamic_macros.h" | ||
| 7 | #include "keyrecords/process_records.h" | ||
| 8 | #include "wait.h" | ||
| 9 | #include "debug.h" | ||
| 10 | #include "eeprom.h" | ||
| 11 | #include "eeconfig.h" | ||
| 12 | #include <string.h> | ||
| 13 | |||
| 14 | static uint8_t macro_id = 255; | ||
| 15 | static uint8_t recording_state = STATE_NOT_RECORDING; | ||
| 16 | |||
| 17 | #if EECONFIG_USER_DATA_SIZE < 4 | ||
| 18 | # error "EECONFIG_USER_DATA_SIZE not set. Don't step on others eeprom." | ||
| 19 | #endif | ||
| 20 | #ifndef DYNAMIC_MACRO_EEPROM_BLOCK0_ADDR | ||
| 21 | # define DYNAMIC_MACRO_EEPROM_BLOCK0_ADDR (uint8_t*)(EECONFIG_USER_DATABLOCK + 4) | ||
| 22 | #endif | ||
| 23 | |||
| 24 | dynamic_macro_t dynamic_macros[DYNAMIC_MACRO_COUNT]; | ||
| 25 | _Static_assert((sizeof(dynamic_macros)) <= (EECONFIG_USER_DATA_SIZE - 4), "User Data Size must be large enough to host all macros"); | ||
| 26 | |||
| 27 | __attribute__((weak)) void dynamic_macro_record_start_user(void) {} | ||
| 28 | |||
| 29 | __attribute__((weak)) void dynamic_macro_play_user(uint8_t macro_id) {} | ||
| 30 | |||
| 31 | __attribute__((weak)) void dynamic_macro_record_key_user(uint8_t macro_id, keyrecord_t* record) {} | ||
| 32 | |||
| 33 | __attribute__((weak)) void dynamic_macro_record_end_user(uint8_t macro_id) {} | ||
| 34 | |||
| 35 | /** | ||
| 36 | * @brief Gets the current macro ID | ||
| 37 | * | ||
| 38 | * @return uint8_t | ||
| 39 | */ | ||
| 40 | uint8_t dynamic_macro_get_current_id(void) { | ||
| 41 | return macro_id; | ||
| 42 | } | ||
| 43 | |||
| 44 | /** | ||
| 45 | * @brief Gets the current recording state | ||
| 46 | * | ||
| 47 | * @return uint8_t | ||
| 48 | */ | ||
| 49 | uint8_t dynamic_macro_get_recording_state(void) { | ||
| 50 | return recording_state; | ||
| 51 | } | ||
| 52 | |||
| 53 | /** | ||
| 54 | * Start recording of the dynamic macro. | ||
| 55 | * | ||
| 56 | * @param macro_id[in] The id of macro to be recorded | ||
| 57 | */ | ||
| 58 | bool dynamic_macro_record_start(uint8_t macro_id) { | ||
| 59 | if (macro_id >= (uint8_t)(DYNAMIC_MACRO_COUNT)) { | ||
| 60 | return false; | ||
| 61 | } | ||
| 62 | dprintf("dynamic macro recording: started for slot %d\n", macro_id); | ||
| 63 | |||
| 64 | dynamic_macro_record_start_user(); | ||
| 65 | |||
| 66 | clear_keyboard(); | ||
| 67 | layer_clear(); | ||
| 68 | |||
| 69 | dynamic_macros[macro_id].length = 0; | ||
| 70 | return true; | ||
| 71 | } | ||
| 72 | |||
| 73 | /** | ||
| 74 | * Play the dynamic macro. | ||
| 75 | * | ||
| 76 | * @param macro_id[in] The id of macro to be played | ||
| 77 | */ | ||
| 78 | void dynamic_macro_play(uint8_t macro_id) { | ||
| 79 | if (macro_id >= (uint8_t)(DYNAMIC_MACRO_COUNT)) { | ||
| 80 | return; | ||
| 81 | } | ||
| 82 | |||
| 83 | dprintf("dynamic macro: slot %d playback, length %d\n", macro_id, dynamic_macros[macro_id].length); | ||
| 84 | |||
| 85 | layer_state_t saved_layer_state = layer_state; | ||
| 86 | |||
| 87 | clear_keyboard(); | ||
| 88 | layer_clear(); | ||
| 89 | |||
| 90 | for (uint8_t i = 0; i < dynamic_macros[macro_id].length; ++i) { | ||
| 91 | process_record(&dynamic_macros[macro_id].events[i]); | ||
| 92 | } | ||
| 93 | |||
| 94 | clear_keyboard(); | ||
| 95 | |||
| 96 | layer_state_set(saved_layer_state); | ||
| 97 | |||
| 98 | dynamic_macro_play_user(macro_id); | ||
| 99 | } | ||
| 100 | |||
| 101 | /** | ||
| 102 | * Record a single key in a dynamic macro. | ||
| 103 | * | ||
| 104 | * @param macro_id[in] The start of the used macro buffer. | ||
| 105 | * @param record[in] The current keypress. | ||
| 106 | */ | ||
| 107 | void dynamic_macro_record_key(uint8_t macro_id, keyrecord_t* record) { | ||
| 108 | dynamic_macro_t* macro = &dynamic_macros[macro_id]; | ||
| 109 | uint8_t length = macro->length; | ||
| 110 | |||
| 111 | /* If we've just started recording, ignore all the key releases. */ | ||
| 112 | if (!record->event.pressed && length == 0) { | ||
| 113 | dprintln("dynamic macro: ignoring a leading key-up event"); | ||
| 114 | return; | ||
| 115 | } | ||
| 116 | |||
| 117 | if (length < DYNAMIC_MACRO_SIZE) { | ||
| 118 | macro->events[length] = *record; | ||
| 119 | macro->length = ++length; | ||
| 120 | } else { | ||
| 121 | dynamic_macro_record_key_user(macro_id, record); | ||
| 122 | } | ||
| 123 | |||
| 124 | dprintf("dynamic macro: slot %d length: %d/%d\n", macro_id, length, DYNAMIC_MACRO_SIZE); | ||
| 125 | } | ||
| 126 | |||
| 127 | /** | ||
| 128 | * End recording of the dynamic macro. Essentially just update the | ||
| 129 | * pointer to the end of the macro. | ||
| 130 | */ | ||
| 131 | void dynamic_macro_record_end(uint8_t macro_id) { | ||
| 132 | if (macro_id >= (uint8_t)(DYNAMIC_MACRO_COUNT)) { | ||
| 133 | return; | ||
| 134 | } | ||
| 135 | dynamic_macro_record_end_user(macro_id); | ||
| 136 | |||
| 137 | dynamic_macro_t* macro = &dynamic_macros[macro_id]; | ||
| 138 | uint8_t length = macro->length; | ||
| 139 | |||
| 140 | keyrecord_t* events_begin = &(macro->events[0]); | ||
| 141 | keyrecord_t* events_pointer = &(macro->events[length - 1]); | ||
| 142 | |||
| 143 | dprintf("dynamic_macro: macro length before trimming: %d\n", macro->length); | ||
| 144 | while (events_pointer != events_begin && (events_pointer)->event.pressed) { | ||
| 145 | dprintln("dynamic macro: trimming a trailing key-down event"); | ||
| 146 | --(macro->length); | ||
| 147 | --events_pointer; | ||
| 148 | } | ||
| 149 | |||
| 150 | macro->checksum = dynamic_macro_calc_crc(macro); | ||
| 151 | dynamic_macro_save_eeprom(macro_id); | ||
| 152 | |||
| 153 | dprintf("dynamic macro: slot %d saved, length: %d\n", macro_id, length); | ||
| 154 | } | ||
| 155 | |||
| 156 | bool process_record_dynamic_macro(uint16_t keycode, keyrecord_t* record) { | ||
| 157 | if (STATE_NOT_RECORDING == recording_state) { | ||
| 158 | /* Program key pressed to request programming mode */ | ||
| 159 | if (keycode == DYN_MACRO_PROG && record->event.pressed) { | ||
| 160 | // dynamic_macro_led_blink(); | ||
| 161 | |||
| 162 | recording_state = STATE_RECORD_KEY_PRESSED; | ||
| 163 | dprintf("dynamic macro: programming key pressed, waiting for macro slot selection. %d\n", recording_state); | ||
| 164 | |||
| 165 | return false; | ||
| 166 | } | ||
| 167 | /* Macro key pressed to request macro playback */ | ||
| 168 | if (IS_DYN_KEYCODE(keycode) && record->event.pressed) { | ||
| 169 | dynamic_macro_play(keycode - DYN_MACRO_KEY00); | ||
| 170 | |||
| 171 | return false; | ||
| 172 | } | ||
| 173 | |||
| 174 | /* Non-dynamic macro key, process it elsewhere. */ | ||
| 175 | return true; | ||
| 176 | } else if (STATE_RECORD_KEY_PRESSED == recording_state) { | ||
| 177 | /* Program key pressed again before a macro selector key, cancel macro recording. | ||
| 178 | Blink leds to indicate cancelation. */ | ||
| 179 | if (keycode == DYN_MACRO_PROG && record->event.pressed) { | ||
| 180 | // dynamic_macro_led_blink(); | ||
| 181 | |||
| 182 | recording_state = STATE_NOT_RECORDING; | ||
| 183 | dprintf("dynamic macro: programming key pressed, programming mode canceled. %d\n", recording_state); | ||
| 184 | |||
| 185 | return false; | ||
| 186 | } else if (IS_DYN_KEYCODE(keycode) && record->event.pressed) { | ||
| 187 | macro_id = keycode - DYN_MACRO_KEY00; | ||
| 188 | |||
| 189 | if (dynamic_macro_record_start(macro_id)) { | ||
| 190 | /* Macro slot selected, enter recording state. */ | ||
| 191 | recording_state = STATE_CURRENTLY_RECORDING; | ||
| 192 | } else { | ||
| 193 | recording_state = STATE_NOT_RECORDING; | ||
| 194 | } | ||
| 195 | |||
| 196 | return false; | ||
| 197 | } | ||
| 198 | /* Ignore any non-macro key press while in RECORD_KEY_PRESSED state. */ | ||
| 199 | return false; | ||
| 200 | } else if (STATE_CURRENTLY_RECORDING == recording_state) { | ||
| 201 | /* Program key pressed to request end of macro recording. */ | ||
| 202 | if (keycode == DYN_MACRO_PROG && record->event.pressed) { | ||
| 203 | dynamic_macro_record_end(macro_id); | ||
| 204 | recording_state = STATE_NOT_RECORDING; | ||
| 205 | |||
| 206 | return false; | ||
| 207 | } | ||
| 208 | /* Don't record other macro key presses. */ | ||
| 209 | else if (IS_DYN_KEYCODE(keycode) && record->event.pressed) { | ||
| 210 | dprintln("dynamic macro: playback key ignored in programming mode."); | ||
| 211 | return false; | ||
| 212 | } | ||
| 213 | /* Non-macro keypress that should be recorded */ | ||
| 214 | else { | ||
| 215 | dynamic_macro_record_key(macro_id, record); | ||
| 216 | |||
| 217 | /* Don't output recorded keypress. */ | ||
| 218 | return false; | ||
| 219 | } | ||
| 220 | } | ||
| 221 | |||
| 222 | return true; | ||
| 223 | } | ||
| 224 | |||
| 225 | static inline uint16_t crc16_update(uint16_t crc, uint8_t a) { | ||
| 226 | crc ^= a; | ||
| 227 | for (uint8_t i = 0; i < 8; ++i) { | ||
| 228 | if (crc & 1) | ||
| 229 | crc = (crc >> 1) ^ 0xA001; | ||
| 230 | else | ||
| 231 | crc = (crc >> 1); | ||
| 232 | } | ||
| 233 | return crc; | ||
| 234 | } | ||
| 235 | |||
| 236 | uint16_t dynamic_macro_calc_crc(dynamic_macro_t* macro) { | ||
| 237 | uint16_t crc = 0; | ||
| 238 | uint8_t* data = (uint8_t*)macro; | ||
| 239 | |||
| 240 | for (uint16_t i = 0; i < DYNAMIC_MACRO_CRC_LENGTH; ++i) { | ||
| 241 | crc = crc16_update(crc, *(data++)); | ||
| 242 | } | ||
| 243 | return crc; | ||
| 244 | } | ||
| 245 | |||
| 246 | inline void* dynamic_macro_eeprom_macro_addr(uint8_t macro_id) { | ||
| 247 | return DYNAMIC_MACRO_EEPROM_BLOCK0_ADDR + sizeof(dynamic_macro_t) * macro_id; | ||
| 248 | } | ||
| 249 | |||
| 250 | void dynamic_macro_load_eeprom_all(void) { | ||
| 251 | for (uint8_t i = 0; i < DYNAMIC_MACRO_COUNT; ++i) { | ||
| 252 | dynamic_macro_load_eeprom(i); | ||
| 253 | } | ||
| 254 | } | ||
| 255 | |||
| 256 | void dynamic_macro_load_eeprom(uint8_t macro_id) { | ||
| 257 | dynamic_macro_t* dst = &dynamic_macros[macro_id]; | ||
| 258 | |||
| 259 | eeprom_read_block(dst, dynamic_macro_eeprom_macro_addr(macro_id), sizeof(dynamic_macro_t)); | ||
| 260 | |||
| 261 | /* Validate checksum, ifchecksum is NOT valid for macro, set its length to 0 to prevent its use. */ | ||
| 262 | if (dynamic_macro_calc_crc(dst) != dst->checksum) { | ||
| 263 | dprintf("dynamic macro: slot %d not loaded, checksum mismatch\n", macro_id); | ||
| 264 | dst->length = 0; | ||
| 265 | |||
| 266 | return; | ||
| 267 | } | ||
| 268 | |||
| 269 | dprintf("dynamic macro: slot %d loaded from eeprom, checksum okay\n", macro_id); | ||
| 270 | } | ||
| 271 | |||
| 272 | void dynamic_macro_save_eeprom(uint8_t macro_id) { | ||
| 273 | dynamic_macro_t* src = &dynamic_macros[macro_id]; | ||
| 274 | |||
| 275 | eeprom_update_block(src, dynamic_macro_eeprom_macro_addr(macro_id), sizeof(dynamic_macro_t)); | ||
| 276 | dprintf("dynamic macro: slot %d saved to eeprom\n", macro_id); | ||
| 277 | } | ||
| 278 | |||
| 279 | void dynamic_macro_init(void) { | ||
| 280 | /* zero out macro blocks */ | ||
| 281 | memset(&dynamic_macros, 0, DYNAMIC_MACRO_COUNT * sizeof(dynamic_macro_t)); | ||
| 282 | dynamic_macro_load_eeprom_all(); | ||
| 283 | } | ||
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 @@ | |||
| 1 | // Copyright 2016 Jack Humbert | ||
| 2 | // Copyright 2019 Wojciech Siewierski < wojciech dot siewierski at onet dot pl > | ||
| 3 | // Copyright 2023 Christopher Courtney, aka Drashna Jael're (@drashna) <drashna@live.com> | ||
| 4 | // SPDX-License-Identifier: GPL-2.0-or-later | ||
| 5 | |||
| 6 | #pragma once | ||
| 7 | |||
| 8 | #include "action.h" | ||
| 9 | #include "action_layer.h" | ||
| 10 | |||
| 11 | #ifndef DYNAMIC_MACRO_COUNT | ||
| 12 | # define DYNAMIC_MACRO_COUNT 8 | ||
| 13 | #endif | ||
| 14 | |||
| 15 | #ifndef DYNAMIC_MACRO_SIZE | ||
| 16 | # define DYNAMIC_MACRO_SIZE 64 | ||
| 17 | #endif | ||
| 18 | |||
| 19 | enum dynamic_macro_recording_state { | ||
| 20 | STATE_NOT_RECORDING, | ||
| 21 | STATE_RECORD_KEY_PRESSED, | ||
| 22 | STATE_CURRENTLY_RECORDING, | ||
| 23 | }; | ||
| 24 | |||
| 25 | typedef struct { | ||
| 26 | keyrecord_t events[DYNAMIC_MACRO_SIZE]; | ||
| 27 | uint8_t length; | ||
| 28 | uint16_t checksum; | ||
| 29 | } dynamic_macro_t; | ||
| 30 | |||
| 31 | void dynamic_macro_init(void); | ||
| 32 | bool dynamic_macro_record_start(uint8_t macro_id); | ||
| 33 | void dynamic_macro_play(uint8_t macro_id); | ||
| 34 | void dynamic_macro_record_key(uint8_t macro_id, keyrecord_t* record); | ||
| 35 | void dynamic_macro_record_end(uint8_t macro_id); | ||
| 36 | bool process_record_dynamic_macro(uint16_t keycode, keyrecord_t* record); | ||
| 37 | |||
| 38 | void dynamic_macro_record_start_user(void); | ||
| 39 | void dynamic_macro_play_user(uint8_t macro_id); | ||
| 40 | void dynamic_macro_record_key_user(uint8_t macro_id, keyrecord_t* record); | ||
| 41 | void dynamic_macro_record_end_user(uint8_t macro_id); | ||
| 42 | |||
| 43 | #define DYNAMIC_MACRO_CRC_LENGTH (sizeof(dynamic_macro_t) - sizeof(uint16_t)) | ||
| 44 | #define IS_DYN_KEYCODE(keycode) (keycode >= DYN_MACRO_KEY00 && keycode <= DYN_MACRO_KEY15) | ||
| 45 | |||
| 46 | uint16_t dynamic_macro_calc_crc(dynamic_macro_t* macro); | ||
| 47 | void dynamic_macro_load_eeprom_all(void); | ||
| 48 | void dynamic_macro_load_eeprom(uint8_t macro_id); | ||
| 49 | void dynamic_macro_save_eeprom(uint8_t macro_id); | ||
| 50 | 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 @@ | |||
| 6 | #ifdef OS_DETECTION_ENABLE | 6 | #ifdef OS_DETECTION_ENABLE |
| 7 | # include "os_detection.h" | 7 | # include "os_detection.h" |
| 8 | #endif | 8 | #endif |
| 9 | #ifdef CUSTOM_DYNAMIC_MACROS_ENABLE | ||
| 10 | # include "keyrecords/dynamic_macros.h" | ||
| 11 | #endif | ||
| 9 | 12 | ||
| 10 | uint16_t copy_paste_timer; | 13 | uint16_t copy_paste_timer; |
| 11 | bool host_driver_disabled = false; | ||
| 12 | // Defines actions tor my global custom keycodes. Defined in drashna.h file | 14 | // Defines actions tor my global custom keycodes. Defined in drashna.h file |
| 13 | // Then runs the _keymap's record handier if not processed here | 15 | // Then runs the _keymap's record handier if not processed here |
| 14 | 16 | ||
| @@ -56,29 +58,14 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { | |||
| 56 | #if defined(CUSTOM_POINTING_DEVICE) | 58 | #if defined(CUSTOM_POINTING_DEVICE) |
| 57 | && process_record_pointing(keycode, record) | 59 | && process_record_pointing(keycode, record) |
| 58 | #endif | 60 | #endif |
| 61 | #ifdef CUSTOM_DYNAMIC_MACROS_ENABLE | ||
| 62 | && process_record_dynamic_macro(keycode, record) | ||
| 63 | #endif | ||
| 59 | && true)) { | 64 | && true)) { |
| 60 | return false; | 65 | return false; |
| 61 | } | 66 | } |
| 62 | 67 | ||
| 63 | switch (keycode) { | 68 | switch (keycode) { |
| 64 | case FIRST_DEFAULT_LAYER_KEYCODE ... LAST_DEFAULT_LAYER_KEYCODE: | ||
| 65 | if (record->event.pressed) { | ||
| 66 | uint8_t mods = mod_config(get_mods() | get_oneshot_mods()); | ||
| 67 | if (!mods) { | ||
| 68 | set_single_persistent_default_layer(keycode - FIRST_DEFAULT_LAYER_KEYCODE); | ||
| 69 | #if LAST_DEFAULT_LAYER_KEYCODE > (FIRST_DEFAULT_LAYER_KEYCODE + 3) | ||
| 70 | } else if (mods & MOD_MASK_SHIFT) { | ||
| 71 | set_single_persistent_default_layer(keycode - FIRST_DEFAULT_LAYER_KEYCODE + 4); | ||
| 72 | # if LAST_DEFAULT_LAYER_KEYCODE > (FIRST_DEFAULT_LAYER_KEYCODE + 7) | ||
| 73 | |||
| 74 | } else if (mods & MOD_MASK_CTRL) { | ||
| 75 | set_single_persistent_default_layer(keycode - FIRST_DEFAULT_LAYER_KEYCODE + 8); | ||
| 76 | # endif | ||
| 77 | #endif | ||
| 78 | } | ||
| 79 | } | ||
| 80 | break; | ||
| 81 | |||
| 82 | case VRSN: // Prints firmware version | 69 | case VRSN: // Prints firmware version |
| 83 | if (record->event.pressed) { | 70 | if (record->event.pressed) { |
| 84 | send_string_with_delay_P(PSTR(QMK_KEYBOARD "/" QMK_KEYMAP " @ " QMK_VERSION ", Built on: " QMK_BUILDDATE), TAP_CODE_DELAY); | 71 | 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) { | |||
| 111 | if (record->event.pressed) { | 98 | if (record->event.pressed) { |
| 112 | userspace_config.rgb_layer_change ^= 1; | 99 | userspace_config.rgb_layer_change ^= 1; |
| 113 | dprintf("rgblight layer change [EEPROM]: %u\n", userspace_config.rgb_layer_change); | 100 | dprintf("rgblight layer change [EEPROM]: %u\n", userspace_config.rgb_layer_change); |
| 114 | eeconfig_update_user(userspace_config.raw); | 101 | eeconfig_update_user_config(&userspace_config.raw); |
| 115 | if (userspace_config.rgb_layer_change) { | 102 | if (userspace_config.rgb_layer_change) { |
| 116 | # if defined(CUSTOM_RGB_MATRIX) | 103 | # if defined(CUSTOM_RGB_MATRIX) |
| 117 | rgb_matrix_set_flags(LED_FLAG_UNDERGLOW | LED_FLAG_KEYLIGHT | LED_FLAG_INDICATOR); | 104 | 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) { | |||
| 168 | } | 155 | } |
| 169 | # endif | 156 | # endif |
| 170 | if (is_eeprom_updated) { | 157 | if (is_eeprom_updated) { |
| 171 | eeconfig_update_user(userspace_config.raw); | 158 | eeconfig_update_user_config(&userspace_config.raw); |
| 172 | } | 159 | } |
| 173 | } | 160 | } |
| 174 | break; | 161 | break; |
| 175 | #endif | 162 | #endif |
| 176 | case KEYLOCK: { | 163 | case KEYLOCK: |
| 177 | static host_driver_t *host_driver = 0; | ||
| 178 | |||
| 179 | if (record->event.pressed) { | 164 | if (record->event.pressed) { |
| 180 | if (host_get_driver()) { | 165 | toggle_keyboard_lock(); |
| 181 | host_driver = host_get_driver(); | ||
| 182 | clear_keyboard(); | ||
| 183 | host_set_driver(0); | ||
| 184 | host_driver_disabled = true; | ||
| 185 | } else { | ||
| 186 | host_set_driver(host_driver); | ||
| 187 | host_driver_disabled = false; | ||
| 188 | } | ||
| 189 | } | 166 | } |
| 190 | break; | 167 | break; |
| 191 | } | ||
| 192 | case OLED_LOCK: { | ||
| 193 | #if defined(OLED_ENABLE) && defined(CUSTOM_OLED_DRIVER) | ||
| 194 | extern bool is_oled_locked; | ||
| 195 | if (record->event.pressed) { | ||
| 196 | is_oled_locked = !is_oled_locked; | ||
| 197 | if (is_oled_locked) { | ||
| 198 | oled_on(); | ||
| 199 | } | ||
| 200 | } | ||
| 201 | #endif | ||
| 202 | } break; | ||
| 203 | #if defined(OS_DETECTION_ENABLE) && defined(OS_DETECTION_DEBUG_ENABLE) | 168 | #if defined(OS_DETECTION_ENABLE) && defined(OS_DETECTION_DEBUG_ENABLE) |
| 204 | case STORE_SETUPS: | 169 | case STORE_SETUPS: |
| 205 | if (record->event.pressed) { | 170 | if (record->event.pressed) { |
| @@ -218,5 +183,18 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { | |||
| 218 | 183 | ||
| 219 | __attribute__((weak)) void post_process_record_keymap(uint16_t keycode, keyrecord_t *record) {} | 184 | __attribute__((weak)) void post_process_record_keymap(uint16_t keycode, keyrecord_t *record) {} |
| 220 | void post_process_record_user(uint16_t keycode, keyrecord_t *record) { | 185 | void post_process_record_user(uint16_t keycode, keyrecord_t *record) { |
| 186 | #if defined(OS_DETECTION_ENABLE) && defined(UNICODE_COMMON_ENABLE) | ||
| 187 | switch (keycode) { | ||
| 188 | case QK_MAGIC_SWAP_LCTL_LGUI: | ||
| 189 | case QK_MAGIC_SWAP_RCTL_RGUI: | ||
| 190 | case QK_MAGIC_SWAP_CTL_GUI: | ||
| 191 | case QK_MAGIC_UNSWAP_LCTL_LGUI: | ||
| 192 | case QK_MAGIC_UNSWAP_RCTL_RGUI: | ||
| 193 | case QK_MAGIC_UNSWAP_CTL_GUI: | ||
| 194 | case QK_MAGIC_TOGGLE_CTL_GUI: | ||
| 195 | set_unicode_input_mode_soft(keymap_config.swap_lctl_lgui ? UNICODE_MODE_MACOS : UNICODE_MODE_WINCOMPOSE); | ||
| 196 | break; | ||
| 197 | } | ||
| 198 | #endif | ||
| 221 | post_process_record_keymap(keycode, record); | 199 | post_process_record_keymap(keycode, record); |
| 222 | } | 200 | } |
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 @@ | |||
| 5 | #include "drashna.h" | 5 | #include "drashna.h" |
| 6 | 6 | ||
| 7 | enum userspace_custom_keycodes { | 7 | enum userspace_custom_keycodes { |
| 8 | VRSN = QK_USER, // Prints QMK Firmware and board info | 8 | VRSN = QK_USER, // Prints QMK Firmware and board info |
| 9 | KC_QWERTY, // Sets default layer to QWERTY | 9 | KC_DIABLO_CLEAR, // Clears all Diablo Timers |
| 10 | FIRST_DEFAULT_LAYER_KEYCODE = KC_QWERTY, // Sets default layer to QWERTY | 10 | KC_RGB_T, // Toggles RGB Layer Indication mode |
| 11 | KC_COLEMAK_DH, // Sets default layer to COLEMAK | 11 | RGB_IDL, // RGB Idling animations |
| 12 | KC_COLEMAK, // Sets default layer to COLEMAK | 12 | KC_SECRET_1, // test1 |
| 13 | KC_DVORAK, // Sets default layer to DVORAK | 13 | KC_SECRET_2, // test2 |
| 14 | LAST_DEFAULT_LAYER_KEYCODE = KC_DVORAK, // Sets default layer to WORKMAN | 14 | KC_SECRET_3, // test3 |
| 15 | KC_DIABLO_CLEAR, // Clears all Diablo Timers | 15 | KC_SECRET_4, // test4 |
| 16 | KC_RGB_T, // Toggles RGB Layer Indication mode | 16 | KC_SECRET_5, // test5 |
| 17 | RGB_IDL, // RGB Idling animations | 17 | KC_CCCV, // Hold to copy, tap to paste |
| 18 | KC_SECRET_1, // test1 | 18 | KC_NUKE, // NUCLEAR LAUNCH DETECTED!!! |
| 19 | KC_SECRET_2, // test2 | 19 | UC_FLIP, // (ಠ痊ಠ)┻━┻ |
| 20 | KC_SECRET_3, // test3 | 20 | UC_TABL, // ┬─┬ノ( º _ ºノ) |
| 21 | KC_SECRET_4, // test4 | 21 | UC_SHRG, // ¯\_(ツ)_/¯ |
| 22 | KC_SECRET_5, // test5 | 22 | UC_DISA, // ಠ_ಠ |
| 23 | KC_CCCV, // Hold to copy, tap to paste | ||
| 24 | KC_NUKE, // NUCLEAR LAUNCH DETECTED!!! | ||
| 25 | UC_FLIP, // (ಠ痊ಠ)┻━┻ | ||
| 26 | UC_TABL, // ┬─┬ノ( º _ ºノ) | ||
| 27 | UC_SHRG, // ¯\_(ツ)_/¯ | ||
| 28 | UC_DISA, // ಠ_ಠ | ||
| 29 | UC_IRNY, | 23 | UC_IRNY, |
| 30 | UC_CLUE, | 24 | UC_CLUE, |
| 31 | KEYLOCK, // Locks keyboard by unmounting driver | 25 | KEYLOCK, // Locks keyboard by unmounting driver |
| @@ -40,11 +34,33 @@ enum userspace_custom_keycodes { | |||
| 40 | KC_COMIC, | 34 | KC_COMIC, |
| 41 | KC_ACCEL, | 35 | KC_ACCEL, |
| 42 | OLED_LOCK, | 36 | OLED_LOCK, |
| 37 | OLED_BRIGHTNESS_INC, | ||
| 38 | OLED_BRIGHTNESS_DEC, | ||
| 43 | 39 | ||
| 44 | STORE_SETUPS, | 40 | STORE_SETUPS, |
| 45 | PRINT_SETUPS, | 41 | PRINT_SETUPS, |
| 46 | 42 | ||
| 47 | USER_SAFE_RANGE, // use "NEWPLACEHOLDER for keymap specific codes | 43 | PD_JIGGLER, |
| 44 | |||
| 45 | DYN_MACRO_PROG, | ||
| 46 | DYN_MACRO_KEY00, | ||
| 47 | DYN_MACRO_KEY01, | ||
| 48 | DYN_MACRO_KEY02, | ||
| 49 | DYN_MACRO_KEY03, | ||
| 50 | DYN_MACRO_KEY04, | ||
| 51 | DYN_MACRO_KEY05, | ||
| 52 | DYN_MACRO_KEY06, | ||
| 53 | DYN_MACRO_KEY07, | ||
| 54 | DYN_MACRO_KEY08, | ||
| 55 | DYN_MACRO_KEY09, | ||
| 56 | DYN_MACRO_KEY10, | ||
| 57 | DYN_MACRO_KEY11, | ||
| 58 | DYN_MACRO_KEY12, | ||
| 59 | DYN_MACRO_KEY13, | ||
| 60 | DYN_MACRO_KEY14, | ||
| 61 | DYN_MACRO_KEY15, | ||
| 62 | |||
| 63 | USER_SAFE_RANGE, | ||
| 48 | }; | 64 | }; |
| 49 | 65 | ||
| 50 | bool process_record_secrets(uint16_t keycode, keyrecord_t *record); | 66 | bool process_record_secrets(uint16_t keycode, keyrecord_t *record); |
| @@ -69,27 +85,15 @@ bool process_record_unicode(uint16_t keycode, keyrecord_t *record); | |||
| 69 | #define KC_SEC4 KC_SECRET_4 | 85 | #define KC_SEC4 KC_SECRET_4 |
| 70 | #define KC_SEC5 KC_SECRET_5 | 86 | #define KC_SEC5 KC_SECRET_5 |
| 71 | 87 | ||
| 88 | #define KC_QWERTY DF(_QWERTY) | ||
| 89 | #define KC_COLEMAK_DH DF(_COLEMAK_DH) | ||
| 90 | #define KC_COLEMAK DF(_COLEMAK) | ||
| 91 | #define KC_DVORAK DF(_DVORAK) | ||
| 92 | |||
| 72 | #define QWERTY KC_QWERTY | 93 | #define QWERTY KC_QWERTY |
| 73 | #define DVORAK KC_DVORAK | 94 | #define DVORAK KC_DVORAK |
| 74 | #define COLEMAK KC_COLEMAK | 95 | #define COLEMAK KC_COLEMAK |
| 75 | #define COLEMAKDH KC_COLEMAK_DH | 96 | #define CLMKDH KC_COLEMAK_DH |
| 76 | |||
| 77 | #define DEFLYR1 FIRST_DEFAULT_LAYER_KEYCODE | ||
| 78 | #define DEFLYR2 (FIRST_DEFAULT_LAYER_KEYCODE + 1) | ||
| 79 | #define DEFLYR3 (FIRST_DEFAULT_LAYER_KEYCODE + 2) | ||
| 80 | #define DEFLYR4 (FIRST_DEFAULT_LAYER_KEYCODE + 3) | ||
| 81 | #if LAST_DEFAULT_LAYER_KEYCODE > (FIRST_DEFAULT_LAYER_KEYCODE + 3) | ||
| 82 | # define DEFLYR5 (FIRST_DEFAULT_LAYER_KEYCODE + 4) | ||
| 83 | # define DEFLYR6 (FIRST_DEFAULT_LAYER_KEYCODE + 5) | ||
| 84 | # define DEFLYR7 (FIRST_DEFAULT_LAYER_KEYCODE + 6) | ||
| 85 | # define DEFLYR8 (FIRST_DEFAULT_LAYER_KEYCODE + 7) | ||
| 86 | # if LAST_DEFAULT_LAYER_KEYCODE > (FIRST_DEFAULT_LAYER_KEYCODE + 7) | ||
| 87 | # define DEFLYR9 (FIRST_DEFAULT_LAYER_KEYCODE + 8) | ||
| 88 | # define DEFLYR10 (FIRST_DEFAULT_LAYER_KEYCODE + 9) | ||
| 89 | # define DEFLYR11 (FIRST_DEFAULT_LAYER_KEYCODE + 10) | ||
| 90 | # define DEFLYR12 (FIRST_DEFAULT_LAYER_KEYCODE + 11) | ||
| 91 | # endif | ||
| 92 | #endif | ||
| 93 | 97 | ||
| 94 | #ifdef SWAP_HANDS_ENABLE | 98 | #ifdef SWAP_HANDS_ENABLE |
| 95 | # define KC_C1R3 SH_T(KC_TAB) | 99 | # define KC_C1R3 SH_T(KC_TAB) |
| @@ -140,3 +144,7 @@ We use custom codes here, so we can substitute the right stuff | |||
| 140 | # define KC_D3_3 KC_3 | 144 | # define KC_D3_3 KC_3 |
| 141 | # define KC_D3_4 KC_4 | 145 | # define KC_D3_4 KC_4 |
| 142 | #endif // TAP_DANCE_ENABLE | 146 | #endif // TAP_DANCE_ENABLE |
| 147 | |||
| 148 | #define OL_LOCK OLED_LOCK | ||
| 149 | #define OL_BINC OLED_BRIGHTNESS_INC | ||
| 150 | #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 @@ | |||
| 5 | 5 | ||
| 6 | #ifdef TAPPING_TERM_PER_KEY | 6 | #ifdef TAPPING_TERM_PER_KEY |
| 7 | __attribute__((weak)) uint16_t get_tapping_term(uint16_t keycode, keyrecord_t *record) { | 7 | __attribute__((weak)) uint16_t get_tapping_term(uint16_t keycode, keyrecord_t *record) { |
| 8 | |||
| 8 | switch (keycode) { | 9 | switch (keycode) { |
| 9 | case BK_LWER: | 10 | case BK_LWER: |
| 10 | return TAPPING_TERM + 25; | 11 | return TAPPING_TERM + 25; |
| 12 | case QK_MOD_TAP ... QK_MOD_TAP_MAX: | ||
| 13 | if (QK_MOD_TAP_GET_MODS(keycode) & MOD_LGUI) { | ||
| 14 | return 300; | ||
| 15 | } | ||
| 11 | default: | 16 | default: |
| 12 | return TAPPING_TERM; | 17 | return TAPPING_TERM; |
| 13 | } | 18 | } |
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) { | |||
| 434 | void keyboard_post_init_unicode(void) { | 434 | void keyboard_post_init_unicode(void) { |
| 435 | unicode_input_mode_init(); | 435 | unicode_input_mode_init(); |
| 436 | } | 436 | } |
| 437 | |||
| 438 | /** | ||
| 439 | * @brief Set the unicode input mode without extra functionality | ||
| 440 | * | ||
| 441 | * @param input_mode | ||
| 442 | */ | ||
| 443 | void set_unicode_input_mode_soft(uint8_t input_mode) { | ||
| 444 | unicode_config.input_mode = input_mode; | ||
| 445 | unicode_input_mode_set_kb(input_mode); | ||
| 446 | } | ||
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 { | |||
| 18 | 18 | ||
| 19 | extern uint8_t unicode_typing_mode; | 19 | extern uint8_t unicode_typing_mode; |
| 20 | extern const PROGMEM char unicode_mode_str[UNCODES_MODE_END][13]; | 20 | extern const PROGMEM char unicode_mode_str[UNCODES_MODE_END][13]; |
| 21 | 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 | |||
| 260 | #define _________________ADJUST_L3_________________ RGB_RMOD,RGB_HUD,RGB_SAD, RGB_VAD, KC_RGB_T | 260 | #define _________________ADJUST_L3_________________ RGB_RMOD,RGB_HUD,RGB_SAD, RGB_VAD, KC_RGB_T |
| 261 | 261 | ||
| 262 | #define _________________ADJUST_R1_________________ KC_SEC1, KC_SEC2, KC_SEC3, KC_SEC4, KC_SEC5 | 262 | #define _________________ADJUST_R1_________________ KC_SEC1, KC_SEC2, KC_SEC3, KC_SEC4, KC_SEC5 |
| 263 | #define _________________ADJUST_R2_________________ CG_SWAP, DEFLYR1, DEFLYR2, DEFLYR3, DEFLYR4 | 263 | #define _________________ADJUST_R2_________________ CG_SWAP, QWERTY, CLMKDH, COLEMAK, DVORAK |
| 264 | #define _________________ADJUST_R3_________________ MG_NKRO, KC_MUTE, KC_VOLD, KC_VOLU, KC_MNXT | 264 | #define _________________ADJUST_R3_________________ MG_NKRO, KC_MUTE, KC_VOLD, KC_VOLU, KC_MNXT |
| 265 | 265 | ||
| 266 | // clang-format on | 266 | // 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 @@ | |||
| 3 | // additional fonts from | 3 | // additional fonts from |
| 4 | // https://github.com/datacute/TinyOLED-Fonts | 4 | // https://github.com/datacute/TinyOLED-Fonts |
| 5 | 5 | ||
| 6 | #if __has_include("oled_font.h") | 6 | #include "progmem.h" |
| 7 | # include "oled_font.h" | ||
| 8 | #else | ||
| 9 | |||
| 10 | // additional fonts from | ||
| 11 | // https://github.com/datacute/TinyOLED-Fonts | ||
| 12 | |||
| 13 | # include "progmem.h" | ||
| 14 | 7 | ||
| 15 | // clang-format off | 8 | // clang-format off |
| 16 | static const unsigned char font[] PROGMEM = { | 9 | static const unsigned char font[] PROGMEM = { |
| @@ -895,7 +888,7 @@ static const unsigned char font[] PROGMEM = { | |||
| 895 | 0x38, 0x44, 0x44, 0x28, 0x7F, 0x00, | 888 | 0x38, 0x44, 0x44, 0x28, 0x7F, 0x00, |
| 896 | 0x38, 0x54, 0x54, 0x54, 0x18, 0x00, | 889 | 0x38, 0x54, 0x54, 0x54, 0x18, 0x00, |
| 897 | 0x00, 0x08, 0x7E, 0x09, 0x02, 0x00, | 890 | 0x00, 0x08, 0x7E, 0x09, 0x02, 0x00, |
| 898 | 0x18, 0x24, 0x24, 0x1C, 0x78, 0x00, | 891 | 0x18, 0xA4, 0xA4, 0x9C, 0x78, 0x00, |
| 899 | 0x7F, 0x08, 0x04, 0x04, 0x78, 0x00, | 892 | 0x7F, 0x08, 0x04, 0x04, 0x78, 0x00, |
| 900 | 0x00, 0x44, 0x7D, 0x40, 0x00, 0x00, | 893 | 0x00, 0x44, 0x7D, 0x40, 0x00, 0x00, |
| 901 | 0x20, 0x40, 0x40, 0x3D, 0x00, 0x00, | 894 | 0x20, 0x40, 0x40, 0x3D, 0x00, 0x00, |
| @@ -904,8 +897,8 @@ static const unsigned char font[] PROGMEM = { | |||
| 904 | 0x7C, 0x04, 0x78, 0x04, 0x78, 0x00, | 897 | 0x7C, 0x04, 0x78, 0x04, 0x78, 0x00, |
| 905 | 0x7C, 0x08, 0x04, 0x04, 0x78, 0x00, | 898 | 0x7C, 0x08, 0x04, 0x04, 0x78, 0x00, |
| 906 | 0x38, 0x44, 0x44, 0x44, 0x38, 0x00, | 899 | 0x38, 0x44, 0x44, 0x44, 0x38, 0x00, |
| 907 | 0x7C, 0x18, 0x24, 0x24, 0x18, 0x00, | 900 | 0xFC, 0x18, 0x24, 0x24, 0x18, 0x00, |
| 908 | 0x18, 0x24, 0x24, 0x18, 0x7C, 0x00, | 901 | 0x18, 0x24, 0x24, 0x18, 0xFC, 0x00, |
| 909 | 0x7C, 0x08, 0x04, 0x04, 0x08, 0x00, | 902 | 0x7C, 0x08, 0x04, 0x04, 0x08, 0x00, |
| 910 | 0x48, 0x54, 0x54, 0x54, 0x24, 0x00, | 903 | 0x48, 0x54, 0x54, 0x54, 0x24, 0x00, |
| 911 | 0x04, 0x04, 0x3F, 0x44, 0x24, 0x00, | 904 | 0x04, 0x04, 0x3F, 0x44, 0x24, 0x00, |
| @@ -923,139 +916,27 @@ static const unsigned char font[] PROGMEM = { | |||
| 923 | # endif | 916 | # endif |
| 924 | 917 | ||
| 925 | // top Logo section | 918 | // top Logo section |
| 926 | # if defined(OLED_LOGO_GMK_BAD) | ||
| 927 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | ||
| 928 | 0x80, 0xC0, 0xE0, 0xF0, 0xF0, 0x70, | ||
| 929 | 0x38, 0x38, 0x38, 0x78, 0x70, 0xF0, | ||
| 930 | 0xE0, 0xE0, 0x80, 0x00, 0x00, 0x00, | ||
| 931 | 0x00, 0x00, 0x00, 0x80, 0xF0, 0xF8, | ||
| 932 | 0xF8, 0xF8, 0xF8, 0x00, 0x00, 0x00, | ||
| 933 | 0x80, 0xE0, 0xF8, 0xF8, 0xF8, 0xF8, | ||
| 934 | 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, | ||
| 935 | 0x80, 0xF8, 0xF8, 0xF8, 0x38, 0x00, | ||
| 936 | 0x80, 0xE0, 0xF0, 0xF8, 0x78, 0x38, | ||
| 937 | 0x08, 0x08, 0x00, 0x00, 0x00, 0x00, | ||
| 938 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | ||
| 939 | 0x80, 0xF8, 0xF8, 0xF8, 0x38, 0x38, | ||
| 940 | 0x38, 0xF8, 0xF0, 0xF0, 0xE0, 0x00, | ||
| 941 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | ||
| 942 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | ||
| 943 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | ||
| 944 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | ||
| 945 | 0x00, 0x00, 0x00, 0x80, 0xFC, 0xFC, | ||
| 946 | 0xFC, 0x1C, 0x00, 0x00, 0x00, 0x00, | ||
| 947 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | ||
| 948 | # elif defined(OLED_LOGO_HUE_MANITEE) | ||
| 949 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | ||
| 950 | 0x00, 0x00, 0x00, 0x80, 0xC0, 0xC0, | ||
| 951 | 0x90, 0x70, 0xE8, 0xA8, 0xE4, 0xC4, | ||
| 952 | 0xC4, 0xA0, 0xE4, 0xB0, 0xDC, 0xE4, | ||
| 953 | 0xFC, 0xFC, 0xFC, 0xFC, 0x3C, 0x3C, | ||
| 954 | 0xFC, 0xF8, 0xF0, 0xF0, 0xE0, 0x00, | ||
| 955 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | ||
| 956 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | ||
| 957 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | ||
| 958 | 0x00, 0x00, 0x00, 0x00, 0xF8, 0xF8, | ||
| 959 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | ||
| 960 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | 919 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, |
| 961 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | 920 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, |
| 962 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | 921 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, |
| 963 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | 922 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, |
| 964 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | 923 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, |
| 965 | 0xF8, 0xF8, 0x00, 0x00, 0x00, 0x00, | ||
| 966 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | 924 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, |
| 967 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | 925 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, |
| 968 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | 926 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, |
| 969 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | 927 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, |
| 970 | # elif defined(OLED_LOGO_CORNE) | ||
| 971 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | 928 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, |
| 972 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | 929 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, |
| 973 | 0x00, 0x00, 0x00, 0x00, 0xC0, 0xE0, | ||
| 974 | 0xF0, 0xF8, 0xF8, 0x18, 0x00, 0xC0, | ||
| 975 | 0xF0, 0xFC, 0xFE, 0xFF, 0xFF, 0xFF, | ||
| 976 | 0xFF, 0xFF, 0xFF, 0xFF, 0x7E, 0x00, | ||
| 977 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | 930 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, |
| 978 | 0x00, 0x00, 0x80, 0xC0, 0xE0, 0xE0, | ||
| 979 | 0xE0, 0xE0, 0xE0, 0xE0, 0xE0, 0xE0, | ||
| 980 | 0xC0, 0x80, 0x00, 0x00, 0x00, 0x00, | ||
| 981 | 0x80, 0xC0, 0xE0, 0xE0, 0xE0, 0xE0, | ||
| 982 | 0xE0, 0xE0, 0xE0, 0xE0, 0xC0, 0x80, | ||
| 983 | 0x00, 0x00, 0x00, 0xE0, 0xE0, 0xC0, | ||
| 984 | 0xC0, 0xE0, 0xE0, 0xE0, 0xE0, 0x00, | ||
| 985 | 0x00, 0xE0, 0xE0, 0xC0, 0xC0, 0xE0, | ||
| 986 | 0xE0, 0xE0, 0xE0, 0xE0, 0xC0, 0x80, | ||
| 987 | 0x00, 0x00, 0x00, 0x00, 0x80, 0xC0, | ||
| 988 | 0xE0, 0xE0, 0xE0, 0xE0, 0xE0, 0xE0, | ||
| 989 | 0xE0, 0xE0, 0xC0, 0x80, 0x00, 0x00, | ||
| 990 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | 931 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, |
| 991 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | 932 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, |
| 992 | # elif defined(OLED_LOGO_LOOSE) | ||
| 993 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | 933 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, |
| 994 | 0x00, 0x00, 0xC0, 0xE0, 0xF0, 0xF8, | ||
| 995 | 0xF8, 0xF8, 0xF8, 0xF8, 0xF8, 0x00, | ||
| 996 | 0xFC, 0xFE, 0xFE, 0xFE, 0xFE, 0xFE, | ||
| 997 | 0x02, 0xF9, 0x01, 0x01, 0x05, 0x09, | ||
| 998 | 0x11, 0x22, 0x06, 0xFE, 0xFE, 0xFE, | ||
| 999 | 0xFE, 0xFE, 0xFE, 0xFE, 0x46, 0x46, | ||
| 1000 | 0x44, 0x44, 0x45, 0x44, 0x29, 0x28, | ||
| 1001 | 0x2A, 0x28, 0x11, 0x13, 0x05, 0x07, | ||
| 1002 | 0x05, 0x07, 0x05, 0x07, 0x05, 0x07, | ||
| 1003 | 0xE5, 0xE7, 0xE5, 0x07, 0x05, 0x07, | ||
| 1004 | 0x05, 0x07, 0x05, 0x07, 0x05, 0x07, | ||
| 1005 | 0x85, 0xC7, 0xE5, 0xE7, 0xE5, 0xE7, | ||
| 1006 | 0xE5, 0xE7, 0xE5, 0xC7, 0x85, 0x07, | ||
| 1007 | 0x85, 0xC7, 0xE5, 0xE7, 0xE5, 0xE7, | ||
| 1008 | 0xE5, 0xE7, 0xE5, 0xC7, 0x85, 0x07, | ||
| 1009 | 0x85, 0xC7, 0xE5, 0xE7, 0xE5, 0xE7, | ||
| 1010 | 0xE5, 0xE7, 0xE5, 0xE7, 0xE5, 0x07, | ||
| 1011 | 0xE5, 0xE7, 0xE5, 0xE7, 0xE5, 0xE7, | ||
| 1012 | 0xE5, 0xE7, 0xE5, 0xE7, 0xE5, 0x00, | ||
| 1013 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | 934 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, |
| 1014 | # elif defined(OLED_LOGO_SKEEB) | ||
| 1015 | 0xC0, 0x20, 0x10, 0x08, 0x04, 0x02, | ||
| 1016 | 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, | ||
| 1017 | 0x01, 0x01, 0x03, 0x07, 0x0F, 0x1F, | ||
| 1018 | 0x3F, 0x7F, 0xFF, 0xFF, 0xFF, 0xFF, | ||
| 1019 | 0xFF, 0xFF, 0xFF, 0xFF, 0x01, 0x01, | ||
| 1020 | 0xFF, 0xFF, 0x01, 0x01, 0xFF, 0xFF, | ||
| 1021 | 0x01, 0x01, 0xFF, 0xFF, 0x19, 0x19, | ||
| 1022 | 0x99, 0x99, 0x99, 0x99, 0x99, 0x99, | ||
| 1023 | 0x01, 0x01, 0xFF, 0xFF, 0x81, 0x81, | ||
| 1024 | 0x99, 0x99, 0x99, 0x99, 0x99, 0x99, | ||
| 1025 | 0x19, 0x19, 0xFF, 0xFF, 0xF9, 0xF9, | ||
| 1026 | 0xF9, 0xF9, 0x01, 0x01, 0xF9, 0xF9, | ||
| 1027 | 0xF9, 0xF9, 0xFF, 0xFF, 0x99, 0x99, | ||
| 1028 | 0x99, 0x99, 0x99, 0x99, 0x99, 0x99, | ||
| 1029 | 0xF9, 0xF9, 0xFF, 0xFF, 0x19, 0x19, | ||
| 1030 | 0x99, 0x99, 0x99, 0x99, 0x99, 0x99, | ||
| 1031 | 0x67, 0x67, 0xFF, 0xFF, 0xFF, 0xFF, | ||
| 1032 | 0xFF, 0xFF, 0xFF, 0xFF, 0x7F, 0x3F, | ||
| 1033 | 0x1F, 0x0F, 0x07, 0x03, 0x01, 0x01, | ||
| 1034 | 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, | ||
| 1035 | 0x02, 0x04, 0x08, 0x10, 0x20, 0xC0, | ||
| 1036 | # else | ||
| 1037 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | 935 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, |
| 1038 | 0x40, 0x40, 0x40, 0xF0, 0xF8, 0xF8, | ||
| 1039 | 0xFF, 0x38, 0xFF, 0xF8, 0xF8, 0x3F, | ||
| 1040 | 0xF8, 0xF8, 0xFF, 0x38, 0xFF, 0xF8, | ||
| 1041 | 0xF8, 0xF0, 0x40, 0x40, 0x40, 0x00, | ||
| 1042 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, | ||
| 1043 | 0xC0, 0xC0, 0xC0, 0x80, 0x00, 0x00, | ||
| 1044 | 0xC0, 0xC0, 0x80, 0x00, 0x00, 0x00, | ||
| 1045 | 0x80, 0xC0, 0xC0, 0x00, 0xC0, 0xC0, | ||
| 1046 | 0x00, 0x00, 0x80, 0xC0, 0xC0, 0x00, | ||
| 1047 | 0x00, 0x00, 0x00, 0x00, 0xC0, 0xC0, | ||
| 1048 | 0xC0, 0xC0, 0xC0, 0x00, 0xC0, 0xC0, | ||
| 1049 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | 936 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, |
| 1050 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | 937 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, |
| 1051 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | 938 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, |
| 1052 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | 939 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, |
| 1053 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | ||
| 1054 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | ||
| 1055 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | ||
| 1056 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | ||
| 1057 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | ||
| 1058 | #endif | ||
| 1059 | 940 | ||
| 1060 | // First icon section | 941 | // First icon section |
| 1061 | 0xE0, 0xF0, 0xF0, 0xF0, 0xE0, 0xEC, | 942 | 0xE0, 0xF0, 0xF0, 0xF0, 0xE0, 0xEC, |
| @@ -1071,272 +952,49 @@ static const unsigned char font[] PROGMEM = { | |||
| 1071 | 0x14, 0x36, 0x00, 0x36, 0x77, 0x77, | 952 | 0x14, 0x36, 0x00, 0x36, 0x77, 0x77, |
| 1072 | 953 | ||
| 1073 | // middle logo section | 954 | // middle logo section |
| 1074 | # if defined(OLED_LOGO_GMK_BAD) | ||
| 1075 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x3C, | ||
| 1076 | 0xFF, 0xFF, 0xFF, 0xC1, 0x80, 0x00, | ||
| 1077 | 0x00, 0x38, 0x38, 0xB8, 0xB8, 0xF9, | ||
| 1078 | 0xF9, 0xF8, 0x38, 0x00, 0x00, 0x00, | ||
| 1079 | 0x00, 0xC0, 0xF8, 0xFF, 0xFF, 0x1F, | ||
| 1080 | 0x01, 0x3F, 0xFF, 0xFF, 0xF0, 0xFE, | ||
| 1081 | 0x7F, 0x0F, 0x03, 0xFF, 0xFF, 0xFF, | ||
| 1082 | 0xFF, 0x00, 0x00, 0x00, 0x00, 0x80, | ||
| 1083 | 0xFF, 0xFF, 0xFF, 0x3F, 0x1E, 0x7F, | ||
| 1084 | 0xFF, 0xFF, 0xF3, 0xC1, 0x80, 0x00, | ||
| 1085 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | ||
| 1086 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, | ||
| 1087 | 0xFF, 0xFF, 0xFF, 0x3F, 0x1C, 0x1C, | ||
| 1088 | 0x9C, 0xFF, 0xFF, 0xF3, 0xE1, 0x00, | ||
| 1089 | 0x00, 0x00, 0x00, 0xF0, 0xFC, 0xFE, | ||
| 1090 | 0xFF, 0x0F, 0x07, 0x07, 0x8E, 0xFF, | ||
| 1091 | 0xFF, 0xFF, 0x3F, 0x00, 0x00, 0x00, | ||
| 1092 | 0x00, 0xF0, 0xFC, 0xFE, 0xFF, 0x8F, | ||
| 1093 | 0x07, 0x07, 0x8E, 0xFF, 0xFF, 0xFF, | ||
| 1094 | 0x3F, 0x00, 0x00, 0x00, 0x00, 0x80, | ||
| 1095 | 0xC0, 0x80, 0x00, 0x00, 0x00, 0x00, | ||
| 1096 | # elif defined(OLED_LOGO_HUE_MANITEE) | ||
| 1097 | 0x00, 0x00, 0x00, 0x00, 0x00, 0xF0, | ||
| 1098 | 0xFC, 0xF6, 0xF7, 0xEF, 0xFF, 0x87, | ||
| 1099 | 0x1F, 0x1F, 0x1F, 0x1F, 0x1F, 0x1F, | ||
| 1100 | 0x1F, 0x1F, 0x1F, 0xFF, 0xFF, 0xFF, | ||
| 1101 | 0xFF, 0x07, 0x1F, 0x1F, 0x19, 0x15, | ||
| 1102 | 0xF7, 0x16, 0x1A, 0x1B, 0x16, 0x07, | ||
| 1103 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | ||
| 1104 | 0x00, 0x00, 0x0C, 0x0C, 0x33, 0x33, | ||
| 1105 | 0x33, 0x33, 0x33, 0x33, 0xC0, 0xC0, | ||
| 1106 | 0x00, 0x00, 0x03, 0x03, 0xFF, 0xFF, | ||
| 1107 | 0x03, 0x03, 0x00, 0x00, 0xC0, 0xC0, | ||
| 1108 | 0x00, 0x00, 0x00, 0xFC, 0xFC, 0x03, | ||
| 1109 | 0x03, 0x03, 0x03, 0x03, 0x03, 0xFC, | ||
| 1110 | 0xFC, 0x00, 0x00, 0x00, 0xFC, 0xFC, | ||
| 1111 | 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, | ||
| 1112 | 0xC0, 0xC0, 0x00, 0x00, 0x00, 0x00, | ||
| 1113 | 0xFF, 0xFF, 0x30, 0x30, 0xCC, 0xCC, | ||
| 1114 | 0x03, 0x03, 0x00, 0x00, 0x00, 0x00, | ||
| 1115 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | ||
| 1116 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | ||
| 1117 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | ||
| 1118 | # elif defined(OLED_LOGO_CORNE) | ||
| 1119 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | ||
| 1120 | 0x00, 0x00, 0x00, 0xF8, 0xFC, 0xFE, | ||
| 1121 | 0xFF, 0xE0, 0x00, 0xFF, 0xFF, 0xFF, | ||
| 1122 | 0xFF, 0xFF, 0xFF, 0x80, 0xFF, 0xFF, | ||
| 1123 | 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, | ||
| 1124 | 0xFF, 0x1F, 0x07, 0x01, 0x00, 0x00, | ||
| 1125 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | ||
| 1126 | 0x00, 0xFF, 0xFF, 0xFF, 0x81, 0x00, | ||
| 1127 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x81, | ||
| 1128 | 0xC3, 0xC3, 0xC3, 0x00, 0x00, 0xFF, | ||
| 1129 | 0xFF, 0xFF, 0x81, 0x00, 0x00, 0x00, | ||
| 1130 | 0x00, 0x00, 0x00, 0x81, 0xFF, 0xFF, | ||
| 1131 | 0xFF, 0x00, 0x00, 0xFF, 0xFF, 0xFF, | ||
| 1132 | 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, | ||
| 1133 | 0x00, 0xFF, 0xFF, 0xFF, 0x01, 0x00, | ||
| 1134 | 0x00, 0x00, 0x00, 0x01, 0xFF, 0xFF, | ||
| 1135 | 0xFF, 0x00, 0x00, 0xFF, 0xFF, 0xFF, | ||
| 1136 | 0x9D, 0x1C, 0x1C, 0x1C, 0x1C, 0x1C, | ||
| 1137 | 0x1C, 0x9D, 0xDF, 0xDF, 0xDF, 0x00, | ||
| 1138 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | ||
| 1139 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | ||
| 1140 | # elif defined(OLED_LOGO_LOOSE) | ||
| 1141 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | ||
| 1142 | 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, | ||
| 1143 | 0xFF, 0xFF, 0xE3, 0xC1, 0xC1, 0x00, | ||
| 1144 | 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, | ||
| 1145 | 0x00, 0xFF, 0x00, 0x00, 0x80, 0x00, | ||
| 1146 | 0x1C, 0x3E, 0x7F, 0xFF, 0xFF, 0xFF, | ||
| 1147 | 0xFF, 0xFF, 0xFF, 0xFF, 0x22, 0x22, | ||
| 1148 | 0x22, 0x22, 0x22, 0x22, 0x22, 0x22, | ||
| 1149 | 0x22, 0x22, 0x22, 0x14, 0x14, 0x14, | ||
| 1150 | 0x14, 0x14, 0x08, 0x08, 0x00, 0x00, | ||
| 1151 | 0xFF, 0xFF, 0xFF, 0x80, 0x80, 0x80, | ||
| 1152 | 0x80, 0x80, 0x80, 0x80, 0x80, 0x00, | ||
| 1153 | 0xFF, 0xFF, 0xFF, 0xFF, 0x80, 0xBE, | ||
| 1154 | 0x80, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, | ||
| 1155 | 0xFF, 0xFF, 0xFF, 0xFF, 0x81, 0xBD, | ||
| 1156 | 0x81, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, | ||
| 1157 | 0x8F, 0x9F, 0x9C, 0x9C, 0x9C, 0x9C, | ||
| 1158 | 0x9C, 0x9C, 0x9C, 0xFC, 0xF8, 0x00, | ||
| 1159 | 0xFF, 0xFF, 0xFF, 0x9C, 0x9C, 0x9C, | ||
| 1160 | 0x9C, 0x9C, 0x9C, 0x80, 0x80, 0x00, | ||
| 1161 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | ||
| 1162 | # elif defined(OLED_LOGO_SKEEB) | ||
| 1163 | 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, | ||
| 1164 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | ||
| 1165 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | ||
| 1166 | 0x00, 0x00, 0x00, 0x01, 0x03, 0x07, | ||
| 1167 | 0x0F, 0x0F, 0x0F, 0x0F, 0x08, 0x08, | ||
| 1168 | 0x0F, 0x0F, 0x0E, 0x0E, 0x0F, 0x0F, | ||
| 1169 | 0x08, 0x08, 0x0F, 0x0F, 0x08, 0x08, | ||
| 1170 | 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, | ||
| 1171 | 0x08, 0x08, 0x0F, 0x0F, 0x09, 0x09, | ||
| 1172 | 0x09, 0x09, 0xF9, 0xF9, 0x09, 0x09, | ||
| 1173 | 0x08, 0x08, 0x0F, 0x0F, 0x0F, 0x0F, | ||
| 1174 | 0x0F, 0x0F, 0x08, 0x08, 0x0F, 0x0F, | ||
| 1175 | 0x0F, 0x0F, 0x0F, 0x0F, 0x09, 0x09, | ||
| 1176 | 0x09, 0x09, 0x09, 0x09, 0x09, 0x09, | ||
| 1177 | 0x09, 0x09, 0x0F, 0x0F, 0x08, 0x08, | ||
| 1178 | 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, | ||
| 1179 | 0x08, 0x08, 0x0F, 0x0F, 0x0F, 0x0F, | ||
| 1180 | 0x07, 0x03, 0x01, 0x00, 0x00, 0x00, | ||
| 1181 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | ||
| 1182 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | ||
| 1183 | 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, | ||
| 1184 | # else | ||
| 1185 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | ||
| 1186 | 0x49, 0x49, 0x49, 0xFF, 0xFF, 0xFF, | ||
| 1187 | 0xFF, 0xE0, 0xDF, 0xBF, 0xBF, 0x00, | ||
| 1188 | 0xBF, 0xBF, 0xDF, 0xE0, 0xFF, 0xFF, | ||
| 1189 | 0xFF, 0xFF, 0x49, 0x49, 0x49, 0x00, | ||
| 1190 | 0x00, 0x00, 0x00, 0x00, 0x1F, 0x3F, | ||
| 1191 | 0x60, 0x60, 0xE0, 0xBF, 0x1F, 0x00, | ||
| 1192 | 0x7F, 0x7F, 0x07, 0x1E, 0x38, 0x1E, | ||
| 1193 | 0x07, 0x7F, 0x7F, 0x00, 0x7F, 0x7F, | ||
| 1194 | 0x0E, 0x1F, 0x3B, 0x71, 0x60, 0x00, | ||
| 1195 | 0x00, 0x00, 0x00, 0x00, 0x7F, 0x7F, | ||
| 1196 | 0x0C, 0x0C, 0x0C, 0x00, 0x7E, 0x7E, | ||
| 1197 | 0x00, 0x7F, 0x7E, 0x03, 0x03, 0x00, | ||
| 1198 | 0x7F, 0x7E, 0x03, 0x03, 0x7E, 0x7E, | ||
| 1199 | 0x03, 0x03, 0x7F, 0x7E, 0x00, 0x0F, | ||
| 1200 | 0x3E, 0x70, 0x3C, 0x06, 0x3C, 0x70, | ||
| 1201 | 0x3E, 0x0F, 0x00, 0x32, 0x7B, 0x49, | ||
| 1202 | 0x49, 0x3F, 0x7E, 0x00, 0x7F, 0x7E, | ||
| 1203 | 0x03, 0x03, 0x00, 0x1E, 0x3F, 0x69, | ||
| 1204 | 0x69, 0x6F, 0x26, 0x00, 0x00, 0x00, | ||
| 1205 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | 955 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, |
| 1206 | # endif | ||
| 1207 | |||
| 1208 | // second icon section | ||
| 1209 | 0x0F, 0x1F, 0x3F, 0x7F, 0x7F, 0x7F, | ||
| 1210 | 0x7F, 0x7F, 0x3F, 0x1E, 0x0C, 0x00, | ||
| 1211 | 0x1F, 0x1F, 0x1F, 0x3F, 0x00, 0x3F, | ||
| 1212 | 0x3F, 0x3F, 0x7F, 0x7F, 0x7F, 0x00, | ||
| 1213 | 0x30, 0x7B, 0x7F, 0x78, 0x30, 0x20, | ||
| 1214 | 0x20, 0x30, 0x78, 0x7F, 0x3B, 0x00, | ||
| 1215 | 0x03, 0x00, 0x0F, 0x7F, 0x0F, 0x0F, | ||
| 1216 | 0x0F, 0x7F, 0x0F, 0x00, 0x03, 0x00, | ||
| 1217 | 0x00, 0x44, 0x28, 0xFF, 0x5A, 0x24, | ||
| 1218 | 0xF0, 0xFE, 0xF1, 0x91, 0xF6, 0xF0, | ||
| 1219 | 0xF0, 0xFC, 0xF2, 0x92, 0xFC, 0xF0, | ||
| 1220 | |||
| 1221 | // bottom logo section | ||
| 1222 | # if defined(OLED_LOGO_GMK_BAD) | ||
| 1223 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | ||
| 1224 | 0x00, 0x01, 0x03, 0x03, 0x03, 0x07, | ||
| 1225 | 0x07, 0x07, 0x07, 0x03, 0x03, 0x03, | ||
| 1226 | 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, | ||
| 1227 | 0x06, 0x07, 0x07, 0x07, 0x01, 0x00, | ||
| 1228 | 0x00, 0x00, 0x07, 0x07, 0x07, 0x01, | ||
| 1229 | 0x00, 0x00, 0x00, 0x07, 0x07, 0x07, | ||
| 1230 | 0x07, 0x00, 0x00, 0x00, 0x00, 0x07, | ||
| 1231 | 0x07, 0x07, 0x07, 0x00, 0x00, 0x00, | ||
| 1232 | 0x00, 0x03, 0x07, 0x07, 0x07, 0x06, | ||
| 1233 | 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, | ||
| 1234 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, | ||
| 1235 | 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, | ||
| 1236 | 0x07, 0x07, 0x03, 0x01, 0x00, 0x00, | ||
| 1237 | 0x00, 0x00, 0x00, 0x00, 0x03, 0x07, | ||
| 1238 | 0x07, 0x07, 0x07, 0x03, 0x07, 0x07, | ||
| 1239 | 0x07, 0x07, 0x00, 0x00, 0x00, 0x00, | ||
| 1240 | 0x00, 0x00, 0x03, 0x07, 0x07, 0x07, | ||
| 1241 | 0x07, 0x03, 0x07, 0x07, 0x07, 0x07, | ||
| 1242 | 0x00, 0x00, 0x00, 0x00, 0x01, 0x07, | ||
| 1243 | 0x07, 0x07, 0x01, 0x00, 0x00, 0x00, | ||
| 1244 | # elif defined(OLED_LOGO_HUE_MANITEE) | ||
| 1245 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, | ||
| 1246 | 0x03, 0x07, 0x07, 0x07, 0x07, 0x01, | ||
| 1247 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | 956 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, |
| 1248 | 0x00, 0x00, 0x00, 0x03, 0x07, 0x07, | ||
| 1249 | 0x03, 0x00, 0x00, 0x02, 0x04, 0x00, | ||
| 1250 | 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, | ||
| 1251 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | 957 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, |
| 1252 | 0x00, 0x00, 0x03, 0x03, 0x03, 0x03, | ||
| 1253 | 0x03, 0x03, 0x03, 0x03, 0x00, 0x00, | ||
| 1254 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | 958 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, |
| 1255 | 0x03, 0x03, 0x03, 0x03, 0x00, 0x00, | ||
| 1256 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, | ||
| 1257 | 0x03, 0x03, 0x03, 0x03, 0x03, 0x00, | ||
| 1258 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | 959 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, |
| 1259 | 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, | ||
| 1260 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | 960 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, |
| 1261 | 0x03, 0x03, 0x00, 0x00, 0x00, 0x00, | ||
| 1262 | 0x03, 0x03, 0x00, 0x00, 0x00, 0x00, | ||
| 1263 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | 961 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, |
| 1264 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | 962 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, |
| 1265 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | 963 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, |
| 1266 | # elif defined(OLED_LOGO_CORNE) | ||
| 1267 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | 964 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, |
| 1268 | 0x00, 0x00, 0x00, 0x03, 0x0F, 0x1F, | ||
| 1269 | 0x3F, 0x3F, 0x3F, 0x3F, 0x1F, 0x1F, | ||
| 1270 | 0x3F, 0x3F, 0x7F, 0x7F, 0x7F, 0x3F, | ||
| 1271 | 0x3F, 0x1F, 0x3F, 0x7F, 0x7F, 0x7F, | ||
| 1272 | 0x7F, 0x7C, 0x78, 0x78, 0x38, 0x1C, | ||
| 1273 | 0x0F, 0x00, 0x00, 0x00, 0x00, 0x00, | ||
| 1274 | 0x00, 0x00, 0x01, 0x03, 0x07, 0x07, | ||
| 1275 | 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, | ||
| 1276 | 0x03, 0x01, 0x00, 0x00, 0x00, 0x00, | ||
| 1277 | 0x01, 0x03, 0x07, 0x07, 0x07, 0x07, | ||
| 1278 | 0x07, 0x07, 0x07, 0x07, 0x03, 0x01, | ||
| 1279 | 0x00, 0x00, 0x00, 0x07, 0x07, 0x07, | ||
| 1280 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | 965 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, |
| 1281 | 0x00, 0x07, 0x07, 0x07, 0x00, 0x00, | ||
| 1282 | 0x00, 0x00, 0x00, 0x00, 0x07, 0x07, | ||
| 1283 | 0x07, 0x00, 0x00, 0x00, 0x01, 0x03, | ||
| 1284 | 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, | ||
| 1285 | 0x07, 0x07, 0x03, 0x01, 0x00, 0x00, | ||
| 1286 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | 966 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, |
| 1287 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | 967 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, |
| 1288 | # elif defined(OLED_LOGO_LOOSE) | ||
| 1289 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | 968 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, |
| 1290 | 0x00, 0x00, 0x01, 0x03, 0x07, 0x0F, | ||
| 1291 | 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x00, | ||
| 1292 | 0x1F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, | ||
| 1293 | 0x20, 0x47, 0x48, 0x50, 0x40, 0x41, | ||
| 1294 | 0x42, 0x24, 0x30, 0x3F, 0x3F, 0x3F, | ||
| 1295 | 0x3F, 0x3F, 0x3F, 0x3F, 0x31, 0x31, | ||
| 1296 | 0x11, 0x51, 0x11, 0x11, 0x4A, 0x0A, | ||
| 1297 | 0x2A, 0x0A, 0x44, 0x64, 0x50, 0x70, | ||
| 1298 | 0x50, 0x70, 0x50, 0x70, 0x50, 0x70, | ||
| 1299 | 0x53, 0x73, 0x53, 0x73, 0x53, 0x73, | ||
| 1300 | 0x53, 0x73, 0x53, 0x73, 0x53, 0x70, | ||
| 1301 | 0x50, 0x71, 0x53, 0x73, 0x53, 0x73, | ||
| 1302 | 0x53, 0x73, 0x53, 0x71, 0x50, 0x70, | ||
| 1303 | 0x50, 0x71, 0x53, 0x73, 0x53, 0x73, | ||
| 1304 | 0x53, 0x73, 0x53, 0x71, 0x50, 0x70, | ||
| 1305 | 0x53, 0x73, 0x53, 0x73, 0x53, 0x73, | ||
| 1306 | 0x53, 0x73, 0x53, 0x73, 0x51, 0x70, | ||
| 1307 | 0x53, 0x73, 0x53, 0x73, 0x53, 0x73, | ||
| 1308 | 0x53, 0x73, 0x53, 0x73, 0x53, 0x00, | ||
| 1309 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | 969 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, |
| 1310 | # elif defined(OLED_LOGO_SKEEB) | ||
| 1311 | 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, | ||
| 1312 | 0xFF, 0x08, 0x08, 0x08, 0x08, 0x08, | ||
| 1313 | 0x08, 0x08, 0x08, 0x08, 0x08, 0xFF, | ||
| 1314 | 0x08, 0x08, 0x0F, 0x0F, 0x08, 0x08, | ||
| 1315 | 0x03, 0x04, 0x08, 0x10, 0x20, 0x40, | ||
| 1316 | 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, | ||
| 1317 | 0x40, 0x20, 0x10, 0x08, 0x04, 0x03, | ||
| 1318 | 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, | ||
| 1319 | 0x00, 0x00, 0xFF, 0xFF, 0x00, 0x00, | ||
| 1320 | 0x80, 0xC0, 0xE0, 0xF0, 0xF8, 0xF8, | ||
| 1321 | 0xF8, 0xF8, 0xF8, 0xF8, 0xF8, 0xF8, | ||
| 1322 | 0xF8, 0xF8, 0xF0, 0xE0, 0xC0, 0x80, | ||
| 1323 | 0x01, 0x02, 0xFC, 0xF8, 0x00, 0x00, | ||
| 1324 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | 970 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, |
| 1325 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | 971 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, |
| 1326 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | 972 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, |
| 1327 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | 973 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, |
| 1328 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | 974 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, |
| 1329 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | 975 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, |
| 976 | |||
| 977 | // second icon section | ||
| 978 | 0x0F, 0x1F, 0x3F, 0x7F, 0x7F, 0x7F, | ||
| 979 | 0x7F, 0x7F, 0x3F, 0x1E, 0x0C, 0x00, | ||
| 980 | 0x1F, 0x1F, 0x1F, 0x3F, 0x00, 0x3F, | ||
| 981 | 0x3F, 0x3F, 0x7F, 0x7F, 0x7F, 0x00, | ||
| 982 | 0x30, 0x7B, 0x7F, 0x78, 0x30, 0x20, | ||
| 983 | 0x20, 0x30, 0x78, 0x7F, 0x3B, 0x00, | ||
| 984 | 0x03, 0x00, 0x0F, 0x7F, 0x0F, 0x0F, | ||
| 985 | 0x0F, 0x7F, 0x0F, 0x00, 0x03, 0x00, | ||
| 986 | 0x00, 0x44, 0x28, 0xFF, 0x5A, 0x24, | ||
| 987 | 0xF0, 0xFE, 0xF1, 0x91, 0xF6, 0xF0, | ||
| 988 | 0xF0, 0xFC, 0xF2, 0x92, 0xFC, 0xF0, | ||
| 989 | |||
| 990 | // bottom logo section | ||
| 991 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | ||
| 992 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | ||
| 993 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | ||
| 994 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | ||
| 1330 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | 995 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, |
| 1331 | 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, | ||
| 1332 | #else | ||
| 1333 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | 996 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, |
| 1334 | 0x01, 0x01, 0x01, 0x07, 0x0F, 0x0F, | ||
| 1335 | 0x7F, 0x0F, 0x7F, 0x0F, 0x0F, 0x7E, | ||
| 1336 | 0x0F, 0x0F, 0x7F, 0x0F, 0x7F, 0x0F, | ||
| 1337 | 0x0F, 0x07, 0x01, 0x01, 0x01, 0x00, | ||
| 1338 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | 997 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, |
| 1339 | 0x00, 0x00, 0x00, 0x01, 0x01, 0x00, | ||
| 1340 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | 998 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, |
| 1341 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | 999 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, |
| 1342 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | 1000 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, |
| @@ -1351,7 +1009,6 @@ static const unsigned char font[] PROGMEM = { | |||
| 1351 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | 1009 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, |
| 1352 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | 1010 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, |
| 1353 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | 1011 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, |
| 1354 | #endif | ||
| 1355 | 1012 | ||
| 1356 | // third icon section | 1013 | // third icon section |
| 1357 | 0x1F, 0x05, 0x00, 0x02, 0x1F, 0x00, | 1014 | 0x1F, 0x05, 0x00, 0x02, 0x1F, 0x00, |
| @@ -1391,14 +1048,13 @@ static const unsigned char font[] PROGMEM = { | |||
| 1391 | 0x6A, 0x60, 0x40, 0x00, 0x00, 0x00, | 1048 | 0x6A, 0x60, 0x40, 0x00, 0x00, 0x00, |
| 1392 | 0x00, 0x04, 0x42, 0x69, 0x65, 0x65, | 1049 | 0x00, 0x04, 0x42, 0x69, 0x65, 0x65, |
| 1393 | 0x65, 0x69, 0x42, 0x04, 0x00, 0x00, | 1050 | 0x65, 0x69, 0x42, 0x04, 0x00, 0x00, |
| 1051 | 0x06, 0x0F, 0x09, 0x0F, 0x06, 0x00, | ||
| 1394 | 0x00, 0x00, 0x1C, 0x14, 0x1C, 0x08, | 1052 | 0x00, 0x00, 0x1C, 0x14, 0x1C, 0x08, |
| 1395 | 0x18, 0x08, 0x18, 0x00, 0x00, 0x00, | 1053 | 0x18, 0x08, 0x18, 0x00, 0x00, 0x00, |
| 1396 | 0x00, 0x70, 0xC8, 0xEE, 0xF9, 0x70, | 1054 | 0x00, 0x70, 0xC8, 0xEE, 0xF9, 0x70, |
| 1397 | 0x1F, 0x05, 0x00, 0x10, 0x77, 0x40, | 1055 | 0x1F, 0x05, 0x00, 0x10, 0x77, 0x40, |
| 1398 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | 1056 | 0x00, 0x06, 0x09, 0x59, 0x01, 0x02, |
| 1399 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | ||
| 1400 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | 1057 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, |
| 1401 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | 1058 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, |
| 1402 | }; | 1059 | }; |
| 1403 | // clang-format on | 1060 | // clang-format on |
| 1404 | #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 @@ | |||
| 1 | // Copyright 2023 Christopher Courtney, aka Drashna Jael're (@drashna) <drashna@live.com> | ||
| 2 | // SPDX-License-Identifier: GPL-2.0-or-later | ||
| 3 | |||
| 4 | #pragma once | ||
| 5 | |||
| 6 | // clang-format off | ||
| 7 | |||
| 8 | static const char PROGMEM code_to_name[256] = { | ||
| 9 | // 0 1 2 3 4 5 6 7 8 9 A B c D E F | ||
| 10 | ' ', ' ', ' ', ' ', 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', // 0x | ||
| 11 | 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z', '1', '2', // 1x | ||
| 12 | '3', '4', '5', '6', '7', '8', '9', '0', 20, 19, 27, 26, 22, '-', '=', '[', // 2x | ||
| 13 | ']','\\', '#', ';','\'', '`', ',', '.', '/', 128,0xD5,0xD6,0xD7,0xD8,0xD9,0xDA, // 3x | ||
| 14 | 0xDB,0xDC,0xDD,0xDE,0XDF,0xFB, 'P', 'S', 19, ' ', 17, 30, 16, 16, 31, 26, // 4x | ||
| 15 | 27, 25, 24, 'N', '/', '*', '-', '+', 23, '1', '2', '3', '4', '5', '6', '7', // 5x | ||
| 16 | '8', '9', '0', '.','\\', 'A', 0, '=', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', // 6x | ||
| 17 | ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', // 7x | ||
| 18 | ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', // 8x | ||
| 19 | ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', // 9x | ||
| 20 | ' ', ' ', ' ', ' ', ' ', 0, ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', // Ax | ||
| 21 | ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', // Bx | ||
| 22 | ' ',0x9E,0x9E, ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ',0x9D,0x9D,0x9D,0x9D, // Cx | ||
| 23 | 0x9D,0x9D,0x9D,0x9D,0x9D,0x9D,0x9D,0x9D,0x9D,0x9D,0x9D,0x9D,0x9D,0x9D,0x9D,0x9D, // Dx | ||
| 24 | 'C', 'S', 'A', 'G', 'C', 'S', 'A', 'G', ' ', ' ', ' ', ' ', ' ', 24, 26, 24, // Ex | ||
| 25 | 25, ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', 24, 25, 27, 26, ' ', ' ', ' ' // Fx | ||
| 26 | }; | ||
| 27 | |||
| 28 | static const char PROGMEM gmk_bad_logo[384] = { | ||
| 29 | 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, 0x00, 0x00, | ||
| 30 | 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, 0x00, 0x00, | ||
| 31 | 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, 0x00, 0x00 | ||
| 32 | }; | ||
| 33 | |||
| 34 | static const char PROGMEM hue_manitee_logo[384] = { | ||
| 35 | 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, 0x00, 0x00, | ||
| 36 | 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, 0x00, 0x00, | ||
| 37 | 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, 0x00, 0x00 | ||
| 38 | }; | ||
| 39 | |||
| 40 | static const char PROGMEM corne_logo[384] = { | ||
| 41 | 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, 0x00, 0x00, | ||
| 42 | 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, 0x00, 0x00, | ||
| 43 | 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, 0x00, 0x00 | ||
| 44 | }; | ||
| 45 | |||
| 46 | static const char PROGMEM loose_logo[384] = { | ||
| 47 | 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, 0x00, 0x00, | ||
| 48 | 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, 0x00, 0x00, | ||
| 49 | 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, 0x00, 0x00 | ||
| 50 | }; | ||
| 51 | |||
| 52 | static const char PROGMEM skeeb_logo[384] = { | ||
| 53 | 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, 0x01, 0x02, 0x04, 0x08, 0x10, 0x20, 0xC0, 0x00, | ||
| 54 | 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, 0x00, 0x00, | ||
| 55 | 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, 0x00, 0x00 | ||
| 56 | }; | ||
| 57 | |||
| 58 | static const char PROGMEM qmk_logo[384] = { | ||
| 59 | 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, 0x00, 0x00, | ||
| 60 | 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, 0x00, 0x00, 0x00, | ||
| 61 | 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, 0x00, 0x00, 0x00, 0x00 | ||
| 62 | }; | ||
| 63 | |||
| 64 | static const char PROGMEM qmk_large_logo[1024] = { | ||
| 65 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3f, 0x3f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3e, 0x3f, 0x3e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3f, 0x3f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3f, 0x3e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3f, 0x3f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | ||
| 66 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | ||
| 67 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x83, 0x83, 0x83, 0x83, 0x83, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfe, 0xfe, 0xfe, 0xfe, 0xfe, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfe, 0xfe, 0xfe, 0xfe, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfc, 0xfe, 0xfe, 0xfe, 0xfe, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x83, 0x83, 0x83, 0x83, 0x83, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | ||
| 68 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x81, 0x83, 0x83, 0x83, 0x83, 0x83, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x83, 0x83, 0x83, 0x83, 0x83, 0x81, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | ||
| 69 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x07, 0x1f, 0x3f, 0x7f, 0x7e, 0xf8, 0xf0, 0xe0, 0xe0, 0xe0, 0xe0, 0xe0, 0xff, 0xff, 0xff, 0xff, 0xe0, 0xe0, 0xe0, 0xe0, 0xe0, 0xf0, 0xf8, 0x7e, 0x7f, 0x3f, 0x1f, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | ||
| 70 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0xc1, 0xc1, 0xc1, 0xc1, 0xc1, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x01, 0x01, 0x01, 0xff, 0xff, 0xff, 0xff, 0x01, 0x01, 0x01, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc1, 0xc1, 0xc1, 0xc1, 0xc1, 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, | ||
| 71 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | ||
| 72 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfc, 0xfc, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7c, 0xfc, 0x7c, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfc, 0xfc, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfc, 0x7c, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfc, 0xfc, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 | ||
| 73 | }; | ||
| 74 | |||
| 75 | static const char PROGMEM header_image[128] = { 0x00, 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, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x7F, 0x3F, 0x1F, 0x0F, 0x07, 0x03, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x02, 0x04, 0x08, 0x10, 0x20, 0xC0 }; | ||
| 76 | static const char PROGMEM row_2_image[128] = { 0x00, 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, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 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, 0x00, 0xFF }; | ||
| 77 | |||
| 78 | static const char PROGMEM display_border[3] = {0x0, 0xFF, 0x0}; | ||
| 79 | |||
| 80 | static const char PROGMEM footer_image[128] = { 0x00, 0x03, 0x04, 0x08, 0x10, 0x20, 0x40, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0xC0, 0xE0, 0xF0, 0xF8, 0xF8, 0xF8, 0xF8, 0xF8, 0xF8, 0xF8, 0xF8, 0xF8, 0xF8, 0xF8, 0xF8, 0xF8, 0xF8, 0xF8, 0xF8, 0xF8, 0xF8, 0xF8, 0xF8, 0xF8, 0xF8, 0xF8, 0xF8, 0xF8, 0xF8, 0xF8, 0xF8, 0xF8, 0xF8, 0xF8, 0xF8, 0xF8, 0xF8, 0xF8, 0xF8, 0xF8, 0xF8, 0xF8, 0xF8, 0xF8, 0xF8, 0xF8, 0xF8, 0xF8, 0xF8, 0xF8, 0xF8, 0xF8, 0xF8, 0xF8, 0xF8, 0xF8, 0xF8, 0xF8, 0xF8, 0xF8, 0xF8, 0xF8, 0xF8, 0xF8, 0xF8, 0xF8, 0xF8, 0xF8, 0xF8, 0xF8, 0xF8, 0xF8, 0xF8, 0xF8, 0xF8, 0xF8, 0xF8, 0xF8, 0xF8, 0xF8, 0xF8, 0xF8, 0xF8, 0xF8, 0xF8, 0xF8, 0xF8, 0xF8, 0xF8, 0xF8, 0xF8, 0xF8, 0xF8, 0xF8, 0xF8, 0xF8, 0xF8, 0xF0, 0xE0, 0xC0, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x40, 0x20, 0x10, 0x08, 0x04, 0x03 }; | ||
| 81 | |||
| 82 | static const char PROGMEM mouse_logo[3][2][16] = { | ||
| 83 | { // mouse icon | ||
| 84 | { 0x00, 0x00, 0x00, 0xFC, 0x02, 0x02, 0x02, 0x3A, 0x02, 0x02, 0x02, 0xFC, 0x00, 0x00, 0x00, 0x00 }, | ||
| 85 | { 0x00, 0x00, 0x3F, 0x60, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x60, 0x3F, 0x00, 0x00, 0x00 } | ||
| 86 | }, | ||
| 87 | { // crosshair icon | ||
| 88 | {0x80, 0xF0, 0x88, 0xE4, 0x92, 0x8A, 0xCA, 0x7F, 0xCA, 0x8A, 0x92, 0xE4, 0x88, 0xF0, 0x80, 0x00 }, | ||
| 89 | {0x00, 0x07, 0x08, 0x13, 0x24, 0x28, 0x29, 0x7F, 0x29, 0x28, 0x24, 0x13, 0x08, 0x07, 0x00, 0x00 } | ||
| 90 | }, | ||
| 91 | { // dragscroll icon | ||
| 92 | {0x00, 0x00, 0x70, 0x88, 0x9C, 0x02, 0x0F, 0x01, 0x0F, 0x02, 0x8C, 0x44, 0x38, 0x00, 0x00, 0x00}, | ||
| 93 | {0x00, 0x00, 0x02, 0x06, 0x0F, 0x1C, 0x3C, 0x7C, 0x3C, 0x1C, 0x0F, 0x06, 0x02, 0x00, 0x00, 0x00} | ||
| 94 | } | ||
| 95 | }; | ||
| 96 | |||
| 97 | |||
| 98 | // Images credit j-inc(/James Incandenza) and pixelbenny. | ||
| 99 | // Credit to obosob for initial animation approach. | ||
| 100 | // heavily modified by drashna because he's a glutton for punishment | ||
| 101 | |||
| 102 | #define OLED_ANIM_SIZE 36 | ||
| 103 | #define OLED_ANIM_ROWS 4 | ||
| 104 | #define OLED_ANIM_MAX_FRAMES 3 | ||
| 105 | |||
| 106 | static const char PROGMEM animation[4][OLED_ANIM_MAX_FRAMES][OLED_ANIM_ROWS][OLED_ANIM_SIZE] = { | ||
| 107 | { // sleep frames | ||
| 108 | { | ||
| 109 | { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x08, 0xa8, 0x48, 0xa8, 0x18, 0x08, 0x00, 0x00, 0x00, 0x80, 0x80, 0x80, 0x80, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, | ||
| 110 | { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x03, 0x02, 0x02, 0x02, 0x02, 0x02, 0x00, 0x00, 0x80, 0x44, 0x84, 0x06, 0x05, 0x04, 0x80, 0x40, 0x20, 0x10, 0xe0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, | ||
| 111 | { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x20, 0x18, 0x04, 0x04, 0x02, 0x7a, 0x86, 0x01, 0x80, 0x80, 0x01, 0x03, 0x05, 0x07, 0x01, 0x00, 0x00, 0x80, 0x83, 0x45, 0xfa, 0x3c, 0xe0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, | ||
| 112 | { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0x08, 0x10, 0x10, 0x10, 0x10, 0x10, 0x33, 0x24, 0x28, 0x28, 0x29, 0x29, 0x29, 0x3a, 0x18, 0x1c, 0x39, 0x24, 0x24, 0x3a, 0x2d, 0x26, 0x31, 0x1f, 0x00, 0x00, 0x00, 0x00, 0x00 } | ||
| 113 | }, | ||
| 114 | { | ||
| 115 | { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, | ||
| 116 | { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x22, 0x22, 0x3a, 0x2a, 0x26, 0x22, 0x80, 0xc0, 0x80, 0x00, 0x24, 0x34, 0x2c, 0xe4, 0x60, 0x10, 0x70, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, | ||
| 117 | { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x38, 0x04, 0x02, 0x02, 0x01, 0x79, 0x87, 0x01, 0x80, 0x81, 0x83, 0x05, 0x05, 0x03, 0x01, 0x00, 0x00, 0x80, 0x43, 0x05, 0xfa, 0x3c, 0xe0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, | ||
| 118 | { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0x08, 0x10, 0x10, 0x10, 0x10, 0x10, 0x33, 0x24, 0x28, 0x28, 0x28, 0x29, 0x29, 0x3a, 0x18, 0x1c, 0x39, 0x24, 0x24, 0x3a, 0x2d, 0x26, 0x31, 0x1f, 0x00, 0x00, 0x00, 0x00, 0x00 } | ||
| 119 | } | ||
| 120 | }, | ||
| 121 | { // wake frames | ||
| 122 | { | ||
| 123 | { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x30, 0x08, 0x10, 0x60, 0x80, 0x00, 0x80, 0x60, 0x10, 0x08, 0x30, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, | ||
| 124 | { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7f, 0x80, 0x40, 0x40, 0x5c, 0x00, 0x01, 0x41, 0x01, 0x00, 0x5c, 0x40, 0x40, 0x80, 0x7f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, | ||
| 125 | { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x40, 0x40, 0x80, 0xe1, 0x12, 0x0a, 0x06, 0x00, 0x80, 0x00, 0x06, 0x0a, 0x12, 0xe1, 0x80, 0x40, 0x40, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, | ||
| 126 | { 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x1f, 0x14, 0x14, 0x10, 0x10, 0x11, 0x1f, 0x10, 0x10, 0x18, 0x0f, 0x18, 0x10, 0x10, 0x1f, 0x11, 0x10, 0x10, 0x14, 0x14, 0x1f, 0x1c, 0x14, 0x14, 0x14, 0x08, 0x00, 0x00, 0x00, 0x00 } | ||
| 127 | }, | ||
| 128 | { | ||
| 129 | { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x30, 0x08, 0x10, 0x60, 0x80, 0x00, 0x80, 0x60, 0x10, 0x08, 0x30, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, | ||
| 130 | { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7f, 0x90, 0x12, 0x0a, 0x02, 0xf4, 0x09, 0x0d, 0xf1, 0x04, 0x02, 0x0a, 0x12, 0x90, 0x7f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, | ||
| 131 | { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x40, 0x40, 0x80, 0xe1, 0x12, 0x0a, 0x06, 0x01, 0x81, 0x00, 0x06, 0x0a, 0x12, 0xe1, 0x80, 0x40, 0x40, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, | ||
| 132 | { 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x1f, 0x14, 0x14, 0x10, 0x10, 0x11, 0x1f, 0x10, 0x10, 0x18, 0x0f, 0x18, 0x10, 0x10, 0x1f, 0x11, 0x10, 0x10, 0x14, 0x14, 0x1f, 0x1c, 0x14, 0x14, 0x14, 0x08, 0x00, 0x00, 0x00, 0x00 } | ||
| 133 | } | ||
| 134 | }, | ||
| 135 | { // kaki frames | ||
| 136 | { | ||
| 137 | { 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x40, 0x40, 0x80, 0x80, 0x80, 0x00, 0xfc, 0x84, 0x08, 0x08, 0x10, 0x20, 0x40, 0x40, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, | ||
| 138 | { 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x1e, 0x60, 0x80, 0x00, 0x00, 0x91, 0xa1, 0x80, 0x00, 0x00, 0x22, 0x84, 0x40, 0x50, 0x48, 0xc1, 0x3e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, | ||
| 139 | { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x40, 0x41, 0x82, 0xe2, 0x12, 0x0a, 0x06, 0x00, 0x80, 0x88, 0x4f, 0x02, 0x22, 0xe2, 0x9f, 0x40, 0x40, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, | ||
| 140 | { 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x1f, 0x14, 0x14, 0x10, 0x10, 0x11, 0x1f, 0x10, 0x10, 0x18, 0x0f, 0x18, 0x14, 0x10, 0x10, 0x10, 0x10, 0x10, 0x14, 0x14, 0x1f, 0x1a, 0x0a, 0x0a, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00 } | ||
| 141 | }, | ||
| 142 | { | ||
| 143 | { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x10, 0x20, 0x20, 0x40, 0x40, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, | ||
| 144 | { 0x00, 0x00, 0x06, 0x1a, 0x22, 0xc2, 0x04, 0x04, 0x04, 0x07, 0x00, 0xc0, 0x20, 0x10, 0x80, 0x80, 0x01, 0x01, 0x02, 0xfc, 0xfe, 0x02, 0x3c, 0x20, 0x40, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, | ||
| 145 | { 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0x0d, 0x8d, 0x55, 0x50, 0x94, 0xf0, 0x10, 0x09, 0x08, 0x00, 0x80, 0x00, 0x06, 0x09, 0x1b, 0xee, 0x00, 0x00, 0x00, 0x00, 0x81, 0xfe, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, | ||
| 146 | { 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x1f, 0x14, 0x14, 0x10, 0x10, 0x11, 0x1f, 0x10, 0x10, 0x18, 0x0f, 0x18, 0x10, 0x10, 0x1f, 0x19, 0x18, 0x1c, 0x14, 0x16, 0x15, 0x14, 0x14, 0x14, 0x14, 0x08, 0x00, 0x00, 0x00, 0x00 } | ||
| 147 | }, | ||
| 148 | { | ||
| 149 | { 0x00, 0x00, 0x00, 0x00, 0x80, 0x40, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0x10, 0x20, 0x40, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, | ||
| 150 | { 0x00, 0x00, 0x00, 0x00, 0x0f, 0xf0, 0x00, 0x01, 0x02, 0x04, 0x04, 0x03, 0x80, 0x40, 0x40, 0x20, 0x00, 0x01, 0x02, 0x8c, 0x70, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, | ||
| 151 | { 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0x0d, 0x8d, 0x55, 0x50, 0x94, 0xf0, 0x10, 0x0a, 0x0e, 0x1d, 0x95, 0x24, 0x24, 0x27, 0x13, 0xe1, 0x01, 0x01, 0x01, 0x01, 0x02, 0xfc, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, | ||
| 152 | { 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x1f, 0x14, 0x14, 0x10, 0x10, 0x11, 0x1f, 0x10, 0x10, 0x18, 0x0f, 0x18, 0x10, 0x10, 0x1f, 0x19, 0x18, 0x1c, 0x14, 0x14, 0x17, 0x14, 0x14, 0x14, 0x14, 0x08, 0x00, 0x00, 0x00, 0x00 } | ||
| 153 | } | ||
| 154 | }, | ||
| 155 | { // rtogi frames | ||
| 156 | { | ||
| 157 | { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x20, 0x10, 0x10, 0x08, 0x04, 0x02, 0x01, 0x0f, 0x90, 0x10, 0x20, 0xf0, 0xf8, 0xf8, 0x00, 0x00, 0x00, 0x00 }, | ||
| 158 | { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x40, 0x20, 0x10, 0x10, 0x08, 0x08, 0x08, 0x08, 0x48, 0x47, 0x88, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x88, 0xc7, 0xc4, 0x62, 0x23, 0x11, 0x3f, 0x00, 0x00, 0x00, 0x00 }, | ||
| 159 | { 0x80, 0x40, 0x20, 0x10, 0x88, 0xcc, 0x43, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0xc0, 0x80, 0x80, 0xc0, 0xe1, 0xfe, 0xb8, 0x88, 0x0c, 0x04, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, | ||
| 160 | { 0x00, 0x01, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x01, 0x06, 0x04, 0x04, 0x04, 0x04, 0x05, 0x04, 0x04, 0x04, 0x07, 0x07, 0x07, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 } | ||
| 161 | }, | ||
| 162 | { | ||
| 163 | { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x20, 0x10, 0x10, 0x08, 0x04, 0x02, 0x01, 0x1f, 0xa0, 0x20, 0x40, 0x80, 0x00, 0xf0, 0x00, 0x00, 0x00, 0x00 }, | ||
| 164 | { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x40, 0x20, 0x10, 0x10, 0x08, 0x08, 0x08, 0x08, 0x48, 0x47, 0x88, 0x00, 0x00, 0x00, 0x00, 0x24, 0x24, 0x28, 0x6b, 0x40, 0xa0, 0x99, 0x86, 0xff, 0x00, 0x00, 0x00, 0x00 }, | ||
| 165 | { 0x0f, 0x11, 0x22, 0x44, 0x48, 0x4c, 0x43, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0xc0, 0x80, 0x80, 0xc0, 0xe1, 0xfe, 0xb8, 0x88, 0x0c, 0x04, 0x06, 0x06, 0x06, 0x0e, 0x0e, 0x06, 0x01, 0x00, 0x00, 0x00, 0x00 }, | ||
| 166 | { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x01, 0x06, 0x04, 0x04, 0x04, 0x04, 0x05, 0x04, 0x04, 0x04, 0x07, 0x07, 0x07, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 } | ||
| 167 | } | ||
| 168 | } | ||
| 169 | }; | ||
| 170 | |||
| 171 | static const char PROGMEM tri_layer_image[][3][24] = { | ||
| 172 | { // base | ||
| 173 | { 0x00, 0x00, 0x00, 0x80, 0x80, 0x40, 0x40, 0x20, 0x20, 0x10, 0x10, 0x08, 0x08, 0x10, 0x10, 0x20, 0x20, 0x40, 0x40, 0x80, 0x80, 0x00, 0x00, 0x00 }, | ||
| 174 | { 0x00, 0x00, 0x00, 0x88, 0x88, 0x5D, 0x5D, 0x3E, 0x3E, 0x7C, 0x7C, 0xF8, 0xF8, 0x7C, 0x7C, 0x3E, 0x3E, 0x5D, 0x5D, 0x88, 0x88, 0x00, 0x00, 0x00 }, | ||
| 175 | { 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x02, 0x02, 0x04, 0x04, 0x08, 0x08, 0x04, 0x04, 0x02, 0x02, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00 } | ||
| 176 | }, | ||
| 177 | { // raise | ||
| 178 | { 0x00, 0x00, 0x00, 0x80, 0x80, 0xC0, 0xC0, 0xE0, 0xE0, 0xF0, 0xF0, 0xF8, 0xF8, 0xF0, 0xF0, 0xE0, 0xE0, 0xC0, 0xC0, 0x80, 0x80, 0x00, 0x00, 0x00 }, | ||
| 179 | { 0x00, 0x00, 0x00, 0x88, 0x88, 0x55, 0x55, 0x23, 0x23, 0x47, 0x47, 0x8F, 0x8F, 0x47, 0x47, 0x23, 0x23, 0x55, 0x55, 0x88, 0x88, 0x00, 0x00, 0x00 }, | ||
| 180 | { 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x02, 0x02, 0x04, 0x04, 0x08, 0x08, 0x04, 0x04, 0x02, 0x02, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00 } | ||
| 181 | }, | ||
| 182 | { // lower | ||
| 183 | { 0x00, 0x00, 0x00, 0x80, 0x80, 0x40, 0x40, 0x20, 0x20, 0x10, 0x10, 0x08, 0x08, 0x10, 0x10, 0x20, 0x20, 0x40, 0x40, 0x80, 0x80, 0x00, 0x00, 0x00 }, | ||
| 184 | { 0x00, 0x00, 0x00, 0x88, 0x88, 0xD5, 0xD5, 0xE2, 0xE2, 0xC4, 0xC4, 0x88, 0x88, 0xC4, 0xC4, 0xE2, 0xE2, 0xD5, 0xD5, 0x88, 0x88, 0x00, 0x00, 0x00 }, | ||
| 185 | { 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x03, 0x03, 0x07, 0x07, 0x0F, 0x0F, 0x07, 0x07, 0x03, 0x03, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00 } | ||
| 186 | }, | ||
| 187 | { // adjust | ||
| 188 | { 0x00, 0x00, 0x00, 0x80, 0x80, 0x40, 0xC0, 0x60, 0xA0, 0x50, 0xB0, 0x58, 0xA8, 0x50, 0xB0, 0x60, 0xA0, 0x40, 0xC0, 0x80, 0x80, 0x00, 0x00, 0x00 }, | ||
| 189 | { 0x00, 0x00, 0x00, 0x88, 0x88, 0x5D, 0xD5, 0x6B, 0xB6, 0x6D, 0xD6, 0xAD, 0xDA, 0x6D, 0xD6, 0x6B, 0xB6, 0x5D, 0xD5, 0x88, 0x88, 0x00, 0x00, 0x00 }, | ||
| 190 | { 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x03, 0x02, 0x05, 0x06, 0x0D, 0x0A, 0x05, 0x06, 0x03, 0x02, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00 } | ||
| 191 | }, | ||
| 192 | { // blank | ||
| 193 | { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, | ||
| 194 | { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, | ||
| 195 | { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, | ||
| 196 | }, | ||
| 197 | { // better gamepad | ||
| 198 | { 0x00, 0x00, 0x00, 0xC0, 0xE0, 0xE0, 0x70, 0xF0, 0xF0, 0xF0, 0xF0, 0x90, 0x90, 0xF0, 0xF0, 0xF0, 0xF0, 0x70, 0xE0, 0xE0, 0xC0, 0x00, 0x00, 0x00 }, | ||
| 199 | { 0x80, 0xF8, 0xFF, 0xFF, 0xFF, 0xFE, 0xFC, 0xE6, 0xC3, 0xC3, 0xE6, 0xFF, 0xFF, 0xFE, 0xF7, 0xE3, 0xF6, 0xFD, 0xFE, 0xFF, 0xFF, 0xFF, 0xF8, 0x80 }, | ||
| 200 | { 0x07, 0x0F, 0x0F, 0x0F, 0x07, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x07, 0x0F, 0x0F, 0x0F, 0x07 } | ||
| 201 | }, | ||
| 202 | { // mouse | ||
| 203 | { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xC0, 0x20, 0x20, 0x20, 0xA0, 0x20, 0x20, 0x20, 0xC0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, | ||
| 204 | { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xF0, 0x0F, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x0F, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, | ||
| 205 | { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x06, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x06, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 } | ||
| 206 | } | ||
| 207 | }; | ||
diff --git a/users/drashna/oled/oled_config.h b/users/drashna/oled/oled_config.h index c46c0c39ce..427764c4a7 100644 --- a/users/drashna/oled/oled_config.h +++ b/users/drashna/oled/oled_config.h | |||
| @@ -4,14 +4,12 @@ | |||
| 4 | #pragma once | 4 | #pragma once |
| 5 | 5 | ||
| 6 | #ifndef OLED_UPDATE_INTERVAL | 6 | #ifndef OLED_UPDATE_INTERVAL |
| 7 | # ifdef OLED_DRIVER_SH1107 | 7 | # ifdef SPLIT_KEYBOARD |
| 8 | # define OLED_UPDATE_INTERVAL 75 | 8 | # define OLED_UPDATE_INTERVAL 60 |
| 9 | # elif defined(OLED_DISPLAY_128X128) | ||
| 10 | # define OLED_UPDATE_INTERVAL 30 | ||
| 9 | # else | 11 | # else |
| 10 | # ifdef SPLIT_KEYBOARD | 12 | # define OLED_UPDATE_INTERVAL 15 |
| 11 | # define OLED_UPDATE_INTERVAL 60 | ||
| 12 | # else | ||
| 13 | # define OLED_UPDATE_INTERVAL 15 | ||
| 14 | # endif | ||
| 15 | # endif | 13 | # endif |
| 16 | #endif | 14 | #endif |
| 17 | #define OLED_DISABLE_TIMEOUT | 15 | #define OLED_DISABLE_TIMEOUT |
| @@ -40,24 +38,3 @@ | |||
| 40 | #define OLED_LOGO_SCIFI | 38 | #define OLED_LOGO_SCIFI |
| 41 | // # define OLED_LOGO_SETS3N | 39 | // # define OLED_LOGO_SETS3N |
| 42 | // # define OLED_LOGO_SKEEB | 40 | // # define OLED_LOGO_SKEEB |
| 43 | |||
| 44 | #ifdef OLED_DRIVER_SH1107 | ||
| 45 | # define OLED_DISPLAY_CUSTOM | ||
| 46 | # define OLED_IC_SH1107 2 | ||
| 47 | # define OLED_DISPLAY_128X128 | ||
| 48 | # define OLED_DISPLAY_WIDTH 128 | ||
| 49 | # define OLED_DISPLAY_HEIGHT 128 | ||
| 50 | # define OLED_MATRIX_SIZE (OLED_DISPLAY_HEIGHT / 8 * OLED_DISPLAY_WIDTH) | ||
| 51 | # define OLED_BLOCK_TYPE uint32_t | ||
| 52 | # define OLED_SOURCE_MAP \ | ||
| 53 | { 0, 8, 16, 24, 32, 40, 48, 56 } | ||
| 54 | # define OLED_TARGET_MAP \ | ||
| 55 | { 56, 48, 40, 32, 24, 16, 8, 0 } | ||
| 56 | # define OLED_BLOCK_COUNT (sizeof(OLED_BLOCK_TYPE) * 8) | ||
| 57 | # define OLED_BLOCK_SIZE (OLED_MATRIX_SIZE / OLED_BLOCK_COUNT) | ||
| 58 | # define OLED_COM_PINS COM_PINS_ALT | ||
| 59 | # define OLED_IC OLED_IC_SH1107 | ||
| 60 | # ifndef OLED_BRIGHTNESS | ||
| 61 | # define OLED_BRIGHTNESS 50 | ||
| 62 | # endif | ||
| 63 | #endif | ||
diff --git a/users/drashna/oled/oled_stuff.c b/users/drashna/oled/oled_stuff.c index 98506247df..d232e90fb2 100644 --- a/users/drashna/oled/oled_stuff.c +++ b/users/drashna/oled/oled_stuff.c | |||
| @@ -16,6 +16,10 @@ | |||
| 16 | */ | 16 | */ |
| 17 | 17 | ||
| 18 | #include "drashna.h" | 18 | #include "drashna.h" |
| 19 | #include <ctype.h> | ||
| 20 | #include <string.h> | ||
| 21 | #include <stdio.h> | ||
| 22 | #include "lib/lib8tion/lib8tion.h" | ||
| 19 | #ifdef UNICODE_COMMON_ENABLE | 23 | #ifdef UNICODE_COMMON_ENABLE |
| 20 | # include "process_unicode_common.h" | 24 | # include "process_unicode_common.h" |
| 21 | # include "keyrecords/unicode.h" | 25 | # include "keyrecords/unicode.h" |
| @@ -23,42 +27,39 @@ | |||
| 23 | #ifdef AUDIO_CLICKY | 27 | #ifdef AUDIO_CLICKY |
| 24 | # include "process_clicky.h" | 28 | # include "process_clicky.h" |
| 25 | #endif | 29 | #endif |
| 26 | #include <string.h> | ||
| 27 | 30 | ||
| 28 | bool is_oled_enabled = true, is_oled_locked = false; | 31 | #ifndef OLED_BRIGHTNESS_STEP |
| 32 | # define OLED_BRIGHTNESS_STEP 32 | ||
| 33 | #endif | ||
| 29 | 34 | ||
| 30 | extern bool host_driver_disabled; | 35 | bool is_oled_enabled = true, is_oled_locked = false, is_oled_force_off = false; |
| 31 | 36 | ||
| 32 | uint32_t oled_timer = 0; | 37 | uint32_t oled_timer = 0; |
| 33 | char keylog_str[OLED_KEYLOGGER_LENGTH] = {0}; | 38 | char oled_keylog_str[OLED_KEYLOGGER_LENGTH + 1] = {0}; |
| 34 | static uint16_t log_timer = 0; | ||
| 35 | #ifdef OLED_DISPLAY_VERBOSE | ||
| 36 | const char PROGMEM display_border[3] = {0x0, 0xFF, 0x0}; | ||
| 37 | #endif | ||
| 38 | 39 | ||
| 39 | deferred_token kittoken; | 40 | deferred_token kittoken; |
| 40 | 41 | ||
| 41 | // clang-format off | 42 | extern uint8_t oled_buffer[OLED_MATRIX_SIZE]; |
| 42 | static const char PROGMEM code_to_name[256] = { | 43 | extern OLED_BLOCK_TYPE oled_dirty; |
| 43 | // 0 1 2 3 4 5 6 7 8 9 A B c D E F | 44 | |
| 44 | ' ', ' ', ' ', ' ', 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', // 0x | 45 | void oled_pan_section(bool left, uint16_t y_start, uint16_t y_end, uint16_t x_start, uint16_t x_end) { |
| 45 | 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z', '1', '2', // 1x | 46 | uint16_t i = 0; |
| 46 | '3', '4', '5', '6', '7', '8', '9', '0', 20, 19, 27, 26, 22, '-', '=', '[', // 2x | 47 | for (uint16_t y = y_start; y < y_end; y++) { |
| 47 | ']','\\', '#', ';','\'', '`', ',', '.', '/', 128,0xD5,0xD6,0xD7,0xD8,0xD9,0xDA, // 3x | 48 | if (left) { |
| 48 | 0xDB,0xDC,0xDD,0xDE,0XDF,0xFB,'P', 'S', 19, ' ', 17, 30, 16, 16, 31, 26, // 4x | 49 | for (uint16_t x = x_start; x < x_end - 1; x++) { |
| 49 | 27, 25, 24, 'N', '/', '*', '-', '+', 23, '1', '2', '3', '4', '5', '6', '7', // 5x | 50 | i = y * OLED_DISPLAY_WIDTH + x; |
| 50 | '8', '9', '0', '.','\\', 'A', 0, '=', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', // 6x | 51 | oled_buffer[i] = oled_buffer[i + 1]; |
| 51 | ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', // 7x | 52 | oled_dirty |= ((OLED_BLOCK_TYPE)1 << (i / OLED_BLOCK_SIZE)); |
| 52 | ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', // 8x | 53 | } |
| 53 | ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', // 9x | 54 | } else { |
| 54 | ' ', ' ', ' ', ' ', ' ', 0, ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', // Ax | 55 | for (uint16_t x = x_end - 1; x > 0; x--) { |
| 55 | ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', // Bx | 56 | i = y * OLED_DISPLAY_WIDTH + x; |
| 56 | ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', // Cx | 57 | oled_buffer[i] = oled_buffer[i - 1]; |
| 57 | ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', // Dx | 58 | oled_dirty |= ((OLED_BLOCK_TYPE)1 << (i / OLED_BLOCK_SIZE)); |
| 58 | 'C', 'S', 'A', 'C', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', 24, 26, 24, // Ex | 59 | } |
| 59 | 25,0x9D,0x9D,0x9D,0x9D,0x9D,0x9D,0x9D,0x9D, 24, 25, 27, 26, ' ', ' ', ' ' // Fx | 60 | } |
| 60 | }; | 61 | } |
| 61 | // clang-format on | 62 | } |
| 62 | 63 | ||
| 63 | /** | 64 | /** |
| 64 | * @brief parses pressed keycodes and saves to buffer | 65 | * @brief parses pressed keycodes and saves to buffer |
| @@ -67,32 +68,34 @@ static const char PROGMEM code_to_name[256] = { | |||
| 67 | * @param record keyrecord_t data structure | 68 | * @param record keyrecord_t data structure |
| 68 | */ | 69 | */ |
| 69 | void add_keylog(uint16_t keycode, keyrecord_t *record) { | 70 | void add_keylog(uint16_t keycode, keyrecord_t *record) { |
| 70 | if (keycode >= QK_MOD_TAP && keycode <= QK_MOD_TAP_MAX) { | 71 | if (IS_QK_MOD_TAP(keycode)) { |
| 71 | keycode = QK_MOD_TAP_GET_TAP_KEYCODE(keycode); | 72 | if (record->tap.count) { |
| 72 | } else if (keycode >= QK_LAYER_TAP && keycode <= QK_LAYER_TAP_MAX) { | 73 | keycode = keycode_config(QK_MOD_TAP_GET_TAP_KEYCODE(keycode)); |
| 73 | keycode = QK_LAYER_TAP_GET_TAP_KEYCODE(keycode); | 74 | } else { |
| 74 | } else if (keycode >= QK_MODS && keycode <= QK_MODS_MAX) { | 75 | keycode = keycode_config(0xE0 + biton(QK_MOD_TAP_GET_MODS(keycode) & 0xF) + biton(QK_MOD_TAP_GET_MODS(keycode) & 0x10)); |
| 75 | keycode = QK_MODS_GET_BASIC_KEYCODE(keycode); | 76 | } |
| 77 | } else if (IS_QK_LAYER_TAP(keycode) && record->tap.count) { | ||
| 78 | keycode = keycode_config(QK_LAYER_TAP_GET_TAP_KEYCODE(keycode)); | ||
| 79 | } else if (IS_QK_MODS(keycode)) { | ||
| 80 | keycode = keycode_config(QK_MODS_GET_BASIC_KEYCODE(keycode)); | ||
| 81 | } else if (IS_QK_ONE_SHOT_MOD(keycode)) { | ||
| 82 | keycode = keycode_config(0xE0 + biton(QK_ONE_SHOT_MOD_GET_MODS(keycode) & 0xF) + biton(QK_ONE_SHOT_MOD_GET_MODS(keycode) & 0x10)); | ||
| 83 | } else if (IS_QK_BASIC(keycode)) { | ||
| 84 | keycode = keycode_config(keycode); | ||
| 76 | } | 85 | } |
| 77 | 86 | ||
| 78 | if ((keycode == KC_BSPC) && mod_config(get_mods() | get_oneshot_mods()) & MOD_MASK_CTRL) { | 87 | if ((keycode == KC_BSPC) && mod_config(get_mods() | get_oneshot_mods()) & MOD_MASK_CTRL) { |
| 79 | memset(keylog_str, ' ', OLED_KEYLOGGER_LENGTH); | 88 | memset(oled_keylog_str, ' ', OLED_KEYLOGGER_LENGTH); |
| 80 | keylog_str[OLED_KEYLOGGER_LENGTH-1] = 0x00; | 89 | oled_keylog_str[OLED_KEYLOGGER_LENGTH] = 0x00; |
| 81 | return; | ||
| 82 | } | ||
| 83 | if (record->tap.count) { | ||
| 84 | keycode &= 0xFF; | ||
| 85 | } else if (keycode > 0xFF) { | ||
| 86 | return; | 90 | return; |
| 87 | } | 91 | } |
| 88 | 92 | ||
| 89 | memmove(keylog_str, keylog_str + 1, OLED_KEYLOGGER_LENGTH - 2); | 93 | if (keycode > ARRAY_SIZE(code_to_name)) { |
| 90 | 94 | return; | |
| 91 | if (keycode < ARRAY_SIZE(code_to_name)) { | ||
| 92 | keylog_str[(OLED_KEYLOGGER_LENGTH - 2)] = pgm_read_byte(&code_to_name[keycode]); | ||
| 93 | } | 95 | } |
| 94 | 96 | ||
| 95 | log_timer = timer_read(); | 97 | memmove(oled_keylog_str, oled_keylog_str + 1, OLED_KEYLOGGER_LENGTH - 1); |
| 98 | oled_keylog_str[(OLED_KEYLOGGER_LENGTH - 1)] = pgm_read_byte(&code_to_name[keycode]); | ||
| 96 | } | 99 | } |
| 97 | 100 | ||
| 98 | /** | 101 | /** |
| @@ -107,15 +110,25 @@ void add_keylog(uint16_t keycode, keyrecord_t *record) { | |||
| 107 | */ | 110 | */ |
| 108 | bool process_record_user_oled(uint16_t keycode, keyrecord_t *record) { | 111 | bool process_record_user_oled(uint16_t keycode, keyrecord_t *record) { |
| 109 | if (record->event.pressed) { | 112 | if (record->event.pressed) { |
| 110 | oled_timer_reset(); | ||
| 111 | add_keylog(keycode, record); | 113 | add_keylog(keycode, record); |
| 114 | if (keycode == OLED_BRIGHTNESS_INC) { | ||
| 115 | userspace_config.oled_brightness = qadd8(userspace_config.oled_brightness, OLED_BRIGHTNESS_STEP); | ||
| 116 | oled_set_brightness(userspace_config.oled_brightness); | ||
| 117 | eeconfig_update_user_config(&userspace_config.raw); | ||
| 118 | } else if (keycode == OLED_BRIGHTNESS_DEC) { | ||
| 119 | userspace_config.oled_brightness = qsub8(userspace_config.oled_brightness, OLED_BRIGHTNESS_STEP); | ||
| 120 | oled_set_brightness(userspace_config.oled_brightness); | ||
| 121 | eeconfig_update_user_config(&userspace_config.raw); | ||
| 122 | } else if (keycode == OLED_LOCK) { | ||
| 123 | is_oled_locked = !is_oled_locked; | ||
| 124 | if (is_oled_locked) { | ||
| 125 | oled_on(); | ||
| 126 | } | ||
| 127 | } | ||
| 112 | } | 128 | } |
| 113 | return true; | 129 | return true; |
| 114 | } | 130 | } |
| 115 | 131 | ||
| 116 | void oled_timer_reset(void) { | ||
| 117 | oled_timer = timer_read32(); | ||
| 118 | } | ||
| 119 | /** | 132 | /** |
| 120 | * @brief Renders keylogger buffer to oled | 133 | * @brief Renders keylogger buffer to oled |
| 121 | * | 134 | * |
| @@ -125,7 +138,7 @@ void render_keylogger_status(uint8_t col, uint8_t line) { | |||
| 125 | oled_set_cursor(col, line); | 138 | oled_set_cursor(col, line); |
| 126 | #endif | 139 | #endif |
| 127 | oled_write_P(PSTR(OLED_RENDER_KEYLOGGER), false); | 140 | oled_write_P(PSTR(OLED_RENDER_KEYLOGGER), false); |
| 128 | oled_write(keylog_str, false); | 141 | oled_write(oled_keylog_str, false); |
| 129 | #ifdef OLED_DISPLAY_VERBOSE | 142 | #ifdef OLED_DISPLAY_VERBOSE |
| 130 | oled_advance_page(true); | 143 | oled_advance_page(true); |
| 131 | #endif | 144 | #endif |
| @@ -138,7 +151,18 @@ void render_keylogger_status(uint8_t col, uint8_t line) { | |||
| 138 | void render_default_layer_state(uint8_t col, uint8_t line) { | 151 | void render_default_layer_state(uint8_t col, uint8_t line) { |
| 139 | #ifdef OLED_DISPLAY_VERBOSE | 152 | #ifdef OLED_DISPLAY_VERBOSE |
| 140 | oled_set_cursor(col, line); | 153 | oled_set_cursor(col, line); |
| 141 | #endif | 154 | oled_write_P(PSTR(OLED_RENDER_LAYOUT_NAME), false); |
| 155 | |||
| 156 | static char layer_state_buffer[11] = {0}; | ||
| 157 | static layer_state_t old_state = 0; | ||
| 158 | |||
| 159 | if (old_state != default_layer_state) { | ||
| 160 | snprintf(layer_state_buffer, sizeof(layer_state_buffer), "%-10s", get_layer_name_string(default_layer_state, false)); | ||
| 161 | old_state = default_layer_state; | ||
| 162 | } | ||
| 163 | oled_write(layer_state_buffer, false); | ||
| 164 | oled_advance_page(true); | ||
| 165 | #else | ||
| 142 | oled_write_P(PSTR(OLED_RENDER_LAYOUT_NAME), false); | 166 | oled_write_P(PSTR(OLED_RENDER_LAYOUT_NAME), false); |
| 143 | switch (get_highest_layer(default_layer_state)) { | 167 | switch (get_highest_layer(default_layer_state)) { |
| 144 | case _QWERTY: | 168 | case _QWERTY: |
| @@ -154,8 +178,6 @@ void render_default_layer_state(uint8_t col, uint8_t line) { | |||
| 154 | oled_write_P(PSTR(OLED_RENDER_LAYOUT_DVORAK), false); | 178 | oled_write_P(PSTR(OLED_RENDER_LAYOUT_DVORAK), false); |
| 155 | break; | 179 | break; |
| 156 | } | 180 | } |
| 157 | #ifdef OLED_DISPLAY_VERBOSE | ||
| 158 | oled_advance_page(true); | ||
| 159 | #endif | 181 | #endif |
| 160 | } | 182 | } |
| 161 | 183 | ||
| @@ -165,114 +187,6 @@ void render_default_layer_state(uint8_t col, uint8_t line) { | |||
| 165 | */ | 187 | */ |
| 166 | void render_layer_state(uint8_t col, uint8_t line) { | 188 | void render_layer_state(uint8_t col, uint8_t line) { |
| 167 | #ifdef OLED_DISPLAY_VERBOSE | 189 | #ifdef OLED_DISPLAY_VERBOSE |
| 168 | // clang-format off | ||
| 169 | static const char PROGMEM tri_layer_image[][3][24] = { | ||
| 170 | // base | ||
| 171 | { | ||
| 172 | { | ||
| 173 | 0x00, 0x00, 0x00, 0x80, 0x80, 0x40, | ||
| 174 | 0x40, 0x20, 0x20, 0x10, 0x10, 0x08, | ||
| 175 | 0x08, 0x10, 0x10, 0x20, 0x20, 0x40, | ||
| 176 | 0x40, 0x80, 0x80, 0x00, 0x00, 0x00 | ||
| 177 | }, | ||
| 178 | { | ||
| 179 | 0x00, 0x00, 0x00, 0x88, 0x88, 0x5D, | ||
| 180 | 0x5D, 0x3E, 0x3E, 0x7C, 0x7C, 0xF8, | ||
| 181 | 0xF8, 0x7C, 0x7C, 0x3E, 0x3E, 0x5D, | ||
| 182 | 0x5D, 0x88, 0x88, 0x00, 0x00, 0x00 | ||
| 183 | }, | ||
| 184 | { | ||
| 185 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, | ||
| 186 | 0x01, 0x02, 0x02, 0x04, 0x04, 0x08, | ||
| 187 | 0x08, 0x04, 0x04, 0x02, 0x02, 0x01, | ||
| 188 | 0x01, 0x00, 0x00, 0x00, 0x00, 0x00 | ||
| 189 | } | ||
| 190 | }, | ||
| 191 | // raise | ||
| 192 | { | ||
| 193 | { | ||
| 194 | 0x00, 0x00, 0x00, 0x80, 0x80, 0xC0, | ||
| 195 | 0xC0, 0xE0, 0xE0, 0xF0, 0xF0, 0xF8, | ||
| 196 | 0xF8, 0xF0, 0xF0, 0xE0, 0xE0, 0xC0, | ||
| 197 | 0xC0, 0x80, 0x80, 0x00, 0x00, 0x00 | ||
| 198 | }, | ||
| 199 | { | ||
| 200 | 0x00, 0x00, 0x00, 0x88, 0x88, 0x55, | ||
| 201 | 0x55, 0x23, 0x23, 0x47, 0x47, 0x8F, | ||
| 202 | 0x8F, 0x47, 0x47, 0x23, 0x23, 0x55, | ||
| 203 | 0x55, 0x88, 0x88, 0x00, 0x00, 0x00 | ||
| 204 | }, | ||
| 205 | { | ||
| 206 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, | ||
| 207 | 0x01, 0x02, 0x02, 0x04, 0x04, 0x08, | ||
| 208 | 0x08, 0x04, 0x04, 0x02, 0x02, 0x01, | ||
| 209 | 0x01, 0x00, 0x00, 0x00, 0x00, 0x00 | ||
| 210 | } | ||
| 211 | }, | ||
| 212 | // lower | ||
| 213 | { | ||
| 214 | { | ||
| 215 | 0x00, 0x00, 0x00, 0x80, 0x80, 0x40, | ||
| 216 | 0x40, 0x20, 0x20, 0x10, 0x10, 0x08, | ||
| 217 | 0x08, 0x10, 0x10, 0x20, 0x20, 0x40, | ||
| 218 | 0x40, 0x80, 0x80, 0x00, 0x00, 0x00 | ||
| 219 | }, | ||
| 220 | { | ||
| 221 | 0x00, 0x00, 0x00, 0x88, 0x88, 0xD5, | ||
| 222 | 0xD5, 0xE2, 0xE2, 0xC4, 0xC4, 0x88, | ||
| 223 | 0x88, 0xC4, 0xC4, 0xE2, 0xE2, 0xD5, | ||
| 224 | 0xD5, 0x88, 0x88, 0x00, 0x00, 0x00 | ||
| 225 | }, | ||
| 226 | { | ||
| 227 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, | ||
| 228 | 0x01, 0x03, 0x03, 0x07, 0x07, 0x0F, | ||
| 229 | 0x0F, 0x07, 0x07, 0x03, 0x03, 0x01, | ||
| 230 | 0x01, 0x00, 0x00, 0x00, 0x00, 0x00 | ||
| 231 | } | ||
| 232 | }, | ||
| 233 | // adjust | ||
| 234 | { | ||
| 235 | { | ||
| 236 | 0x00, 0x00, 0x00, 0x80, 0x80, 0x40, | ||
| 237 | 0xC0, 0x60, 0xA0, 0x50, 0xB0, 0x58, | ||
| 238 | 0xA8, 0x50, 0xB0, 0x60, 0xA0, 0x40, | ||
| 239 | 0xC0, 0x80, 0x80, 0x00, 0x00, 0x00 | ||
| 240 | }, | ||
| 241 | { | ||
| 242 | 0x00, 0x00, 0x00, 0x88, 0x88, 0x5D, | ||
| 243 | 0xD5, 0x6B, 0xB6, 0x6D, 0xD6, 0xAD, | ||
| 244 | 0xDA, 0x6D, 0xD6, 0x6B, 0xB6, 0x5D, | ||
| 245 | 0xD5, 0x88, 0x88, 0x00, 0x00, 0x00 | ||
| 246 | }, | ||
| 247 | { | ||
| 248 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, | ||
| 249 | 0x01, 0x03, 0x02, 0x05, 0x06, 0x0D, | ||
| 250 | 0x0A, 0x05, 0x06, 0x03, 0x02, 0x01, | ||
| 251 | 0x01, 0x00, 0x00, 0x00, 0x00, 0x00 | ||
| 252 | } | ||
| 253 | }, | ||
| 254 | // blank | ||
| 255 | { | ||
| 256 | { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, | ||
| 257 | { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, | ||
| 258 | { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 } | ||
| 259 | }, | ||
| 260 | // better gamepad | ||
| 261 | { | ||
| 262 | { 0, 0, 0,192,224,224,112,240,240,240,240,144,144,240,240,240,240,112,224,224,192, 0, 0, 0 }, | ||
| 263 | { 128,248,255,255,255,254,252,230,195,195,230,255,255,254,247,227,246,253,254,255,255,255,248,128 }, | ||
| 264 | { 7, 15, 15, 15, 7, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 7, 15, 15, 15, 7 } | ||
| 265 | |||
| 266 | }, | ||
| 267 | // mouse | ||
| 268 | { | ||
| 269 | { 0, 0, 0, 0, 0, 0, 0, 0,192, 32, 32, 32,160, 32, 32, 32,192, 0, 0, 0, 0, 0, 0, 0 }, | ||
| 270 | { 0, 0, 0, 0, 0, 0, 0,240, 15, 0, 0, 0, 3, 0, 0, 0, 15,240, 0, 0, 0, 0, 0, 0 }, | ||
| 271 | { 0, 0, 0, 0, 0, 0, 0, 3, 6, 4, 4, 4, 4, 4, 4, 4, 6, 3, 0, 0, 0, 0, 0, 0 } | ||
| 272 | } | ||
| 273 | }; | ||
| 274 | |||
| 275 | // clang-format on | ||
| 276 | uint8_t layer_is[4] = {0, 4, 4, 4}; | 190 | uint8_t layer_is[4] = {0, 4, 4, 4}; |
| 277 | if (layer_state_is(_ADJUST)) { | 191 | if (layer_state_is(_ADJUST)) { |
| 278 | layer_is[0] = 3; | 192 | layer_is[0] = 3; |
| @@ -377,18 +291,22 @@ void render_mod_status(uint8_t modifiers, uint8_t col, uint8_t line) { | |||
| 377 | #if defined(OLED_DISPLAY_VERBOSE) | 291 | #if defined(OLED_DISPLAY_VERBOSE) |
| 378 | oled_set_cursor(col, line); | 292 | oled_set_cursor(col, line); |
| 379 | #endif | 293 | #endif |
| 294 | bool is_caps = host_keyboard_led_state().caps_lock; | ||
| 295 | #ifdef CAPS_WORD_ENABLE | ||
| 296 | is_caps |= is_caps_word_on(); | ||
| 297 | #endif | ||
| 380 | oled_write_P(PSTR(OLED_RENDER_MODS_NAME), false); | 298 | oled_write_P(PSTR(OLED_RENDER_MODS_NAME), false); |
| 381 | #if defined(OLED_DISPLAY_VERBOSE) | 299 | #if defined(OLED_DISPLAY_VERBOSE) |
| 382 | oled_write_P(mod_status[0], (modifiers & MOD_BIT(KC_LSFT))); | 300 | oled_write_P(mod_status[0], (modifiers & MOD_BIT(KC_LSFT)) || is_caps); |
| 383 | oled_write_P(mod_status[!keymap_config.swap_lctl_lgui ? 3 : 4], (modifiers & MOD_BIT(KC_LGUI))); | 301 | oled_write_P(mod_status[!keymap_config.swap_lctl_lgui ? 3 : 4], (modifiers & MOD_BIT(KC_LGUI))); |
| 384 | oled_write_P(mod_status[2], (modifiers & MOD_BIT(KC_LALT))); | 302 | oled_write_P(mod_status[2], (modifiers & MOD_BIT(KC_LALT))); |
| 385 | oled_write_P(mod_status[1], (modifiers & MOD_BIT(KC_LCTL))); | 303 | oled_write_P(mod_status[1], (modifiers & MOD_BIT(KC_LCTL))); |
| 386 | oled_write_P(mod_status[1], (modifiers & MOD_BIT(KC_RCTL))); | 304 | oled_write_P(mod_status[1], (modifiers & MOD_BIT(KC_RCTL))); |
| 387 | oled_write_P(mod_status[2], (modifiers & MOD_BIT(KC_RALT))); | 305 | oled_write_P(mod_status[2], (modifiers & MOD_BIT(KC_RALT))); |
| 388 | oled_write_P(mod_status[!keymap_config.swap_lctl_lgui ? 3 : 4], (modifiers & MOD_BIT(KC_RGUI))); | 306 | oled_write_P(mod_status[!keymap_config.swap_lctl_lgui ? 3 : 4], (modifiers & MOD_BIT(KC_RGUI))); |
| 389 | oled_write_P(mod_status[0], (modifiers & MOD_BIT(KC_RSFT))); | 307 | oled_write_P(mod_status[0], (modifiers & MOD_BIT(KC_RSFT)) || is_caps); |
| 390 | #else | 308 | #else |
| 391 | oled_write_P(mod_status[0], (modifiers & MOD_MASK_SHIFT)); | 309 | oled_write_P(mod_status[0], (modifiers & MOD_MASK_SHIFT) || is_caps); |
| 392 | oled_write_P(mod_status[!keymap_config.swap_lctl_lgui ? 3 : 4], (modifiers & MOD_MASK_GUI)); | 310 | oled_write_P(mod_status[!keymap_config.swap_lctl_lgui ? 3 : 4], (modifiers & MOD_MASK_GUI)); |
| 393 | oled_write_P(PSTR(" "), false); | 311 | oled_write_P(PSTR(" "), false); |
| 394 | oled_write_P(mod_status[2], (modifiers & MOD_MASK_ALT)); | 312 | oled_write_P(mod_status[2], (modifiers & MOD_MASK_ALT)); |
| @@ -508,7 +426,7 @@ void render_user_status(uint8_t col, uint8_t line) { | |||
| 508 | static const char PROGMEM rgb_layer_status[2][3] = {{0xEE, 0xEF, 0}, {0xF0, 0xF1, 0}}; | 426 | static const char PROGMEM rgb_layer_status[2][3] = {{0xEE, 0xEF, 0}, {0xF0, 0xF1, 0}}; |
| 509 | oled_write_P(rgb_layer_status[userspace_config.rgb_layer_change], false); | 427 | oled_write_P(rgb_layer_status[userspace_config.rgb_layer_change], false); |
| 510 | static const char PROGMEM cat_mode[2][3] = {{0xF8, 0xF9, 0}, {0xF6, 0xF7, 0}}; | 428 | static const char PROGMEM cat_mode[2][3] = {{0xF8, 0xF9, 0}, {0xF6, 0xF7, 0}}; |
| 511 | oled_write_P(cat_mode[0], host_driver_disabled); | 429 | oled_write_P(cat_mode[0], get_keyboard_lock()); |
| 512 | #if defined(UNICODE_COMMON_ENABLE) | 430 | #if defined(UNICODE_COMMON_ENABLE) |
| 513 | static const char PROGMEM uc_mod_status[5][3] = {{0xEC, 0xED, 0}, {0x20, 0x20, 0}, {0x20, 0x20, 0}, {0x20, 0x20, 0}, {0xEA, 0xEB, 0}}; | 431 | static const char PROGMEM uc_mod_status[5][3] = {{0xEC, 0xED, 0}, {0x20, 0x20, 0}, {0x20, 0x20, 0}, {0x20, 0x20, 0}, {0xEA, 0xEB, 0}}; |
| 514 | oled_write_P(uc_mod_status[get_unicode_input_mode()], false); | 432 | oled_write_P(uc_mod_status[get_unicode_input_mode()], false); |
| @@ -538,12 +456,51 @@ void render_rgb_hsv(uint8_t col, uint8_t line) { | |||
| 538 | oled_write_P(PSTR(", "), false); | 456 | oled_write_P(PSTR(", "), false); |
| 539 | oled_write(get_u8_str(rgb_matrix_get_val(), ' '), false); | 457 | oled_write(get_u8_str(rgb_matrix_get_val(), ' '), false); |
| 540 | #elif RGBLIGHT_ENABLE | 458 | #elif RGBLIGHT_ENABLE |
| 541 | oled_write(get_u8_str(rgblight_get_hue(), ' '), false); | 459 | if (is_rgblight_startup_running()) { |
| 542 | oled_write_P(PSTR(", "), false); | 460 | oled_write_P(PSTR("Start Animation"), false); |
| 543 | oled_write(get_u8_str(rgblight_get_sat(), ' '), false); | 461 | } else { |
| 544 | oled_write_P(PSTR(", "), false); | 462 | oled_write(get_u8_str(rgblight_get_hue(), ' '), false); |
| 545 | oled_write(get_u8_str(rgblight_get_val(), ' '), false); | 463 | oled_write_P(PSTR(", "), false); |
| 464 | oled_write(get_u8_str(rgblight_get_sat(), ' '), false); | ||
| 465 | oled_write_P(PSTR(", "), false); | ||
| 466 | oled_write(get_u8_str(rgblight_get_val(), ' '), false); | ||
| 467 | } | ||
| 468 | #endif | ||
| 469 | } | ||
| 470 | |||
| 471 | void render_rgb_mode(uint8_t col, uint8_t line) { | ||
| 472 | oled_set_cursor(col, line); | ||
| 473 | __attribute__((unused)) static uint8_t mode; | ||
| 474 | bool need_update = false; | ||
| 475 | static char buf[21] = {0}; | ||
| 476 | |||
| 477 | #ifdef RGB_MATRIX_ENABLE | ||
| 478 | if (mode != rgb_matrix_get_mode()) { | ||
| 479 | snprintf(buf, sizeof(buf), "%-20s", rgb_matrix_name(rgb_matrix_get_mode())); | ||
| 480 | mode = rgb_matrix_get_mode(); | ||
| 481 | need_update = true; | ||
| 482 | } | ||
| 483 | #elif RGBLIGHT_ENABLE | ||
| 484 | if (mode != rgblight_get_mode()) { | ||
| 485 | snprintf(buf, sizeof(buf), "%-20s", rgblight_name(rgblight_get_mode())); | ||
| 486 | mode = rgblight_get_mode(); | ||
| 487 | need_update = true; | ||
| 488 | } | ||
| 546 | #endif | 489 | #endif |
| 490 | if (need_update) { | ||
| 491 | for (uint8_t i = 1; i < sizeof(buf); ++i) { | ||
| 492 | if (buf[i] == 0) | ||
| 493 | break; | ||
| 494 | else if (buf[i] == '_') | ||
| 495 | buf[i] = ' '; | ||
| 496 | else if (buf[i - 1] == ' ') | ||
| 497 | buf[i] = toupper(buf[i]); | ||
| 498 | else if (buf[i - 1] != ' ') | ||
| 499 | buf[i] = tolower(buf[i]); | ||
| 500 | } | ||
| 501 | } | ||
| 502 | |||
| 503 | oled_write(buf, false); | ||
| 547 | } | 504 | } |
| 548 | 505 | ||
| 549 | void render_wpm(uint8_t padding, uint8_t col, uint8_t line) { | 506 | void render_wpm(uint8_t padding, uint8_t col, uint8_t line) { |
| @@ -642,9 +599,6 @@ void render_pointing_dpi_status(uint16_t cpi, uint8_t padding, uint8_t col, uint | |||
| 642 | 599 | ||
| 643 | // #define ANIM_FRAME_DURATION 500 // how long each frame lasts in ms | 600 | // #define ANIM_FRAME_DURATION 500 // how long each frame lasts in ms |
| 644 | // #define SLEEP_TIMER 60000 // should sleep after this period of 0 wpm, needs fixing | 601 | // #define SLEEP_TIMER 60000 // should sleep after this period of 0 wpm, needs fixing |
| 645 | #define OLED_ANIM_SIZE 36 | ||
| 646 | #define OLED_ANIM_ROWS 4 | ||
| 647 | #define OLED_ANIM_MAX_FRAMES 3 | ||
| 648 | #if (OLED_SLEEP_FRAMES > OLED_ANIM_MAX_FRAMES) || (OLED_WAKE_FRAMES > OLED_ANIM_MAX_FRAMES) || (OLED_KAKI_FRAMES > OLED_ANIM_MAX_FRAMES) || (OLED_RTOGI_FRAMES > OLED_ANIM_MAX_FRAMES) | 602 | #if (OLED_SLEEP_FRAMES > OLED_ANIM_MAX_FRAMES) || (OLED_WAKE_FRAMES > OLED_ANIM_MAX_FRAMES) || (OLED_KAKI_FRAMES > OLED_ANIM_MAX_FRAMES) || (OLED_RTOGI_FRAMES > OLED_ANIM_MAX_FRAMES) |
| 649 | # error frame size too large | 603 | # error frame size too large |
| 650 | #endif | 604 | #endif |
| @@ -653,81 +607,6 @@ static uint8_t animation_frame = 0; | |||
| 653 | static uint8_t animation_type = 0; | 607 | static uint8_t animation_type = 0; |
| 654 | 608 | ||
| 655 | void render_kitty(uint8_t col, uint8_t line) { | 609 | void render_kitty(uint8_t col, uint8_t line) { |
| 656 | // Images credit j-inc(/James Incandenza) and pixelbenny. | ||
| 657 | // Credit to obosob for initial animation approach. | ||
| 658 | // heavily modified by drashna because he's a glutton for punishment | ||
| 659 | |||
| 660 | // clang-format off | ||
| 661 | static const char PROGMEM animation[4][OLED_ANIM_MAX_FRAMES][OLED_ANIM_ROWS][OLED_ANIM_SIZE] = { | ||
| 662 | // sleep frames | ||
| 663 | { | ||
| 664 | { | ||
| 665 | { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x08, 0xa8, 0x48, 0xa8, 0x18, 0x08, 0x00, 0x00, 0x00, 0x80, 0x80, 0x80, 0x80, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, | ||
| 666 | { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x03, 0x02, 0x02, 0x02, 0x02, 0x02, 0x00, 0x00, 0x80, 0x44, 0x84, 0x06, 0x05, 0x04, 0x80, 0x40, 0x20, 0x10, 0xe0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, | ||
| 667 | { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x20, 0x18, 0x04, 0x04, 0x02, 0x7a, 0x86, 0x01, 0x80, 0x80, 0x01, 0x03, 0x05, 0x07, 0x01, 0x00, 0x00, 0x80, 0x83, 0x45, 0xfa, 0x3c, 0xe0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, | ||
| 668 | { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0x08, 0x10, 0x10, 0x10, 0x10, 0x10, 0x33, 0x24, 0x28, 0x28, 0x29, 0x29, 0x29, 0x3a, 0x18, 0x1c, 0x39, 0x24, 0x24, 0x3a, 0x2d, 0x26, 0x31, 0x1f, 0x00, 0x00, 0x00, 0x00, 0x00 } | ||
| 669 | }, | ||
| 670 | { | ||
| 671 | { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, | ||
| 672 | { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x22, 0x22, 0x3a, 0x2a, 0x26, 0x22, 0x80, 0xc0, 0x80, 0x00, 0x24, 0x34, 0x2c, 0xe4, 0x60, 0x10, 0x70, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, | ||
| 673 | { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x38, 0x04, 0x02, 0x02, 0x01, 0x79, 0x87, 0x01, 0x80, 0x81, 0x83, 0x05, 0x05, 0x03, 0x01, 0x00, 0x00, 0x80, 0x43, 0x05, 0xfa, 0x3c, 0xe0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, | ||
| 674 | { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0x08, 0x10, 0x10, 0x10, 0x10, 0x10, 0x33, 0x24, 0x28, 0x28, 0x28, 0x29, 0x29, 0x3a, 0x18, 0x1c, 0x39, 0x24, 0x24, 0x3a, 0x2d, 0x26, 0x31, 0x1f, 0x00, 0x00, 0x00, 0x00, 0x00 } | ||
| 675 | } | ||
| 676 | }, | ||
| 677 | // wake frames | ||
| 678 | { | ||
| 679 | { | ||
| 680 | { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x30, 0x08, 0x10, 0x60, 0x80, 0x00, 0x80, 0x60, 0x10, 0x08, 0x30, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, | ||
| 681 | { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7f, 0x80, 0x40, 0x40, 0x5c, 0x00, 0x01, 0x41, 0x01, 0x00, 0x5c, 0x40, 0x40, 0x80, 0x7f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, | ||
| 682 | { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x40, 0x40, 0x80, 0xe1, 0x12, 0x0a, 0x06, 0x00, 0x80, 0x00, 0x06, 0x0a, 0x12, 0xe1, 0x80, 0x40, 0x40, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, | ||
| 683 | { 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x1f, 0x14, 0x14, 0x10, 0x10, 0x11, 0x1f, 0x10, 0x10, 0x18, 0x0f, 0x18, 0x10, 0x10, 0x1f, 0x11, 0x10, 0x10, 0x14, 0x14, 0x1f, 0x1c, 0x14, 0x14, 0x14, 0x08, 0x00, 0x00, 0x00, 0x00 } | ||
| 684 | }, | ||
| 685 | { | ||
| 686 | { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x30, 0x08, 0x10, 0x60, 0x80, 0x00, 0x80, 0x60, 0x10, 0x08, 0x30, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, | ||
| 687 | { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7f, 0x90, 0x12, 0x0a, 0x02, 0xf4, 0x09, 0x0d, 0xf1, 0x04, 0x02, 0x0a, 0x12, 0x90, 0x7f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, | ||
| 688 | { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x40, 0x40, 0x80, 0xe1, 0x12, 0x0a, 0x06, 0x01, 0x81, 0x00, 0x06, 0x0a, 0x12, 0xe1, 0x80, 0x40, 0x40, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, | ||
| 689 | { 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x1f, 0x14, 0x14, 0x10, 0x10, 0x11, 0x1f, 0x10, 0x10, 0x18, 0x0f, 0x18, 0x10, 0x10, 0x1f, 0x11, 0x10, 0x10, 0x14, 0x14, 0x1f, 0x1c, 0x14, 0x14, 0x14, 0x08, 0x00, 0x00, 0x00, 0x00 } | ||
| 690 | } | ||
| 691 | }, | ||
| 692 | // kaki frames | ||
| 693 | { | ||
| 694 | { | ||
| 695 | { 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x40, 0x40, 0x80, 0x80, 0x80, 0x00, 0xfc, 0x84, 0x08, 0x08, 0x10, 0x20, 0x40, 0x40, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, | ||
| 696 | { 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x1e, 0x60, 0x80, 0x00, 0x00, 0x91, 0xa1, 0x80, 0x00, 0x00, 0x22, 0x84, 0x40, 0x50, 0x48, 0xc1, 0x3e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, | ||
| 697 | { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x40, 0x41, 0x82, 0xe2, 0x12, 0x0a, 0x06, 0x00, 0x80, 0x88, 0x4f, 0x02, 0x22, 0xe2, 0x9f, 0x40, 0x40, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, | ||
| 698 | { 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x1f, 0x14, 0x14, 0x10, 0x10, 0x11, 0x1f, 0x10, 0x10, 0x18, 0x0f, 0x18, 0x14, 0x10, 0x10, 0x10, 0x10, 0x10, 0x14, 0x14, 0x1f, 0x1a, 0x0a, 0x0a, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00 } | ||
| 699 | }, | ||
| 700 | { | ||
| 701 | { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x10, 0x20, 0x20, 0x40, 0x40, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, | ||
| 702 | { 0x00, 0x00, 0x06, 0x1a, 0x22, 0xc2, 0x04, 0x04, 0x04, 0x07, 0x00, 0xc0, 0x20, 0x10, 0x80, 0x80, 0x01, 0x01, 0x02, 0xfc, 0xfe, 0x02, 0x3c, 0x20, 0x40, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, | ||
| 703 | { 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0x0d, 0x8d, 0x55, 0x50, 0x94, 0xf0, 0x10, 0x09, 0x08, 0x00, 0x80, 0x00, 0x06, 0x09, 0x1b, 0xee, 0x00, 0x00, 0x00, 0x00, 0x81, 0xfe, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, | ||
| 704 | { 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x1f, 0x14, 0x14, 0x10, 0x10, 0x11, 0x1f, 0x10, 0x10, 0x18, 0x0f, 0x18, 0x10, 0x10, 0x1f, 0x19, 0x18, 0x1c, 0x14, 0x16, 0x15, 0x14, 0x14, 0x14, 0x14, 0x08, 0x00, 0x00, 0x00, 0x00 } | ||
| 705 | }, | ||
| 706 | { | ||
| 707 | { 0x00, 0x00, 0x00, 0x00, 0x80, 0x40, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0x10, 0x20, 0x40, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, | ||
| 708 | { 0x00, 0x00, 0x00, 0x00, 0x0f, 0xf0, 0x00, 0x01, 0x02, 0x04, 0x04, 0x03, 0x80, 0x40, 0x40, 0x20, 0x00, 0x01, 0x02, 0x8c, 0x70, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, | ||
| 709 | { 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0x0d, 0x8d, 0x55, 0x50, 0x94, 0xf0, 0x10, 0x0a, 0x0e, 0x1d, 0x95, 0x24, 0x24, 0x27, 0x13, 0xe1, 0x01, 0x01, 0x01, 0x01, 0x02, 0xfc, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, | ||
| 710 | { 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x1f, 0x14, 0x14, 0x10, 0x10, 0x11, 0x1f, 0x10, 0x10, 0x18, 0x0f, 0x18, 0x10, 0x10, 0x1f, 0x19, 0x18, 0x1c, 0x14, 0x14, 0x17, 0x14, 0x14, 0x14, 0x14, 0x08, 0x00, 0x00, 0x00, 0x00 } | ||
| 711 | } | ||
| 712 | }, | ||
| 713 | // rtogi frames | ||
| 714 | { | ||
| 715 | { | ||
| 716 | { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x20, 0x10, 0x10, 0x08, 0x04, 0x02, 0x01, 0x0f, 0x90, 0x10, 0x20, 0xf0, 0xf8, 0xf8, 0x00, 0x00, 0x00, 0x00 }, | ||
| 717 | { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x40, 0x20, 0x10, 0x10, 0x08, 0x08, 0x08, 0x08, 0x48, 0x47, 0x88, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x88, 0xc7, 0xc4, 0x62, 0x23, 0x11, 0x3f, 0x00, 0x00, 0x00, 0x00 }, | ||
| 718 | { 0x80, 0x40, 0x20, 0x10, 0x88, 0xcc, 0x43, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0xc0, 0x80, 0x80, 0xc0, 0xe1, 0xfe, 0xb8, 0x88, 0x0c, 0x04, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, | ||
| 719 | { 0x00, 0x01, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x01, 0x06, 0x04, 0x04, 0x04, 0x04, 0x05, 0x04, 0x04, 0x04, 0x07, 0x07, 0x07, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 } | ||
| 720 | }, | ||
| 721 | { | ||
| 722 | { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x20, 0x10, 0x10, 0x08, 0x04, 0x02, 0x01, 0x1f, 0xa0, 0x20, 0x40, 0x80, 0x00, 0xf0, 0x00, 0x00, 0x00, 0x00 }, | ||
| 723 | { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x40, 0x20, 0x10, 0x10, 0x08, 0x08, 0x08, 0x08, 0x48, 0x47, 0x88, 0x00, 0x00, 0x00, 0x00, 0x24, 0x24, 0x28, 0x6b, 0x40, 0xa0, 0x99, 0x86, 0xff, 0x00, 0x00, 0x00, 0x00 }, | ||
| 724 | { 0x0f, 0x11, 0x22, 0x44, 0x48, 0x4c, 0x43, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0xc0, 0x80, 0x80, 0xc0, 0xe1, 0xfe, 0xb8, 0x88, 0x0c, 0x04, 0x06, 0x06, 0x06, 0x0e, 0x0e, 0x06, 0x01, 0x00, 0x00, 0x00, 0x00 }, | ||
| 725 | { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x01, 0x06, 0x04, 0x04, 0x04, 0x04, 0x05, 0x04, 0x04, 0x04, 0x07, 0x07, 0x07, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 } | ||
| 726 | } | ||
| 727 | } | ||
| 728 | }; | ||
| 729 | // clang-format on | ||
| 730 | |||
| 731 | for (uint8_t i = 0; i < 4; i++) { | 610 | for (uint8_t i = 0; i < 4; i++) { |
| 732 | oled_set_cursor(col, line + i); | 611 | oled_set_cursor(col, line + i); |
| 733 | oled_write_raw_P(animation[animation_type][animation_frame][i], OLED_ANIM_SIZE); | 612 | oled_write_raw_P(animation[animation_type][animation_frame][i], OLED_ANIM_SIZE); |
| @@ -776,13 +655,6 @@ uint32_t kitty_animation_phases(uint32_t triger_time, void *cb_arg) { | |||
| 776 | void render_mouse_mode(uint8_t col, uint8_t line) { | 655 | void render_mouse_mode(uint8_t col, uint8_t line) { |
| 777 | #if (defined(KEYBOARD_bastardkb_charybdis) || defined(KEYBOARD_handwired_tractyl_manuform)) && defined(POINTING_DEVICE_ENABLE) | 656 | #if (defined(KEYBOARD_bastardkb_charybdis) || defined(KEYBOARD_handwired_tractyl_manuform)) && defined(POINTING_DEVICE_ENABLE) |
| 778 | // credit and thanks to jaspertandy on discord for these images | 657 | // credit and thanks to jaspertandy on discord for these images |
| 779 | static const char PROGMEM mouse_logo[3][2][16] = {// mouse icon | ||
| 780 | {{0, 0, 0, 252, 2, 2, 2, 58, 2, 2, 2, 252, 0, 0, 0, 0}, {0, 0, 63, 96, 64, 64, 64, 64, 64, 64, 64, 96, 63, 0, 0, 0}}, | ||
| 781 | // crosshair icon | ||
| 782 | {{128, 240, 136, 228, 146, 138, 202, 127, 202, 138, 146, 228, 136, 240, 128, 0}, {0, 7, 8, 19, 36, 40, 41, 127, 41, 40, 36, 19, 8, 7, 0, 0}}, | ||
| 783 | // dragscroll icon | ||
| 784 | {{0, 0, 112, 136, 156, 2, 15, 1, 15, 2, 140, 68, 56, 0, 0, 0}, {0, 0, 2, 6, 15, 28, 60, 124, 60, 28, 15, 6, 2, 0, 0, 0}}}; | ||
| 785 | |||
| 786 | uint8_t image_index = 0; | 658 | uint8_t image_index = 0; |
| 787 | # ifdef OLED_DISPLAY_TEST | 659 | # ifdef OLED_DISPLAY_TEST |
| 788 | image_index = animation_frame; | 660 | image_index = animation_frame; |
| @@ -848,7 +720,18 @@ void render_status_left(void) { | |||
| 848 | } | 720 | } |
| 849 | 721 | ||
| 850 | __attribute__((weak)) void oled_render_large_display(bool side) { | 722 | __attribute__((weak)) void oled_render_large_display(bool side) { |
| 851 | if (!side) { | 723 | if (side) { |
| 724 | render_rgb_hsv(1, 7); | ||
| 725 | render_rgb_mode(1, 8); | ||
| 726 | |||
| 727 | render_wpm_graph(48, 72); | ||
| 728 | } else { | ||
| 729 | oled_advance_page(true); | ||
| 730 | oled_advance_page(true); | ||
| 731 | |||
| 732 | oled_set_cursor(0, 9); | ||
| 733 | oled_write_raw_P(qmk_logo, 384); // is 3 rows of 128 pixels, so 384 bytes. | ||
| 734 | |||
| 852 | render_unicode_mode(1, 14); | 735 | render_unicode_mode(1, 14); |
| 853 | } | 736 | } |
| 854 | } | 737 | } |
| @@ -864,7 +747,7 @@ __attribute__((weak)) oled_rotation_t oled_init_keymap(oled_rotation_t rotation) | |||
| 864 | 747 | ||
| 865 | oled_rotation_t oled_init_user(oled_rotation_t rotation) { | 748 | oled_rotation_t oled_init_user(oled_rotation_t rotation) { |
| 866 | if (is_keyboard_master()) { | 749 | if (is_keyboard_master()) { |
| 867 | memset(keylog_str, ' ', OLED_KEYLOGGER_LENGTH); | 750 | memset(oled_keylog_str, ' ', OLED_KEYLOGGER_LENGTH); |
| 868 | } | 751 | } |
| 869 | 752 | ||
| 870 | kittoken = defer_exec(3000, kitty_animation_phases, NULL); | 753 | kittoken = defer_exec(3000, kitty_animation_phases, NULL); |
| @@ -894,12 +777,7 @@ bool oled_task_user(void) { | |||
| 894 | } | 777 | } |
| 895 | 778 | ||
| 896 | #if defined(OLED_DISPLAY_VERBOSE) | 779 | #if defined(OLED_DISPLAY_VERBOSE) |
| 897 | static const char PROGMEM header_image[] = { | ||
| 898 | 0, 192, 32, 16, 8, 4, 2, 1, 1, 1, 1, 1, 1, 1, 1, 3, 7, 15, 31, 63, 127, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 127, 63, 31, 15, 7, 3, 1, 1, 1, 1, 1, 1, 1, 1, 2, 4, 8, 16, 32, 192, 0, | ||
| 899 | // 0,255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 3, 7, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 7, 3, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,255, 0 | ||
| 900 | }; | ||
| 901 | oled_write_raw_P(header_image, sizeof(header_image)); | 780 | oled_write_raw_P(header_image, sizeof(header_image)); |
| 902 | |||
| 903 | oled_set_cursor(4, 0); | 781 | oled_set_cursor(4, 0); |
| 904 | render_oled_title(is_keyboard_left()); | 782 | render_oled_title(is_keyboard_left()); |
| 905 | #endif | 783 | #endif |
| @@ -934,7 +812,6 @@ bool oled_task_user(void) { | |||
| 934 | oled_write_raw_P(display_border, sizeof(display_border)); | 812 | oled_write_raw_P(display_border, sizeof(display_border)); |
| 935 | } | 813 | } |
| 936 | 814 | ||
| 937 | static const char PROGMEM footer_image[] = {0, 3, 4, 8, 16, 32, 64, 128, 128, 128, 128, 128, 128, 128, 192, 224, 240, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 240, 224, 192, 128, 128, 128, 128, 128, 128, 128, 64, 32, 16, 8, 4, 3, 0}; | ||
| 938 | oled_set_cursor(0, num_of_rows); | 815 | oled_set_cursor(0, num_of_rows); |
| 939 | oled_write_raw_P(footer_image, sizeof(footer_image)); | 816 | oled_write_raw_P(footer_image, sizeof(footer_image)); |
| 940 | #endif | 817 | #endif |
| @@ -942,8 +819,12 @@ bool oled_task_user(void) { | |||
| 942 | return false; | 819 | return false; |
| 943 | } | 820 | } |
| 944 | 821 | ||
| 945 | extern bool oled_initialized; | 822 | void housekeeping_task_oled(void) { |
| 946 | 823 | is_oled_enabled = false; | |
| 947 | __attribute__((weak)) void housekeeping_task_oled(void) { | 824 | if ((is_oled_locked || (last_input_activity_elapsed() < 60000)) && !is_oled_force_off) { |
| 948 | is_oled_enabled = is_oled_locked ? true : !(timer_elapsed32(oled_timer) > 60000); | 825 | is_oled_enabled = true; |
| 826 | } | ||
| 827 | if (oled_get_brightness() != userspace_config.oled_brightness) { | ||
| 828 | oled_set_brightness(userspace_config.oled_brightness); | ||
| 829 | } | ||
| 949 | } | 830 | } |
diff --git a/users/drashna/oled/oled_stuff.h b/users/drashna/oled/oled_stuff.h index 419cdc11eb..414720ff2a 100644 --- a/users/drashna/oled/oled_stuff.h +++ b/users/drashna/oled/oled_stuff.h | |||
| @@ -18,6 +18,7 @@ | |||
| 18 | 18 | ||
| 19 | #include "quantum.h" | 19 | #include "quantum.h" |
| 20 | #include "oled_driver.h" | 20 | #include "oled_driver.h" |
| 21 | #include "oled_assets.h" | ||
| 21 | #ifdef DEFFERED_EXEC_ENABLE | 22 | #ifdef DEFFERED_EXEC_ENABLE |
| 22 | extern deferred_token kittoken; | 23 | extern deferred_token kittoken; |
| 23 | #endif | 24 | #endif |
| @@ -55,7 +56,7 @@ void oled_pan_section(bool left, uint16_t y_start, uint16_t y_end, uint16_t x_st | |||
| 55 | 56 | ||
| 56 | # define OLED_RENDER_KEYLOGGER "Keylogger: " | 57 | # define OLED_RENDER_KEYLOGGER "Keylogger: " |
| 57 | # ifndef OLED_KEYLOGGER_LENGTH | 58 | # ifndef OLED_KEYLOGGER_LENGTH |
| 58 | # define OLED_KEYLOGGER_LENGTH 10 | 59 | # define OLED_KEYLOGGER_LENGTH 9 |
| 59 | # endif | 60 | # endif |
| 60 | # define OLED_RENDER_LAYOUT_NAME "Layout: " | 61 | # define OLED_RENDER_LAYOUT_NAME "Layout: " |
| 61 | # define OLED_RENDER_LAYOUT_QWERTY "Qwerty" | 62 | # define OLED_RENDER_LAYOUT_QWERTY "Qwerty" |
| @@ -102,7 +103,7 @@ void oled_pan_section(bool left, uint16_t y_start, uint16_t y_end, uint16_t x_st | |||
| 102 | #else | 103 | #else |
| 103 | # define OLED_RENDER_KEYLOGGER "KLogr" | 104 | # define OLED_RENDER_KEYLOGGER "KLogr" |
| 104 | # ifndef OLED_KEYLOGGER_LENGTH | 105 | # ifndef OLED_KEYLOGGER_LENGTH |
| 105 | # define OLED_KEYLOGGER_LENGTH 6 | 106 | # define OLED_KEYLOGGER_LENGTH 5 |
| 106 | # endif | 107 | # endif |
| 107 | 108 | ||
| 108 | # define OLED_RENDER_LAYOUT_NAME "Lyout" | 109 | # define OLED_RENDER_LAYOUT_NAME "Lyout" |
| @@ -149,7 +150,7 @@ void oled_pan_section(bool left, uint16_t y_start, uint16_t y_end, uint16_t x_st | |||
| 149 | # define OLED_RENDER_WPM_COUNTER "WPM: " | 150 | # define OLED_RENDER_WPM_COUNTER "WPM: " |
| 150 | #endif | 151 | #endif |
| 151 | 152 | ||
| 152 | extern char keylog_str[]; | 153 | extern char oled_keylog_str[OLED_KEYLOGGER_LENGTH + 1]; |
| 153 | 154 | ||
| 154 | #ifndef OLED_WPM_GRAPH_MAX_WPM | 155 | #ifndef OLED_WPM_GRAPH_MAX_WPM |
| 155 | # define OLED_WPM_GRAPH_MAX_WPM 120 | 156 | # define OLED_WPM_GRAPH_MAX_WPM 120 |
diff --git a/users/drashna/oled/rules.mk b/users/drashna/oled/rules.mk new file mode 100644 index 0000000000..95be67a9ef --- /dev/null +++ b/users/drashna/oled/rules.mk | |||
| @@ -0,0 +1,12 @@ | |||
| 1 | |||
| 2 | CUSTOM_OLED_DRIVER ?= yes | ||
| 3 | ifeq ($(strip $(OLED_ENABLE)), yes) | ||
| 4 | ifeq ($(strip $(CUSTOM_OLED_DRIVER)), yes) | ||
| 5 | OPT_DEFS += -DCUSTOM_OLED_DRIVER | ||
| 6 | SRC += $(USER_PATH)/oled/oled_stuff.c | ||
| 7 | endif | ||
| 8 | ifeq ($(strip $(OLED_DISPLAY_TEST)), yes) | ||
| 9 | OPT_DEFS += -DOLED_DISPLAY_TEST | ||
| 10 | endif | ||
| 11 | endif | ||
| 12 | DEFERRED_EXEC_ENABLE = yes | ||
diff --git a/users/drashna/oled/sh110x.c b/users/drashna/oled/sh110x.c deleted file mode 100644 index f96a93a897..0000000000 --- a/users/drashna/oled/sh110x.c +++ /dev/null | |||
| @@ -1,860 +0,0 @@ | |||
| 1 | /* | ||
| 2 | Copyright 2019 Ryan Caltabiano <https://github.com/XScorpion2> | ||
| 3 | |||
| 4 | This program is free software: you can redistribute it and/or modify | ||
| 5 | it under the terms of the GNU General Public License as published by | ||
| 6 | the Free Software Foundation, either version 2 of the License, or | ||
| 7 | (at your option) any later version. | ||
| 8 | |||
| 9 | This program is distributed in the hope that it will be useful, | ||
| 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| 12 | GNU General Public License for more details. | ||
| 13 | |||
| 14 | You should have received a copy of the GNU General Public License | ||
| 15 | along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
| 16 | */ | ||
| 17 | #include "i2c_master.h" | ||
| 18 | #include "oled_driver.h" | ||
| 19 | #include OLED_FONT_H | ||
| 20 | #include "timer.h" | ||
| 21 | #include "print.h" | ||
| 22 | |||
| 23 | #include <string.h> | ||
| 24 | |||
| 25 | #include "progmem.h" | ||
| 26 | |||
| 27 | #include "keyboard.h" | ||
| 28 | |||
| 29 | // for SH1107: https://www.displayfuture.com/Display/datasheet/controller/SH1107.pdf | ||
| 30 | |||
| 31 | // Fundamental Commands | ||
| 32 | #define CONTRAST 0x81 | ||
| 33 | #define DISPLAY_ALL_ON 0xA5 | ||
| 34 | #define DISPLAY_ALL_ON_RESUME 0xA4 | ||
| 35 | #define NORMAL_DISPLAY 0xA6 | ||
| 36 | #define INVERT_DISPLAY 0xA7 | ||
| 37 | #define DISPLAY_ON 0xAF | ||
| 38 | #define DISPLAY_OFF 0xAE | ||
| 39 | #define NOP 0xE3 | ||
| 40 | |||
| 41 | // Scrolling Commands | ||
| 42 | #define ACTIVATE_SCROLL 0x2F | ||
| 43 | #define DEACTIVATE_SCROLL 0x2E | ||
| 44 | #define SCROLL_RIGHT 0x26 | ||
| 45 | #define SCROLL_LEFT 0x27 | ||
| 46 | #define SCROLL_RIGHT_UP 0x29 | ||
| 47 | #define SCROLL_LEFT_UP 0x2A | ||
| 48 | |||
| 49 | // Addressing Setting Commands | ||
| 50 | #define MEMORY_MODE 0x20 | ||
| 51 | #define COLUMN_ADDR 0x21 | ||
| 52 | #define PAGE_ADDR 0x22 | ||
| 53 | #define PAM_SETCOLUMN_LSB 0x00 | ||
| 54 | #define PAM_SETCOLUMN_MSB 0x10 | ||
| 55 | #define PAM_PAGE_ADDR 0xB0 // 0xb0 -- 0xb7 | ||
| 56 | |||
| 57 | // Hardware Configuration Commands | ||
| 58 | #define DISPLAY_START_LINE 0x40 | ||
| 59 | #define SEGMENT_REMAP 0xA0 | ||
| 60 | #define SEGMENT_REMAP_INV 0xA1 | ||
| 61 | #define MULTIPLEX_RATIO 0xA8 | ||
| 62 | #define COM_SCAN_INC 0xC0 | ||
| 63 | #define COM_SCAN_DEC 0xC8 | ||
| 64 | #define DISPLAY_OFFSET 0xD3 | ||
| 65 | #define COM_PINS 0xDA | ||
| 66 | #define COM_PINS_SEQ 0x02 | ||
| 67 | #define COM_PINS_ALT 0x12 | ||
| 68 | #define COM_PINS_SEQ_LR 0x22 | ||
| 69 | #define COM_PINS_ALT_LR 0x32 | ||
| 70 | |||
| 71 | // Timing & Driving Commands | ||
| 72 | #define DISPLAY_CLOCK 0xD5 | ||
| 73 | #define PRE_CHARGE_PERIOD 0xD9 | ||
| 74 | #define VCOM_DETECT 0xDB | ||
| 75 | |||
| 76 | // Advance Graphic Commands | ||
| 77 | #define FADE_BLINK 0x23 | ||
| 78 | #define ENABLE_FADE 0x20 | ||
| 79 | #define ENABLE_BLINK 0x30 | ||
| 80 | |||
| 81 | // Charge Pump Commands | ||
| 82 | #define CHARGE_PUMP 0x8D | ||
| 83 | |||
| 84 | // Commands specific to the SH1107 chip | ||
| 85 | #define SH1107_DISPLAY_START_LINE 0xDC | ||
| 86 | #define SH1107_MEMORY_MODE_PAGE 0x20 | ||
| 87 | #define SH1107_MEMORY_MODE_VERTICAL 0x21 | ||
| 88 | |||
| 89 | // Misc defines | ||
| 90 | #ifndef OLED_BLOCK_COUNT | ||
| 91 | # define OLED_BLOCK_COUNT (sizeof(OLED_BLOCK_TYPE) * 8) | ||
| 92 | #endif | ||
| 93 | #ifndef OLED_BLOCK_SIZE | ||
| 94 | # define OLED_BLOCK_SIZE (OLED_MATRIX_SIZE / OLED_BLOCK_COUNT) | ||
| 95 | #endif | ||
| 96 | |||
| 97 | #define OLED_ALL_BLOCKS_MASK (((((OLED_BLOCK_TYPE)1 << (OLED_BLOCK_COUNT - 1)) - 1) << 1) | 1) | ||
| 98 | |||
| 99 | #ifndef OLED_COM_PIN_COUNT | ||
| 100 | # define OLED_COM_PIN_COUNT 128 | ||
| 101 | #endif | ||
| 102 | |||
| 103 | #ifndef OLED_COM_PIN_OFFSET | ||
| 104 | # define OLED_COM_PIN_OFFSET 0 | ||
| 105 | #endif | ||
| 106 | |||
| 107 | // i2c defines | ||
| 108 | #define I2C_CMD 0x00 | ||
| 109 | #define I2C_DATA 0x40 | ||
| 110 | #if defined(__AVR__) | ||
| 111 | # define I2C_TRANSMIT_P(data) i2c_transmit_P((OLED_DISPLAY_ADDRESS << 1), &data[0], sizeof(data), OLED_I2C_TIMEOUT) | ||
| 112 | #else // defined(__AVR__) | ||
| 113 | # define I2C_TRANSMIT_P(data) i2c_transmit((OLED_DISPLAY_ADDRESS << 1), &data[0], sizeof(data), OLED_I2C_TIMEOUT) | ||
| 114 | #endif // defined(__AVR__) | ||
| 115 | #define I2C_TRANSMIT(data) i2c_transmit((OLED_DISPLAY_ADDRESS << 1), &data[0], sizeof(data), OLED_I2C_TIMEOUT) | ||
| 116 | #define I2C_WRITE_REG(mode, data, size) i2c_writeReg((OLED_DISPLAY_ADDRESS << 1), mode, data, size, OLED_I2C_TIMEOUT) | ||
| 117 | |||
| 118 | #define HAS_FLAGS(bits, flags) ((bits & flags) == flags) | ||
| 119 | |||
| 120 | // Display buffer's is the same as the OLED memory layout | ||
| 121 | // this is so we don't end up with rounding errors with | ||
| 122 | // parts of the display unusable or don't get cleared correctly | ||
| 123 | // and also allows for drawing & inverting | ||
| 124 | uint8_t oled_buffer[OLED_MATRIX_SIZE]; | ||
| 125 | uint8_t *oled_cursor; | ||
| 126 | OLED_BLOCK_TYPE oled_dirty = 0; | ||
| 127 | bool oled_initialized = false; | ||
| 128 | bool oled_active = false; | ||
| 129 | bool oled_scrolling = false; | ||
| 130 | bool oled_inverted = false; | ||
| 131 | uint8_t oled_brightness = OLED_BRIGHTNESS; | ||
| 132 | oled_rotation_t oled_rotation = 0; | ||
| 133 | uint8_t oled_rotation_width = 0; | ||
| 134 | uint8_t oled_scroll_speed = 0; // this holds the speed after being remapped to ssd1306 internal values | ||
| 135 | uint8_t oled_scroll_start = 0; | ||
| 136 | uint8_t oled_scroll_end = 7; | ||
| 137 | #if OLED_TIMEOUT > 0 | ||
| 138 | uint32_t oled_timeout; | ||
| 139 | #endif | ||
| 140 | #if OLED_SCROLL_TIMEOUT > 0 | ||
| 141 | uint32_t oled_scroll_timeout; | ||
| 142 | #endif | ||
| 143 | #if OLED_UPDATE_INTERVAL > 0 | ||
| 144 | uint16_t oled_update_timeout; | ||
| 145 | #endif | ||
| 146 | |||
| 147 | // Internal variables to reduce math instructions | ||
| 148 | |||
| 149 | #if defined(__AVR__) | ||
| 150 | // identical to i2c_transmit, but for PROGMEM since all initialization is in PROGMEM arrays currently | ||
| 151 | // probably should move this into i2c_master... | ||
| 152 | static i2c_status_t i2c_transmit_P(uint8_t address, const uint8_t *data, uint16_t length, uint16_t timeout) { | ||
| 153 | i2c_status_t status = i2c_start(address | I2C_WRITE, timeout); | ||
| 154 | |||
| 155 | for (uint16_t i = 0; i < length && status >= 0; i++) { | ||
| 156 | status = i2c_write(pgm_read_byte((const char *)data++), timeout); | ||
| 157 | if (status) break; | ||
| 158 | } | ||
| 159 | |||
| 160 | i2c_stop(); | ||
| 161 | |||
| 162 | return status; | ||
| 163 | } | ||
| 164 | #endif | ||
| 165 | |||
| 166 | // Flips the rendering bits for a character at the current cursor position | ||
| 167 | static void InvertCharacter(uint8_t *cursor) { | ||
| 168 | const uint8_t *end = cursor + OLED_FONT_WIDTH; | ||
| 169 | while (cursor < end) { | ||
| 170 | *cursor = ~(*cursor); | ||
| 171 | cursor++; | ||
| 172 | } | ||
| 173 | } | ||
| 174 | |||
| 175 | bool oled_init(oled_rotation_t rotation) { | ||
| 176 | #if defined(USE_I2C) && defined(SPLIT_KEYBOARD) | ||
| 177 | if (!is_keyboard_master()) { | ||
| 178 | return true; | ||
| 179 | } | ||
| 180 | #endif | ||
| 181 | |||
| 182 | oled_rotation = oled_init_user(oled_init_kb(rotation)); | ||
| 183 | if (!HAS_FLAGS(oled_rotation, OLED_ROTATION_90)) { | ||
| 184 | oled_rotation_width = OLED_DISPLAY_WIDTH; | ||
| 185 | } else { | ||
| 186 | oled_rotation_width = OLED_DISPLAY_HEIGHT; | ||
| 187 | } | ||
| 188 | i2c_init(); | ||
| 189 | |||
| 190 | static const uint8_t PROGMEM display_setup1[] = { | ||
| 191 | I2C_CMD, | ||
| 192 | DISPLAY_OFF, | ||
| 193 | DISPLAY_CLOCK, | ||
| 194 | 0x80, | ||
| 195 | MULTIPLEX_RATIO, | ||
| 196 | OLED_DISPLAY_WIDTH - 1, | ||
| 197 | SH1107_DISPLAY_START_LINE, | ||
| 198 | 0x00, | ||
| 199 | CHARGE_PUMP, | ||
| 200 | 0x14, | ||
| 201 | SH1107_MEMORY_MODE_PAGE, | ||
| 202 | }; | ||
| 203 | if (I2C_TRANSMIT_P(display_setup1) != I2C_STATUS_SUCCESS) { | ||
| 204 | print("oled_init cmd set 1 failed\n"); | ||
| 205 | return false; | ||
| 206 | } | ||
| 207 | |||
| 208 | if (!HAS_FLAGS(oled_rotation, OLED_ROTATION_180)) { | ||
| 209 | static const uint8_t PROGMEM display_normal[] = { | ||
| 210 | I2C_CMD, | ||
| 211 | SEGMENT_REMAP_INV, | ||
| 212 | COM_SCAN_DEC, | ||
| 213 | DISPLAY_OFFSET, | ||
| 214 | OLED_COM_PIN_OFFSET, | ||
| 215 | }; | ||
| 216 | if (I2C_TRANSMIT_P(display_normal) != I2C_STATUS_SUCCESS) { | ||
| 217 | print("oled_init cmd normal rotation failed\n"); | ||
| 218 | return false; | ||
| 219 | } | ||
| 220 | } else { | ||
| 221 | static const uint8_t PROGMEM display_flipped[] = { | ||
| 222 | I2C_CMD, | ||
| 223 | SEGMENT_REMAP, | ||
| 224 | COM_SCAN_INC, | ||
| 225 | DISPLAY_OFFSET, | ||
| 226 | (OLED_COM_PIN_COUNT - OLED_COM_PIN_OFFSET) % OLED_COM_PIN_COUNT, | ||
| 227 | }; | ||
| 228 | if (I2C_TRANSMIT_P(display_flipped) != I2C_STATUS_SUCCESS) { | ||
| 229 | print("display_flipped failed\n"); | ||
| 230 | return false; | ||
| 231 | } | ||
| 232 | } | ||
| 233 | |||
| 234 | static const uint8_t PROGMEM display_setup2[] = { | ||
| 235 | I2C_CMD, COM_PINS, | ||
| 236 | OLED_COM_PINS, | ||
| 237 | CONTRAST, OLED_BRIGHTNESS, | ||
| 238 | PRE_CHARGE_PERIOD, 0x22, | ||
| 239 | VCOM_DETECT, 0x35, | ||
| 240 | DISPLAY_ALL_ON_RESUME, | ||
| 241 | NORMAL_DISPLAY, | ||
| 242 | DEACTIVATE_SCROLL, | ||
| 243 | DISPLAY_ON | ||
| 244 | }; | ||
| 245 | if (I2C_TRANSMIT_P(display_setup2) != I2C_STATUS_SUCCESS) { | ||
| 246 | print("display_setup2 failed\n"); | ||
| 247 | return false; | ||
| 248 | } | ||
| 249 | |||
| 250 | #if OLED_TIMEOUT > 0 | ||
| 251 | oled_timeout = timer_read32() + OLED_TIMEOUT; | ||
| 252 | #endif | ||
| 253 | #if OLED_SCROLL_TIMEOUT > 0 | ||
| 254 | oled_scroll_timeout = timer_read32() + OLED_SCROLL_TIMEOUT; | ||
| 255 | #endif | ||
| 256 | |||
| 257 | oled_clear(); | ||
| 258 | oled_initialized = true; | ||
| 259 | oled_active = true; | ||
| 260 | oled_scrolling = false; | ||
| 261 | return true; | ||
| 262 | } | ||
| 263 | |||
| 264 | __attribute__((weak)) oled_rotation_t oled_init_kb(oled_rotation_t rotation) { | ||
| 265 | return rotation; | ||
| 266 | } | ||
| 267 | __attribute__((weak)) oled_rotation_t oled_init_user(oled_rotation_t rotation) { | ||
| 268 | return rotation; | ||
| 269 | } | ||
| 270 | |||
| 271 | void oled_clear(void) { | ||
| 272 | memset(oled_buffer, 0, sizeof(oled_buffer)); | ||
| 273 | oled_cursor = &oled_buffer[0]; | ||
| 274 | oled_dirty = OLED_ALL_BLOCKS_MASK; | ||
| 275 | } | ||
| 276 | |||
| 277 | static void calc_bounds(uint8_t update_start, uint8_t *cmd_array) { | ||
| 278 | // Calculate commands to set memory addressing bounds. | ||
| 279 | uint8_t start_page = OLED_BLOCK_SIZE * update_start / OLED_DISPLAY_WIDTH; | ||
| 280 | uint8_t start_column = OLED_BLOCK_SIZE * update_start % OLED_DISPLAY_WIDTH; | ||
| 281 | // Commands for Page Addressing Mode. Sets starting page and column; has no end bound. | ||
| 282 | // Column value must be split into high and low nybble and sent as two commands. | ||
| 283 | cmd_array[0] = PAM_PAGE_ADDR | start_page; | ||
| 284 | cmd_array[1] = PAM_SETCOLUMN_LSB | ((OLED_COLUMN_OFFSET + start_column) & 0x0f); | ||
| 285 | cmd_array[2] = PAM_SETCOLUMN_MSB | ((OLED_COLUMN_OFFSET + start_column) >> 4 & 0x0f); | ||
| 286 | } | ||
| 287 | |||
| 288 | static void calc_bounds_90(uint8_t update_start, uint8_t *cmd_array) { | ||
| 289 | // Block numbering starts from the bottom left corner, going up and then to | ||
| 290 | // the right. The controller needs the page and column numbers for the top | ||
| 291 | // left and bottom right corners of that block. | ||
| 292 | |||
| 293 | // Total number of pages across the screen height. | ||
| 294 | const uint8_t height_in_pages = OLED_DISPLAY_HEIGHT / 8; | ||
| 295 | |||
| 296 | // Difference of starting page numbers for adjacent blocks; may be 0 if | ||
| 297 | // blocks are large enough to occupy one or more whole 8px columns. | ||
| 298 | const uint8_t page_inc_per_block = OLED_BLOCK_SIZE % OLED_DISPLAY_HEIGHT / 8; | ||
| 299 | |||
| 300 | // Top page number for a block which is at the bottom edge of the screen. | ||
| 301 | const uint8_t bottom_block_top_page = (height_in_pages - page_inc_per_block) % height_in_pages; | ||
| 302 | |||
| 303 | // Only the Page Addressing Mode is supported | ||
| 304 | uint8_t start_page = bottom_block_top_page - (OLED_BLOCK_SIZE * update_start % OLED_DISPLAY_HEIGHT / 8); | ||
| 305 | uint8_t start_column = OLED_BLOCK_SIZE * update_start / OLED_DISPLAY_HEIGHT * 8; | ||
| 306 | cmd_array[0] = PAM_PAGE_ADDR | start_page; | ||
| 307 | cmd_array[1] = PAM_SETCOLUMN_LSB | ((OLED_COLUMN_OFFSET + start_column) & 0x0f); | ||
| 308 | cmd_array[2] = PAM_SETCOLUMN_MSB | ((OLED_COLUMN_OFFSET + start_column) >> 4 & 0x0f); | ||
| 309 | } | ||
| 310 | |||
| 311 | uint8_t crot(uint8_t a, int8_t n) { | ||
| 312 | const uint8_t mask = 0x7; | ||
| 313 | n &= mask; | ||
| 314 | return a << n | a >> (-n & mask); | ||
| 315 | } | ||
| 316 | |||
| 317 | static void rotate_90(const uint8_t *src, uint8_t *dest) { | ||
| 318 | for (uint8_t i = 0, shift = 7; i < 8; ++i, --shift) { | ||
| 319 | uint8_t selector = (1 << i); | ||
| 320 | for (uint8_t j = 0; j < 8; ++j) { | ||
| 321 | dest[i] |= crot(src[j] & selector, shift - (int8_t)j); | ||
| 322 | } | ||
| 323 | } | ||
| 324 | } | ||
| 325 | |||
| 326 | void oled_render(void) { | ||
| 327 | // Do we have work to do? | ||
| 328 | oled_dirty &= OLED_ALL_BLOCKS_MASK; | ||
| 329 | if (!oled_dirty || !oled_initialized || oled_scrolling) { | ||
| 330 | return; | ||
| 331 | } | ||
| 332 | |||
| 333 | // Turn on display if it is off | ||
| 334 | oled_on(); | ||
| 335 | |||
| 336 | uint8_t update_start = 0; | ||
| 337 | uint8_t num_processed = 0; | ||
| 338 | while (oled_dirty && num_processed++ < OLED_UPDATE_PROCESS_LIMIT) { // render all dirty blocks (up to the configured limit) | ||
| 339 | // Find next dirty block | ||
| 340 | while (!(oled_dirty & ((OLED_BLOCK_TYPE)1 << update_start))) { | ||
| 341 | ++update_start; | ||
| 342 | } | ||
| 343 | |||
| 344 | // Set column & page position | ||
| 345 | static uint8_t display_start[] = {I2C_CMD, PAM_PAGE_ADDR, PAM_SETCOLUMN_LSB, PAM_SETCOLUMN_MSB}; | ||
| 346 | if (!HAS_FLAGS(oled_rotation, OLED_ROTATION_90)) { | ||
| 347 | calc_bounds(update_start, &display_start[1]); // Offset from I2C_CMD byte at the start | ||
| 348 | } else { | ||
| 349 | calc_bounds_90(update_start, &display_start[1]); // Offset from I2C_CMD byte at the start | ||
| 350 | } | ||
| 351 | |||
| 352 | // Send column & page position | ||
| 353 | if (I2C_TRANSMIT(display_start) != I2C_STATUS_SUCCESS) { | ||
| 354 | print("oled_render offset command failed\n"); | ||
| 355 | return; | ||
| 356 | } | ||
| 357 | |||
| 358 | if (!HAS_FLAGS(oled_rotation, OLED_ROTATION_90)) { | ||
| 359 | // Send render data chunk as is | ||
| 360 | if (I2C_WRITE_REG(I2C_DATA, &oled_buffer[OLED_BLOCK_SIZE * update_start], OLED_BLOCK_SIZE) != I2C_STATUS_SUCCESS) { | ||
| 361 | print("oled_render data failed\n"); | ||
| 362 | return; | ||
| 363 | } | ||
| 364 | } else { | ||
| 365 | // Rotate the render chunks | ||
| 366 | const static uint8_t source_map[] = OLED_SOURCE_MAP; | ||
| 367 | const static uint8_t target_map[] = OLED_TARGET_MAP; | ||
| 368 | |||
| 369 | static uint8_t temp_buffer[OLED_BLOCK_SIZE]; | ||
| 370 | memset(temp_buffer, 0, sizeof(temp_buffer)); | ||
| 371 | for (uint8_t i = 0; i < sizeof(source_map); ++i) { | ||
| 372 | rotate_90(&oled_buffer[OLED_BLOCK_SIZE * update_start + source_map[i]], &temp_buffer[target_map[i]]); | ||
| 373 | } | ||
| 374 | |||
| 375 | // For SH1106 or SH1107 the data chunk must be split into separate pieces for each page | ||
| 376 | const uint8_t columns_in_block = (OLED_BLOCK_SIZE + OLED_DISPLAY_HEIGHT - 1) / OLED_DISPLAY_HEIGHT * 8; | ||
| 377 | const uint8_t num_pages = OLED_BLOCK_SIZE / columns_in_block; | ||
| 378 | for (uint8_t i = 0; i < num_pages; ++i) { | ||
| 379 | // Send column & page position for all pages except the first one | ||
| 380 | if (i > 0) { | ||
| 381 | display_start[1]++; | ||
| 382 | if (I2C_TRANSMIT(display_start) != I2C_STATUS_SUCCESS) { | ||
| 383 | print("oled_render offset command failed\n"); | ||
| 384 | return; | ||
| 385 | } | ||
| 386 | } | ||
| 387 | // Send data for the page | ||
| 388 | if (I2C_WRITE_REG(I2C_DATA, &temp_buffer[columns_in_block * i], columns_in_block) != I2C_STATUS_SUCCESS) { | ||
| 389 | print("oled_render90 data failed\n"); | ||
| 390 | return; | ||
| 391 | } | ||
| 392 | } | ||
| 393 | } | ||
| 394 | |||
| 395 | // Clear dirty flag | ||
| 396 | oled_dirty &= ~((OLED_BLOCK_TYPE)1 << update_start); | ||
| 397 | } | ||
| 398 | } | ||
| 399 | |||
| 400 | void oled_set_cursor(uint8_t col, uint8_t line) { | ||
| 401 | uint16_t index = line * oled_rotation_width + col * OLED_FONT_WIDTH; | ||
| 402 | |||
| 403 | // Out of bounds? | ||
| 404 | if (index >= OLED_MATRIX_SIZE) { | ||
| 405 | index = 0; | ||
| 406 | } | ||
| 407 | |||
| 408 | oled_cursor = &oled_buffer[index]; | ||
| 409 | } | ||
| 410 | |||
| 411 | void oled_advance_page(bool clearPageRemainder) { | ||
| 412 | uint16_t index = oled_cursor - &oled_buffer[0]; | ||
| 413 | uint8_t remaining = oled_rotation_width - (index % oled_rotation_width); | ||
| 414 | |||
| 415 | if (clearPageRemainder) { | ||
| 416 | // Remaining Char count | ||
| 417 | remaining = remaining / OLED_FONT_WIDTH; | ||
| 418 | |||
| 419 | // Write empty character until next line | ||
| 420 | while (remaining--) | ||
| 421 | oled_write_char(' ', false); | ||
| 422 | } else { | ||
| 423 | // Next page index out of bounds? | ||
| 424 | if (index + remaining >= OLED_MATRIX_SIZE) { | ||
| 425 | index = 0; | ||
| 426 | remaining = 0; | ||
| 427 | } | ||
| 428 | |||
| 429 | oled_cursor = &oled_buffer[index + remaining]; | ||
| 430 | } | ||
| 431 | } | ||
| 432 | |||
| 433 | void oled_advance_char(void) { | ||
| 434 | uint16_t nextIndex = oled_cursor - &oled_buffer[0] + OLED_FONT_WIDTH; | ||
| 435 | uint8_t remainingSpace = oled_rotation_width - (nextIndex % oled_rotation_width); | ||
| 436 | |||
| 437 | // Do we have enough space on the current line for the next character | ||
| 438 | if (remainingSpace < OLED_FONT_WIDTH) { | ||
| 439 | nextIndex += remainingSpace; | ||
| 440 | } | ||
| 441 | |||
| 442 | // Did we go out of bounds | ||
| 443 | if (nextIndex >= OLED_MATRIX_SIZE) { | ||
| 444 | nextIndex = 0; | ||
| 445 | } | ||
| 446 | |||
| 447 | // Update cursor position | ||
| 448 | oled_cursor = &oled_buffer[nextIndex]; | ||
| 449 | } | ||
| 450 | |||
| 451 | // Main handler that writes character data to the display buffer | ||
| 452 | void oled_write_char(const char data, bool invert) { | ||
| 453 | // Advance to the next line if newline | ||
| 454 | if (data == '\n') { | ||
| 455 | // Old source wrote ' ' until end of line... | ||
| 456 | oled_advance_page(true); | ||
| 457 | return; | ||
| 458 | } | ||
| 459 | |||
| 460 | if (data == '\r') { | ||
| 461 | oled_advance_page(false); | ||
| 462 | return; | ||
| 463 | } | ||
| 464 | |||
| 465 | // copy the current render buffer to check for dirty after | ||
| 466 | static uint8_t oled_temp_buffer[OLED_FONT_WIDTH]; | ||
| 467 | memcpy(&oled_temp_buffer, oled_cursor, OLED_FONT_WIDTH); | ||
| 468 | |||
| 469 | _Static_assert(sizeof(font) >= ((OLED_FONT_END + 1 - OLED_FONT_START) * OLED_FONT_WIDTH), "OLED_FONT_END references outside array"); | ||
| 470 | |||
| 471 | // set the reder buffer data | ||
| 472 | uint8_t cast_data = (uint8_t)data; // font based on unsigned type for index | ||
| 473 | if (cast_data < OLED_FONT_START || cast_data > OLED_FONT_END) { | ||
| 474 | memset(oled_cursor, 0x00, OLED_FONT_WIDTH); | ||
| 475 | } else { | ||
| 476 | const uint8_t *glyph = &font[(cast_data - OLED_FONT_START) * OLED_FONT_WIDTH]; | ||
| 477 | memcpy_P(oled_cursor, glyph, OLED_FONT_WIDTH); | ||
| 478 | } | ||
| 479 | |||
| 480 | // Invert if needed | ||
| 481 | if (invert) { | ||
| 482 | InvertCharacter(oled_cursor); | ||
| 483 | } | ||
| 484 | |||
| 485 | // Dirty check | ||
| 486 | if (memcmp(&oled_temp_buffer, oled_cursor, OLED_FONT_WIDTH)) { | ||
| 487 | uint16_t index = oled_cursor - &oled_buffer[0]; | ||
| 488 | oled_dirty |= ((OLED_BLOCK_TYPE)1 << (index / OLED_BLOCK_SIZE)); | ||
| 489 | // Edgecase check if the written data spans the 2 chunks | ||
| 490 | oled_dirty |= ((OLED_BLOCK_TYPE)1 << ((index + OLED_FONT_WIDTH - 1) / OLED_BLOCK_SIZE)); | ||
| 491 | } | ||
| 492 | |||
| 493 | // Finally move to the next char | ||
| 494 | oled_advance_char(); | ||
| 495 | } | ||
| 496 | |||
| 497 | void oled_write(const char *data, bool invert) { | ||
| 498 | const char *end = data + strlen(data); | ||
| 499 | while (data < end) { | ||
| 500 | oled_write_char(*data, invert); | ||
| 501 | data++; | ||
| 502 | } | ||
| 503 | } | ||
| 504 | |||
| 505 | void oled_write_ln(const char *data, bool invert) { | ||
| 506 | oled_write(data, invert); | ||
| 507 | oled_advance_page(true); | ||
| 508 | } | ||
| 509 | |||
| 510 | void oled_pan(bool left) { | ||
| 511 | uint16_t i = 0; | ||
| 512 | for (uint16_t y = 0; y < OLED_DISPLAY_HEIGHT / 8; y++) { | ||
| 513 | if (left) { | ||
| 514 | for (uint16_t x = 0; x < OLED_DISPLAY_WIDTH - 1; x++) { | ||
| 515 | i = y * OLED_DISPLAY_WIDTH + x; | ||
| 516 | oled_buffer[i] = oled_buffer[i + 1]; | ||
| 517 | } | ||
| 518 | } else { | ||
| 519 | for (uint16_t x = OLED_DISPLAY_WIDTH - 1; x > 0; x--) { | ||
| 520 | i = y * OLED_DISPLAY_WIDTH + x; | ||
| 521 | oled_buffer[i] = oled_buffer[i - 1]; | ||
| 522 | } | ||
| 523 | } | ||
| 524 | } | ||
| 525 | oled_dirty = OLED_ALL_BLOCKS_MASK; | ||
| 526 | } | ||
| 527 | |||
| 528 | void oled_pan_section(bool left, uint16_t y_start, uint16_t y_end, uint16_t x_start, uint16_t x_end) { | ||
| 529 | uint16_t i = 0; | ||
| 530 | for (uint16_t y = y_start; y < y_end; y++) { | ||
| 531 | if (left) { | ||
| 532 | for (uint16_t x = x_start; x < x_end - 1; x++) { | ||
| 533 | i = y * OLED_DISPLAY_WIDTH + x; | ||
| 534 | oled_buffer[i] = oled_buffer[i + 1]; | ||
| 535 | oled_dirty |= ((OLED_BLOCK_TYPE)1 << (i / OLED_BLOCK_SIZE)); | ||
| 536 | } | ||
| 537 | } else { | ||
| 538 | for (uint16_t x = x_end - 1; x > 0; x--) { | ||
| 539 | i = y * OLED_DISPLAY_WIDTH + x; | ||
| 540 | oled_buffer[i] = oled_buffer[i - 1]; | ||
| 541 | oled_dirty |= ((OLED_BLOCK_TYPE)1 << (i / OLED_BLOCK_SIZE)); | ||
| 542 | } | ||
| 543 | } | ||
| 544 | } | ||
| 545 | } | ||
| 546 | |||
| 547 | oled_buffer_reader_t oled_read_raw(uint16_t start_index) { | ||
| 548 | if (start_index > OLED_MATRIX_SIZE) start_index = OLED_MATRIX_SIZE; | ||
| 549 | oled_buffer_reader_t ret_reader; | ||
| 550 | ret_reader.current_element = &oled_buffer[start_index]; | ||
| 551 | ret_reader.remaining_element_count = OLED_MATRIX_SIZE - start_index; | ||
| 552 | return ret_reader; | ||
| 553 | } | ||
| 554 | |||
| 555 | void oled_write_raw_byte(const char data, uint16_t index) { | ||
| 556 | if (index > OLED_MATRIX_SIZE) index = OLED_MATRIX_SIZE; | ||
| 557 | if (oled_buffer[index] == data) return; | ||
| 558 | oled_buffer[index] = data; | ||
| 559 | oled_dirty |= ((OLED_BLOCK_TYPE)1 << (index / OLED_BLOCK_SIZE)); | ||
| 560 | } | ||
| 561 | |||
| 562 | void oled_write_raw(const char *data, uint16_t size) { | ||
| 563 | uint16_t cursor_start_index = oled_cursor - &oled_buffer[0]; | ||
| 564 | if ((size + cursor_start_index) > OLED_MATRIX_SIZE) size = OLED_MATRIX_SIZE - cursor_start_index; | ||
| 565 | for (uint16_t i = cursor_start_index; i < cursor_start_index + size; i++) { | ||
| 566 | uint8_t c = *data++; | ||
| 567 | if (oled_buffer[i] == c) continue; | ||
| 568 | oled_buffer[i] = c; | ||
| 569 | oled_dirty |= ((OLED_BLOCK_TYPE)1 << (i / OLED_BLOCK_SIZE)); | ||
| 570 | } | ||
| 571 | } | ||
| 572 | |||
| 573 | void oled_write_pixel(uint8_t x, uint8_t y, bool on) { | ||
| 574 | if (x >= oled_rotation_width) { | ||
| 575 | return; | ||
| 576 | } | ||
| 577 | uint16_t index = x + (y / 8) * oled_rotation_width; | ||
| 578 | if (index >= OLED_MATRIX_SIZE) { | ||
| 579 | return; | ||
| 580 | } | ||
| 581 | uint8_t data = oled_buffer[index]; | ||
| 582 | if (on) { | ||
| 583 | data |= (1 << (y % 8)); | ||
| 584 | } else { | ||
| 585 | data &= ~(1 << (y % 8)); | ||
| 586 | } | ||
| 587 | if (oled_buffer[index] != data) { | ||
| 588 | oled_buffer[index] = data; | ||
| 589 | oled_dirty |= ((OLED_BLOCK_TYPE)1 << (index / OLED_BLOCK_SIZE)); | ||
| 590 | } | ||
| 591 | } | ||
| 592 | |||
| 593 | #if defined(__AVR__) | ||
| 594 | void oled_write_P(const char *data, bool invert) { | ||
| 595 | uint8_t c = pgm_read_byte(data); | ||
| 596 | while (c != 0) { | ||
| 597 | oled_write_char(c, invert); | ||
| 598 | c = pgm_read_byte(++data); | ||
| 599 | } | ||
| 600 | } | ||
| 601 | |||
| 602 | void oled_write_ln_P(const char *data, bool invert) { | ||
| 603 | oled_write_P(data, invert); | ||
| 604 | oled_advance_page(true); | ||
| 605 | } | ||
| 606 | |||
| 607 | void oled_write_raw_P(const char *data, uint16_t size) { | ||
| 608 | uint16_t cursor_start_index = oled_cursor - &oled_buffer[0]; | ||
| 609 | if ((size + cursor_start_index) > OLED_MATRIX_SIZE) size = OLED_MATRIX_SIZE - cursor_start_index; | ||
| 610 | for (uint16_t i = cursor_start_index; i < cursor_start_index + size; i++) { | ||
| 611 | uint8_t c = pgm_read_byte(data++); | ||
| 612 | if (oled_buffer[i] == c) continue; | ||
| 613 | oled_buffer[i] = c; | ||
| 614 | oled_dirty |= ((OLED_BLOCK_TYPE)1 << (i / OLED_BLOCK_SIZE)); | ||
| 615 | } | ||
| 616 | } | ||
| 617 | #endif // defined(__AVR__) | ||
| 618 | |||
| 619 | bool oled_on(void) { | ||
| 620 | if (!oled_initialized) { | ||
| 621 | return oled_active; | ||
| 622 | } | ||
| 623 | |||
| 624 | #if OLED_TIMEOUT > 0 | ||
| 625 | oled_timeout = timer_read32() + OLED_TIMEOUT; | ||
| 626 | #endif | ||
| 627 | |||
| 628 | static const uint8_t PROGMEM display_on[] = | ||
| 629 | #ifdef OLED_FADE_OUT | ||
| 630 | {I2C_CMD, FADE_BLINK, 0x00}; | ||
| 631 | #else | ||
| 632 | {I2C_CMD, DISPLAY_ON}; | ||
| 633 | #endif | ||
| 634 | |||
| 635 | if (!oled_active) { | ||
| 636 | if (I2C_TRANSMIT_P(display_on) != I2C_STATUS_SUCCESS) { | ||
| 637 | print("oled_on cmd failed\n"); | ||
| 638 | return oled_active; | ||
| 639 | } | ||
| 640 | oled_active = true; | ||
| 641 | } | ||
| 642 | return oled_active; | ||
| 643 | } | ||
| 644 | |||
| 645 | bool oled_off(void) { | ||
| 646 | if (!oled_initialized) { | ||
| 647 | return !oled_active; | ||
| 648 | } | ||
| 649 | |||
| 650 | static const uint8_t PROGMEM display_off[] = | ||
| 651 | #ifdef OLED_FADE_OUT | ||
| 652 | {I2C_CMD, FADE_BLINK, ENABLE_FADE | OLED_FADE_OUT_INTERVAL}; | ||
| 653 | #else | ||
| 654 | {I2C_CMD, DISPLAY_OFF}; | ||
| 655 | #endif | ||
| 656 | |||
| 657 | if (oled_active) { | ||
| 658 | if (I2C_TRANSMIT_P(display_off) != I2C_STATUS_SUCCESS) { | ||
| 659 | print("oled_off cmd failed\n"); | ||
| 660 | return oled_active; | ||
| 661 | } | ||
| 662 | oled_active = false; | ||
| 663 | } | ||
| 664 | return !oled_active; | ||
| 665 | } | ||
| 666 | |||
| 667 | bool is_oled_on(void) { | ||
| 668 | return oled_active; | ||
| 669 | } | ||
| 670 | |||
| 671 | uint8_t oled_set_brightness(uint8_t level) { | ||
| 672 | if (!oled_initialized) { | ||
| 673 | return oled_brightness; | ||
| 674 | } | ||
| 675 | |||
| 676 | uint8_t set_contrast[] = {I2C_CMD, CONTRAST, level}; | ||
| 677 | if (oled_brightness != level) { | ||
| 678 | if (I2C_TRANSMIT(set_contrast) != I2C_STATUS_SUCCESS) { | ||
| 679 | print("set_brightness cmd failed\n"); | ||
| 680 | return oled_brightness; | ||
| 681 | } | ||
| 682 | oled_brightness = level; | ||
| 683 | } | ||
| 684 | return oled_brightness; | ||
| 685 | } | ||
| 686 | |||
| 687 | uint8_t oled_get_brightness(void) { | ||
| 688 | return oled_brightness; | ||
| 689 | } | ||
| 690 | |||
| 691 | // Set the specific 8 lines rows of the screen to scroll. | ||
| 692 | // 0 is the default for start, and 7 for end, which is the entire | ||
| 693 | // height of the screen. For 128x32 screens, rows 4-7 are not used. | ||
| 694 | void oled_scroll_set_area(uint8_t start_line, uint8_t end_line) { | ||
| 695 | oled_scroll_start = start_line; | ||
| 696 | oled_scroll_end = end_line; | ||
| 697 | } | ||
| 698 | |||
| 699 | void oled_scroll_set_speed(uint8_t speed) { | ||
| 700 | // Sets the speed for scrolling... does not take effect | ||
| 701 | // until scrolling is either started or restarted | ||
| 702 | // the ssd1306 supports 8 speeds | ||
| 703 | // FrameRate2 speed = 7 | ||
| 704 | // FrameRate3 speed = 4 | ||
| 705 | // FrameRate4 speed = 5 | ||
| 706 | // FrameRate5 speed = 0 | ||
| 707 | // FrameRate25 speed = 6 | ||
| 708 | // FrameRate64 speed = 1 | ||
| 709 | // FrameRate128 speed = 2 | ||
| 710 | // FrameRate256 speed = 3 | ||
| 711 | // for ease of use these are remaped here to be in order | ||
| 712 | static const uint8_t scroll_remap[8] = {7, 4, 5, 0, 6, 1, 2, 3}; | ||
| 713 | oled_scroll_speed = scroll_remap[speed]; | ||
| 714 | } | ||
| 715 | |||
| 716 | bool oled_scroll_right(void) { | ||
| 717 | if (!oled_initialized) { | ||
| 718 | return oled_scrolling; | ||
| 719 | } | ||
| 720 | |||
| 721 | // Dont enable scrolling if we need to update the display | ||
| 722 | // This prevents scrolling of bad data from starting the scroll too early after init | ||
| 723 | if (!oled_dirty && !oled_scrolling) { | ||
| 724 | uint8_t display_scroll_right[] = {I2C_CMD, SCROLL_RIGHT, 0x00, oled_scroll_start, oled_scroll_speed, oled_scroll_end, 0x00, 0xFF, ACTIVATE_SCROLL}; | ||
| 725 | if (I2C_TRANSMIT(display_scroll_right) != I2C_STATUS_SUCCESS) { | ||
| 726 | print("oled_scroll_right cmd failed\n"); | ||
| 727 | return oled_scrolling; | ||
| 728 | } | ||
| 729 | oled_scrolling = true; | ||
| 730 | } | ||
| 731 | return oled_scrolling; | ||
| 732 | } | ||
| 733 | |||
| 734 | bool oled_scroll_left(void) { | ||
| 735 | if (!oled_initialized) { | ||
| 736 | return oled_scrolling; | ||
| 737 | } | ||
| 738 | |||
| 739 | // Dont enable scrolling if we need to update the display | ||
| 740 | // This prevents scrolling of bad data from starting the scroll too early after init | ||
| 741 | if (!oled_dirty && !oled_scrolling) { | ||
| 742 | uint8_t display_scroll_left[] = {I2C_CMD, SCROLL_LEFT, 0x00, oled_scroll_start, oled_scroll_speed, oled_scroll_end, 0x00, 0xFF, ACTIVATE_SCROLL}; | ||
| 743 | if (I2C_TRANSMIT(display_scroll_left) != I2C_STATUS_SUCCESS) { | ||
| 744 | print("oled_scroll_left cmd failed\n"); | ||
| 745 | return oled_scrolling; | ||
| 746 | } | ||
| 747 | oled_scrolling = true; | ||
| 748 | } | ||
| 749 | return oled_scrolling; | ||
| 750 | } | ||
| 751 | |||
| 752 | bool oled_scroll_off(void) { | ||
| 753 | if (!oled_initialized) { | ||
| 754 | return !oled_scrolling; | ||
| 755 | } | ||
| 756 | |||
| 757 | if (oled_scrolling) { | ||
| 758 | static const uint8_t PROGMEM display_scroll_off[] = {I2C_CMD, DEACTIVATE_SCROLL}; | ||
| 759 | if (I2C_TRANSMIT_P(display_scroll_off) != I2C_STATUS_SUCCESS) { | ||
| 760 | print("oled_scroll_off cmd failed\n"); | ||
| 761 | return oled_scrolling; | ||
| 762 | } | ||
| 763 | oled_scrolling = false; | ||
| 764 | oled_dirty = OLED_ALL_BLOCKS_MASK; | ||
| 765 | } | ||
| 766 | return !oled_scrolling; | ||
| 767 | } | ||
| 768 | |||
| 769 | bool is_oled_scrolling(void) { | ||
| 770 | return oled_scrolling; | ||
| 771 | } | ||
| 772 | |||
| 773 | bool oled_invert(bool invert) { | ||
| 774 | if (!oled_initialized) { | ||
| 775 | return oled_inverted; | ||
| 776 | } | ||
| 777 | |||
| 778 | if (invert && !oled_inverted) { | ||
| 779 | static const uint8_t PROGMEM display_inverted[] = {I2C_CMD, INVERT_DISPLAY}; | ||
| 780 | if (I2C_TRANSMIT_P(display_inverted) != I2C_STATUS_SUCCESS) { | ||
| 781 | print("oled_invert cmd failed\n"); | ||
| 782 | return oled_inverted; | ||
| 783 | } | ||
| 784 | oled_inverted = true; | ||
| 785 | } else if (!invert && oled_inverted) { | ||
| 786 | static const uint8_t PROGMEM display_normal[] = {I2C_CMD, NORMAL_DISPLAY}; | ||
| 787 | if (I2C_TRANSMIT_P(display_normal) != I2C_STATUS_SUCCESS) { | ||
| 788 | print("oled_invert cmd failed\n"); | ||
| 789 | return oled_inverted; | ||
| 790 | } | ||
| 791 | oled_inverted = false; | ||
| 792 | } | ||
| 793 | |||
| 794 | return oled_inverted; | ||
| 795 | } | ||
| 796 | |||
| 797 | uint8_t oled_max_chars(void) { | ||
| 798 | if (!HAS_FLAGS(oled_rotation, OLED_ROTATION_90)) { | ||
| 799 | return OLED_DISPLAY_WIDTH / OLED_FONT_WIDTH; | ||
| 800 | } | ||
| 801 | return OLED_DISPLAY_HEIGHT / OLED_FONT_WIDTH; | ||
| 802 | } | ||
| 803 | |||
| 804 | uint8_t oled_max_lines(void) { | ||
| 805 | if (!HAS_FLAGS(oled_rotation, OLED_ROTATION_90)) { | ||
| 806 | return OLED_DISPLAY_HEIGHT / OLED_FONT_HEIGHT; | ||
| 807 | } | ||
| 808 | return OLED_DISPLAY_WIDTH / OLED_FONT_HEIGHT; | ||
| 809 | } | ||
| 810 | |||
| 811 | void oled_task(void) { | ||
| 812 | if (!oled_initialized) { | ||
| 813 | return; | ||
| 814 | } | ||
| 815 | |||
| 816 | #if OLED_UPDATE_INTERVAL > 0 | ||
| 817 | if (timer_elapsed(oled_update_timeout) >= OLED_UPDATE_INTERVAL) { | ||
| 818 | oled_update_timeout = timer_read(); | ||
| 819 | oled_set_cursor(0, 0); | ||
| 820 | oled_task_kb(); | ||
| 821 | } | ||
| 822 | #else | ||
| 823 | oled_set_cursor(0, 0); | ||
| 824 | oled_task_kbr(); | ||
| 825 | #endif | ||
| 826 | |||
| 827 | #if OLED_SCROLL_TIMEOUT > 0 | ||
| 828 | if (oled_dirty && oled_scrolling) { | ||
| 829 | oled_scroll_timeout = timer_read32() + OLED_SCROLL_TIMEOUT; | ||
| 830 | oled_scroll_off(); | ||
| 831 | } | ||
| 832 | #endif | ||
| 833 | |||
| 834 | // Smart render system, no need to check for dirty | ||
| 835 | oled_render(); | ||
| 836 | |||
| 837 | // Display timeout check | ||
| 838 | #if OLED_TIMEOUT > 0 | ||
| 839 | if (oled_active && timer_expired32(timer_read32(), oled_timeout)) { | ||
| 840 | oled_off(); | ||
| 841 | } | ||
| 842 | #endif | ||
| 843 | |||
| 844 | #if OLED_SCROLL_TIMEOUT > 0 | ||
| 845 | if (!oled_scrolling && timer_expired32(timer_read32(), oled_scroll_timeout)) { | ||
| 846 | # ifdef OLED_SCROLL_TIMEOUT_RIGHT | ||
| 847 | oled_scroll_right(); | ||
| 848 | # else | ||
| 849 | oled_scroll_left(); | ||
| 850 | # endif | ||
| 851 | } | ||
| 852 | #endif | ||
| 853 | } | ||
| 854 | |||
| 855 | __attribute__((weak)) bool oled_task_kb(void) { | ||
| 856 | return oled_task_user(); | ||
| 857 | } | ||
| 858 | __attribute__((weak)) bool oled_task_user(void) { | ||
| 859 | return true; | ||
| 860 | } | ||
diff --git a/users/drashna/pointing/pointing.c b/users/drashna/pointing/pointing.c index 18dad0da81..82cc5a3aa6 100644 --- a/users/drashna/pointing/pointing.c +++ b/users/drashna/pointing/pointing.c | |||
| @@ -35,12 +35,11 @@ report_mouse_t pointing_device_task_user(report_mouse_t mouse_report) { | |||
| 35 | mouse_report.y = 0; | 35 | mouse_report.y = 0; |
| 36 | 36 | ||
| 37 | if (x != 0 && y != 0 && (timer_elapsed(mouse_debounce_timer) > TAP_CHECK)) { | 37 | if (x != 0 && y != 0 && (timer_elapsed(mouse_debounce_timer) > TAP_CHECK)) { |
| 38 | #ifdef OLED_ENABLE | ||
| 39 | oled_timer_reset(); | ||
| 40 | #endif | ||
| 41 | if (enable_acceleration) { | 38 | if (enable_acceleration) { |
| 42 | x = (mouse_xy_report_t)(x > 0 ? pow(4, x) / 2 + x : -pow(4, abs(x)) / 2 + x); | 39 | float magnitude = sqrtf( mouse_report.x * mouse_report.x + mouse_report.y * mouse_report.y ); |
| 43 | y = (mouse_xy_report_t)(y > 0 ? pow(5, y) / 2 + y : -pow(5, abs(y)) / 2 + y); | 40 | float adjusted_magnitude = powf(magnitude, 1.2f); |
| 41 | x = (mouse_xy_report_t)(x * adjusted_magnitude); | ||
| 42 | y = (mouse_xy_report_t)(y * adjusted_magnitude); | ||
| 44 | // x = (mouse_xy_report_t)(x > 0 ? x * x / 16 + x : -x * x / 16 + x); | 43 | // x = (mouse_xy_report_t)(x > 0 ? x * x / 16 + x : -x * x / 16 + x); |
| 45 | // y = (mouse_xy_report_t)(y > 0 ? y * y / 16 + y : -y * y / 16 + y); | 44 | // y = (mouse_xy_report_t)(y > 0 ? y * y / 16 + y : -y * y / 16 + y); |
| 46 | } | 45 | } |
| @@ -56,6 +55,12 @@ bool process_record_pointing(uint16_t keycode, keyrecord_t* record) { | |||
| 56 | case KC_ACCEL: | 55 | case KC_ACCEL: |
| 57 | enable_acceleration = record->event.pressed; | 56 | enable_acceleration = record->event.pressed; |
| 58 | break; | 57 | break; |
| 58 | #if defined(POINTING_DEVICE_MOUSE_JIGGLER_ENABLE) | ||
| 59 | case PD_JIGGLER: | ||
| 60 | if (record->event.pressed) { | ||
| 61 | pointing_device_mouse_jiggler_toggle(); | ||
| 62 | } | ||
| 63 | #endif | ||
| 59 | default: | 64 | default: |
| 60 | mouse_debounce_timer = timer_read(); | 65 | mouse_debounce_timer = timer_read(); |
| 61 | break; | 66 | break; |
| @@ -73,6 +78,24 @@ layer_state_t layer_state_set_pointing(layer_state_t state) { | |||
| 73 | return state; | 78 | return state; |
| 74 | } | 79 | } |
| 75 | 80 | ||
| 81 | #if defined(POINTING_DEVICE_MOUSE_JIGGLER_ENABLE) | ||
| 82 | static uint16_t mouse_jiggler_timer; | ||
| 83 | |||
| 84 | bool has_mouse_report_changed(report_mouse_t* new_report, report_mouse_t* old_report) { | ||
| 85 | // Only report every 5 seconds. | ||
| 86 | if (userspace_config.mouse_jiggler && timer_elapsed(mouse_jiggler_timer) > 5000) { | ||
| 87 | mouse_jiggler_timer = timer_read(); | ||
| 88 | return true; | ||
| 89 | } | ||
| 90 | return memcmp(new_report, old_report, sizeof(report_mouse_t)); | ||
| 91 | } | ||
| 92 | |||
| 93 | void pointing_device_mouse_jiggler_toggle(void) { | ||
| 94 | mouse_jiggler_timer = timer_read(); | ||
| 95 | userspace_config.mouse_jiggler = !userspace_config.mouse_jiggler; | ||
| 96 | } | ||
| 97 | |||
| 98 | #endif | ||
| 76 | 99 | ||
| 77 | #if defined(POINTING_DEVICE_AUTO_MOUSE_ENABLE) | 100 | #if defined(POINTING_DEVICE_AUTO_MOUSE_ENABLE) |
| 78 | __attribute__((weak)) bool is_mouse_record_keymap(uint16_t keycode, keyrecord_t *record) { return false; } | 101 | __attribute__((weak)) bool is_mouse_record_keymap(uint16_t keycode, keyrecord_t *record) { return false; } |
diff --git a/users/drashna/pointing/pointing.h b/users/drashna/pointing/pointing.h index 28d8610148..c97ce5b2db 100644 --- a/users/drashna/pointing/pointing.h +++ b/users/drashna/pointing/pointing.h | |||
| @@ -8,3 +8,4 @@ report_mouse_t pointing_device_task_keymap(report_mouse_t mouse_report); | |||
| 8 | void matrix_scan_pointing(void); | 8 | void matrix_scan_pointing(void); |
| 9 | bool process_record_pointing(uint16_t keycode, keyrecord_t* record); | 9 | bool process_record_pointing(uint16_t keycode, keyrecord_t* record); |
| 10 | layer_state_t layer_state_set_pointing(layer_state_t state); | 10 | layer_state_t layer_state_set_pointing(layer_state_t state); |
| 11 | void pointing_device_mouse_jiggler_toggle(void); | ||
diff --git a/users/drashna/post_config.h b/users/drashna/post_config.h index 85ce0e3108..5a2dfb6637 100644 --- a/users/drashna/post_config.h +++ b/users/drashna/post_config.h | |||
| @@ -121,7 +121,7 @@ | |||
| 121 | # ifndef MOUSEKEY_WHEEL_DECELERATED_MOVEMENTS | 121 | # ifndef MOUSEKEY_WHEEL_DECELERATED_MOVEMENTS |
| 122 | # define MOUSEKEY_WHEEL_DECELERATED_MOVEMENTS 8 | 122 | # define MOUSEKEY_WHEEL_DECELERATED_MOVEMENTS 8 |
| 123 | # endif | 123 | # endif |
| 124 | #endif // MOUSEKEY_ENABLE | 124 | #endif // MOUSEKEY_ENABLE |
| 125 | 125 | ||
| 126 | #define MOUSE_EXTENDED_REPORT | 126 | #define MOUSE_EXTENDED_REPORT |
| 127 | 127 | ||
| @@ -134,7 +134,7 @@ | |||
| 134 | #endif | 134 | #endif |
| 135 | 135 | ||
| 136 | #if defined(SPLIT_KEYBOARD) && defined(PROTOCOL_CHIBIOS) && !defined(USB_SUSPEND_WAKEUP_DELAY) | 136 | #if defined(SPLIT_KEYBOARD) && defined(PROTOCOL_CHIBIOS) && !defined(USB_SUSPEND_WAKEUP_DELAY) |
| 137 | # define USB_SUSPEND_WAKEUP_DELAY 200 | 137 | # define USB_SUSPEND_WAKEUP_DELAY 500 |
| 138 | #endif | 138 | #endif |
| 139 | 139 | ||
| 140 | #if defined(XAP_ENABLE) && !defined(__AVR__) | 140 | #if defined(XAP_ENABLE) && !defined(__AVR__) |
diff --git a/users/drashna/rgb/rgb_matrix_config.h b/users/drashna/rgb/rgb_matrix_config.h index 86f238f392..bc2c04d981 100644 --- a/users/drashna/rgb/rgb_matrix_config.h +++ b/users/drashna/rgb/rgb_matrix_config.h | |||
| @@ -6,7 +6,7 @@ | |||
| 6 | #define RGB_MATRIX_KEYPRESSES // reacts to keypresses (will slow down matrix scan by a lot) | 6 | #define RGB_MATRIX_KEYPRESSES // reacts to keypresses (will slow down matrix scan by a lot) |
| 7 | // # define RGB_MATRIX_KEYRELEASES // reacts to keyreleases (not recommened) | 7 | // # define RGB_MATRIX_KEYRELEASES // reacts to keyreleases (not recommened) |
| 8 | #define RGB_MATRIX_FRAMEBUFFER_EFFECTS | 8 | #define RGB_MATRIX_FRAMEBUFFER_EFFECTS |
| 9 | // # define RGB_DISABLE_WHEN_USB_SUSPENDED // turn off effects when suspended | 9 | #define RGB_DISABLE_WHEN_USB_SUSPENDED // turn off effects when suspended |
| 10 | 10 | ||
| 11 | #undef ENABLE_RGB_MATRIX_ALPHAS_MODS | 11 | #undef ENABLE_RGB_MATRIX_ALPHAS_MODS |
| 12 | #undef ENABLE_RGB_MATRIX_GRADIENT_UP_DOWN | 12 | #undef ENABLE_RGB_MATRIX_GRADIENT_UP_DOWN |
diff --git a/users/drashna/rgb/rgb_matrix_stuff.c b/users/drashna/rgb/rgb_matrix_stuff.c index eff9191eb7..588e51daf9 100644 --- a/users/drashna/rgb/rgb_matrix_stuff.c +++ b/users/drashna/rgb/rgb_matrix_stuff.c | |||
| @@ -74,7 +74,7 @@ bool process_record_user_rgb_matrix(uint16_t keycode, keyrecord_t *record) { | |||
| 74 | if (record->event.pressed) { | 74 | if (record->event.pressed) { |
| 75 | userspace_config.rgb_matrix_idle_anim ^= 1; | 75 | userspace_config.rgb_matrix_idle_anim ^= 1; |
| 76 | dprintf("RGB Matrix Idle Animation [EEPROM]: %u\n", userspace_config.rgb_matrix_idle_anim); | 76 | dprintf("RGB Matrix Idle Animation [EEPROM]: %u\n", userspace_config.rgb_matrix_idle_anim); |
| 77 | eeconfig_update_user(userspace_config.raw); | 77 | eeconfig_update_user_config(&userspace_config.raw); |
| 78 | if (userspace_config.rgb_matrix_idle_anim) { | 78 | if (userspace_config.rgb_matrix_idle_anim) { |
| 79 | rgb_matrix_mode_noeeprom(RGB_MATRIX_TYPING_HEATMAP); | 79 | rgb_matrix_mode_noeeprom(RGB_MATRIX_TYPING_HEATMAP); |
| 80 | } | 80 | } |
| @@ -146,3 +146,45 @@ __attribute__((weak)) bool rgb_matrix_indicators_keymap(void) { | |||
| 146 | bool rgb_matrix_indicators_user(void) { | 146 | bool rgb_matrix_indicators_user(void) { |
| 147 | return rgb_matrix_indicators_keymap(); | 147 | return rgb_matrix_indicators_keymap(); |
| 148 | } | 148 | } |
| 149 | |||
| 150 | |||
| 151 | //---------------------------------------------------------- | ||
| 152 | // RGB Matrix naming | ||
| 153 | #include <rgb_matrix.h> | ||
| 154 | |||
| 155 | #if defined(RGB_MATRIX_EFFECT) | ||
| 156 | # undef RGB_MATRIX_EFFECT | ||
| 157 | #endif // defined(RGB_MATRIX_EFFECT) | ||
| 158 | |||
| 159 | #define RGB_MATRIX_EFFECT(x) RGB_MATRIX_EFFECT_##x, | ||
| 160 | enum { | ||
| 161 | RGB_MATRIX_EFFECT_NONE, | ||
| 162 | #include "rgb_matrix_effects.inc" | ||
| 163 | #undef RGB_MATRIX_EFFECT | ||
| 164 | #ifdef RGB_MATRIX_CUSTOM_KB | ||
| 165 | # include "rgb_matrix_kb.inc" | ||
| 166 | #endif | ||
| 167 | #ifdef RGB_MATRIX_CUSTOM_USER | ||
| 168 | # include "rgb_matrix_user.inc" | ||
| 169 | #endif | ||
| 170 | }; | ||
| 171 | |||
| 172 | #define RGB_MATRIX_EFFECT(x) \ | ||
| 173 | case RGB_MATRIX_EFFECT_##x: \ | ||
| 174 | return #x; | ||
| 175 | const char* rgb_matrix_name(uint8_t effect) { | ||
| 176 | switch (effect) { | ||
| 177 | case RGB_MATRIX_EFFECT_NONE: | ||
| 178 | return "NONE"; | ||
| 179 | #include "rgb_matrix_effects.inc" | ||
| 180 | #undef RGB_MATRIX_EFFECT | ||
| 181 | #ifdef RGB_MATRIX_CUSTOM_KB | ||
| 182 | # include "rgb_matrix_kb.inc" | ||
| 183 | #endif | ||
| 184 | #ifdef RGB_MATRIX_CUSTOM_USER | ||
| 185 | # include "rgb_matrix_user.inc" | ||
| 186 | #endif | ||
| 187 | default: | ||
| 188 | return "UNKNOWN"; | ||
| 189 | } | ||
| 190 | } | ||
diff --git a/users/drashna/rgb/rgb_matrix_stuff.h b/users/drashna/rgb/rgb_matrix_stuff.h index 9559134c8c..80770bf40f 100644 --- a/users/drashna/rgb/rgb_matrix_stuff.h +++ b/users/drashna/rgb/rgb_matrix_stuff.h | |||
| @@ -13,3 +13,5 @@ void rgb_matrix_layer_helper(uint8_t hue, uint8_t sat, uint8_t val, uint8_t mode | |||
| 13 | 13 | ||
| 14 | bool rgb_matrix_indicators_advanced_keymap(uint8_t led_min, uint8_t led_max); | 14 | bool rgb_matrix_indicators_advanced_keymap(uint8_t led_min, uint8_t led_max); |
| 15 | bool rgb_matrix_indicators_keymap(void); | 15 | bool rgb_matrix_indicators_keymap(void); |
| 16 | |||
| 17 | const char* rgb_matrix_name(uint8_t effect); | ||
diff --git a/users/drashna/rgb/rgb_stuff.c b/users/drashna/rgb/rgb_stuff.c index c283e58d26..cc85425aff 100644 --- a/users/drashna/rgb/rgb_stuff.c +++ b/users/drashna/rgb/rgb_stuff.c | |||
| @@ -11,6 +11,9 @@ void rgblight_sethsv_default_helper(uint8_t index) { | |||
| 11 | rgblight_sethsv_at(rgblight_get_hue(), rgblight_get_sat(), rgblight_get_val(), index); | 11 | rgblight_sethsv_at(rgblight_get_hue(), rgblight_get_sat(), rgblight_get_val(), index); |
| 12 | } | 12 | } |
| 13 | void rgblight_set_hsv_and_mode(uint8_t hue, uint8_t sat, uint8_t val, uint8_t mode) { | 13 | void rgblight_set_hsv_and_mode(uint8_t hue, uint8_t sat, uint8_t val, uint8_t mode) { |
| 14 | if (val > RGBLIGHT_LIMIT_VAL) { | ||
| 15 | val = RGBLIGHT_LIMIT_VAL; | ||
| 16 | } | ||
| 14 | rgblight_sethsv_noeeprom(hue, sat, val); | 17 | rgblight_sethsv_noeeprom(hue, sat, val); |
| 15 | // wait_us(175); // Add a slight delay between color and mode to ensure it's processed correctly | 18 | // wait_us(175); // Add a slight delay between color and mode to ensure it's processed correctly |
| 16 | rgblight_mode_noeeprom(mode); | 19 | rgblight_mode_noeeprom(mode); |
| @@ -48,6 +51,15 @@ uint32_t rgb_startup_animation(uint32_t triger_time, void *cb_arg) { | |||
| 48 | } | 51 | } |
| 49 | #endif | 52 | #endif |
| 50 | 53 | ||
| 54 | bool is_rgblight_startup_running(void) { | ||
| 55 | #if defined(RGBLIGHT_STARTUP_ANIMATION) | ||
| 56 | return is_rgblight_startup && is_keyboard_master(); | ||
| 57 | #else | ||
| 58 | return false; | ||
| 59 | #endif | ||
| 60 | } | ||
| 61 | |||
| 62 | |||
| 51 | void keyboard_post_init_rgb_light(void) { | 63 | void keyboard_post_init_rgb_light(void) { |
| 52 | #if defined(RGBLIGHT_STARTUP_ANIMATION) | 64 | #if defined(RGBLIGHT_STARTUP_ANIMATION) |
| 53 | is_enabled = rgblight_is_enabled(); | 65 | is_enabled = rgblight_is_enabled(); |
| @@ -121,3 +133,33 @@ layer_state_t default_layer_state_set_rgb_light(layer_state_t state) { | |||
| 121 | } | 133 | } |
| 122 | return state; | 134 | return state; |
| 123 | } | 135 | } |
| 136 | |||
| 137 | #define _RGBM_SINGLE_STATIC(sym) \ | ||
| 138 | case RGBLIGHT_MODE_##sym: \ | ||
| 139 | return #sym; | ||
| 140 | #define _RGBM_SINGLE_DYNAMIC(sym) \ | ||
| 141 | case RGBLIGHT_MODE_##sym: \ | ||
| 142 | return #sym; | ||
| 143 | #define _RGBM_MULTI_STATIC(sym) \ | ||
| 144 | case RGBLIGHT_MODE_##sym: \ | ||
| 145 | return #sym; | ||
| 146 | #define _RGBM_MULTI_DYNAMIC(sym) \ | ||
| 147 | case RGBLIGHT_MODE_##sym: \ | ||
| 148 | return #sym; | ||
| 149 | #define _RGBM_TMP_STATIC(sym, msym) \ | ||
| 150 | case RGBLIGHT_MODE_##sym: \ | ||
| 151 | return #msym; | ||
| 152 | #define _RGBM_TMP_DYNAMIC(sym, msym) \ | ||
| 153 | case RGBLIGHT_MODE_##sym: \ | ||
| 154 | return #msym; | ||
| 155 | |||
| 156 | |||
| 157 | const char* rgblight_name(uint8_t effect) { | ||
| 158 | switch (effect) { | ||
| 159 | #include "rgblight_modes.h" | ||
| 160 | case 0: | ||
| 161 | return "Off"; | ||
| 162 | default: | ||
| 163 | return "UNKNOWN"; | ||
| 164 | } | ||
| 165 | } | ||
diff --git a/users/drashna/rgb/rgb_stuff.h b/users/drashna/rgb/rgb_stuff.h index d720275b60..f76c591e03 100644 --- a/users/drashna/rgb/rgb_stuff.h +++ b/users/drashna/rgb/rgb_stuff.h | |||
| @@ -10,3 +10,6 @@ void matrix_scan_rgb_light(void); | |||
| 10 | layer_state_t layer_state_set_rgb_light(layer_state_t state); | 10 | layer_state_t layer_state_set_rgb_light(layer_state_t state); |
| 11 | layer_state_t default_layer_state_set_rgb_light(layer_state_t state); | 11 | layer_state_t default_layer_state_set_rgb_light(layer_state_t state); |
| 12 | void rgblight_sethsv_default_helper(uint8_t index); | 12 | void rgblight_sethsv_default_helper(uint8_t index); |
| 13 | |||
| 14 | const char* rgblight_name(uint8_t effect); | ||
| 15 | bool is_rgblight_startup_running(void); | ||
diff --git a/users/drashna/rules.mk b/users/drashna/rules.mk index 43186b024a..6287d6e78c 100644 --- a/users/drashna/rules.mk +++ b/users/drashna/rules.mk | |||
| @@ -1,11 +1,21 @@ | |||
| 1 | SRC += $(USER_PATH)/drashna.c \ | 1 | SRC += $(USER_PATH)/drashna.c \ |
| 2 | $(USER_PATH)/callbacks.c \ | 2 | $(USER_PATH)/callbacks.c \ |
| 3 | $(USER_PATH)/keyrecords/process_records.c \ | 3 | $(USER_PATH)/keyrecords/process_records.c \ |
| 4 | $(USER_PATH)/keyrecords/tapping.c | 4 | $(USER_PATH)/keyrecords/tapping.c \ |
| 5 | $(USER_PATH)/eeconfig_users.c | ||
| 5 | 6 | ||
| 6 | # TOP_SYMBOLS = yes | 7 | # TOP_SYMBOLS = yes |
| 7 | 8 | ||
| 8 | ifneq ($(PLATFORM),CHIBIOS) | 9 | DEBOUNCE_TYPE = asym_eager_defer_pk |
| 10 | DEFERRED_EXEC_ENABLE = yes | ||
| 11 | OS_DETECTION_ENABLE = yes | ||
| 12 | |||
| 13 | ifeq ($(PLATFORM),CHIBIOS) | ||
| 14 | # cortex-m4 has DSP+FPU support, so use hack to enable it for lib8tion | ||
| 15 | ifeq ($(strip $(MCU)), cortex-m4) | ||
| 16 | OPT_DEFS += -DFASTLED_TEENSY3 | ||
| 17 | endif | ||
| 18 | else | ||
| 9 | ifneq ($(strip $(LTO_SUPPORTED)), no) | 19 | ifneq ($(strip $(LTO_SUPPORTED)), no) |
| 10 | LTO_ENABLE = yes | 20 | LTO_ENABLE = yes |
| 11 | endif | 21 | endif |
| @@ -14,16 +24,7 @@ ifneq ($(PLATFORM),CHIBIOS) | |||
| 14 | endif | 24 | endif |
| 15 | # DEBUG_MATRIX_SCAN_RATE_ENABLE = api | 25 | # DEBUG_MATRIX_SCAN_RATE_ENABLE = api |
| 16 | 26 | ||
| 17 | ifneq ($(strip $(NO_SECRETS)), yes) | 27 | -include $(USER_PATH)/../../../qmk_secrets/rules.mk |
| 18 | ifneq ("$(wildcard $(USER_PATH)/../../../qmk_secrets/secrets.c)","") | ||
| 19 | SRC += $(USER_PATH)/../../../qmk_secrets/secrets.c | ||
| 20 | $(shell touch $(USER_PATH)/../../../qmk_secrets/secrets.c) | ||
| 21 | SECURE_ENABLE = yes | ||
| 22 | endif | ||
| 23 | ifeq ($(strip $(NO_SECRETS)), lite) | ||
| 24 | OPT_DEFS += -DNO_SECRETS | ||
| 25 | endif | ||
| 26 | endif | ||
| 27 | 28 | ||
| 28 | ifeq ($(strip $(MAKE_BOOTLOADER)), yes) | 29 | ifeq ($(strip $(MAKE_BOOTLOADER)), yes) |
| 29 | OPT_DEFS += -DMAKE_BOOTLOADER | 30 | OPT_DEFS += -DMAKE_BOOTLOADER |
| @@ -67,7 +68,6 @@ ifeq ($(strip $(RGBLIGHT_ENABLE)), yes) | |||
| 67 | endif | 68 | endif |
| 68 | ifeq ($(strip $(RGBLIGHT_STARTUP_ANIMATION)), yes) | 69 | ifeq ($(strip $(RGBLIGHT_STARTUP_ANIMATION)), yes) |
| 69 | OPT_DEFS += -DRGBLIGHT_STARTUP_ANIMATION | 70 | OPT_DEFS += -DRGBLIGHT_STARTUP_ANIMATION |
| 70 | DEFERRED_EXEC_ENABLE = yes | ||
| 71 | endif | 71 | endif |
| 72 | endif | 72 | endif |
| 73 | endif | 73 | endif |
| @@ -92,23 +92,7 @@ ifeq ($(strip $(I2C_SCANNER_ENABLE)), yes) | |||
| 92 | CONSOLE_ENABLE := yes | 92 | CONSOLE_ENABLE := yes |
| 93 | endif | 93 | endif |
| 94 | 94 | ||
| 95 | CUSTOM_OLED_DRIVER ?= yes | 95 | -include $(USER_PATH)/oled/rules.mk |
| 96 | ifeq ($(strip $(OLED_ENABLE)), yes) | ||
| 97 | ifeq ($(strip $(OLED_DRIVER)), custom) | ||
| 98 | OPT_DEFS += -DOLED_ENABLE \ | ||
| 99 | -DOLED_DRIVER_SH1107 | ||
| 100 | SRC += $(USER_PATH)/oled/sh110x.c | ||
| 101 | QUANTUM_LIB_SRC += i2c_master.c | ||
| 102 | endif | ||
| 103 | ifeq ($(strip $(CUSTOM_OLED_DRIVER)), yes) | ||
| 104 | OPT_DEFS += -DCUSTOM_OLED_DRIVER | ||
| 105 | SRC += $(USER_PATH)/oled/oled_stuff.c | ||
| 106 | endif | ||
| 107 | ifeq ($(strip $(OLED_DISPLAY_TEST)), yes) | ||
| 108 | OPT_DEFS += -DOLED_DISPLAY_TEST | ||
| 109 | endif | ||
| 110 | DEFERRED_EXEC_ENABLE = yes | ||
| 111 | endif | ||
| 112 | 96 | ||
| 113 | CUSTOM_POINTING_DEVICE ?= yes | 97 | CUSTOM_POINTING_DEVICE ?= yes |
| 114 | ifeq ($(strip $(POINTING_DEVICE_ENABLE)), yes) | 98 | ifeq ($(strip $(POINTING_DEVICE_ENABLE)), yes) |
| @@ -117,6 +101,10 @@ ifeq ($(strip $(POINTING_DEVICE_ENABLE)), yes) | |||
| 117 | OPT_DEFS += -DCUSTOM_POINTING_DEVICE | 101 | OPT_DEFS += -DCUSTOM_POINTING_DEVICE |
| 118 | OPT_DEFS += -DPOINTING_DEVICE_AUTO_MOUSE_ENABLE | 102 | OPT_DEFS += -DPOINTING_DEVICE_AUTO_MOUSE_ENABLE |
| 119 | endif | 103 | endif |
| 104 | POINTING_DEVICE_MOUSE_JIGGLER_ENABLE ?= yes | ||
| 105 | ifeq ($(strip $(POINTING_DEVICE_MOUSE_JIGGLER_ENABLE)), yes) | ||
| 106 | OPT_DEFS += -DPOINTING_DEVICE_MOUSE_JIGGLER_ENABLE | ||
| 107 | endif | ||
| 120 | endif | 108 | endif |
| 121 | 109 | ||
| 122 | CUSTOM_SPLIT_TRANSPORT_SYNC ?= yes | 110 | CUSTOM_SPLIT_TRANSPORT_SYNC ?= yes |
| @@ -128,10 +116,6 @@ ifeq ($(strip $(CUSTOM_SPLIT_TRANSPORT_SYNC)), yes) | |||
| 128 | 116 | ||
| 129 | endif | 117 | endif |
| 130 | 118 | ||
| 131 | ifeq ($(strip $(AUTOCORRECTION_ENABLE)), yes) | ||
| 132 | AUTOCORRECT_ENABLE = yes | ||
| 133 | endif | ||
| 134 | |||
| 135 | CUSTOM_BOOTMAGIC_ENABLE ?= yes | 119 | CUSTOM_BOOTMAGIC_ENABLE ?= yes |
| 136 | ifeq ($(strip $(CUSTOM_BOOTMAGIC_ENABLE)), yes) | 120 | ifeq ($(strip $(CUSTOM_BOOTMAGIC_ENABLE)), yes) |
| 137 | ifeq ($(strip $(BOOTMAGIC_ENABLE)), yes) | 121 | ifeq ($(strip $(BOOTMAGIC_ENABLE)), yes) |
| @@ -139,7 +123,14 @@ ifeq ($(strip $(CUSTOM_BOOTMAGIC_ENABLE)), yes) | |||
| 139 | endif | 123 | endif |
| 140 | endif | 124 | endif |
| 141 | 125 | ||
| 142 | OS_DETECTION_ENABLE ?= yes | 126 | CUSTOM_DYNAMIC_MACROS_ENABLE ?= no |
| 143 | ifeq ($(strip $(OS_DETECTION_ENABLE)), yes) | 127 | ifeq ($(strip $(CUSTOM_DYNAMIC_MACROS_ENABLE)), yes) |
| 144 | DEFERRED_EXEC_ENABLE = yes | 128 | SRC += $(USER_PATH)/keyrecords/dynamic_macros.c |
| 129 | OPT_DEFS += -DCUSTOM_DYNAMIC_MACROS_ENABLE | ||
| 130 | endif | ||
| 131 | |||
| 132 | ifeq ($(strip $(HARDWARE_DEBUG_ENABLE)), yes) | ||
| 133 | LTO_ENABLE := no | ||
| 134 | OPT := 0 | ||
| 135 | OPT_DEFS += -g | ||
| 145 | endif | 136 | endif |
diff --git a/users/drashna/split/split_config.h b/users/drashna/split/split_config.h index 17daa4f808..fd8bf95515 100644 --- a/users/drashna/split/split_config.h +++ b/users/drashna/split/split_config.h | |||
| @@ -9,6 +9,9 @@ | |||
| 9 | #define SPLIT_MODS_ENABLE | 9 | #define SPLIT_MODS_ENABLE |
| 10 | #define SPLIT_WATCHDOG_ENABLE | 10 | #define SPLIT_WATCHDOG_ENABLE |
| 11 | #define SPLIT_WPM_ENABLE | 11 | #define SPLIT_WPM_ENABLE |
| 12 | #define SPLIT_ACTIVITY_ENABLE | ||
| 13 | #define SPLIT_DETECTED_OS_ENABLE | ||
| 14 | #define SPLIT_HAPTIC_ENABLE | ||
| 12 | #ifdef SPLIT_OLED_ENABLE | 15 | #ifdef SPLIT_OLED_ENABLE |
| 13 | # undef SPLIT_OLED_ENABLE | 16 | # undef SPLIT_OLED_ENABLE |
| 14 | #endif | 17 | #endif |
| @@ -16,5 +19,8 @@ | |||
| 16 | # define SELECT_SOFT_SERIAL_SPEED 1 | 19 | # define SELECT_SOFT_SERIAL_SPEED 1 |
| 17 | #endif | 20 | #endif |
| 18 | #ifdef CUSTOM_SPLIT_TRANSPORT_SYNC | 21 | #ifdef CUSTOM_SPLIT_TRANSPORT_SYNC |
| 19 | # define SPLIT_TRANSACTION_IDS_USER RPC_ID_USER_STATE_SYNC, RPC_ID_USER_KEYMAP_SYNC, RPC_ID_USER_CONFIG_SYNC, RPC_ID_USER_PLACEHOLDER, RPC_ID_USER_KEYLOG_STR | 22 | # define SPLIT_TRANSACTION_IDS_USER RPC_ID_USER_STATE_SYNC, RPC_ID_USER_KEYMAP_SYNC, RPC_ID_USER_CONFIG_SYNC, RPC_ID_USER_PLACEHOLDER, RPC_ID_USER_OLED_KEYLOG_STR |
| 20 | #endif | 23 | #endif |
| 24 | |||
| 25 | #define CRC8_USE_TABLE | ||
| 26 | #define CRC8_OPTIMIZE_SPEED | ||
diff --git a/users/drashna/split/transport_sync.c b/users/drashna/split/transport_sync.c index bd6f7c5688..d5a1241586 100644 --- a/users/drashna/split/transport_sync.c +++ b/users/drashna/split/transport_sync.c | |||
| @@ -15,9 +15,6 @@ extern unicode_config_t unicode_config; | |||
| 15 | extern audio_config_t audio_config; | 15 | extern audio_config_t audio_config; |
| 16 | extern bool delayed_tasks_run; | 16 | extern bool delayed_tasks_run; |
| 17 | #endif | 17 | #endif |
| 18 | #if defined(OLED_ENABLE) && !defined(SPLIT_OLED_ENABLE) && defined(CUSTOM_OLED_DRIVER) | ||
| 19 | extern bool is_oled_enabled; | ||
| 20 | #endif | ||
| 21 | #if defined(POINTING_DEVICE_ENABLE) && defined(KEYBOARD_handwired_tractyl_manuform) | 18 | #if defined(POINTING_DEVICE_ENABLE) && defined(KEYBOARD_handwired_tractyl_manuform) |
| 22 | extern bool tap_toggling; | 19 | extern bool tap_toggling; |
| 23 | #endif | 20 | #endif |
| @@ -26,7 +23,6 @@ extern bool swap_hands; | |||
| 26 | #endif | 23 | #endif |
| 27 | 24 | ||
| 28 | extern userspace_config_t userspace_config; | 25 | extern userspace_config_t userspace_config; |
| 29 | extern bool host_driver_disabled; | ||
| 30 | 26 | ||
| 31 | uint16_t transport_keymap_config = 0; | 27 | uint16_t transport_keymap_config = 0; |
| 32 | uint32_t transport_userspace_config = 0, transport_user_state = 0; | 28 | uint32_t transport_userspace_config = 0, transport_user_state = 0; |
| @@ -52,8 +48,8 @@ void user_config_sync(uint8_t initiator2target_buffer_size, const void* initiato | |||
| 52 | #ifdef CUSTOM_OLED_DRIVER | 48 | #ifdef CUSTOM_OLED_DRIVER |
| 53 | # include "oled/oled_stuff.h" | 49 | # include "oled/oled_stuff.h" |
| 54 | void keylogger_string_sync(uint8_t initiator2target_buffer_size, const void* initiator2target_buffer, uint8_t target2initiator_buffer_size, void* target2initiator_buffer) { | 50 | void keylogger_string_sync(uint8_t initiator2target_buffer_size, const void* initiator2target_buffer, uint8_t target2initiator_buffer_size, void* target2initiator_buffer) { |
| 55 | if (initiator2target_buffer_size == (OLED_KEYLOGGER_LENGTH)) { | 51 | if (initiator2target_buffer_size == (OLED_KEYLOGGER_LENGTH+1)) { |
| 56 | memcpy(&keylog_str, initiator2target_buffer, initiator2target_buffer_size); | 52 | memcpy(&oled_keylog_str, initiator2target_buffer, initiator2target_buffer_size); |
| 57 | } | 53 | } |
| 58 | } | 54 | } |
| 59 | #endif | 55 | #endif |
| @@ -64,7 +60,7 @@ void keyboard_post_init_transport_sync(void) { | |||
| 64 | transaction_register_rpc(RPC_ID_USER_KEYMAP_SYNC, user_keymap_sync); | 60 | transaction_register_rpc(RPC_ID_USER_KEYMAP_SYNC, user_keymap_sync); |
| 65 | transaction_register_rpc(RPC_ID_USER_CONFIG_SYNC, user_config_sync); | 61 | transaction_register_rpc(RPC_ID_USER_CONFIG_SYNC, user_config_sync); |
| 66 | #ifdef CUSTOM_OLED_DRIVER | 62 | #ifdef CUSTOM_OLED_DRIVER |
| 67 | transaction_register_rpc(RPC_ID_USER_KEYLOG_STR, keylogger_string_sync); | 63 | transaction_register_rpc(RPC_ID_USER_OLED_KEYLOG_STR, keylogger_string_sync); |
| 68 | #endif | 64 | #endif |
| 69 | } | 65 | } |
| 70 | 66 | ||
| @@ -76,9 +72,6 @@ void user_transport_update(void) { | |||
| 76 | user_state.audio_enable = is_audio_on(); | 72 | user_state.audio_enable = is_audio_on(); |
| 77 | user_state.audio_clicky_enable = is_clicky_on(); | 73 | user_state.audio_clicky_enable = is_clicky_on(); |
| 78 | #endif | 74 | #endif |
| 79 | #if defined(OLED_ENABLE) && !defined(SPLIT_OLED_ENABLE) && defined(CUSTOM_OLED_DRIVER) | ||
| 80 | user_state.is_oled_enabled = is_oled_enabled; | ||
| 81 | #endif | ||
| 82 | #if defined(POINTING_DEVICE_ENABLE) && defined(POINTING_DEVICE_AUTO_MOUSE_ENABLE) | 75 | #if defined(POINTING_DEVICE_ENABLE) && defined(POINTING_DEVICE_AUTO_MOUSE_ENABLE) |
| 83 | user_state.tap_toggling = get_auto_mouse_toggle(); | 76 | user_state.tap_toggling = get_auto_mouse_toggle(); |
| 84 | #endif | 77 | #endif |
| @@ -89,7 +82,7 @@ void user_transport_update(void) { | |||
| 89 | #ifdef SWAP_HANDS_ENABLE | 82 | #ifdef SWAP_HANDS_ENABLE |
| 90 | user_state.swap_hands = swap_hands; | 83 | user_state.swap_hands = swap_hands; |
| 91 | #endif | 84 | #endif |
| 92 | user_state.host_driver_disabled = host_driver_disabled; | 85 | user_state.host_driver_disabled = get_keyboard_lock(); |
| 93 | 86 | ||
| 94 | transport_user_state = user_state.raw; | 87 | transport_user_state = user_state.raw; |
| 95 | } else { | 88 | } else { |
| @@ -100,9 +93,6 @@ void user_transport_update(void) { | |||
| 100 | unicode_config.input_mode = user_state.unicode_mode; | 93 | unicode_config.input_mode = user_state.unicode_mode; |
| 101 | unicode_typing_mode = user_state.unicode_typing_mode; | 94 | unicode_typing_mode = user_state.unicode_typing_mode; |
| 102 | #endif | 95 | #endif |
| 103 | #if defined(OLED_ENABLE) && !defined(SPLIT_OLED_ENABLE) && defined(CUSTOM_OLED_DRIVER) | ||
| 104 | is_oled_enabled = user_state.is_oled_enabled; | ||
| 105 | #endif | ||
| 106 | #if defined(POINTING_DEVICE_ENABLE) && defined(POINTING_DEVICE_AUTO_MOUSE_ENABLE) | 96 | #if defined(POINTING_DEVICE_ENABLE) && defined(POINTING_DEVICE_AUTO_MOUSE_ENABLE) |
| 107 | if (get_auto_mouse_toggle() != user_state.tap_toggling) { | 97 | if (get_auto_mouse_toggle() != user_state.tap_toggling) { |
| 108 | auto_mouse_toggle(); | 98 | auto_mouse_toggle(); |
| @@ -111,7 +101,7 @@ void user_transport_update(void) { | |||
| 111 | #ifdef SWAP_HANDS_ENABLE | 101 | #ifdef SWAP_HANDS_ENABLE |
| 112 | swap_hands = user_state.swap_hands; | 102 | swap_hands = user_state.swap_hands; |
| 113 | #endif | 103 | #endif |
| 114 | host_driver_disabled = user_state.host_driver_disabled; | 104 | set_keyboard_lock(user_state.host_driver_disabled); |
| 115 | } | 105 | } |
| 116 | } | 106 | } |
| 117 | 107 | ||
| @@ -122,7 +112,7 @@ void user_transport_sync(void) { | |||
| 122 | static uint32_t last_config = 0, last_sync[4], last_user_state = 0; | 112 | static uint32_t last_config = 0, last_sync[4], last_user_state = 0; |
| 123 | bool needs_sync = false; | 113 | bool needs_sync = false; |
| 124 | #ifdef CUSTOM_OLED_DRIVER | 114 | #ifdef CUSTOM_OLED_DRIVER |
| 125 | static char keylog_temp[OLED_KEYLOGGER_LENGTH] = {0}; | 115 | static char keylog_temp[OLED_KEYLOGGER_LENGTH + 1] = {0}; |
| 126 | #endif | 116 | #endif |
| 127 | 117 | ||
| 128 | // Check if the state values are different | 118 | // Check if the state values are different |
| @@ -183,9 +173,9 @@ void user_transport_sync(void) { | |||
| 183 | 173 | ||
| 184 | #ifdef CUSTOM_OLED_DRIVER | 174 | #ifdef CUSTOM_OLED_DRIVER |
| 185 | // Check if the state values are different | 175 | // Check if the state values are different |
| 186 | if (memcmp(&keylog_str, &keylog_temp, OLED_KEYLOGGER_LENGTH)) { | 176 | if (memcmp(&oled_keylog_str, &keylog_temp, OLED_KEYLOGGER_LENGTH + 1)) { |
| 187 | needs_sync = true; | 177 | needs_sync = true; |
| 188 | memcpy(&keylog_temp, &keylog_str, OLED_KEYLOGGER_LENGTH); | 178 | memcpy(&keylog_temp, &oled_keylog_str, OLED_KEYLOGGER_LENGTH + 1); |
| 189 | } | 179 | } |
| 190 | if (timer_elapsed32(last_sync[3]) > 250) { | 180 | if (timer_elapsed32(last_sync[3]) > 250) { |
| 191 | needs_sync = true; | 181 | needs_sync = true; |
| @@ -193,7 +183,7 @@ void user_transport_sync(void) { | |||
| 193 | 183 | ||
| 194 | // Perform the sync if requested | 184 | // Perform the sync if requested |
| 195 | if (needs_sync) { | 185 | if (needs_sync) { |
| 196 | if (transaction_rpc_send(RPC_ID_USER_KEYLOG_STR, OLED_KEYLOGGER_LENGTH, &keylog_str)) { | 186 | if (transaction_rpc_send(RPC_ID_USER_OLED_KEYLOG_STR, OLED_KEYLOGGER_LENGTH + 1, &oled_keylog_str)) { |
| 197 | last_sync[3] = timer_read32(); | 187 | last_sync[3] = timer_read32(); |
| 198 | } | 188 | } |
| 199 | needs_sync = false; | 189 | needs_sync = false; |
diff --git a/users/drashna/split/transport_sync.h b/users/drashna/split/transport_sync.h index e27e598f83..d241e5446f 100644 --- a/users/drashna/split/transport_sync.h +++ b/users/drashna/split/transport_sync.h | |||
| @@ -6,7 +6,6 @@ | |||
| 6 | #include "drashna.h" | 6 | #include "drashna.h" |
| 7 | #ifdef OLED_ENABLE | 7 | #ifdef OLED_ENABLE |
| 8 | # include "oled/oled_stuff.h" | 8 | # include "oled/oled_stuff.h" |
| 9 | extern char keylog_str[]; | ||
| 10 | #endif | 9 | #endif |
| 11 | 10 | ||
| 12 | typedef union { | 11 | typedef union { |
