diff options
author | jack <[email protected]> | 2022-11-03 11:53:25 -0600 |
---|---|---|
committer | jack <[email protected]> | 2022-11-03 11:53:25 -0600 |
commit | 1d912b04f911f5a0dde98072206b27ddba3d8ab7 (patch) | |
tree | 9ddb66e8e1632860902ab3dea2158f58f36cc539 | |
parent | 68b86d7016abc94d69817de5bf1160e22cb98b78 (diff) | |
download | qmk_me-1d912b04f911f5a0dde98072206b27ddba3d8ab7.tar.gz qmk_me-1d912b04f911f5a0dde98072206b27ddba3d8ab7.zip |
initial userspace
-rw-r--r-- | README.md | 2 | ||||
-rw-r--r-- | keyboards/xyz60/info.json | 85 | ||||
-rw-r--r-- | keyboards/xyz60/keymaps/waffle/keymap.c | 26 | ||||
-rw-r--r-- | keyboards/xyz60/rules.mk | 0 | ||||
-rw-r--r-- | readme.md | 96 | ||||
-rw-r--r-- | waffle/.gitignore | 2 | ||||
-rw-r--r-- | waffle/autocorrect_data.h | 215 | ||||
-rw-r--r-- | waffle/color.c | 132 | ||||
-rw-r--r-- | waffle/combos.def | 17 | ||||
-rw-r--r-- | waffle/combos.h | 21 | ||||
-rw-r--r-- | waffle/config.h | 40 | ||||
-rw-r--r-- | waffle/dict.txt | 398 | ||||
-rw-r--r-- | waffle/oled.c | 247 | ||||
-rw-r--r-- | waffle/oled.h | 226 | ||||
-rw-r--r-- | waffle/oledfont.h | 14 | ||||
-rw-r--r-- | waffle/raw.py | 47 | ||||
-rw-r--r-- | waffle/rle.c | 76 | ||||
-rw-r--r-- | waffle/rules.mk | 39 | ||||
-rw-r--r-- | waffle/tapping.c | 172 | ||||
-rw-r--r-- | waffle/unicode.c | 263 | ||||
-rw-r--r-- | waffle/waffle.c | 144 | ||||
-rw-r--r-- | waffle/waffle.h | 103 |
22 files changed, 2363 insertions, 2 deletions
diff --git a/README.md b/README.md deleted file mode 100644 index dab575c..0000000 --- a/README.md +++ /dev/null @@ -1,2 +0,0 @@ -# qmk.me -QMK Firmware userspace, keyboards, & keymaps diff --git a/keyboards/xyz60/info.json b/keyboards/xyz60/info.json new file mode 100644 index 0000000..37e7edd --- /dev/null +++ b/keyboards/xyz60/info.json @@ -0,0 +1,85 @@ +{ + "keyboard_name": "xyz60", + "bootloader": "stm32duino", + "diode_direction": "COL2ROW", + "matrix_pins": { + "cols": ["B13", "B8", "B11", "B10", "B2", "B1", "B0", "A7", "A6", "A5", "A4", "A3", "A2", "A1", "A0"], + "rows": ["B7", "B9", "B12", "B14", "B15"] + }, + "matrix_size": { + "cols": 15, + "rows": 5 + }, + "processor": "STM32F103", + "usb": { + "device_version": "0.0.1", + "pid": "0x7879", + "vid": "0x6A73" + }, + "layouts": { + "LAYOUT_60_ansi_tsangan": { + "layout": [ + {"matrix": [0, 0]}, + {"matrix": [0, 1]}, + {"matrix": [0, 2]}, + {"matrix": [0, 3]}, + {"matrix": [0, 4]}, + {"matrix": [0, 5]}, + {"matrix": [0, 6]}, + {"matrix": [0, 7]}, + {"matrix": [0, 8]}, + {"matrix": [0, 9]}, + {"matrix": [0, 10]}, + {"matrix": [0, 11]}, + {"matrix": [0, 12]}, + {"matrix": [0, 14]}, + {"matrix": [1, 0]}, + {"matrix": [1, 1]}, + {"matrix": [1, 2]}, + {"matrix": [1, 3]}, + {"matrix": [1, 4]}, + {"matrix": [1, 5]}, + {"matrix": [1, 6]}, + {"matrix": [1, 7]}, + {"matrix": [1, 8]}, + {"matrix": [1, 9]}, + {"matrix": [1, 10]}, + {"matrix": [1, 11]}, + {"matrix": [1, 12]}, + {"matrix": [1, 13]}, + {"matrix": [2, 0]}, + {"matrix": [2, 1]}, + {"matrix": [2, 2]}, + {"matrix": [2, 3]}, + {"matrix": [2, 4]}, + {"matrix": [2, 5]}, + {"matrix": [2, 6]}, + {"matrix": [2, 7]}, + {"matrix": [2, 8]}, + {"matrix": [2, 9]}, + {"matrix": [2, 10]}, + {"matrix": [2, 11]}, + {"matrix": [2, 13]}, + {"matrix": [3, 0]}, + {"matrix": [3, 2]}, + {"matrix": [3, 3]}, + {"matrix": [3, 4]}, + {"matrix": [3, 5]}, + {"matrix": [3, 6]}, + {"matrix": [3, 7]}, + {"matrix": [3, 8]}, + {"matrix": [3, 9]}, + {"matrix": [3, 10]}, + {"matrix": [3, 11]}, + {"matrix": [3, 13]}, + {"matrix": [4, 0]}, + {"matrix": [4, 1]}, + {"matrix": [4, 2]}, + {"matrix": [4, 6]}, + {"matrix": [4, 10]}, + {"matrix": [4, 12]}, + {"matrix": [4, 13]} + ] + } + } +} diff --git a/keyboards/xyz60/keymaps/waffle/keymap.c b/keyboards/xyz60/keymaps/waffle/keymap.c new file mode 100644 index 0000000..ad77ec7 --- /dev/null +++ b/keyboards/xyz60/keymaps/waffle/keymap.c @@ -0,0 +1,26 @@ +#include "waffle.h" +#define ___NONE___ _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [_BASE] = LAYOUT_waffle_60_ts( + KC_DEL, ___NONE___, + _______, ___BASE1___, _______, _______, PNP, + LINKS, ___BASE2___, KC_BSPC, _______, + _______, ___BASE3___, _______, + KC_VOLD, _______, KC_ESC, LWRSPC, PSTRSE, _______, KC_VOLU + ), + [_LOWER] = LAYOUT_waffle_60_ts( + _______, ___NONE___, + _______, ___LOWER1___, _______, _______, _______, + _______, ___LOWER2___, _______, _______, + _______, ___LOWER3___, _______, + _______, _______, _______, _______, _______, _______, _______ + ), + [_RAISE] = LAYOUT_waffle_60_ts( + _______, ___NONE___, + _______, ___RAISE1___, _______, _______, _______, + _______, ___RAISE2___, _______, _______, + _______, ___RAISE3___, _______, + _______, _______, _______, _______, _______, _______, _______ + ) +}; diff --git a/keyboards/xyz60/rules.mk b/keyboards/xyz60/rules.mk new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/keyboards/xyz60/rules.mk diff --git a/readme.md b/readme.md new file mode 100644 index 0000000..5a9fe82 --- /dev/null +++ b/readme.md @@ -0,0 +1,96 @@ +### layout +![layout](https://i.imgur.com/uKNJuKi.png) + +### combos +`#define COMBO_TERM 50` +| trigger | output (single/double tap) | +| :-----: | :------------------------: | +| r + u | enter | +| v + m | ? | +| t + y | : | +| b + n | _ | +| s + l | + | +| d + k | = | +| g + h | ' / " | +| w + o | - / — | +| e + r | { / } | +| u + i | [ / ] | +| e + i | \ / \| | +| d + f | left click | +| f + g | right click | + +### oled +[font file](oledfont.h) can be viewed and modified at [qmk logo editor](https://joric.github.io/qle)\ +all the boring animation code is stored in [oled.h](https://github.com/waffle87/qmk_firmware/blob/waffle_develop/users/waffle/oled.h) + +**animations:**\ +[felix the dog](https://github.com/waffle87/qmk_firmware/blob/waffle_develop/users/waffle/oled.c#L133-#L151)\ +[bongo cat](https://github.com/waffle87/qmk_firmware/blob/waffle_develop/users/waffle/oled.c#L155-#L172)\ +[layer animation](https://github.com/waffle87/qmk_firmware/blob/waffle_develop/users/waffle/oled.c#L206-#L229)\ +below snippet can be used to render the big byte arrays used by animations. +where `size` is the array size and `action` is the animation frame name. +```c +void anim_frame(uint16_t size, char const action[][size]) { + static uint8_t current_frame = 0; + current_frame = (current_frame + 1) & 1; + oled_write_raw_P(action[current_frame], size); +} +``` +**custom timeout:**\ +some animations don't respect `OLED_TIMEOUT`, so a custom timeout from [drashna](https://github.com/qmk/qmk_firmware/blob/develop/users/drashna/oled/oled_stuff.c) can be used. +this depends on `OLED_DISABLE_TIMEOUT` & `SPLIT_OLED_ENABLE` being defined. +```c +bool oled_task_user(void) { + if (is_keyboard_master()) { + if (timer_elapsed32(oled_timer) > 180000) { //turn off after 3min + oled_off(); + return false; + } else + oled_on(); + } + if (!oled_task_keymap()) + return false; + return false; +} + +uint32_t oled_timer = 0; +void oled_timer_reset(void) { + oled_timer = timer_read32(); +} +``` +`oled_timer_reset()` just needs to be called from `process_record_user()`: +```c +if (record->event.pressed) + oled_timer_reset(); +``` +the above snippet is also neat because global oled behavior can be placed in `oled_task_user`, +while keyboard specific oled code, like rendering certain things, can go in `oled_task_keymap`. + +### raw hid +[raw.py](raw.py) is a basic implementation modified from [rawhid in python](https://gist.github.com/fauxpark/03a3efcc7dbdfbfe57791ea267b13c55). +renders current time on oled display: +```c +void host_info(uint8_t data) { + char buffer[3]; + oled_write_P((char*)itoa(data, buffer, 10), false); +} + +void render_time(void) { + if (user_state.hour < 10) + oled_write_P(PSTR("0"), false); + host_info(user_state.hour); + oled_write_P(PSTR(":"), false); + if (user_state.min < 10) + oled_write_P(PSTR("0"), false); + host_info(user_state.min); +} +``` + +### some keyboards +[crkbd](https://github.com/waffle87/qmk_firmware/tree/waffle_develop/keyboards/crkbd/keymaps/waffle)\ +[relic](https://github.com/waffle87/qmk_firmware/tree/waffle_develop/keyboards/relic/keymaps/waffle)\ +[kyria](https://github.com/waffle87/qmk_firmware/tree/waffle_develop/keyboards/splitkb/kyria/keymaps/waffle)\ +[ferris](https://github.com/waffle87/qmk_firmware/tree/waffle_develop/keyboards/ferris/keymaps/waffle)\ +[microdox](https://github.com/waffle87/qmk_firmware/tree/waffle_develop/keyboards/boardsource/microdox/keymaps/waffle)\ +[minidox](https://github.com/waffle87/qmk_firmware/tree/waffle_develop/keyboards/handwired/minidox/keymaps/waffle)\ +[leftover30](https://github.com/waffle87/qmk_firmware/blob/waffle_develop/keyboards/tominabox1/leftover30_arm/keymaps/waffle/keymap.c) diff --git a/waffle/.gitignore b/waffle/.gitignore new file mode 100644 index 0000000..9ed1850 --- /dev/null +++ b/waffle/.gitignore @@ -0,0 +1,2 @@ +secrets.h +a.out diff --git a/waffle/autocorrect_data.h b/waffle/autocorrect_data.h new file mode 100644 index 0000000..3cca35a --- /dev/null +++ b/waffle/autocorrect_data.h @@ -0,0 +1,215 @@ +// Copyright 2022 jack (@waffle87) +// SPDX-License-Identifier: GPL-2.0-or-later +#define AUTOCORRECT_MIN_LENGTH 5 +#define AUTOCORRECT_MAX_LENGTH 10 +#define DICTIONARY_SIZE 5867 + +static const uint8_t autocorrect_data[DICTIONARY_SIZE] PROGMEM = { 108, 64, 0, 4, 10, 1, 6, 34, 1, 7, 125, 1, 8, 71, 3, + 9, 142, 8, 10, 191, 8, 11, 67, 9, 12, 210, 9, 14, 220, 9, 15, 232, 9, 16, 9, 11, 17, 59, 11, 18, 88, 13, 19, 140, + 13, 21, 166, 13, 22, 109, 15, 23, 33, 17, 25, 89, 20, 26, 144, 20, 28, 182, 20, 0, 70, 95, 0, 7, 103, 0, 8, 113, 0, + 10, 156, 0, 15, 168, 0, 17, 176, 0, 18, 184, 0, 22, 194, 0, 23, 205, 0, 24, 0, 1, 0, 12, 11, 26, 44, 0, 128, 104, 0, + 22, 8, 24, 44, 0, 131, 115, 101, 100, 0, 75, 120, 0, 23, 141, 0, 0, 23, 0, 108, 129, 0, 18, 136, 0, 0, 8, 11, 23, + 44, 0, 132, 0, 44, 0, 128, 114, 0, 12, 21, 26, 28, 19, 18, 6, 0, 133, 114, 105, 103, 104, 116, 0, 17, 12, 16, 16, + 18, 6, 0, 132, 105, 110, 103, 0, 24, 18, 26, 44, 0, 128, 100, 0, 12, 18, 10, 44, 0, 128, 103, 0, 15, 22, 4, 44, 0, + 131, 108, 115, 111, 0, 8, 22, 18, 18, 15, 0, 132, 115, 101, 115, 0, 68, 218, 0, 12, 227, 0, 18, 237, 0, 24, 247, 0, + 0, 21, 10, 44, 0, 130, 101, 97, 116, 0, 21, 6, 18, 19, 28, 11, 0, 128, 101, 0, 15, 4, 44, 0, 131, 32, 108, 111, 116, + 0, 22, 13, 44, 0, 131, 117, 115, 116, 0, 23, 22, 13, 44, 0, 131, 117, 115, 116, 0, 87, 17, 1, 28, 26, 1, 0, 24, 18, + 5, 4, 0, 128, 32, 97, 0, 7, 18, 23, 0, 129, 97, 121, 0, 75, 44, 1, 12, 53, 1, 14, 117, 1, 0, 23, 12, 26, 22, 0, 129, + 99, 104, 0, 80, 66, 1, 21, 78, 1, 22, 92, 1, 23, 101, 1, 0, 17, 4, 28, 7, 0, 132, 110, 97, 109, 105, 99, 0, 23, 8, + 16, 28, 22, 0, 132, 109, 101, 116, 114, 105, 99, 0, 4, 15, 6, 0, 129, 115, 105, 99, 0, 8, 11, 23, 22, 4, 0, 134, + 101, 115, 116, 104, 101, 116, 105, 99, 0, 8, 11, 6, 0, 129, 99, 107, 0, 68, 147, 1, 8, 159, 1, 15, 127, 2, 17, 167, + 2, 18, 223, 2, 21, 250, 2, 24, 50, 3, 0, 12, 15, 25, 17, 12, 0, 131, 97, 108, 105, 100, 0, 70, 193, 1, 7, 203, 1, 8, + 213, 1, 9, 224, 1, 10, 237, 1, 12, 247, 1, 19, 17, 2, 21, 46, 2, 22, 81, 2, 23, 93, 2, 24, 118, 2, 0, 12, 25, 7, 4, + 0, 130, 115, 101, 100, 0, 8, 5, 16, 8, 0, 129, 100, 101, 100, 0, 21, 10, 10, 4, 0, 132, 114, 101, 101, 100, 0, 12, + 22, 12, 23, 4, 22, 0, 131, 102, 105, 101, 100, 0, 17, 12, 22, 0, 131, 103, 110, 101, 100, 0, 85, 254, 1, 25, 7, 2, + 0, 21, 24, 5, 0, 131, 105, 101, 100, 0, 21, 8, 7, 0, 131, 105, 118, 101, 100, 0, 68, 24, 2, 22, 36, 2, 0, 15, 22, 8, + 0, 133, 108, 97, 112, 115, 101, 100, 0, 4, 15, 8, 0, 131, 112, 115, 101, 100, 0, 72, 56, 2, 10, 65, 2, 24, 72, 2, 0, + 9, 8, 21, 0, 129, 114, 101, 100, 0, 4, 44, 0, 128, 101, 100, 0, 6, 6, 18, 0, 129, 114, 101, 100, 0, 4, 19, 15, 8, 0, + 132, 97, 112, 115, 101, 100, 0, 68, 100, 2, 22, 111, 2, 0, 8, 15, 8, 21, 0, 132, 97, 116, 101, 100, 0, 17, 12, 0, + 128, 97, 100, 0, 15, 6, 17, 12, 0, 129, 100, 101, 0, 76, 134, 2, 18, 155, 2, 0, 8, 0, 73, 143, 2, 28, 149, 2, 0, + 131, 105, 101, 108, 100, 0, 131, 105, 101, 108, 100, 0, 22, 8, 21, 11, 23, 0, 130, 104, 111, 108, 100, 0, 72, 177, + 2, 12, 188, 2, 24, 198, 2, 0, 21, 12, 9, 0, 132, 114, 105, 101, 110, 100, 0, 8, 21, 9, 0, 131, 105, 101, 110, 100, + 0, 82, 205, 2, 21, 215, 2, 0, 4, 44, 0, 131, 114, 111, 117, 110, 100, 0, 4, 0, 130, 111, 117, 110, 100, 0, 76, 230, + 2, 21, 241, 2, 0, 8, 21, 19, 0, 132, 101, 114, 105, 111, 100, 0, 6, 8, 21, 0, 130, 111, 114, 100, 0, 68, 4, 3, 8, + 15, 3, 24, 40, 3, 0, 26, 18, 9, 0, 131, 114, 119, 97, 114, 100, 0, 71, 22, 3, 12, 32, 3, 0, 12, 22, 17, 18, 6, 0, + 128, 101, 100, 0, 26, 0, 131, 101, 105, 114, 100, 0, 4, 10, 44, 0, 131, 117, 97, 114, 100, 0, 18, 0, 75, 59, 3, 21, + 65, 3, 0, 22, 0, 128, 108, 100, 0, 4, 0, 128, 110, 100, 0, 68, 117, 3, 5, 130, 3, 6, 173, 3, 7, 45, 4, 8, 73, 4, 10, + 157, 4, 11, 21, 5, 12, 102, 5, 15, 111, 5, 17, 49, 6, 21, 61, 6, 22, 167, 6, 23, 56, 7, 24, 19, 8, 25, 76, 8, 0, 6, + 19, 22, 8, 16, 4, 17, 0, 130, 97, 99, 101, 0, 68, 137, 3, 15, 147, 3, 0, 15, 12, 4, 25, 4, 0, 128, 108, 101, 0, 68, + 154, 3, 24, 165, 3, 0, 15, 12, 4, 25, 4, 0, 130, 98, 108, 101, 0, 18, 7, 0, 130, 98, 108, 101, 0, 72, 186, 3, 12, + 197, 3, 17, 206, 3, 19, 32, 4, 0, 21, 8, 9, 8, 21, 0, 129, 110, 99, 101, 0, 8, 19, 0, 131, 105, 101, 99, 101, 0, 68, + 216, 3, 8, 229, 3, 24, 22, 4, 0, 23, 8, 19, 16, 18, 6, 0, 131, 101, 110, 99, 101, 0, 85, 236, 3, 23, 11, 4, 0, 8, 0, + 73, 245, 3, 15, 2, 4, 0, 21, 44, 0, 134, 101, 102, 101, 114, 101, 110, 99, 101, 0, 18, 23, 0, 131, 97, 110, 99, 101, + 0, 17, 12, 4, 16, 0, 129, 97, 110, 99, 101, 0, 20, 8, 22, 0, 130, 101, 110, 99, 101, 0, 4, 22, 8, 16, 4, 17, 0, 131, + 112, 97, 99, 101, 0, 12, 21, 8, 25, 0, 82, 57, 4, 25, 63, 4, 0, 130, 114, 105, 100, 101, 0, 18, 0, 133, 101, 114, + 114, 105, 100, 101, 0, 23, 0, 68, 88, 4, 12, 99, 4, 17, 109, 4, 23, 144, 4, 0, 21, 4, 24, 10, 0, 130, 110, 116, 101, + 101, 0, 16, 16, 18, 6, 0, 129, 116, 101, 101, 0, 4, 21, 0, 68, 119, 4, 24, 131, 4, 0, 10, 0, 134, 117, 97, 114, 97, + 110, 116, 101, 101, 0, 4, 10, 0, 135, 117, 97, 114, 97, 110, 116, 101, 101, 0, 12, 16, 18, 6, 0, 132, 109, 105, 116, + 116, 101, 101, 0, 68, 167, 4, 7, 234, 4, 16, 12, 5, 0, 74, 180, 4, 17, 191, 4, 22, 200, 4, 24, 209, 4, 0, 21, 18, + 16, 0, 131, 116, 103, 97, 103, 101, 0, 11, 6, 0, 131, 97, 110, 103, 101, 0, 8, 16, 0, 130, 115, 97, 103, 101, 0, 10, + 0, 108, 218, 4, 4, 224, 4, 0, 131, 97, 117, 103, 101, 0, 15, 0, 132, 110, 103, 117, 97, 103, 101, 0, 8, 15, 0, 68, + 247, 4, 12, 253, 4, 15, 6, 5, 0, 131, 108, 101, 103, 101, 0, 25, 12, 21, 19, 0, 130, 103, 101, 0, 4, 0, 130, 103, + 101, 0, 4, 12, 0, 131, 109, 97, 103, 101, 0, 23, 0, 71, 39, 5, 16, 49, 5, 18, 59, 5, 22, 68, 5, 23, 77, 5, 0, 17, 4, + 44, 0, 130, 32, 116, 104, 101, 0, 18, 21, 9, 0, 130, 32, 116, 104, 101, 0, 23, 44, 0, 130, 32, 116, 104, 101, 0, 4, + 44, 0, 130, 32, 116, 104, 101, 0, 68, 84, 5, 24, 92, 5, 0, 44, 0, 130, 32, 116, 104, 101, 0, 18, 5, 4, 0, 130, 32, + 116, 104, 101, 0, 29, 22, 44, 0, 130, 105, 122, 101, 0, 69, 130, 5, 12, 243, 5, 19, 254, 5, 22, 26, 6, 23, 34, 6, + 25, 42, 6, 0, 68, 140, 5, 12, 220, 5, 15, 232, 5, 0, 74, 150, 5, 12, 160, 5, 15, 190, 5, 0, 12, 15, 8, 0, 131, 105, + 98, 108, 101, 0, 15, 0, 68, 169, 5, 12, 180, 5, 0, 25, 4, 0, 133, 105, 108, 97, 98, 108, 101, 0, 4, 25, 4, 0, 132, + 97, 98, 108, 101, 0, 68, 197, 5, 12, 208, 5, 0, 25, 4, 0, 132, 105, 108, 97, 98, 108, 101, 0, 25, 4, 0, 133, 97, + 105, 108, 97, 98, 108, 101, 0, 4, 15, 12, 4, 25, 4, 0, 131, 98, 108, 101, 0, 12, 4, 25, 4, 0, 130, 97, 98, 108, 101, + 0, 26, 11, 44, 0, 132, 119, 104, 105, 108, 101, 0, 72, 5, 6, 18, 15, 6, 0, 18, 19, 0, 132, 101, 111, 112, 108, 101, + 0, 8, 18, 19, 0, 133, 101, 111, 112, 108, 101, 0, 4, 9, 0, 130, 108, 115, 101, 0, 12, 15, 0, 129, 116, 108, 101, 0, + 8, 15, 0, 129, 101, 108, 0, 12, 8, 10, 28, 11, 0, 131, 105, 101, 110, 101, 0, 70, 77, 6, 12, 87, 6, 18, 99, 6, 21, + 138, 6, 24, 145, 6, 0, 18, 22, 44, 0, 131, 99, 111, 114, 101, 0, 24, 20, 4, 0, 132, 99, 113, 117, 105, 114, 101, 0, + 71, 109, 6, 8, 118, 6, 9, 126, 6, 0, 8, 5, 0, 131, 102, 111, 114, 101, 0, 5, 0, 130, 102, 111, 114, 101, 0, 21, 8, + 11, 23, 0, 131, 101, 102, 111, 114, 101, 0, 8, 11, 26, 0, 129, 101, 0, 23, 0, 108, 154, 6, 4, 159, 6, 0, 130, 114, + 117, 101, 0, 16, 4, 0, 130, 101, 117, 114, 0, 68, 189, 6, 8, 225, 6, 12, 233, 6, 15, 248, 6, 17, 1, 7, 18, 31, 7, + 24, 44, 7, 0, 70, 199, 6, 8, 207, 6, 15, 217, 6, 0, 8, 5, 0, 129, 117, 115, 101, 0, 5, 44, 0, 130, 99, 97, 117, 115, + 101, 0, 9, 0, 131, 97, 108, 115, 101, 0, 8, 11, 23, 0, 130, 115, 101, 0, 6, 21, 8, 6, 27, 8, 0, 134, 101, 114, 99, + 105, 115, 101, 0, 12, 4, 9, 0, 131, 108, 115, 101, 0, 72, 8, 7, 18, 19, 7, 0, 22, 12, 15, 0, 132, 99, 101, 110, 115, + 101, 0, 19, 8, 21, 0, 132, 115, 112, 111, 110, 115, 101, 0, 19, 17, 4, 21, 23, 0, 131, 115, 112, 111, 115, 101, 0, + 6, 4, 8, 5, 0, 132, 99, 97, 117, 115, 101, 0, 68, 69, 7, 8, 243, 7, 15, 254, 7, 25, 10, 8, 0, 71, 85, 7, 10, 122, 7, + 15, 135, 7, 19, 202, 7, 21, 212, 7, 0, 18, 16, 0, 80, 95, 7, 18, 110, 7, 0, 18, 6, 4, 0, 135, 99, 111, 109, 109, + 111, 100, 97, 116, 101, 0, 6, 6, 4, 0, 132, 109, 111, 100, 97, 116, 101, 0, 18, 19, 18, 21, 19, 0, 132, 97, 103, 97, + 116, 101, 0, 70, 145, 7, 19, 158, 7, 24, 171, 7, 0, 24, 15, 4, 6, 0, 133, 99, 117, 108, 97, 116, 101, 0, 16, 4, 8, + 23, 0, 134, 109, 112, 108, 97, 116, 101, 0, 70, 178, 7, 15, 191, 7, 0, 24, 15, 4, 6, 0, 134, 99, 117, 108, 97, 116, + 101, 0, 4, 6, 0, 132, 99, 117, 108, 97, 116, 101, 0, 7, 24, 0, 132, 112, 100, 97, 116, 101, 0, 72, 219, 7, 24, 232, + 7, 0, 17, 4, 10, 0, 134, 101, 110, 101, 114, 97, 116, 101, 0, 6, 4, 0, 132, 99, 117, 114, 97, 116, 101, 0, 15, 15, + 4, 19, 0, 131, 101, 116, 116, 101, 0, 4, 19, 16, 8, 23, 0, 131, 108, 97, 116, 101, 0, 12, 21, 19, 0, 129, 97, 116, + 101, 0, 74, 29, 8, 12, 41, 8, 22, 51, 8, 0, 8, 15, 15, 18, 6, 0, 130, 97, 103, 117, 101, 0, 20, 17, 24, 0, 131, 105, + 113, 117, 101, 0, 68, 58, 8, 21, 66, 8, 0, 6, 44, 0, 130, 117, 115, 101, 0, 8, 19, 0, 132, 117, 114, 115, 117, 101, + 0, 76, 83, 8, 18, 120, 8, 0, 72, 93, 8, 11, 103, 8, 15, 112, 8, 0, 15, 8, 5, 0, 131, 105, 101, 118, 101, 0, 6, 4, + 44, 0, 129, 101, 118, 101, 0, 8, 5, 0, 129, 101, 118, 101, 0, 82, 127, 8, 25, 134, 8, 0, 21, 19, 0, 130, 118, 101, + 0, 5, 4, 0, 131, 111, 118, 101, 0, 76, 149, 8, 17, 183, 8, 0, 8, 0, 75, 161, 8, 15, 168, 8, 21, 176, 8, 0, 6, 0, + 130, 105, 101, 102, 0, 8, 5, 0, 130, 105, 101, 102, 0, 5, 0, 130, 105, 101, 102, 0, 24, 18, 9, 44, 0, 128, 100, 0, + 76, 198, 8, 17, 208, 8, 0, 17, 18, 10, 44, 0, 130, 105, 110, 103, 0, 72, 218, 8, 12, 227, 8, 21, 57, 9, 0, 12, 5, 0, + 131, 101, 105, 110, 103, 0, 72, 246, 8, 11, 0, 9, 15, 13, 9, 21, 25, 9, 23, 36, 9, 28, 46, 9, 0, 11, 6, 4, 6, 0, + 131, 105, 110, 103, 0, 23, 6, 4, 16, 0, 133, 116, 99, 104, 105, 110, 103, 0, 8, 12, 6, 0, 133, 101, 105, 108, 105, + 110, 103, 0, 24, 6, 8, 21, 0, 130, 114, 105, 110, 103, 0, 11, 44, 0, 132, 116, 104, 105, 110, 103, 0, 23, 28, 17, 4, + 0, 131, 104, 105, 110, 103, 0, 12, 23, 22, 0, 131, 114, 105, 110, 103, 0, 70, 83, 9, 8, 115, 9, 10, 127, 9, 22, 137, + 9, 23, 155, 9, 0, 76, 90, 9, 21, 100, 9, 0, 23, 26, 22, 0, 131, 105, 116, 99, 104, 0, 4, 8, 22, 4, 8, 21, 0, 134, + 115, 101, 97, 114, 99, 104, 0, 23, 7, 17, 4, 44, 0, 130, 32, 116, 104, 101, 0, 17, 8, 21, 23, 22, 0, 128, 116, 104, + 0, 12, 15, 19, 16, 18, 6, 4, 0, 134, 99, 111, 109, 112, 108, 105, 115, 104, 0, 74, 165, 9, 12, 189, 9, 21, 200, 9, + 0, 72, 172, 9, 12, 182, 9, 0, 21, 23, 22, 0, 130, 110, 103, 116, 104, 0, 8, 11, 0, 129, 104, 116, 0, 26, 7, 17, 4, + 5, 0, 129, 100, 116, 104, 0, 24, 23, 44, 0, 131, 114, 117, 116, 104, 0, 21, 8, 11, 23, 44, 0, 129, 105, 114, 0, 17, + 12, 23, 11, 0, 132, 116, 104, 105, 110, 107, 0, 68, 254, 9, 7, 82, 10, 8, 118, 10, 9, 203, 10, 15, 212, 10, 23, 241, + 10, 24, 250, 10, 0, 76, 8, 10, 23, 19, 10, 24, 44, 10, 0, 6, 19, 28, 23, 0, 131, 105, 99, 97, 108, 0, 76, 26, 10, + 24, 34, 10, 0, 17, 12, 0, 129, 105, 97, 108, 0, 21, 12, 25, 0, 131, 116, 117, 97, 108, 0, 81, 54, 10, 21, 63, 10, + 23, 72, 10, 0, 4, 44, 0, 130, 110, 117, 97, 108, 0, 24, 23, 4, 17, 0, 130, 97, 108, 0, 12, 25, 0, 131, 114, 116, + 117, 97, 108, 0, 72, 89, 10, 24, 96, 10, 0, 12, 9, 0, 129, 108, 100, 0, 82, 103, 10, 26, 109, 10, 0, 6, 0, 129, 108, + 100, 0, 18, 0, 132, 119, 111, 117, 108, 100, 0, 74, 131, 10, 15, 139, 10, 23, 185, 10, 24, 193, 10, 0, 17, 12, 22, + 0, 129, 108, 101, 0, 68, 146, 10, 15, 172, 10, 0, 21, 0, 68, 155, 10, 21, 162, 10, 0, 19, 0, 129, 108, 101, 108, 0, + 4, 19, 0, 132, 97, 108, 108, 101, 108, 0, 4, 21, 21, 4, 19, 0, 133, 97, 108, 108, 101, 108, 0, 23, 12, 15, 0, 129, + 108, 101, 0, 7, 8, 11, 6, 22, 0, 129, 108, 101, 0, 8, 22, 28, 16, 0, 129, 108, 102, 0, 12, 9, 0, 79, 222, 10, 24, + 232, 10, 0, 15, 24, 9, 0, 132, 102, 105, 108, 108, 0, 9, 0, 131, 108, 102, 105, 108, 108, 0, 24, 22, 8, 21, 0, 129, + 108, 116, 0, 9, 23, 4, 8, 21, 10, 0, 133, 97, 116, 101, 102, 117, 108, 0, 68, 19, 11, 15, 36, 11, 21, 47, 11, 0, 21, + 10, 18, 23, 6, 8, 19, 22, 0, 132, 114, 111, 103, 114, 97, 109, 0, 8, 5, 18, 21, 19, 0, 130, 108, 101, 109, 0, 18, 9, + 18, 6, 0, 131, 110, 102, 111, 114, 109, 0, 68, 93, 11, 7, 133, 11, 8, 142, 11, 10, 12, 12, 12, 95, 12, 18, 121, 12, + 19, 21, 13, 21, 33, 13, 22, 44, 13, 24, 54, 13, 26, 77, 13, 0, 12, 0, 74, 102, 11, 23, 110, 11, 0, 4, 44, 0, 130, + 97, 105, 110, 0, 81, 117, 11, 21, 125, 11, 0, 18, 6, 0, 130, 97, 105, 110, 0, 8, 6, 0, 130, 97, 105, 110, 0, 24, 18, + 9, 44, 0, 129, 110, 100, 0, 71, 164, 11, 8, 174, 11, 10, 216, 11, 19, 228, 11, 21, 237, 11, 22, 250, 11, 26, 4, 12, + 0, 15, 12, 11, 6, 0, 129, 114, 101, 110, 0, 87, 181, 11, 26, 206, 11, 0, 72, 188, 11, 26, 196, 11, 0, 5, 0, 130, + 119, 101, 101, 110, 0, 8, 5, 0, 132, 116, 119, 101, 101, 110, 0, 8, 5, 0, 131, 116, 119, 101, 101, 110, 0, 18, 7, + 28, 11, 0, 131, 114, 111, 103, 101, 110, 0, 4, 11, 44, 0, 129, 112, 101, 110, 0, 7, 15, 11, 6, 0, 132, 105, 108, + 100, 114, 101, 110, 0, 18, 18, 11, 6, 0, 131, 115, 101, 110, 0, 23, 8, 5, 0, 128, 101, 110, 0, 72, 19, 12, 12, 30, + 12, 0, 12, 21, 18, 9, 0, 131, 101, 105, 103, 110, 0, 75, 49, 12, 15, 55, 12, 17, 63, 12, 18, 72, 12, 21, 79, 12, 22, + 86, 12, 0, 23, 0, 129, 110, 103, 0, 15, 4, 0, 131, 105, 103, 110, 0, 21, 4, 8, 15, 0, 129, 110, 103, 0, 10, 44, 0, + 129, 110, 103, 0, 23, 22, 0, 129, 110, 103, 0, 4, 44, 0, 130, 115, 105, 103, 110, 0, 74, 102, 12, 23, 110, 12, 0, 4, + 44, 0, 129, 97, 105, 110, 0, 4, 21, 8, 6, 0, 131, 116, 97, 105, 110, 0, 76, 131, 12, 22, 255, 12, 23, 9, 13, 0, 70, + 141, 12, 22, 154, 12, 23, 180, 12, 0, 12, 22, 8, 7, 0, 133, 99, 105, 115, 105, 111, 110, 0, 68, 161, 12, 22, 170, + 12, 0, 12, 15, 0, 131, 105, 115, 111, 110, 0, 4, 6, 6, 18, 0, 131, 105, 111, 110, 0, 71, 196, 12, 12, 206, 12, 15, + 221, 12, 17, 233, 12, 22, 245, 12, 0, 7, 4, 0, 131, 105, 116, 105, 111, 110, 0, 23, 12, 19, 8, 21, 0, 134, 101, 116, + 105, 116, 105, 111, 110, 0, 4, 8, 21, 0, 133, 108, 97, 116, 105, 111, 110, 0, 6, 24, 9, 0, 133, 110, 99, 116, 105, + 111, 110, 0, 18, 19, 0, 131, 105, 116, 105, 111, 110, 0, 12, 25, 12, 7, 0, 129, 105, 111, 110, 0, 12, 6, 4, 21, 9, + 0, 131, 116, 105, 111, 110, 0, 19, 11, 4, 0, 132, 104, 97, 112, 112, 101, 110, 0, 23, 24, 8, 21, 0, 131, 116, 117, + 114, 110, 0, 10, 12, 11, 23, 0, 130, 110, 103, 115, 0, 85, 61, 13, 23, 70, 13, 0, 23, 8, 21, 0, 130, 117, 114, 110, + 0, 8, 21, 0, 128, 114, 110, 0, 18, 14, 17, 24, 0, 130, 110, 111, 119, 110, 0, 71, 98, 13, 17, 109, 13, 26, 118, 13, + 0, 8, 24, 22, 19, 0, 131, 101, 117, 100, 111, 0, 26, 14, 44, 0, 130, 110, 111, 119, 0, 79, 125, 13, 17, 133, 13, 0, + 15, 18, 9, 0, 129, 111, 119, 0, 14, 44, 0, 129, 111, 119, 0, 86, 147, 13, 24, 157, 13, 0, 4, 11, 21, 8, 19, 0, 129, + 112, 115, 0, 18, 18, 15, 0, 129, 107, 117, 112, 0, 68, 197, 13, 8, 6, 14, 11, 19, 15, 15, 28, 15, 18, 42, 15, 19, + 59, 15, 22, 70, 15, 23, 79, 15, 24, 91, 15, 28, 100, 15, 0, 76, 207, 13, 15, 217, 13, 24, 251, 13, 0, 15, 12, 16, + 12, 22, 0, 130, 97, 114, 0, 76, 224, 13, 24, 235, 13, 0, 16, 16, 12, 22, 0, 132, 105, 108, 97, 114, 0, 6, 12, 23, 4, + 19, 0, 134, 114, 116, 105, 99, 117, 108, 97, 114, 0, 15, 10, 8, 21, 0, 131, 117, 108, 97, 114, 0, 68, 37, 14, 7, 45, + 14, 11, 58, 14, 12, 119, 14, 15, 145, 14, 16, 155, 14, 17, 165, 14, 18, 209, 14, 23, 217, 14, 25, 248, 14, 0, 15, 6, + 0, 130, 101, 97, 114, 0, 17, 4, 15, 4, 6, 0, 132, 101, 110, 100, 97, 114, 0, 74, 65, 14, 23, 76, 14, 0, 12, 8, 11, + 0, 133, 105, 103, 104, 101, 114, 0, 72, 86, 14, 18, 98, 14, 24, 110, 14, 0, 11, 10, 18, 23, 0, 133, 101, 116, 104, + 101, 114, 0, 4, 17, 0, 134, 97, 110, 111, 116, 104, 101, 114, 0, 9, 0, 131, 114, 116, 104, 101, 114, 0, 75, 126, 14, + 15, 134, 14, 0, 23, 44, 0, 130, 101, 105, 114, 0, 19, 16, 18, 6, 0, 131, 105, 108, 101, 114, 0, 23, 12, 9, 0, 131, + 108, 116, 101, 114, 0, 16, 4, 21, 10, 44, 0, 129, 97, 114, 0, 76, 172, 14, 23, 184, 14, 0, 10, 10, 8, 5, 0, 132, + 105, 110, 110, 101, 114, 0, 76, 191, 14, 22, 200, 14, 0, 18, 19, 0, 131, 110, 116, 101, 114, 0, 12, 15, 0, 130, 101, + 110, 101, 114, 0, 9, 8, 5, 0, 129, 114, 101, 0, 75, 224, 14, 24, 234, 14, 0, 18, 17, 4, 0, 131, 116, 104, 101, 114, + 0, 19, 18, 16, 6, 0, 134, 111, 109, 112, 117, 116, 101, 114, 0, 72, 255, 14, 26, 10, 15, 0, 8, 21, 8, 11, 26, 0, + 131, 118, 101, 114, 0, 18, 11, 0, 130, 101, 118, 101, 114, 0, 8, 23, 18, 0, 130, 104, 101, 114, 0, 4, 24, 6, 12, 23, + 21, 4, 19, 0, 130, 108, 97, 114, 0, 23, 4, 21, 8, 23, 17, 12, 0, 135, 116, 101, 114, 97, 116, 111, 114, 0, 23, 15, + 15, 24, 17, 0, 130, 112, 116, 114, 0, 4, 8, 28, 44, 0, 129, 114, 115, 0, 18, 4, 21, 8, 19, 18, 0, 130, 116, 111, + 114, 0, 6, 18, 44, 0, 129, 99, 117, 114, 0, 8, 25, 8, 44, 0, 129, 114, 121, 0, 68, 131, 15, 8, 183, 15, 10, 71, 16, + 21, 82, 16, 22, 93, 16, 23, 245, 16, 24, 253, 16, 0, 75, 144, 15, 19, 155, 15, 21, 165, 15, 28, 174, 15, 0, 19, 21, + 8, 19, 0, 131, 104, 97, 112, 115, 0, 11, 21, 8, 19, 0, 130, 97, 112, 115, 0, 8, 28, 44, 0, 130, 97, 114, 115, 0, 26, + 15, 4, 0, 130, 97, 121, 115, 0, 68, 199, 15, 6, 222, 15, 12, 233, 15, 15, 53, 16, 22, 60, 16, 0, 71, 206, 15, 14, + 214, 15, 0, 12, 44, 0, 130, 101, 97, 115, 0, 23, 0, 131, 97, 107, 101, 115, 0, 8, 7, 17, 12, 0, 131, 105, 99, 101, + 115, 0, 70, 243, 15, 21, 26, 16, 23, 41, 16, 0, 72, 250, 15, 12, 4, 16, 0, 7, 17, 12, 0, 132, 105, 99, 101, 115, 0, + 71, 11, 16, 23, 18, 16, 0, 17, 12, 0, 130, 101, 115, 0, 21, 8, 25, 0, 130, 101, 115, 0, 18, 22, 8, 6, 6, 4, 0, 132, + 115, 111, 114, 105, 101, 115, 0, 15, 12, 5, 4, 0, 131, 105, 116, 105, 101, 115, 0, 4, 9, 0, 129, 115, 101, 0, 18, + 11, 6, 44, 0, 130, 111, 115, 101, 115, 0, 12, 17, 11, 23, 0, 131, 105, 110, 103, 115, 0, 8, 4, 28, 44, 0, 131, 101, + 97, 114, 115, 0, 68, 103, 16, 8, 115, 16, 18, 234, 16, 0, 21, 4, 5, 16, 8, 0, 130, 114, 97, 115, 115, 0, 70, 128, + 16, 17, 152, 16, 21, 181, 16, 22, 210, 16, 0, 70, 135, 16, 24, 144, 16, 0, 18, 21, 19, 0, 131, 101, 115, 115, 0, 22, + 0, 130, 99, 101, 115, 115, 0, 76, 159, 16, 22, 171, 16, 0, 22, 22, 24, 5, 0, 133, 105, 110, 101, 115, 115, 0, 24, 5, + 0, 131, 105, 110, 101, 115, 115, 0, 19, 0, 85, 190, 16, 24, 201, 16, 0, 24, 22, 0, 133, 112, 112, 114, 101, 115, + 115, 0, 22, 0, 131, 112, 114, 101, 115, 115, 0, 70, 217, 16, 18, 226, 16, 0, 6, 24, 22, 0, 131, 101, 115, 115, 0, + 19, 0, 130, 115, 101, 115, 115, 0, 21, 6, 6, 4, 0, 132, 114, 111, 115, 115, 0, 21, 12, 9, 0, 129, 115, 116, 0, 82, + 4, 17, 22, 18, 17, 0, 15, 18, 16, 18, 17, 4, 0, 132, 97, 108, 111, 117, 115, 0, 17, 8, 6, 17, 18, 6, 0, 133, 115, + 101, 110, 115, 117, 115, 0, 68, 70, 17, 8, 100, 17, 10, 129, 17, 11, 139, 17, 12, 175, 17, 15, 186, 17, 16, 197, 17, + 17, 209, 17, 18, 31, 19, 19, 89, 19, 22, 117, 19, 24, 21, 20, 0, 85, 77, 17, 26, 88, 17, 0, 8, 19, 8, 22, 0, 131, + 97, 114, 97, 116, 0, 11, 8, 16, 18, 22, 0, 131, 119, 104, 97, 116, 0, 68, 107, 17, 17, 116, 17, 0, 21, 10, 44, 0, + 130, 101, 97, 116, 0, 16, 17, 21, 8, 25, 18, 10, 0, 130, 101, 110, 116, 0, 11, 24, 4, 6, 0, 130, 103, 104, 116, 0, + 71, 149, 17, 10, 156, 17, 12, 164, 17, 0, 12, 26, 0, 129, 116, 104, 0, 17, 8, 15, 0, 129, 116, 104, 0, 10, 17, 18, + 23, 0, 131, 105, 103, 104, 116, 0, 23, 24, 18, 5, 4, 0, 129, 32, 105, 116, 0, 22, 24, 8, 21, 0, 131, 115, 117, 108, + 116, 0, 4, 23, 21, 18, 19, 16, 12, 0, 129, 110, 116, 0, 68, 222, 17, 8, 22, 18, 21, 12, 19, 22, 23, 19, 0, 76, 235, + 17, 17, 246, 17, 21, 1, 18, 23, 11, 18, 0, 19, 12, 6, 8, 21, 0, 130, 101, 110, 116, 0, 12, 16, 18, 21, 19, 0, 130, + 101, 110, 116, 0, 4, 19, 19, 4, 0, 130, 101, 110, 116, 0, 8, 19, 16, 18, 6, 0, 130, 101, 110, 116, 0, 76, 35, 18, + 16, 68, 18, 21, 168, 18, 25, 2, 19, 0, 70, 42, 18, 19, 55, 18, 0, 8, 9, 9, 8, 0, 133, 105, 99, 105, 101, 110, 116, + 0, 8, 6, 8, 21, 0, 133, 105, 112, 105, 101, 110, 116, 0, 72, 81, 18, 17, 93, 18, 21, 126, 18, 23, 157, 18, 0, 25, + 18, 10, 0, 131, 114, 110, 109, 101, 110, 116, 0, 72, 100, 18, 21, 112, 18, 0, 25, 18, 10, 0, 132, 114, 110, 109, + 101, 110, 116, 0, 18, 25, 18, 10, 0, 134, 101, 114, 110, 109, 101, 110, 116, 0, 72, 133, 18, 18, 144, 18, 0, 25, 18, + 10, 0, 131, 110, 109, 101, 110, 116, 0, 25, 18, 10, 0, 133, 101, 114, 110, 109, 101, 110, 116, 0, 4, 23, 22, 0, 131, + 101, 109, 101, 110, 116, 0, 68, 181, 18, 8, 192, 18, 9, 204, 18, 21, 215, 18, 0, 19, 4, 0, 132, 112, 97, 114, 101, + 110, 116, 0, 9, 12, 7, 0, 132, 102, 101, 114, 101, 110, 116, 0, 9, 12, 7, 0, 131, 101, 114, 101, 110, 116, 0, 68, + 222, 18, 8, 246, 18, 0, 19, 0, 68, 231, 18, 19, 239, 18, 0, 133, 112, 97, 114, 101, 110, 116, 0, 4, 0, 131, 101, + 110, 116, 0, 9, 12, 7, 0, 133, 102, 101, 114, 101, 110, 116, 0, 8, 15, 8, 21, 0, 130, 97, 110, 116, 0, 8, 9, 9, 12, + 7, 0, 129, 101, 110, 116, 0, 18, 6, 0, 130, 110, 115, 116, 0, 69, 47, 19, 16, 54, 19, 17, 61, 19, 21, 71, 19, 22, + 80, 19, 0, 4, 44, 0, 128, 117, 116, 0, 15, 4, 0, 128, 115, 116, 0, 7, 12, 7, 0, 130, 32, 110, 111, 116, 0, 19, 8, + 21, 0, 130, 111, 114, 116, 0, 16, 15, 4, 0, 130, 111, 115, 116, 0, 72, 96, 19, 28, 107, 19, 0, 12, 6, 8, 21, 0, 131, + 101, 105, 112, 116, 0, 6, 17, 8, 0, 130, 114, 121, 112, 116, 0, 72, 139, 19, 10, 180, 19, 12, 189, 19, 16, 218, 19, + 17, 228, 19, 18, 255, 19, 24, 10, 20, 0, 74, 146, 19, 21, 169, 19, 0, 76, 153, 19, 24, 161, 19, 0, 11, 0, 130, 104, + 101, 115, 116, 0, 22, 0, 130, 103, 101, 115, 116, 0, 23, 17, 12, 0, 131, 101, 114, 101, 115, 116, 0, 21, 4, 15, 0, + 129, 101, 115, 116, 0, 73, 196, 19, 17, 208, 19, 0, 8, 17, 4, 16, 0, 132, 105, 102, 101, 115, 116, 0, 4, 10, 4, 0, + 131, 105, 110, 115, 116, 0, 18, 15, 4, 0, 131, 109, 111, 115, 116, 0, 68, 235, 19, 17, 246, 19, 0, 12, 10, 4, 0, + 132, 97, 105, 110, 115, 116, 0, 12, 4, 10, 4, 0, 130, 115, 116, 0, 15, 16, 4, 0, 132, 108, 109, 111, 115, 116, 0, + 13, 4, 44, 0, 131, 100, 106, 117, 115, 116, 0, 70, 31, 20, 19, 56, 20, 23, 79, 20, 0, 72, 38, 20, 21, 49, 20, 0, 6, + 27, 8, 0, 132, 101, 99, 117, 116, 101, 0, 12, 6, 0, 128, 105, 116, 0, 87, 63, 20, 24, 71, 20, 0, 17, 12, 0, 131, + 112, 117, 116, 0, 18, 0, 130, 116, 112, 117, 116, 0, 19, 24, 18, 0, 131, 116, 112, 117, 116, 0, 72, 96, 20, 12, 132, + 20, 0, 68, 103, 20, 12, 110, 20, 0, 11, 44, 0, 129, 118, 101, 0, 70, 117, 20, 8, 125, 20, 0, 8, 21, 0, 130, 101, + 105, 118, 0, 6, 8, 21, 0, 129, 118, 0, 8, 11, 6, 4, 44, 0, 130, 105, 101, 118, 101, 0, 76, 154, 20, 17, 164, 20, 18, + 173, 20, 0, 8, 25, 8, 21, 0, 130, 105, 101, 119, 0, 18, 14, 44, 0, 130, 110, 111, 119, 0, 15, 18, 9, 0, 129, 108, + 111, 119, 0, 68, 210, 20, 6, 221, 20, 8, 24, 21, 11, 34, 21, 15, 52, 21, 17, 249, 21, 21, 3, 22, 22, 168, 22, 23, + 195, 22, 0, 17, 19, 16, 18, 6, 0, 130, 97, 110, 121, 0, 68, 234, 20, 8, 246, 20, 12, 1, 21, 19, 12, 21, 0, 21, 6, + 18, 19, 28, 11, 0, 130, 105, 115, 121, 0, 24, 20, 8, 21, 9, 0, 129, 110, 99, 121, 0, 21, 6, 18, 19, 28, 11, 0, 129, + 115, 121, 0, 24, 21, 14, 17, 4, 5, 0, 129, 116, 99, 121, 0, 23, 9, 4, 22, 0, 130, 101, 116, 121, 0, 6, 21, 4, 21, + 12, 8, 11, 0, 135, 105, 101, 114, 97, 114, 99, 104, 121, 0, 68, 71, 21, 11, 138, 21, 14, 148, 21, 15, 156, 21, 18, + 228, 21, 21, 238, 21, 0, 69, 90, 21, 8, 99, 21, 15, 105, 21, 17, 114, 21, 21, 121, 21, 24, 130, 21, 0, 18, 21, 19, + 0, 129, 98, 108, 121, 0, 21, 0, 128, 108, 121, 0, 8, 21, 0, 131, 97, 108, 108, 121, 0, 12, 9, 0, 128, 108, 121, 0, + 8, 17, 8, 10, 0, 128, 108, 121, 0, 23, 6, 4, 0, 128, 108, 121, 0, 10, 12, 15, 22, 0, 129, 116, 108, 121, 0, 12, 15, + 0, 129, 101, 108, 121, 0, 68, 166, 21, 5, 209, 21, 8, 218, 21, 0, 86, 173, 21, 23, 197, 21, 0, 24, 0, 108, 182, 21, + 22, 189, 21, 0, 131, 117, 97, 108, 108, 121, 0, 24, 0, 132, 97, 108, 108, 121, 0, 24, 6, 4, 0, 133, 116, 117, 97, + 108, 108, 121, 0, 4, 5, 18, 21, 19, 0, 129, 121, 0, 4, 21, 0, 132, 101, 97, 108, 108, 121, 0, 16, 18, 17, 4, 0, 130, + 97, 108, 121, 0, 4, 16, 12, 21, 19, 0, 129, 105, 108, 121, 0, 8, 18, 16, 44, 0, 130, 110, 101, 121, 0, 68, 19, 22, + 8, 123, 22, 18, 132, 22, 23, 145, 22, 25, 160, 22, 0, 69, 35, 22, 12, 44, 22, 15, 57, 22, 16, 85, 22, 22, 94, 22, 0, + 12, 15, 0, 130, 114, 97, 114, 121, 0, 15, 15, 12, 27, 24, 4, 0, 132, 105, 97, 114, 121, 0, 76, 64, 22, 15, 74, 22, + 0, 27, 24, 4, 0, 130, 105, 97, 114, 121, 0, 12, 27, 24, 4, 0, 131, 105, 97, 114, 121, 0, 24, 22, 0, 130, 109, 97, + 114, 121, 0, 8, 6, 0, 70, 104, 22, 8, 115, 22, 0, 8, 17, 0, 133, 101, 115, 115, 97, 114, 121, 0, 17, 0, 130, 115, + 97, 114, 121, 0, 19, 18, 21, 19, 0, 128, 116, 121, 0, 10, 4, 23, 4, 6, 0, 132, 101, 103, 111, 114, 121, 0, 17, 24, + 6, 18, 44, 0, 134, 99, 111, 117, 110, 116, 114, 121, 0, 8, 44, 0, 129, 101, 114, 121, 0, 4, 0, 85, 177, 22, 26, 188, + 22, 0, 6, 18, 19, 28, 11, 0, 130, 105, 115, 121, 0, 15, 4, 0, 129, 121, 115, 0, 73, 205, 22, 15, 213, 22, 21, 222, + 22, 0, 4, 22, 0, 129, 101, 116, 121, 0, 12, 5, 4, 0, 129, 105, 116, 121, 0, 19, 8, 18, 21, 19, 0, 132, 112, 101, + 114, 116, 121, 0 +}; diff --git a/waffle/color.c b/waffle/color.c new file mode 100644 index 0000000..5ca950e --- /dev/null +++ b/waffle/color.c @@ -0,0 +1,132 @@ +// Copyright 2022 jack (@waffle87) +// SPDX-License-Identifier: GPL-2.0-or-later +#include "color.h" +#include <lib/lib8tion/lib8tion.h> +#define FORCE_REFERENCE(var) __asm__ volatile("" : : "r"(var)) +#define FASTLED_SCALE8_FIXED 1 + +RGB rgb_matrix_hsv_to_rgb(const HSV hsv) { + const uint8_t Y1 = 1, Y2 = 0, G_2 = 1, Gscale = 0, hue = hsv.h, sat = hsv.s; + uint8_t val = hsv.v, offset = hue & 0x1F, offset8 = offset; + { +#ifdef __AVR__ + offset8 <<= 1; + __asm__ volatile(""); + offset8 <<= 1; + __asm__ volatile(""); + offset8 <<= 1; +#else + offset8 <<= 3; +#endif + } + uint8_t third = scale8(offset8, (256 / 3)), r, g, b; + if (!(hue & 0x80)) { + if (!(hue & 0x40)) { + if (!(hue & 0x20)) { + r = 255 - third; + g = third; + b = 0; + FORCE_REFERENCE(b); + } else { + if (Y1) { + r = 171; + g = 85 + third; + b = 0; + FORCE_REFERENCE(b); + } + if (Y2) { + r = 170 + third; + uint8_t twothirds = scale8(offset8, ((256 * 2) / 3)); + g = 85 + twothirds; + b = 0; + FORCE_REFERENCE(b); + } + } + } else { + if (!(hue & 0x20)) { + if (Y1) { + uint8_t twothirds = scale8(offset8, ((256 * 2) / 3)); + r = 171 - twothirds; + g = 170 + third; + b = 0; + FORCE_REFERENCE(b); + } + if (Y2) { + r = 255 - offset8; + g = 255; + b = 0; + FORCE_REFERENCE(b); + } + } else { + r = 0; + FORCE_REFERENCE(r); + g = 255 - third; + b = third; + } + } + } else { + if (!(hue & 0x40)) { + if (!(hue & 0x20)) { + r = 0; + FORCE_REFERENCE(r); + uint8_t twothirds = scale8(offset8, ((256 * 2) / 3)); + g = 171 - twothirds; + b = 85 + twothirds; + } else { + r = third; + g = 0; + FORCE_REFERENCE(g); + b = 255 - third; + } + } else { + if (!(hue & 0x20)) { + r = 85 + third; + g = 0; + FORCE_REFERENCE(g); + b = 171 - third; + } else { + r = 170 + third; + g = 0; + FORCE_REFERENCE(g); + b = 85 - third; + } + } + } + if (G_2) + g = g >> 1; + if (Gscale) + g = scale8_video_LEAVING_R1_DIRTY(g, Gscale); + if (sat != 255) { + if (sat == 0) { + r = 255; + b = 255; + g = 255; + } else { + uint8_t desat = 255 - sat; + desat = scale8_video(desat, desat); + uint8_t satscale = 255 - desat; + r = scale8_LEAVING_R1_DIRTY(r, satscale); + g = scale8_LEAVING_R1_DIRTY(g, satscale); + b = scale8_LEAVING_R1_DIRTY(b, satscale); + cleanup_R1(); + uint8_t brightness_floor = desat; + r += brightness_floor; + g += brightness_floor; + b += brightness_floor; + } + } + if (val != 255) { + val = scale8_video_LEAVING_R1_DIRTY(val, val); + if (val == 0) { + r = 0; + g = 0; + b = 0; + } else { + r = scale8_LEAVING_R1_DIRTY(r, val); + g = scale8_LEAVING_R1_DIRTY(g, val); + b = scale8_LEAVING_R1_DIRTY(b, val); + cleanup_R1(); + } + } + return (RGB){.r = r, .g = g, .b = b}; +} diff --git a/waffle/combos.def b/waffle/combos.def new file mode 100644 index 0000000..3646ec1 --- /dev/null +++ b/waffle/combos.def @@ -0,0 +1,17 @@ +// Copyright 2022 jack (@waffle87) +// SPDX-License-Identifier: GPL-2.0-or-later + +// name output keys +CMB(ru_ent, KC_ENT, KC_R, KC_U) +CMB(dk_eql, KC_EQL, LCTL_T(KC_D), RCTL_T(KC_K)) +CMB(gh_quot, TD(QUOT_DQUO), KC_G, KC_H) +CMB(vm_ques, KC_QUES, KC_V, KC_M) +CMB(ty_coln, KC_COLN, KC_T, KC_Y) +CMB(bn_unds, KC_UNDS, KC_B, KC_N) +CMB(er_cbkt, TD(CBRKT), KC_E, KC_R) +CMB(ui_brkt, TD(BRKT), KC_U, KC_I) +CMB(sl_plus, KC_PLUS, LGUI_T(KC_S), RGUI_T(KC_L)) +CMB(ei_bsls, TD(BSLS_PIPE), KC_E, KC_I) +CMB(wo_mins, TD(EM_DASH), KC_W, KC_O) +CMB(df_btn1, KC_BTN1, KC_D, KC_F) +CMB(fg_btn2, KC_BTN2, KC_F, KC_G) diff --git a/waffle/combos.h b/waffle/combos.h new file mode 100644 index 0000000..f823d4c --- /dev/null +++ b/waffle/combos.h @@ -0,0 +1,21 @@ +// Copyright 2022 jack (@waffle87) +// SPDX-License-Identifier: GPL-2.0-or-later +#pragma once + +#define CMB(name, action, ...) C_##name, +enum combos { +#include "combos.def" + COMBO_LENGTH +}; +#undef CMB +uint16_t COMBO_LEN = COMBO_LENGTH; + +#define CMB(name, action, ...) const uint16_t PROGMEM name##_combo[] = {__VA_ARGS__, COMBO_END}; +#include "combos.def" +#undef CMB + +combo_t key_combos[COMBO_LENGTH] = { +#define CMB(name, action, ...) COMBO(name##_combo, action), +#include "combos.def" +#undef CMB +}; diff --git a/waffle/config.h b/waffle/config.h new file mode 100644 index 0000000..8957333 --- /dev/null +++ b/waffle/config.h @@ -0,0 +1,40 @@ +// Copyright 2022 jack (@waffle87) +// SPDX-License-Identifier: GPL-2.0-or-later +#pragma once + +#define IGNORE_MOD_TAP_INTERRUPT +#define TAPPING_TERM_PER_KEY +#define PERSMISSVE_HOLD +#define TAPPING_TERM 140 +#define LAYER_STATE_8BIT +#define FORCE_NKRO +#define BOTH_SHIFTS_TURNS_ON_CAPS_WORD +#define COMBO_TERM 40 +#define NO_ACTION_ONESHOT +#define UNICODE_SELECTED_MODES UC_LNX +#define ENABLE_COMPILE_KEYCODE +#define IGNORE_ATOMIC_BLOCK +#ifdef RAW_ENABLE +#undef VENDOR_ID +#define VENDOR_ID 0x6A73 +#undef PRODUCT_ID +#define PRODUCT_ID 0x6B62 +#endif +#undef MANUFACTURER +#define MANUFACTURER "Waffles" + +#ifdef OLED_ENABLE +# define OLED_FONT_H "users/waffle/oledfont.h" +# define OLED_UPDATE_INTERVAL 50 +# define OLED_DISABLE_TIMEOUT +#endif + +#ifdef SPLIT_KEYBOARD +# define MASTER_RIGHT +# define SPLIT_MODS_ENABLE +# define SPLIT_WPM_ENABLE +# define SPLIT_LAYER_STATE_ENABLE +# define SPLIT_OLED_ENABLE +# define SPLIT_LED_STATE_ENABLE +# define SPLIT_TRANSACTION_IDS_USER RPC_ID_USER_KEYLOG_STR +#endif diff --git a/waffle/dict.txt b/waffle/dict.txt new file mode 100644 index 0000000..80e4845 --- /dev/null +++ b/waffle/dict.txt @@ -0,0 +1,398 @@ +# Copyright 2022 jack (@waffle87) +# SPDX-License-Identifier: GPL-2.0-or-later + +:theri -> their +:thier -> their +:abot -> about +owudl -> would +:woul: -> would +poeple -> people +poeople -> people +:whic: -> which +coudl -> could +htink -> think +otehr -> other +:othe: -> other +becase -> because +:bease -> because +beacuse -> because +theese -> these +:goign -> going +:gonig -> going +:goin: -> going +:yaers -> years +:yeasr -> years +:yeras -> years +shoud -> should +raelly -> really +realy -> really +relaly -> really +bedore -> before +beore -> before +befoer -> before +littel -> little +litle -> little +bieng -> being +:hwile -> while +:aound -> around +aroud -> around +arund -> around +:hting -> thing +thign -> thing +thigsn -> things +thnigs -> things +anohter -> another +naother -> another +betwen -> between +beteen -> between +beween -> between +bewteen -> between +:eveyr -> every +:evry -> every +:graet -> great +:grat: -> great +:agian -> again +:agin -> again +alwasy -> always +alwyas -> always +:acheiv -> achieve +:achive -> achieve +amlost -> almost +almot -> almost +almsot -> almost +alomst -> almost +chnage -> change +chekc -> check +childen -> children +chldren -> children +claer -> clear +compnay -> company +contian -> contain +elasped -> elapsed +eslaped -> elapsed +feild -> field +fiedl -> field +fitler -> filter +firts -> first +follwo -> follow +folow -> follow +:foudn -> found +:founf -> found +frequecy -> frequency +firend -> friend +freind -> friend +heigth -> height +iamge -> image +inital -> initial +intput -> input +laguage -> language +lenght -> length +levle -> level +libary -> library +:moeny -> money +mysefl -> myself +ouptut -> output +ouput -> output +probaly -> probably +probelm -> problem +recrod -> record +reponse -> response +reprot -> report +singel -> single +stregth -> strength +strengh -> strength +tkaes -> takes +therfore -> therefore +todya -> today +toghether -> together +unkown -> unknown +unqiue -> unique +widht -> width +accross -> across +adviced -> advised +aledge -> allege +alledge -> allege +amature -> amateur +anomolous -> anomalous +anomoly -> anomaly +aparent -> apparent +aparrent -> apparent +apparant -> apparent +apparrent -> apparent +asthetic -> aesthetic +auxilary -> auxiliary +auxillary -> auxiliary +auxilliary -> auxiliary +bankrupcy -> bankruptcy +busness -> business +bussiness -> business +calander -> calendar +commitee -> committee +comittee -> committee +competance -> competence +competant -> competent +concensus -> consensus +copywrite: -> copyright +choosen -> chosen +collegue -> colleague +excercise -> exercise +:grammer -> grammar +:guage -> gauge +govement -> government +govenment -> government +goverment -> government +governmnet -> government +govorment -> government +govornment -> government +guaratee -> guarantee +garantee -> guarantee +gaurantee -> guarantee +heirarchy -> hierarchy +hygeine -> hygiene +hypocracy -> hypocrisy +hypocrasy -> hypocrisy +hypocricy -> hypocrisy +hypocrit: -> hypocrite +looses: -> loses +maintence -> maintenance +morgage -> mortgage +neccesary -> necessary +necesary -> necessary +pallete -> palette +paralel -> parallel +parralel -> parallel +parrallel -> parallel +priviledge -> privilege +probablly -> probably +prominant -> prominent +propogate -> propagate +proove -> prove +psuedo -> pseudo +reciept -> receipt +receiev -> receiv +reciev -> receiv +recepient -> recipient +recipiant -> recipient +relevent -> relevant +repitition -> repetition +safty -> safety +saftey -> safety +seperat -> separat +spectogram -> spectrogram +symetric -> symmetric +tolerence -> tolerance +cacheing -> caching +complier -> compiler +doulbe -> double +dyanmic -> dynamic +excecut -> execute +failse -> false +fales -> false +fasle -> false +flase -> false +indeces -> indices +indecies -> indices +indicies -> indices +interator -> iterator +looup -> lookup +namesapce -> namespace +namespcae -> namespace +nulltpr -> nullptr +operaotr -> operator +overide -> override +ovveride -> override +poitner -> pointer +:rference -> reference +referece -> reference +singed -> signed +stirng -> string +strign -> string +swithc -> switch +swtich -> switch +teamplate -> template +tempalte -> template +:ture -> true +retrun -> return +retun -> return +reutrn -> return +cosnt -> const +virutal -> virtual +vitual -> virtual +yeild -> yield +:alot: -> a lot +:andteh -> and the +:andthe -> and the +:asthe -> as the +:atthe -> at the +abouta -> about a +aboutit -> about it +aboutthe -> about the +:tothe -> to the +didnot -> did not +fromthe -> from the +:agred -> agreed +:ajust -> adjust +:anual -> annual +:asign -> assign +:aslo: -> also +:casue -> cause +:choses -> chooses +:gaurd -> guard +:haev -> have +:hapen -> happen +:idaes -> ideas +:jsut: -> just +:jstu: -> just +:knwo -> know +:konw -> know +:kwno -> know +:ocuntry -> country +:ocur -> occur +:socre -> score +:szie -> size +:the:the: -> the +:turth -> truth +:uesd: -> used +:usally -> usually +abilties -> abilities +abilty -> ability +abvove -> above +accesories -> accessories +accomodate -> accommodate +acommodate -> accommodate +acomplish -> accomplish +actualy -> actually +acurate -> accurate +acutally -> actually +addtion -> addition +againnst -> against +aganist -> against +aggreed -> agreed +agianst -> against +ahppn -> happen +allign -> align +anytying -> anything +aquire -> acquire +availabe -> available +availaible -> available +availalbe -> available +availble -> available +availiable -> available +avalable -> available +avaliable -> available +avilable -> available +bandwith -> bandwidth +begginer -> beginner +beleif -> belief +beleive -> believe +belive -> believe +breif -> brief +burried -> buried +caluclate -> calculate +caluculate -> calculate +calulate -> calculate +catagory -> category +cauhgt -> caught +ceratin -> certain +certian -> certain +cheif -> chief +cieling -> ceiling +circut -> circuit +clasic -> classic +cmoputer -> computer +coform -> conform +comming: -> coming +considerd -> considered +dervied -> derived +desicion -> decision +diferent -> different +diferrent -> different +differnt -> different +diffrent -> different +divison -> division +effecient -> efficient +eligable -> eligible +elpased -> elapsed +embarass -> embarrass +embeded -> embedded +encypt -> encrypt +finaly -> finally +foriegn -> foreign +foward -> forward +fraciton -> fraction +fucntion -> function +fufill -> fulfill +fullfill -> fulfill +futher -> further +ganerate -> generate +generaly -> generally +greatful -> grateful +heigher -> higher +higest -> highest +howver -> however +hydogen -> hydrogen +importamt -> important +inclued -> include +insted -> instead +intrest -> interest +invliad -> invalid +largst -> largest +learnign -> learning +liasion -> liaison +likly -> likely +lisense -> license +listner -> listener +macthing -> matching +manefist -> manifest +mesage -> message +naturual -> natural +occassion -> occasion +occured -> occurred +particualr -> particular +paticular -> particular +peice -> piece +perhasp -> perhaps +perhpas -> perhaps +perphas -> perhaps +persue -> pursue +posess -> possess +postion -> position +preiod -> period +primarly -> primarily +privte -> private +proccess -> process +proeprty -> property +propery -> property +realtion -> relation +reasearch -> research +recuring -> recurring +refered -> referred +regluar -> regular +releated -> related +resutl -> result +reuslt -> result +reveiw -> review +satisifed -> satisfied +scheduel -> schedule +sequnce -> sequence +similiar -> similar +simmilar -> similar +slighly -> slightly +somehwat -> somewhat +statment -> statement +sucess -> success +succsess -> success +sugest -> suggest +sumary -> summary +supress -> suppress +surpress -> suppress +thresold -> threshold +tongiht -> tonight +tranpose -> transpose +typcial -> typical +udpate -> update +ususally -> usually +verticies -> vertices +whereever -> wherever +wherre -> where +wierd -> weird diff --git a/waffle/oled.c b/waffle/oled.c new file mode 100644 index 0000000..4b2cdcb --- /dev/null +++ b/waffle/oled.c @@ -0,0 +1,247 @@ +// Copyright 2022 jack (@waffle87) +// SPDX-License-Identifier: GPL-2.0-or-later +#include "waffle.h" +uint32_t oled_timer = 0; + +void render_wpm(void) { + oled_write(PSTR("WPM: "), false); + oled_write_ln(get_u8_str(get_current_wpm(), ' '), false); +} + +#ifdef DEBUG_MATRIX_SCAN_RATE +void render_scan_rate(void) { + oled_write(get_u16_str(get_matrix_scan_rate(), ' '), false); + oled_write_ln(PSTR("/s"), false); +} +#endif + +#ifdef RAW_ENABLE +void host_info(uint8_t data) { + char buffer[3]; + oled_write_ln((char*)itoa(data, buffer, 10), false); +} + +void render_time(void) { + if (user_state.hour < 10) + oled_write(PSTR("0"), false); + host_info(user_state.hour); + oled_write(PSTR(":"), false); + if (user_state.min < 10) + oled_write(PSTR("0"), false); + host_info(user_state.min); +} +#endif + +void qmk_logo(void) { + static const char PROGMEM qmk_logo[16] = {0x8a, 0x8b, 0x8c, 0x8d, 0x8e, 0xaa, 0xab, 0xac, 0xad, 0xae, 0xca, 0xcb, 0xcc, 0xcd, 0xce, 0}; + oled_write(qmk_logo, false); +}; + +void render_keyboard(void) { + static const char PROGMEM keyboard[16] = {0xba, 0xbb, 0xbc, 0xbd, 0xbe, 0xda, 0xdb, 0xdc, 0xdd, 0xde, 0}; + oled_write(keyboard, false); +}; + +void layer_status(void) { + bool blink = (timer_read() % 1000) < 500; + switch (get_highest_layer(layer_state)) { + case _RAISE: + oled_write_ln(PSTR("> hi"), false); + break; + case _LOWER: + oled_write_ln(PSTR("> lo"), false); + break; + case _ADJUST: + oled_write_ln(PSTR("> ad"), false); + break; + default: + oled_write_ln(blink ? PSTR("> _") : PSTR("> "), false); + } +}; + +void mod_status(uint8_t mods) { + static const char PROGMEM status [4][3] = {{0xd3, 0xd4, 0}, {0x93, 0x94, 0}, {0xb3, 0xb4, 0}, {0x95, 0x96, 0}}; + bool blink = (timer_read() % 1000) < 500; + if (mods & MOD_MASK_CTRL) { + oled_set_cursor(2, 11); + oled_write(status[0], false); + } else if (mods & MOD_MASK_SHIFT) { + oled_set_cursor(2, 11); + oled_write(status[1], false); + } else if (mods & MOD_MASK_ALT) { + oled_set_cursor(2, 11); + oled_write(status[2], false); + } else if (mods & MOD_MASK_GUI) { + oled_set_cursor(2, 11); + oled_write(status[3], false); + } else + oled_write_ln(blink ? PSTR("$ _") : PSTR("$ "), false); +} + +void keylock_status(led_t led_usb_state) { + bool blink = (timer_read() % 1000) < 500; + if (led_usb_state.caps_lock) + oled_write_ln(PSTR("% cap"), false); + else if (led_usb_state.num_lock) + oled_write_ln(PSTR("% num"), false); + else if (led_usb_state.scroll_lock) + oled_write_ln(PSTR("% scr"), false); + else + oled_write_ln(blink ? PSTR("% _") : PSTR("% "), false); +} + +static uint16_t log_timer = 0; +char keylog_str[5] = {0}; +const char code_to_name[60] = { + ' ', ' ', ' ', ' ', 'a', 'b', 'c', 'd', 'e', 'f', + 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', + 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z', + '1', '2', '3', '4', '5', '6', '7', '8', '9', '0', + 'R', 'E', 'B', 'T', '_', '-', '=', '[', ']', '\\', + '#', ';', '\'', '`', ',', '.', '/', ' ', ' ', ' ' +}; + +void add_keylog(uint16_t keycode) { + if ((keycode >= QK_MOD_TAP && keycode <= QK_MOD_TAP_MAX) || (keycode >= QK_LAYER_TAP && keycode <= QK_LAYER_TAP_MAX)) + keycode = keycode & 0xFF; + for (uint8_t i = 4; i > 0; i--) + keylog_str[i] = keylog_str[i - 1]; + if (keycode < 60) + keylog_str[0] = code_to_name[keycode]; + keylog_str[4] = 0; + log_timer = timer_read(); +} + +void render_keylogger(void) { oled_write(keylog_str, false); } + +void keylogger_status(void) { + bool blink = (timer_read() % 1000) < 500; + oled_write_ln(blink ? PSTR("~ _") : PSTR("~ "), false); +} + +void anim_frame(uint16_t size, char const action[][size]) { + static uint8_t current_frame = 0; + current_frame = (current_frame + 1) & 1; + oled_write_raw(action[current_frame], size); +} + +#ifdef FELIX_DOG +void felix(void) { + static uint16_t felix_anim_timer = 0; + bool shifted = get_mods() & MOD_MASK_SHIFT || host_keyboard_led_state().caps_lock || is_caps_word_on(); + void animate(void) { + if (shifted) + anim_frame(96, felix_bark); + else if (get_mods() & MOD_MASK_CAG) + anim_frame(96, felix_sneak); + else if (get_current_wpm() > 40) + anim_frame(96, felix_run); + else if (get_current_wpm() > 30 && get_current_wpm() <= 40) + anim_frame(96, felix_walk); + else + anim_frame(96, felix_sit); + } + if (timer_elapsed(felix_anim_timer) > 200) { + felix_anim_timer = timer_read(); + animate(); + } +} +#endif + +#ifdef BONGO_CAT +void bongo(void) { + static uint16_t bongo_anim_timer = 0; + void animate(void) { + if (get_current_wpm() <= 30) { + anim_frame(512, bongo_idle); + } if (get_current_wpm() > 30 && get_current_wpm() <= 40) { + anim_frame(512, bongo_prep); + } if (get_current_wpm() > 40) { + anim_frame(512, bongo_tap); + } + } + if (timer_elapsed(bongo_anim_timer) > 200) { + bongo_anim_timer = timer_read(); + animate(); + } +} +#endif + +#ifdef WPM_GRAPH +void wpm_graph(void) { + float max_wpm = 160; + static uint8_t height = OLED_DISPLAY_HEIGHT - 1, vert_count = 0; + static uint16_t graph_timer = 0; + if (timer_elapsed(graph_timer) > 100) { + height = 63 - ((get_current_wpm() / max_wpm) * 63); + for (uint8_t i = 0; i <= 1; i++) + oled_write_pixel(3, height + i, true); + if (vert_count == 3) { + vert_count = 0; + while (height <= 63) { + oled_write_pixel(3, height, true); + height++; + } + } else { + for (uint8_t i = 63; i > height; i--) + if (i % 3 == 0) + oled_write_pixel(3, i, true); + vert_count++; + } + for (uint16_t y = 0; y < 8; y++) { + for (uint16_t x = 124; x > 0; x--) { + uint16_t i = y * OLED_DISPLAY_WIDTH + x; + oled_buffer[i] = oled_buffer[i - 1]; + oled_dirty |= ((OLED_BLOCK_TYPE)1 << (i / OLED_BLOCK_SIZE)); + } + } + graph_timer = timer_read(); + } +} +#endif + +#ifdef LAYER_ANIM +void layer_anim(void) { + static uint16_t layer_anim_timer = 0; + void animate(void) { + switch (get_highest_layer(layer_state)) { + case _RAISE: + anim_frame(650, tap_sym); + break; + case _LOWER: + anim_frame(520, tap_num); + break; + case _ADJUST: + anim_frame(520, tap_sys); + break; + default: + bongo(); + } + } + if (timer_elapsed(layer_anim_timer) > 200) { + layer_anim_timer = timer_read(); + animate(); + } +} +#endif + +__attribute__((weak)) bool oled_task_keymap(void) { + return true; +} + +bool oled_task_user(void) { + if (is_keyboard_master()) { + if (timer_elapsed32(oled_timer) > 180000) { + oled_off(); + return false; + } else + oled_on(); + } + if (!oled_task_keymap()) + return false; + return false; +} + +void oled_timer_reset(void) { + oled_timer = timer_read32(); +} diff --git a/waffle/oled.h b/waffle/oled.h new file mode 100644 index 0000000..20f3081 --- /dev/null +++ b/waffle/oled.h @@ -0,0 +1,226 @@ +// Copyright 2022 jack (@waffle87) +// SPDX-License-Identifier: GPL-2.0-or-later +#pragma once +#include "quantum.h" + +extern uint8_t oled_buffer[OLED_MATRIX_SIZE]; +extern OLED_BLOCK_TYPE oled_dirty; +void render_wpm(void); +void render_scan_rate(void); +void render_time(void); //render time +void qmk_logo(void); +void render_keyboard(void); //small split keyboard +void layer_status(void); //active layer +void mod_status(uint8_t mods); //active modifier (ctl, shift, alt, gui) +void keylock_status(led_t led_usb_state); //active key lock (caps, num, scroll) +void add_keylog(uint16_t keycode); +void render_keylogger(void); //keylogger data +void keylogger_status(void); //keylogger prompt +void felix(void); //felix the dog (90 or 270 rotation) +void bongo(void); //solid-filled bongo cat (0 or 180 rotation) +void wpm_graph(void); //wpm graph for 128x64 oled (memory intensive) +void layer_anim(void); +void oled_timer_reset(void); + +#ifdef BONGO_CAT +static const char PROGMEM bongo_idle[5][512] = { { + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128,192,192,224,224,224,224,240,240,240,240,240,248,248,252,252,252,248,240,192,128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128,128,128, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 24,124,254,254,254,254,254,254,255,255,255,255,255,127,127,255,255,255,255,255,255,255,255,255,127,255,207,207,255, 63, 63, 63, 62,252,248,240,224,192,128, 0, 0, 0,128,128,128,128, 64, 64, 64, 64, 32, 32, 32, 32, 16, 16, 16, 16, 8, 8, 8, 8, 8, 4, 4, 4, 4, 4, 2, 2, 2, 2, 1, 1, 1, 1, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,192,248,252,255,255,255,255,255,255,255,255,243,243,243,242,254,255,255,191, 62, 61, 29, 30, 30, 30, 14, 15, 15, 15, 15, 7, 7, 15, 15, 31, 31, 31, 31, 31, 31, 15, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128,128,128,128,128, 64, 64, 64, 64, 64, 32, 32, 32, 32, 32, 16, 16, 16, 16, 16, 8, 8, 8, 8, 8, 4, 4, 4, 4, 4, 2, 3, 3, 3, 1, 1, 1, 1, 1, 1, 3, 7, 7, 7, 15, 15, 15, 15, 15, 7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + }, { + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128,192,192,224,224,224,224,240,240,240,240,240,248,248,252,252,252,248,240,192,128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128,128,128, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 24,124,254,254,254,254,254,254,255,255,255,255,255,127,127,255,255,255,255,255,255,255,255,255,127,255,207,207,255, 63, 63, 63, 62,252,248,240,224,192,128, 0, 0, 0,128,128,128,128, 64, 64, 64, 64, 32, 32, 32, 32, 16, 16, 16, 16, 8, 8, 8, 8, 8, 4, 4, 4, 4, 4, 2, 2, 2, 2, 1, 1, 1, 1, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,192,248,252,255,255,255,255,255,255,255,255,243,243,243,242,254,255,255,191, 62, 61, 29, 30, 30, 30, 14, 15, 15, 15, 15, 7, 7, 15, 15, 31, 31, 31, 31, 31, 31, 15, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128,128,128,128,128, 64, 64, 64, 64, 64, 32, 32, 32, 32, 32, 16, 16, 16, 16, 16, 8, 8, 8, 8, 8, 4, 4, 4, 4, 4, 2, 3, 3, 3, 1, 1, 1, 1, 1, 1, 3, 3, 7, 7, 15, 15, 15, 15, 15, 7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + }, { + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128,128,192,192,192,192,224,224,224,224,240,248,252,254,254,252,248,224,128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128,128,128, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 60,254,255,255,254,254,252,252,254,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,159,159,255,127,126,126,124,248,240,224,192,128, 0, 0, 0, 0,128,128,128,128, 64, 64, 64, 64, 32, 32, 32, 32, 16, 16, 16, 16, 8, 8, 8, 8, 8, 4, 4, 4, 4, 4, 2, 2, 2, 2, 1, 1, 1, 1, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128,240,249,255,255,255,255,255,255,255,255,231,231,231,228,252,255,255,191, 61, 59, 27, 29, 29, 29, 12, 15, 15, 15, 15, 6, 6, 14, 14, 31, 31, 31, 31, 31, 31, 15, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128,128,128,128,128, 64, 64, 64, 64, 64, 32, 32, 32, 32, 32, 16, 16, 16, 16, 16, 8, 8, 8, 8, 8, 4, 4, 4, 4, 4, 2, 3, 3, 3, 1, 1, 1, 1, 1, 1, 3, 3, 7, 7, 15, 15, 15, 15, 15, 7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + }, { + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128,128, 0, 0, 0, 0, 0,128,192,192,224,224,224,224,240,240,240,240,248,252,254,255,255,254,252,240,192,128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128,128,128, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 30,255,255,255,255,255,254,254,255,255,255,255,255,127,127,255,255,255,255,255,255,255,255,255,127,255,207,207,255, 63, 63, 63, 62,252,248,240,224,192,128, 0, 0, 0,128,128,128,128, 64, 64, 64, 64, 32, 32, 32, 32, 16, 16, 16, 16, 8, 8, 8, 8, 8, 4, 4, 4, 4, 4, 2, 2, 2, 2, 1, 1, 1, 1, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128,240,252,255,255,255,255,255,255,255,255,243,243,243,242,254,255,255,191, 62, 61, 29, 30, 30, 30, 14, 15, 15, 15, 15, 7, 7, 15, 15, 31, 31, 31, 31, 31, 31, 15, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128,128,128,128,128, 64, 64, 64, 64, 64, 32, 32, 32, 32, 32, 16, 16, 16, 16, 16, 8, 8, 8, 8, 8, 4, 4, 4, 4, 4, 2, 3, 3, 3, 1, 1, 1, 1, 1, 1, 3, 3, 7, 7, 15, 15, 15, 15, 15, 7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + }, { + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128,192,192,224,224,224,224,240,240,240,240,248,248,252,254,254,254,252,248,192,128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128,128,128, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 28,254,255,255,254,254,254,254,255,255,255,255,255,127,127,255,255,255,255,255,255,255,255,255,127,255,207,207,255, 63, 63, 63, 62,252,248,240,224,192,128, 0, 0, 0,128,128,128,128, 64, 64, 64, 64, 32, 32, 32, 32, 16, 16, 16, 16, 8, 8, 8, 8, 8, 4, 4, 4, 4, 4, 2, 2, 2, 2, 1, 1, 1, 1, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128,240,252,255,255,255,255,255,255,255,255,243,243,243,242,254,255,255,191, 62, 61, 29, 30, 30, 30, 14, 15, 15, 15, 15, 7, 7, 15, 15, 31, 31, 31, 31, 31, 31, 15, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128,128,128,128,128, 64, 64, 64, 64, 64, 32, 32, 32, 32, 32, 16, 16, 16, 16, 16, 8, 8, 8, 8, 8, 4, 4, 4, 4, 4, 2, 3, 3, 3, 1, 1, 1, 1, 1, 1, 3, 3, 7, 7, 15, 15, 15, 15, 15, 7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + } +}; + +static const char PROGMEM bongo_prep[][512] = { { + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128,128, 0, 0, 0, 0, 0,128,192,192,224,224,224,224,240,240,240,240,248,252,254,255,255,254,252,240,192,128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128,128,128, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 30,255,255,255,255,255,254,254,127,127,127,255,255,127,127,255,255,255,255,255,255,255,255,255,127,255,207,207,255,255,255, 31,230,250,247,207,203,255,246,124, 0, 0,128,128,128,128, 64, 64, 64, 64, 32, 32, 32, 32, 16, 16, 16, 16, 8, 8, 8, 8, 8, 4, 4, 4, 4, 4, 2, 2, 2, 2, 1, 1, 1, 1, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128,240,252,255,255,255,231,249,250,231,230,251,252, 67,126,126,127,127, 63, 62, 61, 29, 30, 30, 30, 14, 15, 15, 15, 15, 7, 7, 7, 7, 7, 7, 3, 3, 3, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128,128,128,128,128, 64, 64, 64, 64, 64, 32, 32, 32, 32, 32, 16, 16, 16, 16, 16, 8, 8, 8, 8, 8, 4, 4, 4, 4, 4, 2, 3, 3, 3, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + } +}; + +static const char PROGMEM bongo_tap[2][512] = { { + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128,128, 0, 0, 0, 0, 0,128,192,192,224,224,224,224,240,240,240,240,248,252,254,255,255,254,252,240,192,128, 0, 0, 0, 0, 0, 0, 0,248,248,248,248, 0, 0, 0, 0, 0,128,128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128,128,128, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 30,255,255,255,255,255,254,254,127,127,127,255,255,127,127,255,255,255,255,255,255,255,255,255,127,255,207,207,255,255,255,255,254,252,248,240,224,195,135, 7, 1, 0,184,188,190,159, 95, 95, 79, 76, 32, 32, 32, 32, 16, 16, 16, 16, 8, 8, 8, 8, 8, 4, 4, 4, 4, 4, 2, 2, 2, 2, 1, 1, 1, 1, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128,240,252,255,255,255,231,249,250,231,230,251,124, 67,126,126,127,127, 63, 62, 61, 29, 30, 30, 30, 14, 15, 15, 15, 15, 7, 7, 15, 15, 31, 31, 31, 31, 31, 31, 15, 1, 61,124,252,252,252,252,252, 60, 12, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128,128,128,128,128, 64, 64, 64, 64, 64, 32, 32, 32, 32, 32, 16, 16, 16, 16, 16, 8, 8, 8, 8, 8, 4, 4, 4, 4, 4, 2, 3, 3, 3, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 3, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + }, { + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128,128, 0, 0, 0, 0, 0,128,192,192,224,224,224,224,240,240,240,240,248,252,254,255,255,254,252,240,192,128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128,128,128, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 30,255,255,255,255,255,254,254,255,255,255,255,255,127,127,255,255,255,255,255,255,255,255,255,127,255,207,207,255,255,255, 31,230,250,247,207,203,255,246,124, 0, 0,128,128,128,128, 64, 64, 64, 64, 32, 32, 32, 32, 16, 16, 16, 16, 8, 8, 8, 8, 8, 4, 4, 4, 4, 4, 2, 2, 2, 2, 1, 1, 1, 1, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128,240,252,255,255,255,255,255,255,255,255,255,255,255,254,254,255,255,191, 62, 61, 29, 30, 30, 30, 14, 15, 15, 15, 15, 7, 7, 7, 7, 7, 7, 3, 3, 3, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128,128,128,128,128, 64, 64, 64, 64, 64, 32, 32, 32, 32, 32, 16, 16, 16, 16, 16, 8, 8, 8, 8, 8, 4, 4, 4, 4, 4, 2, 3,123,123,121,121,121,121, 57, 49, 3, 3, 7, 7, 15, 15, 15,143,143,135,128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + } +}; +#endif + +#ifdef FELIX_DOG +static const char PROGMEM felix_sit[2][96] = { { + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0xfc, + 0xfe, 0xfd, 0xfe, 0xdc, 0xfc, 0xfc, 0xfe, 0x5d, 0xfe, 0xe0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0xf0, 0xf8, 0x1c, 0xf0, 0xf8, 0xfc, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xfd, 0xf9, 0xfd, 0x7f, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x03, 0x07, 0x0f, 0x1f, 0x1f, 0x3f, 0x3f, 0x3f, 0x37, + 0x21, 0x13, 0x3f, 0x3f, 0x3f, 0x0f, 0x11, 0x1f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + }, { + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0xfe, + 0xfd, 0xfe, 0xfc, 0xdc, 0xfc, 0xfe, 0xfd, 0x5e, 0xfc, 0xe0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0xf0, 0xf8, 0xfc, 0x80, 0xf0, 0xf8, 0xfc, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xfd, 0xf1, 0xfd, 0x7f, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x03, 0x07, 0x0f, 0x1f, 0x1f, 0x3f, 0x3f, 0x3f, 0x37, + 0x21, 0x13, 0x3f, 0x3f, 0x3f, 0x0f, 0x11, 0x1f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + } +}; + +static const char PROGMEM felix_walk[2][96] = { { + 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0xc0, 0xe0, 0xf0, 0xf0, 0x70, 0x30, 0x20, 0x00, 0x80, 0xc0, + 0xc0, 0xf0, 0xf8, 0xf4, 0xf8, 0x70, 0xf0, 0xf0, 0xf8, 0x74, 0xf8, 0x80, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0x0f, 0xff, 0xfd, 0xfe, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xf7, 0xe7, 0xf5, 0x1f, 0x0f, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x1f, 0x3f, 0x3f, 0x3f, 0x0f, 0x11, 0x1f, 0x1f, + 0x03, 0x07, 0x1f, 0x3f, 0x3f, 0x0f, 0x13, 0x1f, 0x1f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + }, { + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0xc0, 0xe0, 0xe0, 0xe0, 0xc0, 0x80, 0x00, 0x00, 0x00, + 0x00, 0xe0, 0xf0, 0xe8, 0xf0, 0xe0, 0xe0, 0xe0, 0xf0, 0xe8, 0xf0, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x1f, 0x3f, 0xfb, 0xfd, 0xfe, 0xfe, 0xfe, 0xfe, 0xfe, 0xfe, 0xfe, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xfe, 0xff, 0xef, 0xcf, 0xea, 0x3f, 0x1f, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3f, 0x3f, 0x3f, 0x0f, 0x03, 0x07, 0x0f, 0x1f, 0x03, + 0x1f, 0x1f, 0x17, 0x0f, 0x1f, 0x3f, 0x3f, 0x33, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + } +}; + +static const char PROGMEM felix_run[2][96] = { { + 0x00, 0x00, 0x00, 0x00, 0xe0, 0xf0, 0xf8, 0xf8, 0xf8, 0xb0, 0xa0, 0x80, 0x80, 0x80, 0x80, 0x80, + 0x80, 0xc0, 0xc0, 0xfc, 0xf4, 0xe4, 0xf8, 0x70, 0xf8, 0xe4, 0xf8, 0x70, 0xc0, 0x80, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x01, 0x63, 0xe7, 0xe7, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xf7, 0x67, 0x37, 0x35, 0x1f, 0x0f, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x0e, 0x0f, 0x07, 0x07, 0x07, 0x07, 0x03, 0x03, 0x03, 0x01, 0x01, + 0x03, 0x03, 0x07, 0x0f, 0x1f, 0x3f, 0x3b, 0x33, 0x07, 0x07, 0x06, 0x00, 0x00, 0x00, 0x00, 0x00, + }, { + 0x00, 0x00, 0x00, 0xe0, 0xf0, 0xf0, 0xf8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, + 0x80, 0x80, 0xf8, 0xe8, 0xc8, 0xf0, 0xe0, 0xf0, 0xc8, 0xf0, 0xe0, 0xc0, 0x80, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x03, 0x07, 0x0f, 0x1f, 0x1f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfe, 0xef, 0xcf, 0x6f, 0x6a, 0x3f, 0x1f, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x03, 0x0f, 0x1f, 0x3f, 0x3f, 0x37, + 0x03, 0x1f, 0x3f, 0x3f, 0x1f, 0x0f, 0x1f, 0x3f, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + } +}; + +static const char PROGMEM felix_bark[2][96] = { { + 0x00, 0xc0, 0xe0, 0xf0, 0xf0, 0x30, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x80, 0xc0, + 0xfc, 0xf4, 0xe4, 0xf8, 0x70, 0xf8, 0xe4, 0xf8, 0x70, 0xc0, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x03, 0x07, 0x0f, 0x1f, 0x1f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xf7, 0xf7, 0x37, 0x35, 0x1f, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x03, 0x0f, 0x1f, 0x3f, 0x3f, 0x37, 0x03, 0x03, + 0x07, 0x0f, 0x1f, 0x3f, 0x3b, 0x33, 0x07, 0x07, 0x06, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + }, { + 0x00, 0xe0, 0xf0, 0xf0, 0xf0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x80, 0xc0, + 0xc0, 0xec, 0xf4, 0xe4, 0xf8, 0x70, 0xf8, 0xe4, 0xf8, 0x70, 0xc0, 0x80, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x03, 0x07, 0x0f, 0x1f, 0x1f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x77, 0x37, 0x35, 0x1f, 0x0f, 0x20, 0x4a, 0x09, 0x10, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x03, 0x0f, 0x1f, 0x3f, 0x3f, 0x37, 0x03, 0x03, + 0x07, 0x0f, 0x1f, 0x3f, 0x3b, 0x33, 0x07, 0x07, 0x06, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + } +}; + +static const char PROGMEM felix_sneak[2][96] = { { + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0xc0, 0xc0, 0xc0, 0xc0, 0x80, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0xc0, 0x40, 0x40, 0x80, 0x00, 0x80, 0x40, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x1e, 0x3f, 0xff, 0xfb, 0xfd, 0xfd, 0xfd, 0xfd, 0xfd, 0xfc, 0xfc, 0xfc, + 0xfc, 0xfe, 0xff, 0xff, 0xfe, 0xff, 0xf7, 0xff, 0x7e, 0x7f, 0x57, 0xfc, 0xf8, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x1f, 0x3f, 0x3f, 0x3f, 0x0f, 0x1f, 0x1f, 0x03, 0x07, + 0x1f, 0x3f, 0x3f, 0x3f, 0x0f, 0x1f, 0x1f, 0x07, 0x07, 0x03, 0x03, 0x01, 0x00, 0x00, 0x00, 0x00, + }, { + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0xc0, 0xc0, 0xc0, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0xe0, 0xa0, 0x20, 0xc0, 0x80, 0xc0, 0x20, 0xc0, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x3e, 0x7f, 0xf7, 0xfb, 0xfd, 0xfd, 0xfd, 0xfd, 0xfc, 0xfc, 0xfc, 0xfc, + 0xfc, 0xfe, 0xff, 0xff, 0xff, 0xff, 0xfb, 0xff, 0xbf, 0xbf, 0xab, 0xfe, 0x7c, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3f, 0x3f, 0x3f, 0x0f, 0x03, 0x07, 0x0f, 0x1f, 0x1f, 0x07, + 0x1f, 0x1f, 0x0f, 0x1f, 0x3f, 0x3f, 0x37, 0x07, 0x03, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, + } +}; +#endif + +#ifdef LAYER_ANIM +static const char PROGMEM tap_num[3][520] = { { + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0x60, 0x9c, 0x03, 0, 0, 0x01, 0x02, 0x04, 0x08, 0x10, 0x20, 0x20, 0x20, 0x11, 0x10, 0x08, 0x08, 0x04, 0x04, 0x02, 0x01, 0x0e, 0xf0, 0x20, 0xc0, 0x80, 0, 0, 0x80, 0x80, 0xc0, 0x30, 0x0c, 0x02, 0x11, 0x21, 0x40, 0x80, 0x04, 0x06, 0x09, 0x24, 0x24, 0x18, 0x80, 0x81, 0x41, 0x42, 0x24, 0x18, 0xe0, 0, 0, 0, 0x01, 0x01, 0x01, 0, 0, 0, 0x80, 0x40, 0x20, 0x20, 0x10, 0x10, 0x8f, 0x48, 0xc4, 0x84, 0x88, 0x08, 0x10, 0x20, 0x20, 0x40, 0x80, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0x01, 0x02, 0x04, 0x08, 0x10, 0x20, 0x40, 0x80, 0, 0, 0x80, 0x80, 0x40, 0xc0, 0x30, 0x08, 0x44, 0x84, 0x02, 0x02, 0x01, 0x01, 0x78, 0x28, 0x11, 0x21, 0x42, 0x06, 0x05, 0x08, 0x90, 0x60, 0x80, 0, 0, 0, 0x01, 0x02, 0x02, 0x02, 0x01, 0x01, 0, 0, 0x80, 0x40, 0x40, + 0x20, 0x20, 0x1f, 0x92, 0x8c, 0x08, 0x18, 0x14, 0x24, 0x7a, 0x46, 0x81, 0, 0x02, 0x04, 0x08, 0x10, 0x20, 0x40, 0x41, 0x44, 0x24, 0x23, 0x10, 0x10, 0x08, 0x88, 0x84, 0x43, 0x5c, 0x20, 0x20, 0x10, 0x10, 0x20, 0x20, 0x40, 0x80, 0x80, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0x01, 0x01, 0, 0x18, 0x27, 0x40, 0x80, + 0, 0, 0, 0x01, 0x02, 0x04, 0x08, 0x08, 0x08, 0x04, 0x04, 0x02, 0xc2, 0x21, 0x11, 0x10, 0x08, 0x0b, 0x05, 0x66, 0x42, 0x82, 0x04, 0x04, 0x08, 0x18, 0x14, 0x2c, 0x43, 0x80, 0x04, 0x08, 0x10, 0x20, 0x41, 0x80, 0x80, 0x8f, 0x44, 0x44, 0x20, 0x20, 0x10, 0x10, 0x09, 0x86, 0xb8, 0x40, 0x40, 0x20, 0x20, 0x40, 0x40, 0x80, 0xe0, 0x18, 0x06, 0x01, 0x08, 0x10, 0x20, 0x40, 0x80, 0, 0, 0, 0x88, 0x80, 0x40, 0x40, 0x20, 0x21, 0x12, 0x0c, 0x70, 0x80, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0x01, 0x02, 0x04, 0x08, 0x10, 0x20, 0x40, 0x40, 0x20, 0x60, 0x9c, 0x03, 0, 0, 0x01, 0x02, 0x04, 0x08, 0x10, 0x20, 0x20, 0x20, 0x11, 0x10, 0x08, 0x08, 0x04, 0x04, 0x02, 0x81, 0x8e, 0x70, 0x40, 0x20, 0x20, 0x10, 0x10, 0x08, 0xc8, 0x24, 0x24, 0x42, 0x82, 0x01, 0x01, 0, 0, 0, 0, 0, 0, 0, 0, 0x80, 0x81, 0x41, 0x42, 0x24, 0x18, 0xe0, 0, 0, 0, 0x01, + 0x01, 0x01, 0, 0, 0, 0, 0x80, 0x80, 0x40, 0x40, 0x20, 0x27, 0x18, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + }, { + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0x80, 0x70, 0x0c, 0x03, 0, 0x04, 0x08, 0x10, 0x20, 0x41, 0x80, 0x80, 0x81, 0x46, 0x40, 0x20, 0x20, 0x10, 0x10, 0x09, 0x86, 0xb8, 0x50, 0x60, 0x20, 0x20, 0x40, 0x40, 0x80, 0x80, 0x40, 0xc0, 0x30, 0x08, 0x44, 0x84, 0x02, 0x02, 0x11, 0x19, 0x24, 0x90, 0x91, 0x61, 0x03, 0x04, 0x04, 0x08, 0x90, 0x60, 0x80, 0, 0, 0, 0x01, 0x01, 0x01, 0, 0, 0x80, 0x60, 0x10, 0x88, 0x08, 0x04, 0x04, 0x23, 0x12, 0x71, 0x21, 0x22, 0xc2, 0x04, 0x08, 0x08, 0x10, 0x20, 0xc0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0x01, 0x02, 0x04, 0x08, 0x10, 0x20, 0x40, 0x80, 0, 0, 0, 0, 0, 0, 0xc0, 0x30, 0x0c, 0x02, 0x11, 0x21, 0x40, 0x80, 0, 0, 0x1e, 0x0a, 0x04, 0x08, 0x90, 0x81, 0x41, 0x42, 0x24, 0x18, 0xe0, 0, 0x01, 0x02, 0x04, 0x08, 0x08, 0x08, 0x04, 0x04, 0x02, 0xc2, 0x21, 0x11, 0x10, + 0x08, 0x0b, 0x45, 0x26, 0x22, 0xc2, 0x04, 0x04, 0x0c, 0x1e, 0x11, 0x20, 0x40, 0x80, 0x01, 0x02, 0x04, 0x08, 0x10, 0x10, 0x11, 0x09, 0x08, 0x04, 0x04, 0x02, 0x82, 0x81, 0x40, 0x47, 0x38, 0x20, 0x10, 0x10, 0x20, 0x20, 0x40, 0x80, 0x80, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0x01, 0x02, 0x04, 0x04, 0x02, 0x06, 0x09, 0x10, 0x20, + 0x40, 0x80, 0, 0, 0, 0x01, 0x02, 0x02, 0x02, 0x01, 0x01, 0, 0xc0, 0x20, 0x10, 0x10, 0x08, 0x08, 0x07, 0x64, 0x42, 0x82, 0x04, 0x04, 0x08, 0x10, 0x1c, 0x23, 0x40, 0x80, 0x01, 0x02, 0x04, 0x08, 0x10, 0x20, 0x20, 0x23, 0x11, 0x11, 0x08, 0x08, 0x04, 0x04, 0x02, 0x01, 0x0e, 0xf0, 0x20, 0xc0, 0x80, 0x80, 0x40, 0x40, 0xe0, 0x18, 0x06, 0x01, 0x08, 0x10, 0x20, 0x40, 0x80, 0, 0, 0, 0x88, 0x80, 0x40, 0x40, 0x20, 0x21, 0x12, 0x0c, 0x70, 0x80, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0x01, 0x02, 0x04, 0x08, 0x10, 0x10, 0x08, 0x68, 0x9c, 0x03, 0, 0, 0x01, 0x02, 0x04, 0x08, 0x10, 0x20, 0x20, 0x20, 0x11, 0x10, 0x08, 0x08, 0x04, 0x04, 0x02, 0x01, 0x0e, 0xf0, 0x20, 0xc0, 0x80, 0x40, 0x40, 0xa0, 0xa0, 0xd0, 0x90, 0x08, 0x08, 0x04, 0x04, 0x02, 0x02, 0x01, 0x01, 0, 0, 0x01, 0x01, 0x03, 0x04, 0x04, 0x08, 0x90, 0x60, 0x80, 0, 0, 0, 0x01, 0x01, 0x01, 0, 0, 0, 0, 0x80, 0x80, 0x40, 0x40, 0x20, 0x27, 0x18, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + }, { + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0x60, 0x9c, 0x03, 0, 0, 0x01, 0x02, 0x04, 0x08, 0x10, 0x20, 0x20, 0x20, 0x11, 0x10, 0x08, 0x08, 0x04, 0x04, 0x02, 0x81, 0x8e, 0x70, 0x40, 0x20, 0x20, 0x40, 0x40, 0x80, 0, 0xc0, 0x30, 0x0c, 0x02, 0x11, 0x21, 0x40, 0x80, 0x04, 0x06, 0x09, 0x24, 0x24, 0x18, 0x80, 0x81, 0x41, 0x42, 0x24, 0x18, 0xe0, 0, 0x01, 0x02, 0x04, 0x04, 0x04, 0x02, 0x02, 0x81, 0x61, 0x10, 0x88, 0x08, 0x04, 0x05, 0x22, 0x12, 0x71, 0x21, 0x22, 0xc2, 0x04, 0x08, 0x08, 0x10, 0x20, 0xc0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0x01, 0x02, 0x04, 0x08, 0x10, 0x20, 0x40, 0x80, 0, 0, 0x80, 0x80, 0xc0, 0x30, 0x0c, 0x02, 0x11, 0x21, 0x40, 0x80, 0, 0, 0x1e, 0x0a, 0x04, 0x08, 0x90, 0x81, 0x41, 0x42, 0x24, 0x18, 0xe0, 0, 0, 0, 0x01, 0x02, 0x02, 0x02, 0x01, 0x01, 0, 0xc0, 0x20, 0x10, 0x10, + 0x08, 0x08, 0x47, 0x24, 0x22, 0xc2, 0x04, 0x04, 0x08, 0x1e, 0x11, 0x20, 0x40, 0x80, 0x01, 0x02, 0x04, 0x08, 0x10, 0x10, 0x11, 0x09, 0x08, 0x04, 0x04, 0x02, 0x02, 0x01, 0, 0x07, 0xf8, 0x80, 0x40, 0x40, 0x80, 0x80, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0x01, 0x01, 0, 0x06, 0x09, 0x10, 0x20, + 0x40, 0x80, 0, 0, 0, 0x01, 0x02, 0x02, 0x02, 0x01, 0x01, 0, 0, 0x80, 0x40, 0x40, 0x20, 0x20, 0x1f, 0x92, 0x0c, 0x08, 0x10, 0x10, 0x28, 0x68, 0x5c, 0x83, 0, 0, 0x01, 0x02, 0x04, 0x08, 0x10, 0x20, 0x20, 0x23, 0x11, 0x11, 0x08, 0x08, 0x04, 0x04, 0x02, 0x81, 0x8e, 0x70, 0x60, 0x20, 0x20, 0x40, 0x40, 0xc0, 0xa0, 0x60, 0x18, 0x04, 0x22, 0x42, 0x81, 0x01, 0, 0, 0, 0, 0x20, 0, 0x01, 0x02, 0x82, 0x84, 0x48, 0x30, 0xc0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0x01, 0x02, 0x04, 0x08, 0x10, 0x10, 0x08, 0x88, 0x74, 0x0c, 0x03, 0, 0x04, 0x08, 0x10, 0x20, 0x40, 0x81, 0x81, 0x82, 0x44, 0x40, 0x20, 0x20, 0x10, 0x10, 0x09, 0x86, 0xb8, 0x50, 0x60, 0x20, 0x20, 0x10, 0x10, 0x08, 0xc8, 0x24, 0x24, 0x42, 0x82, 0x01, 0x01, 0, 0, 0, 0, 0, 0, 0, 0, 0x80, 0x81, 0x41, 0x42, 0x24, 0x18, 0xe0, 0, 0x01, 0x02, 0x04, + 0x04, 0x04, 0x02, 0x02, 0x01, 0x01, 0, 0, 0, 0, 0x81, 0x9e, 0x60, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + } +}; + +static const char PROGMEM tap_sym[3][650] = { { + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0x80, 0x80, 0x40, 0x40, 0x40, 0x20, 0x20, 0x20, 0x10, 0x10, 0x10, 0x10, 0x08, 0x08, 0x08, 0x08, 0x0c, 0x0a, 0x09, 0x09, 0x09, 0x08, 0x04, 0x04, 0x04, 0x04, 0x08, 0x08, 0x08, 0x08, 0x08, 0x10, 0x10, 0x20, 0x20, 0x20, 0x50, 0x40, 0x80, 0, 0, 0, 0, 0x1c, 0x22, 0x21, 0x21, 0x22, 0x2c, 0x30, 0xd0, 0x10, 0x11, 0x21, 0x20, 0x40, 0x80, 0x80, 0, 0, 0, 0, 0, 0x20, 0x20, 0x21, 0x12, 0x1c, 0xf0, 0x10, 0x18, 0x08, 0x08, 0, 0, 0x01, 0x01, 0x02, 0x04, 0x08, 0x30, 0xc0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0x80, 0xc0, 0xc0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0xc0, 0x20, 0x10, 0x08, 0x04, 0x02, 0x81, 0x01, 0, 0, 0x40, 0x80, 0, 0x80, 0, 0, 0, 0, 0x18, 0x24, 0x24, 0x24, 0x18, 0, 0xc0, 0x30, 0x0e, 0x80, 0x40, 0x40, 0x80, 0, 0, 0, 0, 0xc0, 0x20, 0x20, 0x20, 0x40, 0x40, 0x40, 0x20, 0x18, 0, 0, 0, 0x01, 0x82, 0x44, 0x78, 0x40, 0x20, 0x10, 0x10, 0x08, 0x08, 0x08, 0x07, 0x04, 0x04, 0x02, 0x02, 0x02, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x81, 0x81, 0x81, 0x82, 0x02, 0x02, 0x02, 0x04, 0x04, 0x08, 0x0b, 0x10, 0x10, 0x20, 0x60, 0x20, 0x30, 0x18, 0x0c, 0x04, 0x03, 0x01, 0, 0xff, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0xfe, 0x01, 0, 0, 0, 0x08, 0x88, 0x85, 0x4e, 0x74, 0xe2, 0x21, 0x21, 0x17, 0x18, 0x68, 0xc4, 0, 0, 0, 0, 0, 0, 0x18, 0x07, 0, 0, 0, 0x03, 0x04, 0x04, 0x04, 0x03, 0, 0, 0, 0x01, 0, 0, 0, 0, 0, 0, 0xc0, 0x20, 0x10, 0x0c, 0x02, 0x01, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0xc0, 0x60, 0x30, 0x10, 0x08, 0x08, 0x08, 0x08, 0x08, 0x10, 0x30, 0x40, 0x80, 0, 0x0e, 0x03, 0x01, 0x01, 0, 0xe0, 0x30, 0x19, 0x07, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0xc0, 0x3f, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0x03, 0x04, 0x08, 0x10, 0x20, 0x20, 0xc0, 0, 0, 0, 0x01, 0x80, 0x40, 0x40, 0x40, 0x40, 0x80, 0x80, 0x80, 0x80, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x20, 0x20, 0x10, 0x10, 0x10, 0x10, 0x08, 0x08, 0x34, 0xcf, 0, 0, 0, 0, 0, 0x3e, 0x63, 0xc1, 0xc1, 0xbe, 0x80, 0, 0, 0, 0, 0, 0, 0x80, 0, 0, 0x1f, 0x20, 0x40, 0xc0, 0x8e, 0x11, 0x19, 0x0e, 0x03, 0x86, 0x84, 0xc6, 0x63, 0, 0, 0, 0, 0, 0, 0x01, 0x06, 0, 0, 0x20, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0xc0, 0x20, 0x18, 0x07, 0x01, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0x03, 0, 0x02, 0x02, 0x01, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0x01, 0, 0, 0, 0, 0, 0, 0, 0x03, 0, 0, 0, 0x01, 0x03, 0, 0, 0, 0, 0x03, 0, 0, 0, 0, 0, 0, 0, 0x01, 0x01, 0x01, 0x01, 0x01, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0x01, 0x01, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 + }, { + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0x80, 0x80, 0x40, 0x40, 0x40, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x10, 0x18, 0x14, 0x14, 0x12, 0x12, 0x11, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x20, 0x20, 0x20, 0x20, 0x20, 0x40, 0x60, 0x80, 0x80, 0x80, 0, 0, 0, 0x1c, 0x22, 0x21, 0x21, 0x22, 0x2c, 0x30, 0x50, 0x90, 0x11, 0x11, 0x20, 0x20, 0x40, 0xc0, 0, 0, 0, 0, 0, 0x10, 0x10, 0x10, 0x09, 0x0e, 0x78, 0x88, 0x04, 0x04, 0x04, 0, 0, 0, 0, 0, 0x01, 0x02, 0x0c, 0xf0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0xc0, 0x20, 0x10, 0x08, 0x08, 0x04, 0x82, 0x01, 0x01, 0, 0x40, 0x80, 0, 0x80, 0x80, 0, 0, 0, 0x30, 0x48, 0x48, 0x48, 0x30, 0, 0x80, 0x60, 0x18, 0x04, 0x80, 0x80, 0, 0, 0, 0, 0, 0, 0x80, 0x80, 0x80, 0x80, 0, 0, 0x80, 0xe0, 0x01, 0x01, 0x02, 0x06, 0x08, 0x10, 0xe0, 0x10, 0x20, 0x20, 0x20, 0x20, 0x21, 0x16, 0x18, 0x30, 0x50, 0x08, 0x08, 0x07, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0x01, 0, 0, 0, 0, 0, 0, 0x80, 0x40, 0x30, 0x0c, 0x02, 0x01, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0xff, 0, 0, 0, 0, 0x08, 0x8c, 0xc5, 0x4e, 0x74, 0xe2, 0x21, 0x21, 0x17, 0x18, 0x68, 0x84, 0x04, 0, 0, 0, 0, 0, 0x30, 0x0e, 0x01, 0, 0, 0x07, 0x09, 0x08, 0x09, 0x06, 0, 0, 0, 0x07, 0, 0, 0, 0x01, 0x01, 0x01, 0x01, 0, 0, 0, 0, 0, 0x80, 0x70, 0x0f, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0xf8, 0x04, 0x02, 0x02, 0x01, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0x03, 0x04, 0x08, 0x10, 0x20, 0xe0, 0, 0, 0, 0, 0x81, 0xc0, 0x40, 0x40, 0xc0, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x40, 0x40, 0x40, 0x40, 0x40, 0x20, 0x20, 0x20, 0x10, 0x10, 0x08, 0x08, 0x04, 0x0a, 0x06, 0x05, 0x04, 0x04, 0x04, 0x04, 0x04, 0x02, 0x02, 0x02, 0x02, 0x02, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x06, 0x18, 0x60, 0x80, 0, 0, 0, 0, 0x80, 0x78, 0x07, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0x03, 0, 0x02, 0x02, 0x01, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0x01, 0x02, 0, 0, 0x03, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + }, { + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0x80, 0x40, 0x40, 0x20, 0x10, 0x10, 0x08, 0x04, 0, 0x02, 0x01, 0x01, 0x01, 0, 0, 0, 0, 0, 0x80, 0x80, 0xe0, 0x80, 0xe0, 0, 0, 0, 0, 0, 0, 0x3c, 0x22, 0x21, 0x21, 0x23, 0x2c, 0x30, 0x70, 0x51, 0x91, 0x10, 0x10, 0x10, 0x20, 0x60, 0x80, 0, 0, 0, 0, 0x08, 0x08, 0x08, 0x04, 0x07, 0x3c, 0xc4, 0x04, 0x04, 0x02, 0x02, 0, 0, 0, 0, 0, 0x01, 0x07, 0xfc, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0xf0, 0x0c, 0x03, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0x06, 0x18, 0x20, 0xc0, 0, 0, 0, 0x05, 0x06, 0x03, 0x01, 0x07, 0x01, 0x01, 0x01, 0, 0, 0, 0, 0, 0, 0, 0x30, 0x20, 0x20, 0x20, 0x20, 0x21, 0x16, 0x1c, 0x38, 0x68, 0x04, 0x07, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0x80, 0xc0, 0x20, 0x30, 0x0c, 0x07, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0x0f, 0x30, 0x40, 0x40, 0x80, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0x01, 0, 0, 0x10, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0x80, 0x80, 0x80, 0x80, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0x80, 0x7e, 0x02, 0x01, 0x01, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0x01, 0x01, 0x02, 0x02, 0x02, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x02, 0x02, 0x02, 0x02, 0x01, 0x01, 0x01, 0, 0, 0, 0x01, 0x03, 0x04, 0x18, 0x30, 0x40, 0x80, 0, 0, 0, 0xc0, 0x3f, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0x01, 0x03, 0, 0x02, 0x01, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + } +}; + +static const char PROGMEM tap_sys[3][520] = { { + 0x01, 0x80, 0x60, 0x10, 0x48, 0x08, 0x24, 0x04, 0x14, 0x84, 0x14, 0x04, 0x28, 0x88, 0x10, 0x60, 0x80, 0, 0, 0x04, 0, 0x80, 0x60, 0x10, 0x08, 0x08, 0x04, 0x44, 0x84, 0x04, 0x04, 0x04, 0x08, 0x08, 0x10, 0x60, 0x82, 0, 0, 0, 0, 0, 0, 0, 0xfc, 0x02, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x81, 0x41, 0x21, 0x21, 0x21, 0xa1, 0x61, 0x41, 0xc1, 0x41, 0xc1, 0x81, 0x81, 0x81, 0x81, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x81, 0x41, 0x21, 0x21, 0x21, 0xa2, 0xfc, 0, 0, 0, 0x10, 0, 0, 0, 0, 0, 0x80, 0x40, 0x20, 0x10, 0x10, 0x08, 0x08, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x08, 0x08, 0x10, 0x10, 0x20, 0x40, 0x84, 0, 0, 0, 0, 0x04, + 0, 0x1f, 0x60, 0x85, 0x10, 0x40, 0, 0x80, 0x06, 0x07, 0, 0, 0, 0, 0x82, 0x60, 0x1f, 0, 0, 0, 0, 0x1f, 0x60, 0x80, 0x40, 0x20, 0x20, 0x10, 0x93, 0x5c, 0x10, 0x20, 0x20, 0x40, 0x80, 0x60, 0x1f, 0, 0, 0, 0, 0, 0, 0, 0xff, 0xc1, 0x02, 0x0c, 0x70, 0x80, 0, 0, 0, 0, 0, 0xe0, 0x1c, 0x03, 0, 0xc0, 0x38, 0x06, 0x01, 0x80, 0x70, 0x0c, 0x02, 0x03, 0x1c, 0xe0, 0x01, 0x06, 0x38, 0xc1, 0x02, 0x0c, 0x70, 0x80, 0, 0, 0, 0, 0, 0xe0, 0x1c, 0x03, 0, 0xc0, 0x38, 0x06, 0x01, 0x80, 0xff, 0, 0, 0, 0, 0, 0, 0xf0, 0x0c, 0x03, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0xc0, 0x30, 0x0c, 0x03, 0, 0, 0, 0, 0, 0, 0x03, 0x0c, 0xf0, 0x04, 0, + 0x80, 0x80, 0x88, 0x80, 0x81, 0x81, 0x02, 0x02, 0x12, 0x02, 0x82, 0x82, 0x81, 0x81, 0x80, 0x80, 0, 0x08, 0, 0, 0x80, 0x80, 0x90, 0x80, 0x81, 0x81, 0x02, 0x02, 0x02, 0x02, 0x82, 0x82, 0x01, 0x01, 0, 0, 0x80, 0x80, 0, 0x01, 0, 0, 0, 0, 0xff, 0x41, 0x8e, 0xb0, 0xc0, 0x83, 0x9c, 0x60, 0xa0, 0x18, 0x07, 0x80, 0x40, 0x30, 0x0e, 0x01, 0x80, 0x60, 0x1c, 0x03, 0, 0, 0, 0, 0, 0, 0x07, 0x18, 0x20, 0x41, 0x8e, 0xb0, 0xc0, 0x83, 0x9c, 0x60, 0xa0, 0x18, 0x07, 0x80, 0x40, 0x30, 0x0e, 0x01, 0x80, 0x60, 0x1c, 0x03, 0xff, 0, 0, 0, 0, 0, 0, 0x07, 0x18, 0x60, 0x90, 0x08, 0x08, 0x04, 0x64, 0x04, 0x02, 0xf2, 0x52, 0x92, 0x13, 0x12, 0x12, 0xf2, 0x02, 0x04, 0x64, 0x04, 0x08, 0x08, 0x90, 0x70, 0x18, 0x07, 0, 0, + 0x1f, 0x12, 0x99, 0x14, 0x12, 0x1f, 0, 0x04, 0, 0, 0x1f, 0x10, 0x10, 0x10, 0x10, 0x1f, 0, 0, 0x40, 0, 0x1f, 0x10, 0x10, 0x10, 0x10, 0x1f, 0, 0, 0, 0x40, 0x0d, 0x0d, 0, 0x0c, 0x0c, 0, 0x01, 0x01, 0, 0, 0, 0x40, 0, 0, 0x1f, 0x20, 0x40, 0x40, 0x40, 0x40, 0x41, 0x41, 0x41, 0x41, 0x43, 0x42, 0x42, 0x42, 0x42, 0x41, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x41, 0x41, 0x41, 0x41, 0x43, 0x42, 0x42, 0x42, 0x42, 0x41, 0x40, 0x40, 0x40, 0x20, 0x1f, 0, 0, 0x08, 0, 0, 0, 0, 0, 0, 0x40, 0x01, 0x02, 0x04, 0x04, 0x08, 0x08, 0x11, 0x12, 0x12, + 0x12, 0x12, 0x12, 0x11, 0x08, 0x08, 0x04, 0x44, 0x02, 0x01, 0, 0, 0, 0, 0x20, 0 + }, { + 0x04, 0x80, 0x60, 0x10, 0x48, 0x08, 0xa4, 0x04, 0x14, 0x04, 0x14, 0x04, 0x28, 0x88, 0x10, 0x60, 0x80, 0, 0x04, 0, 0, 0x80, 0x60, 0x10, 0x08, 0x08, 0x04, 0x04, 0x04, 0x04, 0xc4, 0x04, 0x08, 0x08, 0x10, 0x60, 0x80, 0x02, 0, 0, 0x04, 0, 0, 0, 0xfc, 0x02, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x81, 0x41, 0x21, 0x21, 0x21, 0xa1, 0x61, 0x41, 0xc1, 0x41, 0x41, 0x81, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x81, 0x41, 0x21, 0x21, 0x21, 0xa2, 0xfc, 0, 0, 0x40, 0, 0, 0x02, 0, 0, 0, 0x80, 0x40, 0x20, 0x10, 0x10, 0x08, 0x08, 0x04, 0x84, 0x04, 0x04, 0x04, 0x04, 0x04, 0x08, 0x08, 0x10, 0x10, 0x20, 0x42, 0x80, 0, 0, 0x10, 0, 0, 0, 0x1f, 0x60, 0x85, 0x10, 0x40, 0, 0x81, 0x06, 0x06, 0, 0, 0, 0, 0x82, 0x60, + 0x1f, 0, 0, 0, 0, 0x1f, 0x60, 0x80, 0x40, 0x20, 0x20, 0x10, 0x50, 0x9e, 0x11, 0x20, 0x20, 0x40, 0x80, 0x60, 0x1f, 0, 0, 0, 0, 0, 0, 0, 0xff, 0xc0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0xe0, 0x1c, 0x03, 0, 0xc0, 0x38, 0x06, 0x01, 0, 0, 0, 0, 0x03, 0x1c, 0xe0, 0x01, 0x06, 0x38, 0xc0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0xe0, 0x1c, 0x03, 0, 0xc0, 0x38, 0x06, 0x01, 0, 0xff, 0, 0, 0, 0, 0, 0, 0xf0, 0x0c, 0x03, 0, 0, 0, 0, 0, 0, 0, 0, 0x01, 0x1e, 0xe0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0x03, 0x0c, 0xf0, 0, 0, 0x80, 0x80, 0x90, 0x80, 0x81, 0x81, 0x02, 0x02, 0x02, 0x02, 0x82, 0x82, 0x81, 0x81, 0x80, 0x88, + 0, 0, 0, 0, 0x80, 0x80, 0x80, 0x88, 0x81, 0x81, 0x02, 0x02, 0x02, 0x02, 0x82, 0x82, 0x01, 0x81, 0x80, 0, 0, 0, 0, 0, 0, 0, 0x10, 0, 0xff, 0x41, 0x8e, 0xb0, 0xc0, 0x80, 0x80, 0x40, 0x20, 0x18, 0x07, 0x80, 0x40, 0x30, 0x0e, 0x01, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0x07, 0x18, 0x20, 0x41, 0x8e, 0xb0, 0xc0, 0x80, 0x80, 0x40, 0x20, 0x18, 0x07, 0x80, 0x40, 0x30, 0x0e, 0x01, 0, 0, 0, 0, 0xff, 0, 0x02, 0, 0, 0, 0, 0x07, 0x18, 0x60, 0x90, 0x08, 0x08, 0x04, 0x64, 0x04, 0x02, 0xf2, 0x12, 0x92, 0x53, 0x92, 0x12, 0xf2, 0x02, 0x04, 0x64, 0x04, 0x08, 0x08, 0x90, 0x70, 0x18, 0x07, 0, 0, 0x1f, 0x10, 0x10, 0x10, 0x10, 0x1f, 0, 0x80, 0, 0, 0x1f, 0x10, 0x10, 0x10, 0x10, 0x1f, + 0, 0, 0, 0, 0x1f, 0x1f, 0x1f, 0x1f, 0x1f, 0x1f, 0, 0, 0, 0x40, 0x01, 0x01, 0x80, 0x0d, 0x0d, 0, 0x0c, 0x0c, 0, 0, 0, 0, 0, 0, 0x1f, 0x20, 0x40, 0x40, 0x40, 0x40, 0x41, 0x41, 0x41, 0x41, 0x41, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x41, 0x41, 0x41, 0x41, 0x41, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x20, 0x1f, 0, 0, 0, 0, 0, 0x08, 0, 0, 0, 0, 0x01, 0x02, 0x04, 0x04, 0x08, 0x08, 0x11, 0x12, 0x12, 0x12, 0x12, 0x12, 0x11, 0x08, 0x08, 0x04, 0x04, 0x02, 0x01, 0, 0, 0x04, 0, 0, 0, + }, { + 0, 0x80, 0x60, 0x14, 0x48, 0x08, 0x24, 0x04, 0x14, 0x04, 0x14, 0x04, 0x28, 0x88, 0x10, 0x60, 0x80, 0, 0, 0x08, 0, 0x80, 0x60, 0x10, 0x08, 0x08, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x08, 0x88, 0x10, 0x60, 0x80, 0, 0, 0x04, 0, 0, 0, 0, 0xfc, 0x02, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x81, 0x41, 0x21, 0x21, 0x21, 0x21, 0x21, 0x41, 0x81, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x81, 0x41, 0x21, 0x21, 0x21, 0x22, 0xfc, 0, 0, 0x10, 0, 0, 0, 0, 0x02, 0, 0x80, 0x40, 0x20, 0x10, 0x10, 0x08, 0x08, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x08, 0x08, 0x10, 0x10, 0x20, 0x40, 0x80, 0, 0x04, 0, 0, 0, 0, 0x1f, 0x60, 0x85, 0x10, 0x44, 0x04, 0x84, 0x06, 0x06, 0, 0, 0, 0, 0x82, 0x60, + 0x1f, 0, 0, 0, 0, 0x1f, 0x60, 0x80, 0x40, 0x20, 0x20, 0x10, 0x10, 0x18, 0x14, 0x22, 0x21, 0x40, 0x80, 0x60, 0x1f, 0, 0, 0, 0, 0, 0, 0, 0xff, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0xe0, 0x1c, 0x03, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0x03, 0x1c, 0xe0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0xe0, 0x1c, 0x03, 0, 0, 0, 0, 0, 0, 0xff, 0, 0, 0, 0x08, 0, 0, 0xf0, 0x0c, 0x03, 0, 0, 0, 0, 0x01, 0x06, 0x08, 0x30, 0x40, 0x80, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0x03, 0x0c, 0xf0, 0, 0, 0x80, 0x80, 0x80, 0x90, 0x81, 0x81, 0x02, 0x12, 0x02, 0x02, 0x82, 0x82, 0x81, 0x81, 0x80, 0x80, 0, 0, 0x08, 0, 0x80, 0x80, 0x80, 0x80, 0x81, 0x81, 0x02, 0x02, 0x02, 0x02, 0x02, 0x0a, + 0x01, 0x81, 0x80, 0, 0x80, 0x80, 0x08, 0, 0, 0, 0x01, 0, 0xff, 0x40, 0x80, 0x80, 0x80, 0x80, 0x80, 0x40, 0x20, 0x18, 0x07, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0x07, 0x18, 0x20, 0x40, 0x80, 0x80, 0x80, 0x80, 0x80, 0x40, 0x20, 0x18, 0x07, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0xff, 0, 0, 0, 0, 0, 0, 0x07, 0x18, 0x60, 0x90, 0x08, 0x08, 0x04, 0x64, 0x04, 0x02, 0xf2, 0x12, 0x13, 0x12, 0x92, 0x52, 0xf2, 0x02, 0x04, 0x64, 0x04, 0x08, 0x08, 0x90, 0x70, 0x18, 0x07, 0, 0, 0x1f, 0x10, 0x10, 0x10, 0x10, 0x1f, 0, 0, 0x80, 0, 0x1f, 0x10, 0x16, 0x16, 0x10, 0x1f, 0, 0, 0, 0, 0x1f, 0x10, 0x10, 0x10, 0x50, 0x1f, 0, 0, 0, 0, 0x0c, 0x0c, 0, 0x01, 0x01, 0, 0x0d, 0x0d, 0, 0, 0x40, 0, 0, 0, 0x1f, 0x20, 0x40, 0x40, + 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x20, 0x1f, 0, 0x80, 0, 0, 0, 0, 0, 0x08, 0, 0, 0x01, 0x02, 0x04, 0x04, 0x08, 0x08, 0x11, 0x12, 0x12, 0x12, 0x12, 0x12, 0x11, 0x08, 0x08, 0x04, 0x04, 0x02, 0x01, 0x10, 0, 0, 0, 0, 0, + } +}; +#endif diff --git a/waffle/oledfont.h b/waffle/oledfont.h new file mode 100644 index 0000000..ee86755 --- /dev/null +++ b/waffle/oledfont.h @@ -0,0 +1,14 @@ +// Copyright 2022 jack (@waffle87) +// SPDX-License-Identifier: GPL-2.0-or-later +#include "progmem.h" +const unsigned char font[] PROGMEM = { + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3E, 0x5B, 0x4F, 0x5B, 0x3E, 0x00, 0x3E, 0x6B, 0x4F, 0x6B, 0x3E, 0x00, 0x1C, 0x3E, 0x7C, 0x3E, 0x1C, 0x00, 0x18, 0x3C, 0x7E, 0x3C, 0x18, 0x00, 0x1C, 0x57, 0x7D, 0x57, 0x1C, 0x00, 0x1C, 0x5E, 0x7F, 0x5E, 0x1C, 0x00, 0x00, 0x18, 0x3C, 0x18, 0x00, 0x00, 0xFF, 0xE7, 0xC3, 0xE7, 0xFF, 0x00, 0x00, 0x18, 0x24, 0x18, 0x00, 0x00, 0xFF, 0xE7, 0xDB, 0xE7, 0xFF, 0x00, 0x30, 0x48, 0x3A, 0x06, 0x0E, 0x00, 0x26, 0x29, 0x79, 0x29, 0x26, 0x00, 0x40, 0x7F, 0x05, 0x05, 0x07, 0x00, 0x40, 0x7F, 0x05, 0x25, 0x3F, 0x00, 0x5A, 0x3C, 0xE7, 0x3C, 0x5A, 0x00, 0x7F, 0x3E, 0x1C, 0x1C, 0x08, 0x00, 0x08, 0x1C, 0x1C, 0x3E, 0x7F, 0x00, 0x14, 0x22, 0x7F, 0x22, 0x14, 0x00, 0x5F, 0x5F, 0x00, 0x5F, 0x5F, 0x00, 0x06, 0x09, 0x7F, 0x01, 0x7F, 0x00, 0x00, 0x66, 0x89, 0x95, 0x6A, 0x00, 0x60, 0x60, 0x60, 0x60, 0x60, 0x00, 0x94, 0xA2, 0xFF, 0xA2, 0x94, 0x00, 0x08, 0x04, 0x7E, 0x04, 0x08, 0x00, + 0x10, 0x20, 0x7E, 0x20, 0x10, 0x00, 0x08, 0x08, 0x2A, 0x1C, 0x08, 0x00, 0x08, 0x1C, 0x2A, 0x08, 0x08, 0x00, 0x1E, 0x10, 0x10, 0x10, 0x10, 0x00, 0x0C, 0x1E, 0x0C, 0x1E, 0x0C, 0x00, 0x30, 0x38, 0x3E, 0x38, 0x30, 0x00, 0x06, 0x0E, 0x3E, 0x0E, 0x06, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x5F, 0x00, 0x00, 0x00, 0x00, 0x07, 0x00, 0x07, 0x00, 0x00, 0x14, 0x7F, 0x14, 0x7F, 0x14, 0x00, 0x24, 0x2A, 0x7F, 0x2A, 0x12, 0x00, 0x23, 0x13, 0x08, 0x64, 0x62, 0x00, 0x36, 0x49, 0x56, 0x20, 0x50, 0x00, 0x00, 0x08, 0x07, 0x03, 0x00, 0x00, 0x00, 0x1C, 0x22, 0x41, 0x00, 0x00, 0x00, 0x41, 0x22, 0x1C, 0x00, 0x00, 0x2A, 0x1C, 0x7F, 0x1C, 0x2A, 0x00, 0x08, 0x08, 0x3E, 0x08, 0x08, 0x00, 0x00, 0x80, 0x70, 0x30, 0x00, 0x00, 0x08, 0x08, 0x08, 0x08, 0x08, 0x00, 0x00, 0x00, 0x60, 0x60, 0x00, 0x00, 0x20, 0x10, 0x08, 0x04, 0x02, 0x00, 0x3E, 0x51, 0x49, 0x45, 0x3E, 0x00, 0x00, 0x42, 0x7F, 0x40, 0x00, 0x00, + 0x72, 0x49, 0x49, 0x49, 0x46, 0x00, 0x21, 0x41, 0x49, 0x4D, 0x33, 0x00, 0x18, 0x14, 0x12, 0x7F, 0x10, 0x00, 0x27, 0x45, 0x45, 0x45, 0x39, 0x00, 0x3C, 0x4A, 0x49, 0x49, 0x31, 0x00, 0x41, 0x21, 0x11, 0x09, 0x07, 0x00, 0x36, 0x49, 0x49, 0x49, 0x36, 0x00, 0x46, 0x49, 0x49, 0x29, 0x1E, 0x00, 0x00, 0x00, 0x14, 0x00, 0x00, 0x00, 0x00, 0x40, 0x34, 0x00, 0x00, 0x00, 0x00, 0x08, 0x14, 0x22, 0x41, 0x00, 0x14, 0x14, 0x14, 0x14, 0x14, 0x00, 0x00, 0x41, 0x22, 0x14, 0x08, 0x00, 0x02, 0x01, 0x59, 0x09, 0x06, 0x00, 0x3E, 0x41, 0x5D, 0x59, 0x4E, 0x00, 0x7C, 0x12, 0x11, 0x12, 0x7C, 0x00, 0x7F, 0x49, 0x49, 0x49, 0x36, 0x00, 0x3E, 0x41, 0x41, 0x41, 0x22, 0x00, 0x7F, 0x41, 0x41, 0x41, 0x3E, 0x00, 0x7F, 0x49, 0x49, 0x49, 0x41, 0x00, 0x7F, 0x09, 0x09, 0x09, 0x01, 0x00, 0x3E, 0x41, 0x41, 0x51, 0x73, 0x00, 0x7F, 0x08, 0x08, 0x08, 0x7F, 0x00, 0x00, 0x41, 0x7F, 0x41, 0x00, 0x00, 0x20, 0x40, 0x41, 0x3F, 0x01, 0x00, + 0x7F, 0x08, 0x14, 0x22, 0x41, 0x00, 0x7F, 0x40, 0x40, 0x40, 0x40, 0x00, 0x7F, 0x02, 0x1C, 0x02, 0x7F, 0x00, 0x7F, 0x04, 0x08, 0x10, 0x7F, 0x00, 0x3E, 0x41, 0x41, 0x41, 0x3E, 0x00, 0x7F, 0x09, 0x09, 0x09, 0x06, 0x00, 0x3E, 0x41, 0x51, 0x21, 0x5E, 0x00, 0x7F, 0x09, 0x19, 0x29, 0x46, 0x00, 0x26, 0x49, 0x49, 0x49, 0x32, 0x00, 0x03, 0x01, 0x7F, 0x01, 0x03, 0x00, 0x3F, 0x40, 0x40, 0x40, 0x3F, 0x00, 0x1F, 0x20, 0x40, 0x20, 0x1F, 0x00, 0x3F, 0x40, 0x38, 0x40, 0x3F, 0x00, 0x63, 0x14, 0x08, 0x14, 0x63, 0x00, 0x03, 0x04, 0x78, 0x04, 0x03, 0x00, 0x61, 0x59, 0x49, 0x4D, 0x43, 0x00, 0x00, 0x7F, 0x41, 0x41, 0x41, 0x00, 0x02, 0x04, 0x08, 0x10, 0x20, 0x00, 0x00, 0x41, 0x41, 0x41, 0x7F, 0x00, 0x04, 0x02, 0x01, 0x02, 0x04, 0x00, 0x40, 0x40, 0x40, 0x40, 0x40, 0x00, 0x00, 0x03, 0x07, 0x08, 0x00, 0x00, 0x20, 0x54, 0x54, 0x78, 0x40, 0x00, 0x7F, 0x28, 0x44, 0x44, 0x38, 0x00, 0x38, 0x44, 0x44, 0x44, 0x28, 0x00, + 0x38, 0x44, 0x44, 0x28, 0x7F, 0x00, 0x38, 0x54, 0x54, 0x54, 0x18, 0x00, 0x00, 0x08, 0x7E, 0x09, 0x02, 0x00, 0x18, 0x24, 0x24, 0x1C, 0x78, 0x00, 0x7F, 0x08, 0x04, 0x04, 0x78, 0x00, 0x00, 0x44, 0x7D, 0x40, 0x00, 0x00, 0x20, 0x40, 0x40, 0x3D, 0x00, 0x00, 0x7F, 0x10, 0x28, 0x44, 0x00, 0x00, 0x00, 0x41, 0x7F, 0x40, 0x00, 0x00, 0x7C, 0x04, 0x78, 0x04, 0x78, 0x00, 0x7C, 0x08, 0x04, 0x04, 0x78, 0x00, 0x38, 0x44, 0x44, 0x44, 0x38, 0x00, 0x7C, 0x18, 0x24, 0x24, 0x18, 0x00, 0x18, 0x24, 0x24, 0x18, 0x7C, 0x00, 0x7C, 0x08, 0x04, 0x04, 0x08, 0x00, 0x48, 0x54, 0x54, 0x54, 0x24, 0x00, 0x04, 0x04, 0x3F, 0x44, 0x24, 0x00, 0x3C, 0x40, 0x40, 0x20, 0x7C, 0x00, 0x1C, 0x20, 0x40, 0x20, 0x1C, 0x00, 0x3C, 0x40, 0x30, 0x40, 0x3C, 0x00, 0x44, 0x28, 0x10, 0x28, 0x44, 0x00, 0x4C, 0x90, 0x90, 0x90, 0x7C, 0x00, 0x44, 0x64, 0x54, 0x4C, 0x44, 0x00, 0x00, 0x08, 0x36, 0x41, 0x00, 0x00, 0x00, 0x00, 0x77, 0x00, 0x00, 0x00, + 0x00, 0x41, 0x36, 0x08, 0x00, 0x00, 0x02, 0x01, 0x02, 0x04, 0x02, 0x00, 0x3C, 0x26, 0x23, 0x26, 0x3C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xC0, 0x60, 0x30, 0x18, 0xF8, 0x18, 0x00, 0xC0, 0x70, 0x1C, 0x06, 0x03, 0x01, 0x01, 0x01, 0x01, 0x01, 0xC3, 0x7E, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x08, 0x08, 0x00, 0x00, 0x08, 0x08, 0x08, 0x00, 0x1C, 0x22, 0x41, 0x41, 0x41, 0x22, 0x1C, 0x00, 0x08, 0x08, 0x08, 0x00, 0x00, 0x08, 0x08, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0x20, 0xF8, 0x0C, 0x04, 0xE7, 0xE4, 0xE4, 0x07, 0x04, 0xE4, 0xE7, 0xE4, 0x04, 0x07, 0xE4, 0xE4, 0xE7, 0x04, 0x0C, 0xF8, 0x20, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1C, 0x1C, 0x3E, 0x7F, 0x7F, 0x00, 0x14, 0x08, 0x14, 0x00, 0x00, 0x00, 0x1C, 0x1C, 0x3E, 0x7F, 0x7F, 0x00, 0x22, 0x1C, 0x41, 0x3E, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x30, 0x18, 0x0C, 0x06, 0x0C, 0x18, 0x30, 0x77, 0x77, 0x77, 0x00, 0x77, 0x77, + 0x77, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3E, 0x4A, 0x4F, 0x4A, 0x3E, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x60, 0x70, 0x3E, 0x1F, 0x19, 0x18, 0x0C, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xF8, 0x0C, 0x06, 0x07, 0xFC, 0x00, 0xFF, 0x01, 0x00, 0x00, 0x00, 0xFF, 0x80, 0xFF, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xF0, 0x1C, 0x07, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1C, 0x22, 0x41, 0x00, 0x00, 0x1C, 0x22, 0x00, 0x00, 0x1C, 0x3E, 0x7F, 0x63, 0x41, 0x22, 0x1C, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x49, 0x49, 0xFF, 0x00, 0x00, 0x0F, 0x1F, 0x3F, 0x38, 0x30, 0xFF, 0xFF, 0xFF, 0x30, 0x38, 0x3F, 0x1F, 0x0F, 0x00, 0x00, 0xFF, 0x49, 0x49, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x40, 0x60, 0x6A, 0x64, 0x6A, 0x60, 0x40, 0x00, 0x00, 0x00, 0x00, 0x04, 0x42, 0x69, 0x65, 0x65, 0x65, 0x69, 0x42, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x06, 0x06, 0x0C, 0x18, 0x30, 0x66, 0x66, 0x66, 0x00, 0x00, 0xFC, 0x24, 0x24, 0xFC, 0x24, 0x24, 0xFC, 0x24, 0x24, 0xFC, 0x24, 0x24, 0xFC, 0x24, 0x24, 0xFC, 0x24, 0x24, 0xFC, 0x24, 0x24, 0xFC, 0x24, 0x24, 0xFC, 0x00, 0x00, 0x00, 0xF0, 0x90, 0x90, 0xF0, 0x90, 0x90, 0xF0, 0x98, 0x9C, 0xF2, 0x22, 0x21, 0xE1, 0x01, 0x01, 0x01, 0xF1, 0x91, 0x91, 0xFA, 0x4C, 0x4C, 0xF8, 0x48, 0x48, 0xF8, 0x48, 0x48, 0xF8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x0E, 0x18, 0x30, 0x21, 0x21, 0x31, 0x18, 0x10, 0x30, 0x20, 0x60, 0x41, 0x60, 0x20, 0x30, 0x18, 0x30, 0x60, 0x40, 0x40, 0x47, 0x4C, 0x48, 0x68, 0x38, 0x1C, 0x0F, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x1C, 0x22, 0x41, 0x63, 0x7F, 0x3E, 0x1C, + 0x00, 0x00, 0x22, 0x1C, 0x00, 0x00, 0x41, 0x22, 0x1C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x02, 0x0F, 0x18, 0x10, 0x70, 0x10, 0x10, 0x70, 0x10, 0x13, 0x73, 0x13, 0x10, 0x70, 0x10, 0x10, 0x70, 0x10, 0x18, 0x0F, 0x02, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1C, 0x22, 0xC9, 0xD1, 0xC9, 0x22, 0x1C, 0x00, 0x00, 0x00, 0x00, 0x10, 0x02, 0x38, 0xFC, 0xED, 0xFC, 0x38, 0x02, 0x10, 0x00, 0x00, 0x08, 0x0C, 0x7E, 0x7F, 0x7E, 0x0C, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0F, 0x09, 0x09, 0x09, 0x0F, 0x09, 0x09, 0x0F, 0x09, 0x09, 0x09, 0x09, 0x09, 0x09, 0x09, 0x09, 0x09, 0x0F, 0x09, 0x09, 0x0F, 0x09, 0x09, 0x09, 0x0F, 0x00, 0x00, 0x00, 0x07, 0x04, 0x04, 0x07, 0x04, 0x04, 0x07, 0x04, 0x04, 0x0F, 0x09, 0x09, 0x0F, 0x00, 0x00, 0x00, 0x07, 0x04, 0x04, 0x07, 0x02, 0x02, 0x03, 0x02, 0x02, 0x03, 0x02, 0x02, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +}; diff --git a/waffle/raw.py b/waffle/raw.py new file mode 100644 index 0000000..08ed06f --- /dev/null +++ b/waffle/raw.py @@ -0,0 +1,47 @@ +import hid +import sys +import psutil +import math +import time +import datetime + +vendor_id = 0x6A73 +product_id = 0x6B62 +usage_page = 0xFF60 +usage = 0x61 + + +def get_raw_hid_interface(): + device_interfaces = hid.enumerate(vendor_id, product_id) + raw_hid_interfaces = [i for i in device_interfaces if i['usage_page'] == usage_page and i['usage'] == usage] + if len(raw_hid_interfaces) == 0: + return None + interface = hid.Device(path=raw_hid_interfaces[0]['path']) + return interface + + +def send_packet(data): + interface = get_raw_hid_interface() + if interface is None: + print("no device found") + sys.exit(1) + request_data = [0x00] * 33 #hidapi doesn't send first byte to host + request_data[1:len(data) + 1] = data + request_packet = bytes(request_data) + try: + interface.write(request_packet) + finally: + interface.close() + + +if __name__ == "__main__": + while True: + time.sleep(30) + cpu_temp = psutil.sensors_temperatures()["gigabyte_wmi"][2] + cur_hour = datetime.datetime.now().strftime("%H") + cur_minute = datetime.datetime.now().strftime("%M") + send_packet([ + math.trunc(cpu_temp.current), + int(cur_hour), + int(cur_minute) + ]) diff --git a/waffle/rle.c b/waffle/rle.c new file mode 100644 index 0000000..5dd7044 --- /dev/null +++ b/waffle/rle.c @@ -0,0 +1,76 @@ +// Copyright 2022 jack (@waffle87) +// SPDX-License-Identifier: GPL-2.0-or-later +#include <stdio.h> +#define FRAME_SIZE 650 + +void test_decode(unsigned char *rle, size_t rleN, const unsigned char *orig, size_t n) { + int cursor = 0, bytes = (unsigned char)rle[0]; + unsigned char i = 1; + while (i < bytes) { + unsigned char count = rle[i]; + i++; + if ((count & 0x80) == 0) { + unsigned char value = rle[i]; + i++; + for (int reps = 0; reps < count; reps++) { + if (orig[cursor != value]) + printf("error at byte %d\n", cursor); + cursor++; + } + } else { + count &= ~(0x80); + for (int dups = 0; dups < count; dups++) { + unsigned char value = rle[i]; + i++; + if (orig[cursor] != value) + printf("error at byte %d\n", cursor); + cursor++; + } + } + } +} + +int encode(unsigned char *output, const unsigned char *array, size_t n) { + size_t rleSize = 1, idx = 0; + while (idx < n) { + if (idx < n - 3 && array[idx] != array[idx + 1] && array[idx + 1] != array[idx + 2]) { + unsigned char count = 1; + while (count < 126 && idx + count < n - 3 && array[idx + count] != array[idx + count + 1]) + count++; + output[rleSize++] = count | (0x80); + for (int i = 0; i < count; i++) + output[rleSize++] = array[idx + i]; + idx += count; + } else { + unsigned char count = 1; + while (count < 126 && idx + count < n && array[idx] == array[idx + count]) + count++; + output[rleSize++] = count; + output[rleSize++] = array[idx]; + idx += count; + } + } + output[0] = rleSize; + test_decode(output, rleSize, array, n); + return rleSize; +} + +void print_array(unsigned char *array, int n) { + printf("{"); + for (int i = 0; i < n; i++) { + if (i == 0) + printf("%u", array[i]); + else + printf(", %u", array[i]); + } + printf("}"); +} + +int main() { + char output[128 * 32]; + int size = encode(output, frame[0], FRAME_SIZE); + printf("static const unsigned char PROGMEM prep[][%d] = {", size); + print_array(output, size); + printf("};\n"); + size = 0; +} diff --git a/waffle/rules.mk b/waffle/rules.mk new file mode 100644 index 0000000..5adb7aa --- /dev/null +++ b/waffle/rules.mk @@ -0,0 +1,39 @@ +BOOTMAGIC_ENABLE = yes +EXTRAKEY_ENABLE = yes +NRKO_ENABLE = yes +COMBO_ENABLE = yes +CAPS_WORD_ENABLE = yes +AUTOCORRECT_ENABLE = yes +TOP_SYMBOLS = yes +LTO_ENABLE = yes +TAP_DANCE_ENABLE = yes +UNICODE_COMMON = yes +MOUSEKEY_ENABLE = yes +MAGIC_ENABLE = no +CONSOLE_ENABLE = no +COMMAND_ENABLE = no +DEBOUNCE_TYPE = asym_eager_defer_pk + +SRC += waffle.c tapping.c + +ifeq ($(strip $(OLED_ENABLE)), yes) + SRC += oled.c + WPM_ENABLE = yes +endif + +ifeq ($(strip $(RGB_MATRIX_ENABLE)), yes) + SRC += color.c +endif + +ifeq ($(strip $(UNICODE_COMMON)), yes) + SRC += unicode.c +endif + +ifeq ($(PLATFORM), CHIBIOS) + RANDWORD = yes + EXTRAFLAGS = -O3 +endif + +ifeq ($(strip $(RANDWORD)), yes) + OPT_DEFS += -DRANDWORD +endif diff --git a/waffle/tapping.c b/waffle/tapping.c new file mode 100644 index 0000000..7ef50df --- /dev/null +++ b/waffle/tapping.c @@ -0,0 +1,172 @@ +// Copyright 2022 jack (@waffle87) +// SPDX-License-Identifier: GPL-2.0-or-later +#include "waffle.h" +#include "secrets.h" +#ifdef RANDWORD +#include "users/ridingqwerty/dict.h" +uint16_t word; +#endif + +#define INTERCEPT_MOD_TAP(mod, keycode) \ +case mod(keycode): \ + if (record->tap.count && record->event.pressed) { \ + tap_code16(keycode); \ + return false; \ + } \ + break; \ + +uint16_t get_tapping_term(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + case LWRSPC: + case ESCLWR: + return TAPPING_TERM - 20; + case LINKS: + case PNP: + case TD(QUOT_DQUO): + case TD(EM_DASH): + case TD(CBRKT): + case TD(BRKT): + case TD(BSLS_PIPE): + return TAPPING_TERM + 60; + default: + return TAPPING_TERM; + } +} + +void td_reset(qk_tap_dance_state_t *state, void *user_data) { + clear_keyboard(); + layer_clear(); +} + +void qmk_dance(qk_tap_dance_state_t *state, void *user_data) { + if (state->count == 1) { + tap_code16(C(KC_T)); + send_string(qmkstr); + tap_code(KC_ENT); + } else { + tap_code16(C(KC_T)); + send_string(confstr); + tap_code(KC_ENT); + } +} + +void dash_dance(qk_tap_dance_state_t *state, void *user_data) { + if (state->count == 1) + tap_code(KC_MINS); +#ifdef UNICODE_COMMON_ENABLE + else + register_unicode(0x2014); //— +#endif +} + +void curly_bracket_dance(qk_tap_dance_state_t *state, void *user_data) { + if (state->count == 1) + tap_code16(KC_LCBR); + else + tap_code16(KC_RCBR); +} + +void bracket_dance(qk_tap_dance_state_t *state, void *user_data) { + if (state->count == 1) + tap_code(KC_LBRC); + else + tap_code(KC_RBRC); +} + +void bsls_pipe_dance(qk_tap_dance_state_t *state, void *user_data) { + if (state->count == 1) + tap_code(KC_BSLS); + else + tap_code16(KC_PIPE); +} + +void quot_dquo_dance(qk_tap_dance_state_t *state, void *user_data) { + if (state->count == 1) + tap_code(KC_QUOT); + else + tap_code16(KC_DQUO); +} + +void zero_dance(qk_tap_dance_state_t *state, void *user_data) { + if (state->count == 1) + tap_code(KC_0); +#ifdef UNICODE_COMMON_ENABLE + else + register_unicode(0x00B0); //° +#endif +} + +void media_dance(qk_tap_dance_state_t *state, void *user_data) { + switch (state->count) { + case 1: + tap_code(KC_MPLY); + break; + case 2: + tap_code(KC_MNXT); + break; + case 3: + tap_code(KC_MPRV); + break; + } +} + +void clipst_search_dance(qk_tap_dance_state_t *state, void *user_data) { + if (state->pressed && !state->interrupted) + layer_on(_RAISE); + else if (state->count == 1) + tap_code16(C(S(KC_V))); + else if (state->count == 2) + tap_code16(C(S(KC_F))); +} + +qk_tap_dance_action_t tap_dance_actions[] = { + [QMK_LINKS] = ACTION_TAP_DANCE_FN(qmk_dance), + [EM_DASH] = ACTION_TAP_DANCE_FN(dash_dance), + [CBRKT] = ACTION_TAP_DANCE_FN(curly_bracket_dance), + [BRKT] = ACTION_TAP_DANCE_FN(bracket_dance), + [BSLS_PIPE] = ACTION_TAP_DANCE_FN(bsls_pipe_dance), + [QUOT_DQUO] = ACTION_TAP_DANCE_FN(quot_dquo_dance), + [DEG_0] = ACTION_TAP_DANCE_FN(zero_dance), + [PLY_NXT_PRV] = ACTION_TAP_DANCE_FN(media_dance), + [CLIPST_RAISE] = ACTION_TAP_DANCE_FN_ADVANCED(NULL, clipst_search_dance, td_reset) +}; + + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + if (!(process_record_keymap(keycode, record) +#ifdef UNICODE_COMMON_ENABLE + && process_record_unicode(keycode, record) +#endif + && true)) + return false; +#ifdef OLED_ENABLE + if (record->event.pressed) { + oled_timer_reset(); + add_keylog(keycode); + } +#endif + switch (keycode) { + case UPDIR: + if (record->event.pressed) + SEND_STRING("../"); + break; + INTERCEPT_MOD_TAP(LALT_T, KC_EXLM) + INTERCEPT_MOD_TAP(LGUI_T, KC_AT) + INTERCEPT_MOD_TAP(LCTL_T, KC_HASH) + INTERCEPT_MOD_TAP(LSFT_T, KC_DLR) + INTERCEPT_MOD_TAP(RSFT_T, KC_AMPR) + INTERCEPT_MOD_TAP(RCTL_T, KC_ASTR) + INTERCEPT_MOD_TAP(RGUI_T, KC_LPRN) + INTERCEPT_MOD_TAP(RALT_T, KC_RPRN) + case RWORD: +#ifdef RANDWORD + word = rand() % NUMBER_OF_WORDS; + if (record->event.pressed) { + send_string(dict[word]); + tap_code(KC_SPC); + } +#endif + break; + } + return process_record_keymap(keycode, record); +} diff --git a/waffle/unicode.c b/waffle/unicode.c new file mode 100644 index 0000000..e831883 --- /dev/null +++ b/waffle/unicode.c @@ -0,0 +1,263 @@ +// Copyright 2022 jack (@waffle87) +// SPDX-License-Identifier: GPL-2.0-or-later +#include "waffle.h" + +uint8_t typing_mode = NOMODE; +typedef uint32_t (*translator_function_t)(bool is_shifted, uint32_t keycode); + +void tap_unicode_glyph_nomods(uint32_t glyph) { + uint8_t temp_mod = get_mods(); + clear_mods(); + register_unicode(glyph); + set_mods(temp_mod); +} + +void tap_code16_nomods(uint16_t kc) { + uint8_t temp_mod = get_mods(); + clear_mods(); + tap_code16(kc); + set_mods(temp_mod); +} + +#define DEFINE_UNICODE_RANGE_TRANSLATOR(translator_name, lower_alpha, \ + upper_alpha, zero_glyph, number_one, \ + space_glyph) \ + static inline uint32_t translator_name(bool is_shifted, uint32_t keycode) { \ + switch (keycode) { \ + case KC_A ... KC_Z: \ + return (is_shifted ? upper_alpha : lower_alpha) + keycode - KC_A; \ + case KC_0: \ + return zero_glyph; \ + case KC_1 ... KC_9: \ + return (number_one + keycode - KC_1); \ + case KC_SPACE: \ + return space_glyph; \ + } \ + return keycode; \ + } + +#define DEFINE_UNICODE_LUT_TRANSLATOR(translator_name, ...) \ + static inline uint32_t translator_name(bool is_shifted, uint32_t keycode) { \ + static const uint32_t translation[] = {__VA_ARGS__}; \ + uint32_t ret = keycode; \ + if ((keycode - KC_A) < (sizeof(translation) / sizeof(uint32_t))) { \ + ret = translation[keycode - KC_A]; \ + } \ + return ret; \ + } + +bool process_record_glyph_replacement(uint16_t keycode, keyrecord_t *record, translator_function_t translator) { + uint8_t temp_mod = get_mods(); + bool is_shifted = (temp_mod) & MOD_MASK_SHIFT; + if (((temp_mod) & (MOD_MASK_CTRL | MOD_MASK_ALT | MOD_MASK_GUI)) == 0) { + if (KC_A <= keycode && keycode <= KC_Z) { + if (record->event.pressed) + tap_unicode_glyph_nomods(translator(is_shifted, keycode)); + return false; + } else if (KC_1 <= keycode && keycode <= KC_0) { + if (is_shifted) + return process_record_keymap(keycode, record); + if (record->event.pressed) + register_unicode(translator(is_shifted, keycode)); + return false; + } else if (keycode == KC_SPACE) { + if (record->event.pressed) + register_unicode(translator(is_shifted, keycode)); + return false; + } + } + return true; +} + +DEFINE_UNICODE_RANGE_TRANSLATOR(unicode_range_translator_wide, 0xFF41, 0xFF21, 0xFF10, 0xFF11, 0x2003); +DEFINE_UNICODE_RANGE_TRANSLATOR(unicode_range_translator_script, 0x1D4EA, 0x1D4D0, 0x1D7CE, 0x1D7C1, 0x2002); +DEFINE_UNICODE_RANGE_TRANSLATOR(unicode_range_translator_boxes, 0x1F170, 0x1F170, '0', '1', 0x2002); +DEFINE_UNICODE_RANGE_TRANSLATOR(unicode_range_translator_regional, 0x1F1E6, 0x1F1E6, '0', '1', 0x2003); + +DEFINE_UNICODE_LUT_TRANSLATOR(unicode_lut_translator_aussie, + 0x0250, // a + 'q', // b + 0x0254, // c + 'p', // d + 0x01DD, // e + 0x025F, // f + 0x0183, // g + 0x0265, // h + 0x1D09, // i + 0x027E, // j + 0x029E, // k + 'l', // l + 0x026F, // m + 'u', // n + 'o', // o + 'd', // p + 'b', // q + 0x0279, // r + 's', // s + 0x0287, // t + 'n', // u + 0x028C, // v + 0x028D, // w + 0x2717, // x + 0x028E, // y + 'z', // z + 0x0269, // 1 + 0x3139, // 2 + 0x0190, // 3 + 0x3123, // 4 + 0x03DB, // 5 + '9', // 6 + 0x3125, // 7 + '8', // 8 + '6', // 9 + '0' // 0 +); + +DEFINE_UNICODE_LUT_TRANSLATOR(unicode_lut_translator_super, + 0x1D43, // a + 0x1D47, // b + 0x1D9C, // c + 0x1D48, // d + 0x1D49, // e + 0x1DA0, // f + 0x1D4D, // g + 0x02B0, // h + 0x2071, // i + 0x02B2, // j + 0x1D4F, // k + 0x02E1, // l + 0x1D50, // m + 0x207F, // n + 0x1D52, // o + 0x1D56, // p + 0x06F9, // q + 0x02B3, // r + 0x02E2, // s + 0x1D57, // t + 0x1D58, // u + 0x1D5B, // v + 0x02B7, // w + 0x02E3, // x + 0x02B8, // y + 0x1DBB, // z + 0x00B9, // 1 + 0x00B2, // 2 + 0x00B3, // 3 + 0x2074, // 4 + 0x2075, // 5 + 0x2076, // 6 + 0x2077, // 7 + 0x2078, // 8 + 0x2079, // 9 + 0x2070 // 0 +); + +bool process_record_aussie(uint16_t keycode, keyrecord_t *record) { + bool is_shifted = (get_mods()) & MOD_MASK_SHIFT; + if ((KC_A <= keycode) && (keycode <= KC_0)) { + if (record->event.pressed) { + if (!process_record_glyph_replacement(keycode, record, unicode_lut_translator_aussie)) { + tap_code16_nomods(KC_LEFT); + return false; + } + } + } else if (record->event.pressed && keycode == KC_SPACE) { + tap_code16_nomods(KC_SPACE); + tap_code16_nomods(KC_LEFT); + return false; + } else if (record->event.pressed && keycode == KC_ENTER) { + tap_code16_nomods(KC_END); + tap_code16_nomods(KC_ENTER); + return false; + } else if (record->event.pressed && keycode == KC_HOME) { + tap_code16_nomods(KC_END); + return false; + } else if (record->event.pressed && keycode == KC_END) { + tap_code16_nomods(KC_HOME); + return false; + } else if (record->event.pressed && keycode == KC_BSPC) { + tap_code16_nomods(KC_DELT); + return false; + } else if (record->event.pressed && keycode == KC_DELT) { + tap_code16_nomods(KC_BSPC); + return false; + } else if (record->event.pressed && keycode == KC_QUOT) { + tap_unicode_glyph_nomods(is_shifted ? 0x201E : 0x201A); + tap_code16_nomods(KC_LEFT); + return false; + } else if (record->event.pressed && keycode == KC_COMMA) { + tap_unicode_glyph_nomods(is_shifted ? '<' : 0x2018); + tap_code16_nomods(KC_LEFT); + return false; + } else if (record->event.pressed && keycode == KC_DOT) { + tap_unicode_glyph_nomods(is_shifted ? '>' : 0x02D9); + tap_code16_nomods(KC_LEFT); + return false; + } else if (record->event.pressed && keycode == KC_SLASH) { + tap_unicode_glyph_nomods(is_shifted ? 0x00BF : '/'); + tap_code16_nomods(KC_LEFT); + return false; + } + return true; +} + +bool process_record_zalgo(uint16_t keycode, keyrecord_t *record) { + if ((KC_A <= keycode) && (keycode <= KC_0)) { + if (record->event.pressed) { + tap_code16_nomods(keycode); + int num = (rand() % (8 + 1 - 2)) + 2; + for (int i = 0; i < num; i++) { + uint16_t hex = (rand() % (0x036F + 1 - 0x0300)) + 0x0300; + register_unicode(hex); + } + return false; + } + } + return true; +} + +bool process_record_unicode(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + case TABLE1: + if (record->event.pressed) { send_unicode_string("┬──┬ ノ( ゜-゜ノ)"); } break; + case TABLE2: + if (record->event.pressed) { send_unicode_string("(╯°□°)╯︵┻━┻"); } break; + case KC_NOMODE ... KC_SUPER: + if (record->event.pressed) { + if (typing_mode != keycode - KC_NOMODE) + typing_mode = keycode - KC_NOMODE; + else + typing_mode = NOMODE; + } + break; + } + if (((get_mods()) & ~MOD_MASK_SHIFT) != 0) + return true; + if (((keycode >= QK_MOD_TAP && keycode <= QK_MOD_TAP_MAX) || (keycode >= QK_LAYER_TAP && keycode <= QK_LAYER_TAP_MAX)) && record->tap.count) + keycode &= 0xFF; + if (typing_mode == WIDE) { + if (((KC_A <= keycode) && (keycode <= KC_0)) || keycode == KC_SPACE) + return process_record_glyph_replacement(keycode, record, unicode_range_translator_wide); + } else if (typing_mode == SCRIPT) { + if (((KC_A <= keycode) && (keycode <= KC_0)) || keycode == KC_SPACE) + return process_record_glyph_replacement(keycode, record, unicode_range_translator_script); + } else if (typing_mode == BLOCKS) { + if (((KC_A <= keycode) && (keycode <= KC_0)) || keycode == KC_SPACE) + return process_record_glyph_replacement(keycode, record, unicode_range_translator_boxes); + } else if (typing_mode == REGIONAL) { + if (((KC_A <= keycode) && (keycode <= KC_0)) || keycode == KC_SPACE) { + if (!process_record_glyph_replacement(keycode, record, unicode_range_translator_regional)) { + wait_us(500); + tap_unicode_glyph_nomods(0x200C); + return false; + } + } + } else if (typing_mode == SUPER) { + if (((KC_A <= keycode) && (keycode <= KC_0))) + return process_record_glyph_replacement(keycode, record, unicode_lut_translator_super); + } else if (typing_mode == AUSSIE) + return process_record_aussie(keycode, record); + else if (typing_mode == ZALGO) + return process_record_zalgo(keycode, record); + return true; +} diff --git a/waffle/waffle.c b/waffle/waffle.c new file mode 100644 index 0000000..40fca48 --- /dev/null +++ b/waffle/waffle.c @@ -0,0 +1,144 @@ +// Copyright 2022 jack (@waffle87) +// SPDX-License-Identifier: GPL-2.0-or-later +#include "waffle.h" +#include "combos.h" + +#ifdef RAW_ENABLE +void raw_hid_receive(uint8_t *data, uint8_t length) { + user_state.cpu_temp = data[0]; + user_state.hour = data[1]; + user_state.min = data[2]; +} +#endif + +#if defined(SPLIT_KEYBOARD) && defined(OLED_ENABLE) +#include "transactions.h" +extern char keylog_str[5]; +void keylogger_sync(uint8_t initiator2target_buffer_size, const void *initiator2target_buffer, uint8_t target2initiator_buffer_size, void *target2initiator_buffer) { + if (initiator2target_buffer_size == 5) + memcpy(&keylog_str, initiator2target_buffer, initiator2target_buffer_size); +} + +__attribute__ ((weak)) void housekeeping_task_user(void) { + if (is_keyboard_master()) { + static uint32_t last_sync; + bool needs_sync = false; + static char tmp_keylog[5] = {0}; + if (memcmp(&keylog_str, &tmp_keylog, 5)) { + needs_sync = true; + memcpy(&tmp_keylog, &keylog_str, 5); + } + if (timer_elapsed32(last_sync) > 250) + needs_sync = true; + if (needs_sync) { + if (transaction_rpc_send(RPC_ID_USER_KEYLOG_STR, 5, &keylog_str)) + last_sync = timer_read32(); + } + } +} +#endif + +void matrix_io_delay(void) { + __asm__ volatile("nop\nnop\nnop\n"); +} + +__attribute__ ((weak)) bool process_record_keymap(uint16_t keycode, keyrecord_t *record) { return true; } +__attribute__ ((weak)) void keyboard_post_init_user(void) { +#if defined(SPLIT_KEYBOARD) && defined(OLED_ENABLE) + transaction_register_rpc(RPC_ID_USER_KEYLOG_STR, keylogger_sync); +#endif +#ifdef RGBLIGHT_ENABLE + rgblight_enable_noeeprom(); + rgblight_sethsv_noeeprom(HSV_CYAN); + rgblight_mode_noeeprom(RGBLIGHT_MODE_STATIC_LIGHT); +#endif +#ifdef CONSOLE_ENABLE + debug_keyboard = true; + debug_enable = true; + debug_matrix = true; + debug_mouse = true; +#endif +#ifdef AUTOCORRECT_ENABLE + if (!autocorrect_is_enabled()) + autocorrect_enable(); +#endif +} + +#if !defined (ENCODER_MAP_ENABLE) && defined (ENCODER_ENABLE) +bool encoder_update_user(uint8_t index, bool clockwise) { + if (index == 0) { + switch (get_highest_layer(layer_state)) { + case _LOWER: +#if defined (RGBLIGHT_ENABLE) || defined (RGB_MATRIX_ENABLE) + clockwise ? rgblight_increase_hue() : rgblight_decrease_hue(); +#endif + break; + default: + clockwise ? tap_code_delay(KC_VOLU, 20) : tap_code_delay(KC_VOLD, 20); + } + } else if (index == 1) { + switch (get_highest_layer(layer_state)) { + case _LOWER: +#if defined (RGBLIGHT_ENABLE) || defined (RGB_MATRIX_ENABLE) + clockwise ? rgblight_increase_sat() : rgblight_decrease_sat(); +#endif + break; + default: + clockwise ? tap_code(KC_MNXT) : tap_code(KC_MPRV); + } + } + return false; +} +#endif + +#ifdef POINTING_DEVICE_DRIVER_pimoroni_trackball +uint8_t red = 255, green = 0, blue = 0; + +void trackball_hue(void) { + if (red != 255 && green != 255 && blue != 255) red = 255; + if (red == 255 && green < 255 && blue == 0) green += 15; + else if (green == 255 && blue == 0 && red > 0) red -= 15; + else if (red == 0 && blue < 255 && green == 255 ) blue += 15; + else if (blue == 255 && green > 0 && red == 0) green -= 15; + else if (green == 0 && blue == 255 && red < 255) red += 15; + else if (green == 0 && blue > 0 && red == 255) blue -= 15; + pimoroni_trackball_set_rgbw(red, green, blue, 0); +} +#endif + +#ifdef POINTING_DEVICE_ENABLE +static bool scrolling = false; +layer_state_t layer_state_set_user(layer_state_t state) { + switch (get_highest_layer(state)) { + case _LOWER: + scrolling = true; +#ifdef POINTING_DEVICE_DRIVER_pimoroni_trackball + pimoroni_trackball_set_cpi(0.1); +#else + pointing_device_set_cpi(64); +#endif + break; + default: + if (scrolling) { + scrolling = false; +#ifdef POINTING_DEVICE_DRIVER_pimoroni_trackball + pimoroni_trackball_set_cpi(1); +#else + pointing_device_set_cpi(1024); +#endif + } + break; + } + return state; +} + +report_mouse_t pointing_device_task_user(report_mouse_t mouse_report) { + if (scrolling) { + mouse_report.h = mouse_report.x; + mouse_report.v = -mouse_report.y; + mouse_report.x = 0; + mouse_report.y = 0; + } + return mouse_report; +} +#endif diff --git a/waffle/waffle.h b/waffle/waffle.h new file mode 100644 index 0000000..b6226e7 --- /dev/null +++ b/waffle/waffle.h @@ -0,0 +1,103 @@ +// Copyright 2022 jack (@waffle87) +// SPDX-License-Identifier: GPL-2.0-or-later +#pragma once +#include QMK_KEYBOARD_H +#ifdef OLED_ENABLE +#include "oled.h" +#endif + +#ifdef RAW_ENABLE +#pragma message "check other device's vid/pid" +typedef struct { + uint8_t cpu_temp; + uint8_t hour; + uint8_t min; +} user_config; +user_config user_state; +#endif + +bool process_record_keymap(uint16_t keycode, keyrecord_t *record); + +enum layers { + _BASE, + _ADJUST, + _LOWER, + _RAISE +}; + +enum tapdances { + QMK_LINKS, + EM_DASH, + CBRKT, + BRKT, + BSLS_PIPE, + QUOT_DQUO, + DEG_0, + PLY_NXT_PRV, + CLIPST_RAISE +}; + + +enum custom_keycodes { + UPDIR = SAFE_RANGE, + TABLE1, + TABLE2, + KC_NOMODE, + KC_WIDE, + KC_SCRIPT, + KC_BLOCKS, + KC_REGIONAL, + KC_AUSSIE, + KC_ZALGO, + KC_SUPER, + RWORD, + NEW_SAFE_RANGE +}; + +#ifdef UNICODE_COMMON_ENABLE +bool process_record_unicode(uint16_t keycode, keyrecord_t *record); + +enum unicode_mode { + NOMODE, + WIDE, + SCRIPT, + BLOCKS, + REGIONAL, + AUSSIE, + ZALGO, + SUPER +}; +#endif + +#define DEG0 TD(DEG_0) +#define LINKS TD(QMK_LINKS) +#define PNP TD(PLY_NXT_PRV) +#define PSTRSE TD(CLIPST_RAISE) +#define H_S UC(0x262D) //☭ +#define STAR UC(0x2605) //★ +#define ESCLWR LT(_LOWER, KC_ESC) +#define LWRSPC LT(_LOWER, KC_SPC) +#define RSEBSP LT(_RAISE, KC_BSPC) +#define HRML(k1,k2,k3,k4) LALT_T(k1),LGUI_T(k2),LCTL_T(k3),LSFT_T(k4) +#define HRMR(k1,k2,k3,k4) RSFT_T(k1),RCTL_T(k2),RGUI_T(k3),RALT_T(k4) + +#define ___BASE1___ KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P +#define ___BASE2___ HRML(KC_A, KC_S, KC_D, KC_F), KC_G, KC_H, HRMR(KC_J, KC_K, KC_L, KC_SCLN) +#define ___BASE3___ KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH +#define ___BASE4___ UPDIR, ESCLWR, KC_SPC, KC_BSPC, PSTRSE, PNP + +#define ___LOWER1___ KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, DEG0 +#define ___LOWER2___ HRML(KC_EXLM, KC_AT, KC_HASH, KC_DLR), KC_PERC, KC_CIRC, HRMR(KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN) +#define ___LOWER3___ KC_VOLD, KC_TAB, KC_CAPS, KC_TILD, KC_GRV, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT, KC_VOLU +#define ___LOWER4___ KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS + +#define ___RAISE1___ RGB_TOG, RGB_MOD, RGB_HUI, RGB_SAI, RGB_VAI, KC_NOMODE, KC_SCRIPT, KC_BLOCKS, KC_REGIONAL, QK_MAKE +#define ___RAISE2___ CK_TOGG, RGB_RMOD, RGB_HUD, RGB_SAD, RGB_VAD, KC_WIDE, KC_AUSSIE, KC_ZALGO, KC_SUPER, QK_BOOT +#define ___RAISE3___ KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10 +#define ___RAISE4___ KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS + +#define LAYOUT_waffle_60_ts(...) LAYOUT_60_ansi_tsangan(__VA_ARGS__) +#define LAYOUT_stack_of_waffles(...) LAYOUT_stack(__VA_ARGS__) +#define LAYOUT_waffle_3x6(...) LAYOUT_split_3x6_3(__VA_ARGS__) +#define LAYOUT_waffle_3x5(...) LAYOUT_split_3x5_3(__VA_ARGS__) +#define LAYOUT_waffle(...) LAYOUT(__VA_ARGS__) |