2020-10-17 11:46:57 -07:00
|
|
|
/* Copyright 2020 Christopher Courtney, aka Drashna Jael're (@drashna) <drashna@live.com>
|
|
|
|
*
|
|
|
|
* This program is free software: you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU General Public License as published by
|
|
|
|
* the Free Software Foundation, either version 2 of the License, or
|
|
|
|
* (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
*/
|
|
|
|
|
2018-10-01 18:00:14 -07:00
|
|
|
#include "drashna.h"
|
|
|
|
|
2023-02-28 11:14:48 -08:00
|
|
|
enum crkbd_keycodes {
|
|
|
|
RGBRST = USER_SAFE_RANGE,
|
|
|
|
};
|
2018-10-01 18:00:14 -07:00
|
|
|
|
2019-11-20 12:37:24 -08:00
|
|
|
/*
|
|
|
|
* The `LAYOUT_crkbd_base` macro is a template to allow the use of identical
|
|
|
|
* modifiers for the default layouts (eg QWERTY, Colemak, Dvorak, etc), so
|
|
|
|
* that there is no need to set them up for each layout, and modify all of
|
|
|
|
* them if I want to change them. This helps to keep consistency and ease
|
|
|
|
* of use. K## is a placeholder to pass through the individual keycodes
|
|
|
|
*/
|
|
|
|
|
2021-08-21 13:34:44 -07:00
|
|
|
#ifdef CONVERT_TO_PROTON_C
|
|
|
|
# define MID_TMB ET_RAIS
|
|
|
|
#else
|
|
|
|
# define MID_TMB KC_ENT
|
|
|
|
#endif
|
|
|
|
|
2021-01-22 08:23:03 -08:00
|
|
|
// clang-format off
|
2021-02-23 10:57:24 -08:00
|
|
|
#define LAYOUT_split_3x6_3_wrapper(...) LAYOUT_split_3x6_3(__VA_ARGS__)
|
2020-10-17 11:46:57 -07:00
|
|
|
#define LAYOUT_split_3x6_3_base( \
|
2018-10-15 12:34:49 -07:00
|
|
|
K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, \
|
2021-02-23 10:57:24 -08:00
|
|
|
K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, \
|
2018-10-15 12:34:49 -07:00
|
|
|
K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A \
|
|
|
|
) \
|
2020-10-17 11:46:57 -07:00
|
|
|
LAYOUT_split_3x6_3_wrapper( \
|
2018-11-26 16:45:24 -08:00
|
|
|
KC_ESC, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, KC_MINS, \
|
2021-02-23 10:57:24 -08:00
|
|
|
ALT_T(KC_TAB), K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, RALT_T(K1B), \
|
2019-05-06 22:34:09 -07:00
|
|
|
OS_LSFT, CTL_T(K21), K22, K23, K24, K25, K26, K27, K28, K29, RCTL_T(K2A), OS_RSFT, \
|
2021-08-21 13:34:44 -07:00
|
|
|
OS_LGUI, KC_SPC, BK_LWER, DL_RAIS, MID_TMB, OS_RGUI \
|
2018-10-15 12:34:49 -07:00
|
|
|
)
|
2021-07-26 17:59:49 -07:00
|
|
|
#define LAYOUT_base_wrapper(...) LAYOUT_split_3x6_3_base(__VA_ARGS__)
|
2018-10-01 18:00:14 -07:00
|
|
|
|
|
|
|
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
2021-07-26 17:59:49 -07:00
|
|
|
[_DEFAULT_LAYER_1] = LAYOUT_base_wrapper(
|
|
|
|
_________________QWERTY_L1_________________, _________________QWERTY_R1_________________,
|
|
|
|
_________________QWERTY_L2_________________, _________________QWERTY_R2_________________,
|
|
|
|
_________________QWERTY_L3_________________, _________________QWERTY_R3_________________
|
|
|
|
),
|
|
|
|
|
|
|
|
[_DEFAULT_LAYER_2] = LAYOUT_base_wrapper(
|
|
|
|
______________COLEMAK_MOD_DH_L1____________, ______________COLEMAK_MOD_DH_R1____________,
|
|
|
|
______________COLEMAK_MOD_DH_L2____________, ______________COLEMAK_MOD_DH_R2____________,
|
|
|
|
______________COLEMAK_MOD_DH_L3____________, ______________COLEMAK_MOD_DH_R3____________
|
|
|
|
),
|
|
|
|
|
|
|
|
[_DEFAULT_LAYER_3] = LAYOUT_base_wrapper(
|
|
|
|
_________________COLEMAK_L1________________, _________________COLEMAK_R1________________,
|
|
|
|
_________________COLEMAK_L2________________, _________________COLEMAK_R2________________,
|
|
|
|
_________________COLEMAK_L3________________, _________________COLEMAK_R3________________
|
|
|
|
),
|
|
|
|
|
|
|
|
[_DEFAULT_LAYER_4] = LAYOUT_base_wrapper(
|
|
|
|
_________________DVORAK_L1_________________, _________________DVORAK_R1_________________,
|
|
|
|
_________________DVORAK_L2_________________, _________________DVORAK_R2_________________,
|
|
|
|
_________________DVORAK_L3_________________, _________________DVORAK_R3_________________
|
|
|
|
),
|
2019-02-13 21:11:56 -08:00
|
|
|
|
2020-10-17 11:46:57 -07:00
|
|
|
[_LOWER] = LAYOUT_split_3x6_3_wrapper(
|
2018-11-26 16:45:24 -08:00
|
|
|
KC_F11, _________________LOWER_L1__________________, _________________LOWER_R1__________________, KC_F11,
|
|
|
|
KC_F12, _________________LOWER_L2__________________, _________________LOWER_R2__________________, KC_PIPE,
|
|
|
|
_______, _________________LOWER_L3__________________, _________________LOWER_R3__________________, _______,
|
2018-10-01 18:00:14 -07:00
|
|
|
_______, _______, _______, _______, _______, _______
|
|
|
|
),
|
|
|
|
|
2022-12-29 16:48:05 -08:00
|
|
|
[_RAISE] = LAYOUT_split_3x6_3_wrapper(
|
2018-11-26 16:45:24 -08:00
|
|
|
_______, _________________RAISE_L1__________________, _________________RAISE_R1__________________, _______,
|
2018-10-01 18:00:14 -07:00
|
|
|
_______, _________________RAISE_L2__________________, _________________RAISE_R2__________________, KC_BSLS,
|
|
|
|
_______, _________________RAISE_L3__________________, _________________RAISE_R3__________________, _______,
|
2018-10-15 12:34:49 -07:00
|
|
|
_______, _______, _______, _______, _______, _______
|
2018-10-01 18:00:14 -07:00
|
|
|
),
|
|
|
|
|
2022-12-29 16:48:05 -08:00
|
|
|
[_ADJUST] = LAYOUT_split_3x6_3_wrapper(
|
2022-05-30 22:02:55 -07:00
|
|
|
QK_MAKE, _________________ADJUST_L1_________________, _________________ADJUST_R1_________________, QK_BOOT,
|
|
|
|
VRSN, _________________ADJUST_L2_________________, _________________ADJUST_R2_________________, EE_CLR,
|
2021-10-15 22:30:23 -07:00
|
|
|
KEYLOCK, _________________ADJUST_L3_________________, _________________ADJUST_R3_________________, RGB_IDL,
|
2022-05-30 22:02:55 -07:00
|
|
|
QK_RBT, KC_NUKE, _______, _______, TG_MODS, AUTO_CTN
|
2018-10-01 18:00:14 -07:00
|
|
|
)
|
|
|
|
};
|
2019-07-22 20:22:33 -07:00
|
|
|
// clang-format on
|
2018-10-01 18:00:14 -07:00
|
|
|
|
2021-08-23 23:28:26 -07:00
|
|
|
#ifdef OLED_ENABLE
|
2023-02-28 11:14:48 -08:00
|
|
|
oled_rotation_t oled_init_keymap(oled_rotation_t rotation) {
|
|
|
|
return OLED_ROTATION_270;
|
|
|
|
}
|
2021-09-29 11:16:11 -07:00
|
|
|
|
|
|
|
# ifdef CONVERT_TO_PROTON_C
|
|
|
|
// WPM-responsive animation stuff here
|
|
|
|
# define SLEEP_FRAMES 2
|
2023-02-28 11:14:48 -08:00
|
|
|
# define SLEEP_SPEED 10 // below this wpm value your animation will idle
|
2021-09-29 11:16:11 -07:00
|
|
|
|
2023-02-28 11:14:48 -08:00
|
|
|
# define WAKE_FRAMES 2 // uncomment if >1
|
2021-09-29 11:16:11 -07:00
|
|
|
|
2023-02-28 11:14:48 -08:00
|
|
|
# define KAKI_FRAMES 3
|
|
|
|
# define KAKI_SPEED 40 // above this wpm value typing animation to triggere
|
2021-09-29 11:16:11 -07:00
|
|
|
|
|
|
|
# define RTOGI_FRAMES 2
|
2023-02-28 11:14:48 -08:00
|
|
|
// #define LTOGI_FRAMES 2
|
2021-09-29 11:16:11 -07:00
|
|
|
|
2023-02-28 11:14:48 -08:00
|
|
|
// #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 ANIM_SIZE 512 // number of bytes in array, minimize for adequate firmware size, max is 1024
|
2021-09-29 11:16:11 -07:00
|
|
|
|
|
|
|
uint32_t anim_timer = 0;
|
|
|
|
uint32_t anim_frame_duration = 500;
|
|
|
|
uint8_t current_sleep_frame = 0;
|
2023-02-28 11:14:48 -08:00
|
|
|
uint8_t current_wake_frame = 0; // uncomment if WAKE_FRAMES >1
|
2021-09-29 11:16:11 -07:00
|
|
|
uint8_t current_kaki_frame = 0;
|
2023-02-28 11:14:48 -08:00
|
|
|
# ifdef SWAP_HANDS_ENABLE
|
|
|
|
uint8_t current_rtogi_frame = 0;
|
|
|
|
# endif
|
2021-09-29 11:16:11 -07:00
|
|
|
// uint8_t current_ltogi_frame = 0;
|
|
|
|
// clang-format off
|
2022-03-06 22:12:17 -08:00
|
|
|
void render_small_kitty(void) {
|
2021-09-29 11:16:11 -07:00
|
|
|
// Images credit j-inc(/James Incandenza) and pixelbenny. Credit to obosob for initial animation approach.
|
|
|
|
static const char PROGMEM sleep[SLEEP_FRAMES][ANIM_SIZE] = {{
|
|
|
|
// 'sleep1', 32x32px
|
|
|
|
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,
|
|
|
|
},
|
|
|
|
{// 'sleep2', 32x32px
|
|
|
|
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 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
|
|
|
|
}};
|
|
|
|
static const char PROGMEM wake[WAKE_FRAMES][ANIM_SIZE] = {{
|
|
|
|
// 'mati2', 32x32px
|
|
|
|
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
|
|
|
|
},
|
|
|
|
{// 'mati3', 32x32px
|
|
|
|
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
|
|
|
|
}};
|
|
|
|
static const char PROGMEM kaki[KAKI_FRAMES][ANIM_SIZE] = {{
|
|
|
|
// 'jare2', 32x32px
|
|
|
|
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
|
|
|
|
},
|
|
|
|
{
|
|
|
|
// 'kaki1', 32x32px
|
|
|
|
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
|
|
|
|
},
|
|
|
|
{// 'kaki2', 32x32px
|
|
|
|
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, 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, 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, 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,
|
|
|
|
}};
|
2022-05-30 22:02:55 -07:00
|
|
|
#ifdef SWAP_HANDS_ENABLE
|
2021-09-29 11:16:11 -07:00
|
|
|
static const char PROGMEM rtogi[KAKI_FRAMES][ANIM_SIZE] = {{
|
|
|
|
// 'rtogi1', 32x32px
|
|
|
|
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, 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,
|
|
|
|
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, 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
|
|
|
|
},
|
|
|
|
{// 'rtogi2', 32x32px
|
|
|
|
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, 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,
|
|
|
|
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, 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
|
|
|
|
}};
|
2022-05-30 22:02:55 -07:00
|
|
|
#endif
|
2021-09-29 11:16:11 -07:00
|
|
|
// assumes 1 frame prep stage
|
2022-05-30 22:02:55 -07:00
|
|
|
#ifdef SWAP_HANDS_ENABLE
|
2021-09-29 11:16:11 -07:00
|
|
|
extern bool swap_hands;
|
2022-05-30 22:02:55 -07:00
|
|
|
#endif
|
2021-09-29 11:16:11 -07:00
|
|
|
void animation_phase(void) {
|
2022-05-30 22:02:55 -07:00
|
|
|
#ifdef SWAP_HANDS_ENABLE
|
2021-09-29 11:16:11 -07:00
|
|
|
if (swap_hands) {
|
|
|
|
anim_frame_duration = 300;
|
|
|
|
current_rtogi_frame = (current_rtogi_frame + 1) % RTOGI_FRAMES;
|
|
|
|
oled_write_raw_P(rtogi[abs((RTOGI_FRAMES - 1) - current_rtogi_frame)], ANIM_SIZE);
|
2022-05-30 22:02:55 -07:00
|
|
|
} else
|
|
|
|
#endif
|
|
|
|
{
|
2021-09-29 11:16:11 -07:00
|
|
|
if (get_current_wpm() <= SLEEP_SPEED) {
|
|
|
|
anim_frame_duration = 500;
|
|
|
|
current_sleep_frame = (current_sleep_frame + 1) % SLEEP_FRAMES;
|
|
|
|
oled_write_raw_P(sleep[abs((SLEEP_FRAMES - 1) - current_sleep_frame)], ANIM_SIZE);
|
|
|
|
}
|
|
|
|
// if(get_current_wpm() >IDLE_SPEED && get_current_wpm() <TAP_SPEED){
|
|
|
|
if (get_current_wpm() > SLEEP_SPEED) {
|
|
|
|
anim_frame_duration = 800;
|
|
|
|
current_wake_frame = (current_wake_frame + 1) % WAKE_FRAMES;
|
|
|
|
oled_write_raw_P(wake[abs((WAKE_FRAMES - 1) - current_wake_frame)], ANIM_SIZE);
|
|
|
|
// oled_write_raw_P(wake[0], ANIM_SIZE); // remove if IDLE_FRAMES >1
|
|
|
|
}
|
|
|
|
if (get_current_wpm() >= KAKI_SPEED) {
|
|
|
|
anim_frame_duration = 500;
|
|
|
|
current_kaki_frame = (current_kaki_frame + 1) % KAKI_FRAMES;
|
|
|
|
oled_write_raw_P(kaki[abs((KAKI_FRAMES - 1) - current_kaki_frame)], ANIM_SIZE);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (get_current_wpm() != 000) {
|
|
|
|
// if(timer_elapsed32(anim_timer) > ANIM_FRAME_DURATION) {
|
|
|
|
if (timer_elapsed32(anim_timer) > anim_frame_duration) {
|
|
|
|
anim_timer = timer_read32();
|
|
|
|
animation_phase();
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
// if(timer_elapsed32(anim_timer) > ANIM_FRAME_DURATION) {
|
|
|
|
if (timer_elapsed32(anim_timer) > anim_frame_duration) {
|
|
|
|
anim_timer = timer_read32();
|
|
|
|
animation_phase();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void oled_driver_render_logo_right(void) {
|
2022-03-06 22:12:17 -08:00
|
|
|
render_small_kitty();
|
2021-09-29 11:16:11 -07:00
|
|
|
|
2022-11-29 11:43:42 -08:00
|
|
|
render_default_layer_state(0, 4);
|
2021-09-29 11:16:11 -07:00
|
|
|
}
|
|
|
|
# endif
|
2019-04-22 11:55:55 -07:00
|
|
|
#endif
|
|
|
|
|
2021-01-22 08:23:03 -08:00
|
|
|
#ifdef TAPPING_TERM_PER_KEY
|
2020-05-30 13:14:59 -07:00
|
|
|
uint16_t get_tapping_term(uint16_t keycode, keyrecord_t *record) {
|
2019-05-06 22:34:09 -07:00
|
|
|
switch (keycode) {
|
|
|
|
case ALT_T(KC_A):
|
|
|
|
return TAPPING_TERM + 100;
|
|
|
|
default:
|
|
|
|
return TAPPING_TERM;
|
|
|
|
}
|
2019-04-22 11:55:55 -07:00
|
|
|
}
|
2021-01-22 08:23:03 -08:00
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifdef RGB_MATRIX_ENABLE
|
|
|
|
void check_default_layer(uint8_t mode, uint8_t type, uint8_t led_min, uint8_t led_max) {
|
2019-11-20 12:37:24 -08:00
|
|
|
switch (get_highest_layer(default_layer_state)) {
|
2019-09-07 08:57:30 -07:00
|
|
|
case _QWERTY:
|
2021-07-26 17:59:49 -07:00
|
|
|
rgb_matrix_layer_helper(DEFAULT_LAYER_1_HSV, mode, rgb_matrix_config.speed, type, led_min, led_max);
|
|
|
|
break;
|
|
|
|
case _COLEMAK_DH:
|
|
|
|
rgb_matrix_layer_helper(DEFAULT_LAYER_2_HSV, mode, rgb_matrix_config.speed, type, led_min, led_max);
|
2019-09-07 08:57:30 -07:00
|
|
|
break;
|
|
|
|
case _COLEMAK:
|
2021-07-26 17:59:49 -07:00
|
|
|
rgb_matrix_layer_helper(DEFAULT_LAYER_3_HSV, mode, rgb_matrix_config.speed, type, led_min, led_max);
|
2019-09-07 08:57:30 -07:00
|
|
|
break;
|
|
|
|
case _DVORAK:
|
2021-07-26 17:59:49 -07:00
|
|
|
rgb_matrix_layer_helper(DEFAULT_LAYER_4_HSV, mode, rgb_matrix_config.speed, type, led_min, led_max);
|
2019-09-07 08:57:30 -07:00
|
|
|
break;
|
2019-07-22 20:22:33 -07:00
|
|
|
}
|
2019-05-14 23:26:41 -07:00
|
|
|
}
|
2019-09-07 08:57:30 -07:00
|
|
|
|
2021-12-29 20:17:34 -08:00
|
|
|
bool rgb_matrix_indicators_advanced_keymap(uint8_t led_min, uint8_t led_max) {
|
2021-01-22 08:23:03 -08:00
|
|
|
if (userspace_config.rgb_layer_change) {
|
2019-11-20 12:37:24 -08:00
|
|
|
switch (get_highest_layer(layer_state)) {
|
2019-05-13 14:48:53 -07:00
|
|
|
case _GAMEPAD:
|
2021-01-22 08:23:03 -08:00
|
|
|
rgb_matrix_layer_helper(HSV_ORANGE, 0, rgb_matrix_config.speed, LED_FLAG_UNDERGLOW, led_min, led_max);
|
2019-07-22 20:22:33 -07:00
|
|
|
break;
|
2019-05-13 14:48:53 -07:00
|
|
|
case _DIABLO:
|
2021-01-22 08:23:03 -08:00
|
|
|
rgb_matrix_layer_helper(HSV_RED, 0, rgb_matrix_config.speed, LED_FLAG_UNDERGLOW, led_min, led_max);
|
2019-07-22 20:22:33 -07:00
|
|
|
break;
|
2019-05-13 14:48:53 -07:00
|
|
|
case _RAISE:
|
2021-01-22 08:23:03 -08:00
|
|
|
rgb_matrix_layer_helper(HSV_YELLOW, 0, rgb_matrix_config.speed, LED_FLAG_UNDERGLOW, led_min, led_max);
|
2019-07-22 20:22:33 -07:00
|
|
|
break;
|
2019-05-13 14:48:53 -07:00
|
|
|
case _LOWER:
|
2021-01-22 08:23:03 -08:00
|
|
|
rgb_matrix_layer_helper(HSV_GREEN, 0, rgb_matrix_config.speed, LED_FLAG_UNDERGLOW, led_min, led_max);
|
2019-07-22 20:22:33 -07:00
|
|
|
break;
|
2019-05-13 14:48:53 -07:00
|
|
|
case _ADJUST:
|
2021-01-22 08:23:03 -08:00
|
|
|
rgb_matrix_layer_helper(HSV_RED, 0, rgb_matrix_config.speed, LED_FLAG_UNDERGLOW, led_min, led_max);
|
2019-07-22 20:22:33 -07:00
|
|
|
break;
|
2021-07-26 17:59:49 -07:00
|
|
|
default:
|
|
|
|
{
|
|
|
|
check_default_layer(0, LED_FLAG_UNDERGLOW, led_min, led_max);
|
|
|
|
break;
|
|
|
|
}
|
2019-05-13 14:48:53 -07:00
|
|
|
}
|
2021-01-22 08:23:03 -08:00
|
|
|
check_default_layer(0, LED_FLAG_MODIFIER, led_min, led_max);
|
2019-05-13 14:48:53 -07:00
|
|
|
}
|
2021-12-29 20:17:34 -08:00
|
|
|
return false;
|
2019-05-13 14:48:53 -07:00
|
|
|
}
|
|
|
|
#endif
|