diff options
Diffstat (limited to 'users/drashna')
-rw-r--r-- | users/drashna/callbacks.c | 20 | ||||
-rw-r--r-- | users/drashna/callbacks.h | 3 | ||||
-rw-r--r-- | users/drashna/config.h | 2 | ||||
-rw-r--r-- | users/drashna/keyrecords/caps_word.c | 164 | ||||
-rw-r--r-- | users/drashna/keyrecords/caps_word.h | 77 | ||||
-rw-r--r-- | users/drashna/keyrecords/process_records.c | 26 | ||||
-rw-r--r-- | users/drashna/keyrecords/process_records.h | 4 | ||||
-rw-r--r-- | users/drashna/keyrecords/unicode.c | 4 | ||||
-rw-r--r-- | users/drashna/oled/oled_stuff.c | 290 | ||||
-rw-r--r-- | users/drashna/oled/sh110x.c | 86 | ||||
-rw-r--r-- | users/drashna/pointing/pointing.c | 2 | ||||
-rw-r--r-- | users/drashna/post_config.h | 5 | ||||
-rw-r--r-- | users/drashna/rgb/rgb_stuff.c | 4 | ||||
-rw-r--r-- | users/drashna/rules.mk | 5 | ||||
-rw-r--r-- | users/drashna/split/transport_sync.c | 12 |
15 files changed, 320 insertions, 384 deletions
diff --git a/users/drashna/callbacks.c b/users/drashna/callbacks.c index f01aab433e..c11a381dee 100644 --- a/users/drashna/callbacks.c +++ b/users/drashna/callbacks.c @@ -33,10 +33,10 @@ void matrix_init_user(void) { __attribute__((weak)) void keyboard_post_init_keymap(void) {} void keyboard_post_init_user(void) { -#if defined(RGBLIGHT_ENABLE) +#if defined(CUSTOM_RGBLIGHT) keyboard_post_init_rgb_light(); #endif -#if defined(RGB_MATRIX_ENABLE) +#if defined(CUSTOM_RGB_MATRIX) keyboard_post_init_rgb_matrix(); #endif #if defined(SPLIT_KEYBOARD) && defined(SPLIT_TRANSACTION_IDS_USER) @@ -104,8 +104,10 @@ void matrix_scan_user(void) { #ifdef TAP_DANCE_ENABLE // Run Diablo 3 macro checking code. run_diablo_macro_check(); #endif // TAP_DANCE_ENABLE - -#if defined(RGB_MATRIX_ENABLE) +#ifdef CAPS_WORD_ENABLE + caps_word_task(); +#endif +#if defined(CUSTOM_RGB_MATRIX) matrix_scan_rgb_matrix(); #endif matrix_scan_secret(); @@ -126,12 +128,12 @@ layer_state_t layer_state_set_user(layer_state_t state) { } state = update_tri_layer_state(state, _RAISE, _LOWER, _ADJUST); -#if defined(POINTING_DEVICE_ENABLE) +#if defined(CUSTOM_POINTING_DEVICE) state = layer_state_set_pointing(state); #endif -#if defined(RGBLIGHT_ENABLE) +#if defined(CUSTOM_RGBLIGHT) state = layer_state_set_rgb_light(state); -#endif // RGBLIGHT_ENABLE +#endif // CUSTOM_RGBLIGHT #if defined(AUDIO_ENABLE) && !defined(__arm__) static bool is_gamepad_on = false; if (layer_state_cmp(state, _GAMEPAD) != is_gamepad_on) { @@ -156,9 +158,9 @@ layer_state_t default_layer_state_set_user(layer_state_t s state = default_layer_state_set_keymap(state); #if 0 -# if defined(RGBLIGHT_ENABLE) || defined(RGB_MATRIX_ENABLE) +# if defined(CUSTOM_RGBLIGHT) || defined(RGB_MATRIX_ENABLE) state = default_layer_state_set_rgb(state); -# endif // RGBLIGHT_ENABLE +# endif #endif return state; } diff --git a/users/drashna/callbacks.h b/users/drashna/callbacks.h index f6ac6b88de..5fe5f6a808 100644 --- a/users/drashna/callbacks.h +++ b/users/drashna/callbacks.h @@ -23,3 +23,6 @@ void matrix_init_unicode(void); #ifdef SPLIT_KEYBOARD void matrix_slave_scan_keymap(void); #endif +#ifdef CAPS_WORD_ENABLE +# include "keyrecords/caps_word.h" +#endif diff --git a/users/drashna/config.h b/users/drashna/config.h index f55ed36bc2..4551c3504f 100644 --- a/users/drashna/config.h +++ b/users/drashna/config.h @@ -291,4 +291,6 @@ # ifndef OLED_BRIGHTNESS # define OLED_BRIGHTNESS 50 # endif +# undef OLED_UPDATE_INTERVAL +# define OLED_UPDATE_INTERVAL 100 #endif diff --git a/users/drashna/keyrecords/caps_word.c b/users/drashna/keyrecords/caps_word.c index 0c7cd6cfe5..a152b2387b 100644 --- a/users/drashna/keyrecords/caps_word.c +++ b/users/drashna/keyrecords/caps_word.c @@ -1,83 +1,139 @@ -// Copyright 2021 Google LLC. -// SPDX-License-Identifier: Apache-2.0 - #include "caps_word.h" -#ifndef IS_COMMAND -# define IS_COMMAND() (get_mods() == MOD_MASK_SHIFT) -#endif - -bool caps_word_enabled = false; -bool caps_word_shifted = false; - -/** - * @brief Handler for Caps Word feature. - * - * This checks the keycodes, and applies shift to the correct keys, if and when needid. - * - * @param keycode Keycode from matrix - * @param record keyrecord_t data structure - * @return true Continue processing keycode and sent to host - * @return false Stop processing keycode, and do not send to host - */ +static bool caps_word_active = false; + +#if CAPS_WORD_IDLE_TIMEOUT > 0 +# if CAPS_WORD_IDLE_TIMEOUT < 100 || CAPS_WORD_IDLE_TIMEOUT > 30000 +// Constrain timeout to a sensible range. With the 16-bit timer, the longest +// representable timeout is 32768 ms, rounded here to 30000 ms = half a minute. +# error "caps_word: CAPS_WORD_IDLE_TIMEOUT must be between 100 and 30000 ms" +# endif + +static uint16_t idle_timer = 0; + +void caps_word_task(void) { + if (caps_word_active && timer_expired(timer_read(), idle_timer)) { + caps_word_set(false); + } +} +#endif // CAPS_WORD_IDLE_TIMEOUT > 0 + bool process_caps_word(uint16_t keycode, keyrecord_t* record) { - if (!caps_word_enabled) { +#ifndef NO_ACTION_ONESHOT + const uint8_t mods = get_mods() | get_oneshot_mods(); +#else + const uint8_t mods = get_mods(); +#endif // NO_ACTION_ONESHOT + + if (!caps_word_active) { // Pressing both shift keys at the same time enables caps word. - if (IS_COMMAND()) { - clear_mods(); - clear_oneshot_mods(); - caps_word_shifted = false; - caps_word_enabled = true; + if ((mods & MOD_MASK_SHIFT) == MOD_MASK_SHIFT) { + caps_word_set(true); // Activate Caps Word. return false; } return true; + } else { +#if CAPS_WORD_IDLE_TIMEOUT > 0 + idle_timer = record->event.time + CAPS_WORD_IDLE_TIMEOUT; +#endif // CAPS_WORD_IDLE_TIMEOUT > 0 } if (!record->event.pressed) { return true; } - if (!((get_mods() | get_oneshot_mods()) & ~MOD_MASK_SHIFT)) { + if (!(mods & ~MOD_MASK_SHIFT)) { switch (keycode) { + // Ignore MO, TO, TG, TT, and OSL layer switch keys. + case QK_MOMENTARY ... QK_MOMENTARY_MAX: + case QK_TO ... QK_TO_MAX: + case QK_TOGGLE_LAYER ... QK_TOGGLE_LAYER_MAX: + case QK_LAYER_TAP_TOGGLE ... QK_LAYER_TAP_TOGGLE_MAX: + case QK_ONE_SHOT_LAYER ... QK_ONE_SHOT_LAYER_MAX: + return true; + +#ifndef NO_ACTION_TAPPING case QK_MOD_TAP ... QK_MOD_TAP_MAX: - case QK_LAYER_TAP ... QK_LAYER_TAP_MAX: - // Earlier return if this has not been considered tapped yet. if (record->tap.count == 0) { + // Deactivate if a mod becomes active through holding a mod-tap key. + caps_word_set(false); return true; } - // Get the base tapping keycode of a mod- or layer-tap key. keycode &= 0xff; - } + break; - switch (keycode) { - // Letter keys should be shifted. - case KC_A ... KC_Z: - if (!caps_word_shifted) { - register_code(KC_LSFT); +# ifndef NO_ACTION_LAYER + case QK_LAYER_TAP ... QK_LAYER_TAP_MAX: +# endif // NO_ACTION_LAYER + if (record->tap.count == 0) { + return true; } - caps_word_shifted = true; - return true; + keycode &= 0xff; + break; +#endif // NO_ACTION_TAPPING - // Keycodes that continue caps word but shouldn't get shifted. - case KC_1 ... KC_0: - case KC_BSPC: - case KC_MINS: - case KC_UNDS: - if (caps_word_shifted) { - unregister_code(KC_LSFT); +#ifdef SWAP_HANDS_ENABLE + case QK_SWAP_HANDS ... QK_SWAP_HANDS_MAX: + if (keycode > 0x56F0 || record->tap.count == 0) { + return true; } - caps_word_shifted = false; - return true; + keycode &= 0xff; + break; +#endif // SWAP_HANDS_ENABLE + } - // Any other keycode disables caps word. + if (caps_word_press_user(keycode)) { + return true; } } - // Disable caps word. - caps_word_enabled = false; - if (caps_word_shifted) { - unregister_code(KC_LSFT); - } - caps_word_shifted = false; + caps_word_set(false); // Deactivate Caps Word. return true; } + +void caps_word_set(bool active) { + if (active != caps_word_active) { + if (active) { + clear_mods(); +#ifndef NO_ACTION_ONESHOT + clear_oneshot_mods(); +#endif // NO_ACTION_ONESHOT +#if CAPS_WORD_IDLE_TIMEOUT > 0 + idle_timer = timer_read() + CAPS_WORD_IDLE_TIMEOUT; +#endif // CAPS_WORD_IDLE_TIMEOUT > 0 + } else if ((get_weak_mods() & MOD_BIT(KC_LSFT)) != 0) { + // If the weak shift mod is still on, turn it off and send an update to + // the host computer. + del_weak_mods(MOD_BIT(KC_LSFT)); + send_keyboard_report(); + } + + caps_word_active = active; + caps_word_set_user(active); + } +} + +bool caps_word_get(void) { + return caps_word_active; +} + +__attribute__((weak)) void caps_word_set_user(bool active) {} + +__attribute__((weak)) bool caps_word_press_user(uint16_t keycode) { + switch (keycode) { + // Keycodes that continue Caps Word, with shift applied. + case KC_A ... KC_Z: + add_weak_mods(MOD_BIT(KC_LSFT)); // Apply shift to the next key. + return true; + + // Keycodes that continue Caps Word, without shifting. + case KC_1 ... KC_0: + case KC_BSPC: + case KC_MINS: + case KC_UNDS: + return true; + + default: + return false; // Deactivate Caps Word. + } +} diff --git a/users/drashna/keyrecords/caps_word.h b/users/drashna/keyrecords/caps_word.h index 79e410ddda..4279d7e831 100644 --- a/users/drashna/keyrecords/caps_word.h +++ b/users/drashna/keyrecords/caps_word.h @@ -5,4 +5,81 @@ #include "drashna.h" +// Call this function from `process_record_user()` to implement Caps Word. bool process_caps_word(uint16_t keycode, keyrecord_t* record); + +// If CAPS_WORD_IDLE_TIMEOUT is set, call `caps_word_task()` from +// `matrix_scan_user()` as described above. +// +// If CAPS_WORD_IDLE_TIMEOUT isn't set, calling this function has no effect (but +// will still compile). +#if CAPS_WORD_IDLE_TIMEOUT > 0 +void caps_word_task(void); +#else +static inline void caps_word_task(void) {} +#endif + +// Activates or deactivates Caps Word. For instance activate Caps Word with a +// combo by defining a `COMBO_ACTION` that calls `caps_word_set(true)`: +// +// void process_combo_event(uint16_t combo_index, bool pressed) { +// switch(combo_index) { +// case CAPS_COMBO: +// if (pressed) { +// caps_word_set(true); // Activate Caps Word. +// } +// break; +// +// // Other combos... +// } +// } +void caps_word_set(bool active); + +// Returns whether Caps Word is currently active. +bool caps_word_get(void); + +// An optional callback that gets called when Caps Word turns on or off. This is +// useful to represent the current Caps Word state, e.g. by setting an LED or +// playing a sound. In your keymap, define +// +// void caps_word_set_user(bool active) { +// if (active) { +// // Do something when Caps Word activates. +// } else { +// // Do something when Caps Word deactivates. +// } +// } +void caps_word_set_user(bool active); + +// An optional callback which is called on every key press while Caps Word is +// active. When the key should be shifted (that is, a letter key), the callback +// should call `add_weak_mods(MOD_BIT(KC_LSFT))` to shift the key. The callback +// also determines whether the key should continue Caps Word. Returning true +// continues the current "word", while returning false is "word breaking" and +// deactivates Caps Word. The default callback is +// +// bool caps_word_press_user(uint16_t keycode) { +// switch (keycode) { +// // Keycodes that continue Caps Word, with shift applied. +// case KC_A ... KC_Z: +// add_weak_mods(MOD_BIT(KC_LSFT)); // Apply shift to the next key. +// return true; +// +// // Keycodes that continue Caps Word, without shifting. +// case KC_1 ... KC_0: +// case KC_BSPC: +// case KC_MINS: +// case KC_UNDS: +// return true; +// +// default: +// return false; // Deactivate Caps Word. +// } +// } +// +// To customize, copy the above function into your keymap and add/remove +// keycodes to the above cases. +// +// NOTE: Outside of this callback, you can use `caps_word_set(false)` to +// deactivate Caps Word. +bool caps_word_press_user(uint16_t keycode); diff --git a/users/drashna/keyrecords/process_records.c b/users/drashna/keyrecords/process_records.c index 160a880215..99267d88a8 100644 --- a/users/drashna/keyrecords/process_records.c +++ b/users/drashna/keyrecords/process_records.c @@ -41,21 +41,21 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { #ifdef KEYLOGGER_ENABLE uprintf("KL: kc: 0x%04X, col: %2u, row: %2u, pressed: %b, time: %5u, int: %b, count: %u\n", keycode, record->event.key.col, record->event.key.row, record->event.pressed, record->event.time, record->tap.interrupted, record->tap.count); #endif // KEYLOGGER_ENABLE -#ifdef OLED_ENABLE +#if defined(OLED_ENABLE) && defined(CUSTOM_OLED_DRIVER) process_record_user_oled(keycode, record); #endif // OLED if (!(process_record_keymap(keycode, record) && process_record_secrets(keycode, record) -#ifdef RGB_MATRIX_ENABLE +#ifdef CUSTOM_RGB_MATRIX && process_record_user_rgb_matrix(keycode, record) #endif -#ifdef RGBLIGHT_ENABLE +#ifdef CUSTOM_RGBLIGHT && process_record_user_rgb_light(keycode, record) #endif #ifdef CUSTOM_UNICODE_ENABLE && process_record_unicode(keycode, record) #endif -#if defined(POINTING_DEVICE_ENABLE) +#if defined(CUSTOM_POINTING_DEVICE) && process_record_pointing(keycode, record) #endif #ifdef CAPS_WORD_ENABLE @@ -142,26 +142,26 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { } break; case KC_RGB_T: // This allows me to use underglow as layer indication, or as normal -#if defined(RGBLIGHT_ENABLE) || defined(RGB_MATRIX_ENABLE) +#if defined(CUSTOM_RGBLIGHT) || defined(CUSTOM_RGB_MATRIX) if (record->event.pressed) { userspace_config.rgb_layer_change ^= 1; dprintf("rgblight layer change [EEPROM]: %u\n", userspace_config.rgb_layer_change); eeconfig_update_user(userspace_config.raw); if (userspace_config.rgb_layer_change) { -# if defined(RGBLIGHT_ENABLE) && defined(RGB_MATRIX_ENABLE) +# if defined(CUSTOM_RGBLIGHT) && defined(CUSTOM_RGB_MATRIX) rgblight_enable_noeeprom(); # endif layer_state_set(layer_state); // This is needed to immediately set the layer color (looks better) -# if defined(RGBLIGHT_ENABLE) && defined(RGB_MATRIX_ENABLE) +# if defined(CUSTOM_RGBLIGHT) && defined(CUSTOM_RGB_MATRIX) } else { rgblight_disable_noeeprom(); # endif } } -#endif // RGBLIGHT_ENABLE +#endif // CUSTOM_RGBLIGHT break; -#if defined(RGBLIGHT_ENABLE) || defined(RGB_MATRIX_ENABLE) +#if defined(CUSTOM_RGBLIGHT) || defined(CUSTOM_RGB_MATRIX) case RGB_TOG: // Split keyboards need to trigger on key-up for edge-case issue # ifndef SPLIT_KEYBOARD @@ -169,10 +169,10 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { # else if (!record->event.pressed) { # endif -# if defined(RGBLIGHT_ENABLE) && !defined(RGBLIGHT_DISABLE_KEYCODES) +# if defined(CUSTOM_RGBLIGHT) && !defined(RGBLIGHT_DISABLE_KEYCODES) rgblight_toggle(); # endif -# if defined(RGB_MATRIX_ENABLE) && !defined(RGB_MATRIX_DISABLE_KEYCODES) +# if defined(CUSTOM_RGB_MATRIX) && !defined(RGB_MATRIX_DISABLE_KEYCODES) rgb_matrix_toggle(); # endif } @@ -181,7 +181,7 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { case RGB_MODE_FORWARD ... RGB_MODE_GRADIENT: // quantum_keycodes.h L400 for definitions if (record->event.pressed) { bool is_eeprom_updated; -# if defined(RGBLIGHT_ENABLE) && !defined(RGBLIGHT_DISABLE_KEYCODES) +# if defined(CUSTOM_RGBLIGHT) && !defined(RGBLIGHT_DISABLE_KEYCODES) // This disables layer indication, as it's assumed that if you're changing this ... you want that disabled if (userspace_config.rgb_layer_change) { userspace_config.rgb_layer_change = false; @@ -189,7 +189,7 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { is_eeprom_updated = true; } # endif -# if defined(RGB_MATRIX_ENABLE) && defined(RGB_MATRIX_FRAMEBUFFER_EFFECTS) +# if defined(CUSTOM_RGB_MATRIX) && defined(RGB_MATRIX_FRAMEBUFFER_EFFECTS) if (userspace_config.rgb_matrix_idle_anim) { userspace_config.rgb_matrix_idle_anim = false; dprintf("RGB Matrix Idle Animation [EEPROM]: %u\n", userspace_config.rgb_matrix_idle_anim); diff --git a/users/drashna/keyrecords/process_records.h b/users/drashna/keyrecords/process_records.h index d7a81d4607..5ca2966131 100644 --- a/users/drashna/keyrecords/process_records.h +++ b/users/drashna/keyrecords/process_records.h @@ -4,8 +4,10 @@ #pragma once #include "drashna.h" -#if defined(KEYBOARD_handwired_tractyl_manuform) +#if defined(KEYBOARD_handwired_tractyl_manuform) && defined(POINTING_DEVICE_ENABLE) # define PLACEHOLDER_SAFE_RANGE KEYMAP_SAFE_RANGE +#elif defined(KEYBOARD_bastardkb_charybdis) +# define PLACEHOLDER_SAFE_RANGE CHARYBDIS_SAFE_RANGE #else # define PLACEHOLDER_SAFE_RANGE SAFE_RANGE #endif diff --git a/users/drashna/keyrecords/unicode.c b/users/drashna/keyrecords/unicode.c index 5acd51da9b..af87ee2a61 100644 --- a/users/drashna/keyrecords/unicode.c +++ b/users/drashna/keyrecords/unicode.c @@ -6,7 +6,7 @@ #include "drashna.h" #include "process_unicode_common.h" -uint16_t typing_mode; +uint16_t typing_mode = KC_NOMODE; /** * @brief Registers the unicode keystrokes based on desired unicode @@ -245,7 +245,7 @@ bool process_record_unicode(uint16_t keycode, keyrecord_t *record) { if (typing_mode != keycode) { typing_mode = keycode; } else { - typing_mode = 0; + typing_mode = KC_NOMODE; } } break; diff --git a/users/drashna/oled/oled_stuff.c b/users/drashna/oled/oled_stuff.c index 752829e0fa..2a26b8b638 100644 --- a/users/drashna/oled/oled_stuff.c +++ b/users/drashna/oled/oled_stuff.c @@ -19,6 +19,9 @@ #ifdef UNICODE_COMMON_ENABLE # include "process_unicode_common.h" #endif +# ifdef AUDIO_CLICKY +# include "process_clicky.h" +# endif #include <string.h> extern bool host_driver_disabled; @@ -26,7 +29,9 @@ extern bool host_driver_disabled; uint32_t oled_timer = 0; char keylog_str[OLED_KEYLOGGER_LENGTH] = {0}; static uint16_t log_timer = 0; +#ifdef OLED_DISPLAY_VERBOSE static const char PROGMEM display_border[3] = {0x0, 0xFF, 0x0}; +#endif deferred_token kittoken; @@ -101,12 +106,6 @@ bool process_record_user_oled(uint16_t keycode, keyrecord_t *record) { return true; } -void update_log(void) { - if (timer_elapsed(log_timer) > 750) { - // add_keylog(0); - } -} - /** * @brief Renders keylogger buffer to oled * @@ -448,20 +447,24 @@ void render_bootmagic_status(void) { #endif } -#if defined(POINTING_DEVICE_ENABLE) +#if defined(CUSTOM_POINTING_DEVICE) extern bool tap_toggling; #endif void render_user_status(void) { #ifdef AUDIO_ENABLE - bool is_audio_on = false, is_clicky_on = false; + bool is_audio_on = false, l_is_clicky_on = false; # ifdef SPLIT_KEYBOARD - is_audio_on = user_state.audio_enable; - is_clicky_on = user_state.audio_clicky_enable; + is_audio_on = user_state.audio_enable; +# ifdef AUDIO_CLICKY + l_is_clicky_on = user_state.audio_clicky_enable; +# endif # else is_audio_on = is_audio_on(); - is_clicky_on = is_clicky_on(); +# ifdef AUDIO_CLICKY + l_is_clicky_on = is_clicky_on(); +# endif # endif #endif #if defined(OLED_DISPLAY_VERBOSE) @@ -476,7 +479,7 @@ void render_user_status(void) { # if !defined(OLED_DISPLAY_VERBOSE) oled_write_P(PSTR(" "), false); # endif -#elif defined(POINTING_DEVICE_ENABLE) +#elif defined(CUSTOM_POINTING_DEVICE) static const char PROGMEM mouse_lock[3] = {0xF2, 0xF3, 0}; oled_write_P(mouse_lock, tap_toggling); #endif @@ -486,7 +489,7 @@ void render_user_status(void) { # ifdef AUDIO_CLICKY static const char PROGMEM audio_clicky_status[2][3] = {{0xF4, 0xF5, 0}, {0xF6, 0xF7, 0}}; - oled_write_P(audio_clicky_status[is_clicky_on && is_audio_on], false); + oled_write_P(audio_clicky_status[l_is_clicky_on && is_audio_on], false); # if !defined(OLED_DISPLAY_VERBOSE) oled_write_P(PSTR(" "), false); # endif @@ -540,6 +543,7 @@ void render_wpm(uint8_t padding) { // vertical_offset = 0; void render_wpm_graph(uint8_t max_lines_graph, uint8_t vertical_offset) { +#ifdef WPM_ENABLE static uint16_t timer = 0; static uint8_t x = OLED_DISPLAY_HEIGHT - 1; uint8_t currwpm = get_current_wpm(); @@ -588,6 +592,7 @@ void render_wpm_graph(uint8_t max_lines_graph, uint8_t vertical_offset) { timer = timer_read(); // refresh the timer for the next iteration } +#endif } #if defined(POINTING_DEVICE_ENABLE) @@ -625,7 +630,7 @@ __attribute__((weak)) void oled_driver_render_logo_right(void) { //#define ANIM_FRAME_DURATION 500 // how long each frame lasts in ms // #define SLEEP_TIMER 60000 // should sleep after this period of 0 wpm, needs fixing -#define OLED_ANIM_SIZE 32 // number of bytes in array, minimize for adequate firmware size, max is 1024 +#define OLED_ANIM_SIZE 36 #define OLED_ANIM_ROWS 4 #define OLED_ANIM_MAX_FRAMES 3 #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) @@ -645,247 +650,67 @@ void render_kitty(void) { // sleep frames { { - { - 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, 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, 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, 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, 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 }, + { 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 }, + { 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 }, + { 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 } }, { - { - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 - }, - { - 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, 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, 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, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + { 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 }, + { 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 }, + { 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 } } }, // wake frames { { - { - 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, 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, 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, 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, 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 }, + { 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 }, + { 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 }, + { 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 } }, { - { - 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, 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, 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, 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, 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 }, + { 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 }, + { 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 }, + { 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 } } }, // kaki frames { { - { - 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, 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, 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, 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, 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 }, + { 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 }, + { 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 }, + { 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 } }, { - { - 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, 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, 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, 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, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x10, 0x20, 0x20, 0x40, 0x40, 0x80, 0x00, 0x00, 0x |