1
0
Fork 0

[Keymap] Drashna's Improve OLEDs and custom Split code (#14063)

* Fill the oleds with right mods

* Enable double mods on x32 oleds

* Disable forced NKRO

* Make oleds fancy only on good MCUs

* Overhaul oled display

* Further enhance oled, with kitty!

* Final oled form

* Not working transport

* Transport id of woring

* Add acceleration

* fix button placement for accel macro

* Fix accelartion location and behavior

* Remove OLED sync code

* Fix alignment issue

* Remove audio hack

* Fix up zima keymap

* Add matrix slave scan function and cleanup drashna.h

* Clean up user space

* Allow userspace sync to be disable-able

* Fix weird issue with audio

* Fix alignment issue with user split sync

* Disable second rgb matrix task

* Disable additional animations

* Change dynamic keymap settings

* Hacky fix for borked corne

* Add Blackpill (F411) support to tractyl manuform

* remove manual via eeprom reset

* Remove all references to rgblight twinkle

* Fix issues with config processing
This commit is contained in:
Drashna Jaelre 2021-08-21 13:34:44 -07:00 committed by GitHub
parent da1c011afc
commit 58a5030661
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
42 changed files with 936 additions and 521 deletions

View file

@ -17,6 +17,11 @@
#pragma once #pragma once
#include "tractyl_manuform.h" #include "tractyl_manuform.h"
#if defined(KEYBOARD_handwired_tractyl_manuform_5x6_right_f411)
# include "f411.h"
#elif defined(KEYBOARD_handwired_tractyl_manuform_5x6_right_teensy2pp)
# include "teensy2pp.h"
#endif
#include "quantum.h" #include "quantum.h"
#define ___ KC_NO #define ___ KC_NO

View file

@ -22,38 +22,14 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#define PRODUCT_ID 0x3536 #define PRODUCT_ID 0x3536
#define DEVICE_VER 0x0001 #define DEVICE_VER 0x0001
#define PRODUCT Tractyl Manuform(5x6)
/* key matrix size */ /* key matrix size */
// Rows are doubled-up // Rows are doubled-up
#define MATRIX_ROWS 12 #define MATRIX_ROWS 12
#define MATRIX_COLS 6 #define MATRIX_COLS 6
// wiring of each half
#define MATRIX_COL_PINS \
{ C0, C1, C2, C3, C4, C5 }
#define MATRIX_ROW_PINS \
{ F7, F6, F5, F4, F3, F2 }
#define DIODE_DIRECTION COL2ROW #define DIODE_DIRECTION COL2ROW
// WS2812 RGB LED strip input and number of LEDs
#define RGB_DI_PIN E7
#define RGBLED_NUM 20
#define RGBLIGHT_SPLIT
#define RGBLED_SPLIT \
{ 10, 10 }
#define RGBLIGHT_SLEEP
// #define RGBW
#define RGBLIGHT_LIMIT_VAL 100
/* define if matrix has ghost */
//#define MATRIX_HAS_GHOST
/* number of backlight levels */
// #define BACKLIGHT_LEVELS 3
#define DEBUG_LED_PIN D6
#define ROTATIONAL_TRANSFORM_ANGLE -25 #define ROTATIONAL_TRANSFORM_ANGLE -25
/* Bootmagic Lite key configuration */ /* Bootmagic Lite key configuration */
@ -62,22 +38,9 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#define BOOTMAGIC_LITE_ROW_RIGHT 6 #define BOOTMAGIC_LITE_ROW_RIGHT 6
#define BOOTMAGIC_LITE_COLUMN_RIGHT 5 #define BOOTMAGIC_LITE_COLUMN_RIGHT 5
#define AUDIO_PIN C6
#define AUDIO_PIN_ALT B7
#define DYNAMIC_KEYMAP_LAYER_COUNT 16 #define DYNAMIC_KEYMAP_LAYER_COUNT 16
#define LAYER_STATE_16BIT #define LAYER_STATE_16BIT
/* serial.c configuration for split keyboard */
#define SOFT_SERIAL_PIN D2
#define EE_HANDS
#define ENCODERS_PAD_A \
{ D5 }
#define ENCODERS_PAD_B \
{ D4 }
#define ENCODER_RESOLUTION 4
/* Set 0 if debouncing isn't needed */ /* Set 0 if debouncing isn't needed */
#define DEBOUNCE 5 #define DEBOUNCE 5
@ -89,7 +52,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#define NO_ACTION_FUNCTION #define NO_ACTION_FUNCTION
#define SERIAL_USE_MULTI_TRANSACTION #define SERIAL_USE_MULTI_TRANSACTION
#define SPLIT_TRANSACTION_IDS_KB RPC_ID_STATE_SYNC, RPC_ID_SLAVE_STATE #define SPLIT_TRANSACTION_IDS_KB RPC_ID_KB_CONFIG_SYNC, RPC_ID_POINTER_STATE_SYNC
/* PMW3360 Settings */ /* PMW3360 Settings */
#define PMW3360_CS_PIN B0 #define PMW3360_CS_PIN B0

View file

@ -0,0 +1,38 @@
/* Copyright 2020 QMK
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
/*
* This file was auto-generated by:
* `qmk chibios-confmigrate -i keyboards/handwired/onekey/blackpill_f411/chconf.h -r platforms/chibios/common/configs/chconf.h`
*/
#pragma once
#define CH_CFG_ST_FREQUENCY 10000
#define CH_CFG_FACTORY_OBJECTS_REGISTRY TRUE
#define CH_CFG_FACTORY_GENERIC_BUFFERS TRUE
#define CH_CFG_FACTORY_SEMAPHORES TRUE
#define CH_CFG_FACTORY_MAILBOXES TRUE
#define CH_CFG_FACTORY_OBJ_FIFOS TRUE
#define CH_CFG_FACTORY_PIPES TRUE
#include_next <chconf.h>

View file

@ -0,0 +1,98 @@
/*
Copyright 2012 Jun Wako <wakojun@gmail.com>
Copyright 2015 Jack Humbert
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#pragma once
#define PRODUCT Tractyl Manuform(5x6) BlackPill
// wiring of each half
#define MATRIX_COL_PINS \
{ A15, B3, B4, B5, B6, B7 }
#define MATRIX_ROW_PINS \
{ B12, B13, B14, B15, A8, A9 }
#define DIODE_DIRECTION COL2ROW
#define USB_VBUS_PIN B10
#define SPLIT_HAND_PIN C14 // high = left, low = right
// WS2812 RGB LED strip input and number of LEDs
#define RGB_DI_PIN A1
#define WS2812_PWM_DRIVER PWMD5 // default: PWMD2
#define WS2812_PWM_CHANNEL 2 // default: 2
#define WS2812_PWM_PAL_MODE 2 // Pin "alternate function", see the respective datasheet for the appropriate values for your MCU. default: 2
//#define WS2812_PWM_COMPLEMENTARY_OUTPUT // Define for a complementary timer output (TIMx_CHyN); omit for a normal timer output (TIMx_CHy).
#define WS2812_DMA_STREAM STM32_DMA1_STREAM0 // DMA Stream for TIMx_UP, see the respective reference manual for the appropriate values for your MCU.
#define WS2812_DMA_CHANNEL 6 // DMA Channel for TIMx_UP, see the respective reference manual for the appropriate values for your MCU.
#define RGBLED_NUM 20
#define RGBLIGHT_SPLIT
#define RGBLED_SPLIT \
{ 10, 10 }
#define DEBUG_LED_PIN C13
#define AUDIO_PIN A0
#define AUDIO_PWM_DRIVER PWMD5
#define AUDIO_PWM_CHANNEL 1
#define AUDIO_STATE_TIMER GPTD4
/* serial.c configuration for split keyboard */
#define SERIAL_USART_FULL_DUPLEX // Enable full duplex operation mode.
#define SERIAL_USART_TX_PIN A2
#define SERIAL_USART_RX_PIN A3
#define SERIAL_USART_DRIVER SD2
#define SERIAL_USART_TX_PAL_MODE 7 // Pin "alternate function", see the respective datasheet for the appropriate values for your MCU. default: 7
#define SERIAL_USART_RX_PAL_MODE 7 // Pin "alternate function", see the respective datasheet for the appropriate values for your MCU. default: 7
#define SERIAL_USART_TIMEOUT 100 // USART driver timeout. default 100
#undef SOFT_SERIAL_PIN
// #define EE_HANDS
#define I2C_DRIVER I2CD1
#define I2C1_SCL_BANK GPIOB
#define I2C1_SDA_BANK GPIOB
#define I2C1_SCL 8
#define I2C1_SDA 9
#define I2C1_SCL_PAL_MODE 4
#define I2C1_SDA_PAL_MODE 4
#define I2C1_CLOCK_SPEED 400000
#define ENCODERS_PAD_A \
{ B1 }
#define ENCODERS_PAD_B \
{ B2 }
#define SPI_DRIVER SPID1
#define SPI_SCK_PIN A5
#define SPI_SCK_PAL_MODE 5
#define SPI_MOSI_PIN A7
#define SPI_MOSI_PAL_MODE 5
#define SPI_MISO_PIN A6
#define SPI_MISO_PAL_MODE 5
#define EXTERNAL_EEPROM_SPI_SLAVE_SELECT_PIN A4
// #define EXTERNAL_EEPROM_SPI_CLOCK_DIVISOR 64
// #define EXTERNAL_EEPROM_BYTE_COUNT 8196
// #define EXTERNAL_EEPROM_PAGE_SIZE 32
// #define EXTERNAL_EEPROM_ADDRESS_SIZE 2
#define DEBUG_EEPROM_OUTPUT
#define PMW_CS_PIN B0
#define SPI_MODE 0
#define SPI_DIVISOR 64

View file

@ -0,0 +1,26 @@
/* Copyright 2020 Christopher Courtney, aka Drashna Jael're (@drashna) <drashna@live.com>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include "f411.h"
void matrix_init_sub_kb(void) { setPinInputHigh(A0); }
void matrix_scan_sub_kb(void) {
if (!readPin(A0)) {
reset_keyboard();
}
matrix_scan_user();
}

View file

@ -0,0 +1,19 @@
/* Copyright 2020 Christopher Courtney, aka Drashna Jael're (@drashna) <drashna@live.com>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#pragma once
#include "5x6_right.h"

View file

@ -0,0 +1,25 @@
/* Copyright 2020 Nick Brassel (tzarc)
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
#pragma once
// #define HAL_USE_DAC TRUE
#define HAL_USE_PWM TRUE
#define HAL_USE_SERIAL TRUE
#define HAL_USE_I2C TRUE
#define HAL_USE_SPI TRUE
#define HAL_USE_GPT TRUE
#include_next <halconf.h>

View file

@ -0,0 +1,34 @@
/* Copyright 2020 Nick Brassel (tzarc)
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
#pragma once
#include_next "mcuconf.h"
#undef STM32_I2C_USE_I2C1
#define STM32_I2C_USE_I2C1 TRUE
#undef STM32_PWM_USE_TIM5
#define STM32_PWM_USE_TIM5 TRUE
#undef STM32_GPT_USE_TIM4
#define STM32_GPT_USE_TIM4 TRUE
#undef STM32_SPI_USE_SPI1
#define STM32_SPI_USE_SPI1 TRUE
#undef STM32_SERIAL_USE_USART2
#define STM32_SERIAL_USE_USART2 TRUE

View file

@ -0,0 +1,13 @@
# MCU name
MCU = STM32F411
# Bootloader selection
BOOTLOADER = stm32-dfu
KEYBOARD_SHARED_EP = yes
CONSOLE_ENABLE = yes
EEPROM_DRIVER = spi
WS2812_DRIVER = pwm
SERIAL_DRIVER = usart
AUDIO_DRIVER = pwm_hardware

View file

@ -16,6 +16,11 @@
#include "drashna.h" #include "drashna.h"
enum tractyl_keycodes {
KC_ACCEL = NEW_SAFE_RANGE,
};
bool enable_acceleration = false;
// clang-format off // clang-format off
#define LAYOUT_5x6_right_wrapper(...) LAYOUT_5x6_right(__VA_ARGS__) #define LAYOUT_5x6_right_wrapper(...) LAYOUT_5x6_right(__VA_ARGS__)
#define LAYOUT_5x6_right_base( \ #define LAYOUT_5x6_right_base( \
@ -66,7 +71,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
_______, _______, _______, _______, _______, _______, KC_BTN7, KC_BTN4, KC_BTN5, KC_BTN8, _______, _______, _______, _______, _______, _______, _______, _______, KC_BTN7, KC_BTN4, KC_BTN5, KC_BTN8, _______, _______,
_______, _______, _______, _______, _______, _______, _______, _______,
_______, _______, KC_BTN3, _______, _______, KC_BTN3,
_______, _______, _______, KC_ACCEL, _______, _______,
_______, _______, _______, _______ _______, _______, _______, _______
), ),
[_GAMEPAD] = LAYOUT_5x6_right( [_GAMEPAD] = LAYOUT_5x6_right(
@ -164,13 +169,17 @@ bool tap_toggling = false;
# define TAP_CHECK TAPPING_TERM # define TAP_CHECK TAPPING_TERM
# endif # endif
void process_mouse_user(report_mouse_t* mouse_report, int16_t x, int16_t y) { void process_mouse_user(report_mouse_t* mouse_report, int8_t x, int8_t y) {
if (x != 0 && y != 0) { if (x != 0 && y != 0) {
mouse_timer = timer_read(); mouse_timer = timer_read();
# ifdef OLED_DRIVER_ENABLE # ifdef OLED_DRIVER_ENABLE
oled_timer = timer_read32(); oled_timer = timer_read32();
# endif # endif
if (timer_elapsed(mouse_debounce_timer) > TAP_CHECK) { if (timer_elapsed(mouse_debounce_timer) > TAP_CHECK) {
if (enable_acceleration) {
x = (x > 0 ? x * x / 16 + x : -x * x / 16 + x);
y = (y > 0 ? y * y / 16 + y : -y * y / 16 + y);
}
mouse_report->x = x; mouse_report->x = x;
mouse_report->y = y; mouse_report->y = y;
if (!layer_state_is(_MOUSE)) { if (!layer_state_is(_MOUSE)) {
@ -222,6 +231,8 @@ bool process_record_keymap(uint16_t keycode, keyrecord_t* record) {
case KC_MS_UP ... KC_MS_WH_RIGHT: case KC_MS_UP ... KC_MS_WH_RIGHT:
record->event.pressed ? mouse_keycode_tracker++ : mouse_keycode_tracker--; record->event.pressed ? mouse_keycode_tracker++ : mouse_keycode_tracker--;
mouse_timer = timer_read(); mouse_timer = timer_read();
case KC_ACCEL:
enable_acceleration = record->event.pressed;
break; break;
default: default:
if (IS_NOEVENT(record->event)) break; if (IS_NOEVENT(record->event)) break;
@ -248,15 +259,146 @@ layer_state_t layer_state_set_keymap(layer_state_t state) {
} }
#endif #endif
void matrix_init_keymap(void) { #ifdef OLED_DRIVER_ENABLE
#ifdef AUDIO_ENABLE // WPM-responsive animation stuff here
extern audio_config_t audio_config; # define SLEEP_FRAMES 2
# define SLEEP_SPEED 10 // below this wpm value your animation will idle
if (!is_keyboard_master()) { # define WAKE_FRAMES 2 // uncomment if >1
audio_stop_all();
audio_config.enable = false; # define KAKI_FRAMES 3
# define KAKI_SPEED 40 // above this wpm value typing animation to triggere
# define RTOGI_FRAMES 2
//#define LTOGI_FRAMES 2
//#define ANIM_FRAME_DURATION 500 // how long each frame lasts in ms
// #define SLEEP_TIMER 60000 // should sleep after this period of 0 wpm, needs fixing
# define ANIM_SIZE 512 // number of bytes in array, minimize for adequate firmware size, max is 1024
uint32_t anim_timer = 0;
uint32_t anim_frame_duration = 500;
uint8_t current_sleep_frame = 0;
uint8_t current_wake_frame = 0; // uncomment if WAKE_FRAMES >1
uint8_t current_kaki_frame = 0;
uint8_t current_rtogi_frame = 0;
// uint8_t current_ltogi_frame = 0;
void render_kitty(void) {
// Images credit j-inc(/James Incandenza) and pixelbenny. Credit to obosob for initial animation approach.
static const char PROGMEM sleep[SLEEP_FRAMES][ANIM_SIZE] = {{
// 'sleep1', 128x32px
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x08, 0xa8, 0x48, 0xa8, 0x18, 0x08, 0x00, 0x00, 0x00, 0x80, 0x80, 0x80, 0x80, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x03, 0x02, 0x02, 0x02, 0x02, 0x02, 0x00, 0x00, 0x80, 0x44, 0x84, 0x06, 0x05, 0x04, 0x80, 0x40, 0x20, 0x10, 0xe0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x20, 0x18, 0x04, 0x04, 0x02, 0x7a, 0x86, 0x01, 0x80, 0x80, 0x01, 0x03, 0x05, 0x07, 0x01, 0x00, 0x00, 0x80, 0x83, 0x45, 0xfa, 0x3c, 0xe0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0x08, 0x10, 0x10, 0x10, 0x10, 0x10, 0x33, 0x24, 0x28, 0x28, 0x29, 0x29, 0x29, 0x3a, 0x18, 0x1c, 0x39, 0x24, 0x24, 0x3a, 0x2d, 0x26, 0x31, 0x1f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
},
{// 'sleep2', 128x32px
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x22, 0x22, 0x3a, 0x2a, 0x26, 0x22, 0x80, 0xc0, 0x80, 0x00, 0x24, 0x34, 0x2c, 0xe4, 0x60, 0x10, 0x70, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x38, 0x04, 0x02, 0x02, 0x01, 0x79, 0x87, 0x01, 0x80, 0x81, 0x83, 0x05, 0x05, 0x03, 0x01, 0x00, 0x00, 0x80, 0x43, 0x05, 0xfa, 0x3c, 0xe0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0x08, 0x10, 0x10, 0x10, 0x10, 0x10, 0x33, 0x24, 0x28, 0x28, 0x28, 0x29, 0x29, 0x3a, 0x18, 0x1c, 0x39, 0x24, 0x24, 0x3a, 0x2d, 0x26, 0x31, 0x1f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}};
static const char PROGMEM wake[WAKE_FRAMES][ANIM_SIZE] = {{
// 'mati2', 128x32px
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x30, 0x08, 0x10, 0x60, 0x80, 0x00, 0x80, 0x60, 0x10, 0x08, 0x30, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7f, 0x80, 0x40, 0x40, 0x5c, 0x00, 0x01, 0x41, 0x01, 0x00, 0x5c, 0x40, 0x40, 0x80, 0x7f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x40, 0x40, 0x80, 0xe1, 0x12, 0x0a, 0x06, 0x00, 0x80, 0x00, 0x06, 0x0a, 0x12, 0xe1, 0x80, 0x40, 0x40, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x1f, 0x14, 0x14, 0x10, 0x10, 0x11, 0x1f, 0x10, 0x10, 0x18, 0x0f, 0x18, 0x10, 0x10, 0x1f, 0x11, 0x10, 0x10, 0x14, 0x14, 0x1f, 0x1c, 0x14, 0x14, 0x14, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
},
{// 'mati3', 128x32px
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x30, 0x08, 0x10, 0x60, 0x80, 0x00, 0x80, 0x60, 0x10, 0x08, 0x30, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7f, 0x90, 0x12, 0x0a, 0x02, 0xf4, 0x09, 0x0d, 0xf1, 0x04, 0x02, 0x0a, 0x12, 0x90, 0x7f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x40, 0x40, 0x80, 0xe1, 0x12, 0x0a, 0x06, 0x01, 0x81, 0x00, 0x06, 0x0a, 0x12, 0xe1, 0x80, 0x40, 0x40, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x1f, 0x14, 0x14, 0x10, 0x10, 0x11, 0x1f, 0x10, 0x10, 0x18, 0x0f, 0x18, 0x10, 0x10, 0x1f, 0x11, 0x10, 0x10, 0x14, 0x14, 0x1f, 0x1c, 0x14, 0x14, 0x14, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}};
static const char PROGMEM kaki[KAKI_FRAMES][ANIM_SIZE] = {{
// 'jare2', 128x32px
0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x40, 0x40, 0x80, 0x80, 0x80, 0x00, 0xfc, 0x84, 0x08, 0x08, 0x10, 0x20, 0x40, 0x40, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x1e, 0x60, 0x80, 0x00, 0x00, 0x91, 0xa1, 0x80, 0x00, 0x00, 0x22, 0x84, 0x40, 0x50, 0x48, 0xc1, 0x3e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x40, 0x41, 0x82, 0xe2, 0x12, 0x0a, 0x06, 0x00, 0x80, 0x88, 0x4f, 0x02, 0x22, 0xe2, 0x9f, 0x40, 0x40, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x1f, 0x14, 0x14, 0x10, 0x10, 0x11, 0x1f, 0x10, 0x10, 0x18, 0x0f, 0x18, 0x14, 0x10, 0x10, 0x10, 0x10, 0x10, 0x14, 0x14, 0x1f, 0x1a, 0x0a, 0x0a, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
},
{
// 'kaki1', 128x32px
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x10, 0x20, 0x20, 0x40, 0x40, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x06, 0x1a, 0x22, 0xc2, 0x04, 0x04, 0x04, 0x07, 0x00, 0xc0, 0x20, 0x10, 0x80, 0x80, 0x01, 0x01, 0x02, 0xfc, 0xfe, 0x02, 0x3c, 0x20, 0x40, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0x0d, 0x8d, 0x55, 0x50, 0x94, 0xf0, 0x10, 0x09, 0x08, 0x00, 0x80, 0x00, 0x06, 0x09, 0x1b, 0xee, 0x00, 0x00, 0x00, 0x00, 0x81, 0xfe, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x1f, 0x14, 0x14, 0x10, 0x10, 0x11, 0x1f, 0x10, 0x10, 0x18, 0x0f, 0x18, 0x10, 0x10, 0x1f, 0x19, 0x18, 0x1c, 0x14, 0x16, 0x15, 0x14, 0x14, 0x14, 0x14, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
},
{// 'kaki2', 128x32px
0x00, 0x00, 0x00, 0x00, 0x80, 0x40, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0x10, 0x20, 0x40, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x0f, 0xf0, 0x00, 0x01, 0x02, 0x04, 0x04, 0x03, 0x80, 0x40, 0x40, 0x20, 0x00, 0x01, 0x02, 0x8c, 0x70, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0x0d, 0x8d, 0x55, 0x50, 0x94, 0xf0, 0x10, 0x0a, 0x0e, 0x1d, 0x95, 0x24, 0x24, 0x27, 0x13, 0xe1, 0x01, 0x01, 0x01, 0x01, 0x02, 0xfc, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x1f, 0x14, 0x14, 0x10, 0x10, 0x11, 0x1f, 0x10, 0x10, 0x18, 0x0f, 0x18, 0x10, 0x10, 0x1f, 0x19, 0x18, 0x1c, 0x14, 0x14, 0x17, 0x14, 0x14, 0x14, 0x14, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}};
static const char PROGMEM rtogi[KAKI_FRAMES][ANIM_SIZE] = {{
// 'rtogi1', 128x32px
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x20, 0x10, 0x10, 0x08, 0x04, 0x02, 0x01, 0x0f, 0x90, 0x10, 0x20, 0xf0, 0xf8, 0xf8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x40, 0x20, 0x10, 0x10, 0x08, 0x08, 0x08, 0x08, 0x48, 0x47, 0x88, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x88, 0xc7, 0xc4, 0x62, 0x23, 0x11, 0x3f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x80, 0x40, 0x20, 0x10, 0x88, 0xcc, 0x43, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0xc0, 0x80, 0x80, 0xc0, 0xe1, 0xfe, 0xb8, 0x88, 0x0c, 0x04, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x01, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x01, 0x06, 0x04, 0x04, 0x04, 0x04, 0x05, 0x04, 0x04, 0x04, 0x07, 0x07, 0x07, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
},
{// 'rtogi2', 128x32px
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x20, 0x10, 0x10, 0x08, 0x04, 0x02, 0x01, 0x1f, 0xa0, 0x20, 0x40, 0x80, 0x00, 0xf0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x40, 0x20, 0x10, 0x10, 0x08, 0x08, 0x08, 0x08, 0x48, 0x47, 0x88, 0x00, 0x00, 0x00, 0x00, 0x24, 0x24, 0x28, 0x6b, 0x40, 0xa0, 0x99, 0x86, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x0f, 0x11, 0x22, 0x44, 0x48, 0x4c, 0x43, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0xc0, 0x80, 0x80, 0xc0, 0xe1, 0xfe, 0xb8, 0x88, 0x0c, 0x04, 0x06, 0x06, 0x06, 0x0e, 0x0e, 0x06, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x01, 0x06, 0x04, 0x04, 0x04, 0x04, 0x05, 0x04, 0x04, 0x04, 0x07, 0x07, 0x07, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}};
// assumes 1 frame prep stage
extern bool swap_hands;
void animation_phase(void) {
if (swap_hands) {
anim_frame_duration = 300;
current_rtogi_frame = (current_rtogi_frame + 1) % RTOGI_FRAMES;
oled_write_raw_P(rtogi[abs((RTOGI_FRAMES - 1) - current_rtogi_frame)], ANIM_SIZE);
} else {
if (get_current_wpm() <= SLEEP_SPEED) {
anim_frame_duration = 500;
current_sleep_frame = (current_sleep_frame + 1) % SLEEP_FRAMES;
oled_write_raw_P(sleep[abs((SLEEP_FRAMES - 1) - current_sleep_frame)], ANIM_SIZE);
}
// if(get_current_wpm() >IDLE_SPEED && get_current_wpm() <TAP_SPEED){
if (get_current_wpm() > SLEEP_SPEED) {
anim_frame_duration = 800;
current_wake_frame = (current_wake_frame + 1) % WAKE_FRAMES;
oled_write_raw_P(wake[abs((WAKE_FRAMES - 1) - current_wake_frame)], ANIM_SIZE);
// oled_write_raw_P(wake[0], ANIM_SIZE); // remove if IDLE_FRAMES >1
}
if (get_current_wpm() >= KAKI_SPEED) {
anim_frame_duration = 500;
current_kaki_frame = (current_kaki_frame + 1) % KAKI_FRAMES;
oled_write_raw_P(kaki[abs((KAKI_FRAMES - 1) - current_kaki_frame)], ANIM_SIZE);
}
}
}
if (get_current_wpm() != 000) {
// if(timer_elapsed32(anim_timer) > ANIM_FRAME_DURATION) {
if (timer_elapsed32(anim_timer) > anim_frame_duration) {
anim_timer = timer_read32();
animation_phase();
}
} else {
// if(timer_elapsed32(anim_timer) > ANIM_FRAME_DURATION) {
if (timer_elapsed32(anim_timer) > anim_frame_duration) {
anim_timer = timer_read32();
animation_phase();
}
} }
#endif
} }
void keyboard_post_init_keymap(void) { matrix_init_keymap(); } void oled_driver_render_logo_left(void) {
render_kitty();
oled_set_cursor(6, 0);
oled_write_P(PSTR(" Tractyl "), true);
oled_set_cursor(6, 1);
oled_write_P(PSTR(" Manuform "), true);
oled_set_cursor(6, 2);
# if defined(WPM_ENABLE)
render_wpm(1);
# endif
oled_set_cursor(6, 3);
# if defined(KEYBOARD_handwired_tractyl_manuform_5x6_right)
render_pointing_dpi_status(0);
# endif
oled_set_cursor(0, 4);
}
#endif

View file

@ -1,9 +1,3 @@
# MCU name
MCU = at90usb1286
# Bootloader selection
BOOTLOADER = halfkay
# Build Options # Build Options
# change yes to no to disable # change yes to no to disable
# #
@ -29,3 +23,5 @@ SPLIT_KEYBOARD = yes
SRC += drivers/sensors/pmw3360.c SRC += drivers/sensors/pmw3360.c
QUANTUM_LIB_SRC += spi_master.c tm_sync.c QUANTUM_LIB_SRC += spi_master.c tm_sync.c
DEFAULT_FOLDER = handwired/tractyl_manuform/5x6_right/teensy2pp

View file

@ -0,0 +1,50 @@
/*
Copyright 2012 Jun Wako <wakojun@gmail.com>
Copyright 2015 Jack Humbert
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#pragma once
#define PRODUCT Tractyl Manuform(5x6) Teensy 2.0 ++
// wiring of each half
#define MATRIX_COL_PINS \
{ C0, C1, C2, C3, C4, C5 }
#define MATRIX_ROW_PINS \
{ F7, F6, F5, F4, F3, F2 }
#define DIODE_DIRECTION COL2ROW
// WS2812 RGB LED strip input and number of LEDs
#define RGB_DI_PIN E7
#define RGBLED_NUM 20
#define RGBLIGHT_SPLIT
#define RGBLED_SPLIT \
{ 10, 10 }
#define DEBUG_LED_PIN D6
#define AUDIO_PIN C6
#define AUDIO_PIN_ALT B7
/* serial.c configuration for split keyboard */
#define SOFT_SERIAL_PIN D2
#define EE_HANDS
#define ENCODERS_PAD_A \
{ D5 }
#define ENCODERS_PAD_B \
{ D4 }

View file

@ -0,0 +1,5 @@
# MCU name
MCU = at90usb1286
# Bootloader selection
BOOTLOADER = halfkay

View file

@ -0,0 +1,19 @@
/* Copyright 2020 Christopher Courtney, aka Drashna Jael're (@drashna) <drashna@live.com>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#pragma once
#include "5x6_right.h"

View file

@ -14,86 +14,59 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>. * along with this program. If not, see <http://www.gnu.org/licenses/>.
*/ */
#ifdef SPLIT_TRANSACTION_IDS_KB #include "tractyl_manuform.h"
#include "transactions.h"
#include <string.h>
#include "drivers/sensors/pmw3360.h"
# include "tractyl_manuform.h" kb_config_data_t kb_config;
# include "transactions.h" kb_pointer_data_t kb_pointer;
# include <string.h>
# include "drivers/sensors/pmw3360.h"
kb_runtime_config_t kb_state; void kb_config_sync_handler(uint8_t initiator2target_buffer_size, const void* initiator2target_buffer, uint8_t target2initiator_buffer_size, void* target2initiator_buffer) {
kb_slave_data_t kb_slave; if (initiator2target_buffer_size == sizeof(kb_config)) {
memcpy(&kb_config, initiator2target_buffer, sizeof(kb_config));
void slave_state_sync(uint8_t initiator2target_buffer_size, const void* initiator2target_buffer, uint8_t target2initiator_buffer_size, void* target2initiator_buffer) {
if (target2initiator_buffer_size == sizeof(kb_slave)) {
memcpy(target2initiator_buffer, &kb_slave, sizeof(kb_slave));
if (kb_slave.mouse_x > 127) {
kb_slave.mouse_x -= 127;
} else if (kb_slave.mouse_x < -127) {
kb_slave.mouse_x += 127;
} else {
kb_slave.mouse_x = 0;
}
if (kb_slave.mouse_y > 127) {
kb_slave.mouse_y -= 127;
} else if (kb_slave.mouse_y < -127) {
kb_slave.mouse_y += 127;
} else {
kb_slave.mouse_y = 0;
} }
}
void kb_pointer_sync_handler(uint8_t initiator2target_buffer_size, const void* initiator2target_buffer, uint8_t target2initiator_buffer_size, void* target2initiator_buffer) {
if (target2initiator_buffer_size == sizeof(kb_pointer)) {
memcpy(target2initiator_buffer, &kb_pointer, sizeof(kb_pointer));
} }
} }
void pointer_state_sync(uint8_t initiator2target_buffer_size, const void* initiator2target_buffer, uint8_t target2initiator_buffer_size, void* target2initiator_buffer) { void keyboard_pre_init_sync(void) {
if (initiator2target_buffer_size == sizeof(kb_state)) { memset(&kb_config, 0, sizeof(kb_config));
memcpy(&kb_state, initiator2target_buffer, sizeof(kb_state)); memset(&kb_pointer, 0, sizeof(kb_pointer));
}
} }
void keyboard_post_init_kb(void) { void keyboard_post_init_kb(void) {
// Register keyboard state sync split transaction // Register keyboard state sync split transaction
transaction_register_rpc(RPC_ID_STATE_SYNC, pointer_state_sync); transaction_register_rpc(RPC_ID_KB_CONFIG_SYNC, kb_config_sync_handler);
transaction_register_rpc(RPC_ID_SLAVE_STATE, slave_state_sync); transaction_register_rpc(RPC_ID_POINTER_STATE_SYNC, kb_pointer_sync_handler);
keyboard_post_init_user(); keyboard_post_init_user();
} }
void kb_state_update(void) { void kb_config_update(void) {
# ifdef POINTING_DEVICE_ENABLE
if (is_keyboard_master()) { if (is_keyboard_master()) {
static uint16_t cpi = 0; static uint16_t cpi = 0;
if (cpi != kb_state.device_cpi) { if (cpi != kb_config.device_cpi) {
cpi = kb_state.device_cpi; cpi = kb_config.device_cpi;
pmw_set_cpi(cpi); pmw_set_cpi(cpi);
} }
} }
# endif
} }
void kb_post_state_update(void) { void kb_config_sync(void) {
# ifdef POINTING_DEVICE_ENABLE
if (is_keyboard_master() && is_keyboard_left()) {
report_mouse_t temp_report = pointing_device_get_report();
temp_report.x = kb_slave.mouse_x;
temp_report.y = kb_slave.mouse_y;
pointing_device_set_report(temp_report);
}
# endif
}
void kb_state_sync(void) {
if (is_keyboard_master()) { if (is_keyboard_master()) {
// Keep track of the last state, so that we can tell if we need to propagate to slave // Keep track of the last state, so that we can tell if we need to propagate to slave
static kb_runtime_config_t last_kb_state; static kb_config_data_t last_kb_config;
static uint32_t last_sync = 0; static uint32_t last_sync = 0;
static uint32_t mouse_sync = 0;
bool needs_sync = false; bool needs_sync = false;
// Check if the state values are different // Check if the state values are different
if (memcmp(&kb_state, &last_kb_state, sizeof(kb_runtime_config_t))) { if (memcmp(&kb_config, &last_kb_config, sizeof(kb_config))) {
needs_sync = true; needs_sync = true;
memcpy(&last_kb_state, &kb_state, sizeof(kb_runtime_config_t)); memcpy(&last_kb_config, &kb_config, sizeof(kb_config));
} }
// Send to slave every 500ms regardless of state change // Send to slave every 500ms regardless of state change
if (timer_elapsed32(last_sync) > 500) { if (timer_elapsed32(last_sync) > 500) {
@ -102,31 +75,45 @@ void kb_state_sync(void) {
// Perform the sync if requested // Perform the sync if requested
if (needs_sync) { if (needs_sync) {
if (transaction_rpc_send(RPC_ID_STATE_SYNC, sizeof(kb_runtime_config_t), &kb_state)) { if (transaction_rpc_send(RPC_ID_KB_CONFIG_SYNC, sizeof(kb_config), &kb_config)) {
last_sync = timer_read32(); last_sync = timer_read32();
} }
} }
}
}
if (is_keyboard_left()) { void kb_pointer_sync(void) {
if (timer_elapsed32(mouse_sync) >= 5) { if (is_keyboard_master() && is_keyboard_left()) {
// always sync slave data, since it may contain device reports. // Keep track of the last state, so that we can tell if we need to propagate to slave
if (transaction_rpc_recv(RPC_ID_SLAVE_STATE, sizeof(kb_slave_data_t), &kb_slave)) { static uint32_t last_sync = 0;
if (kb_slave.mouse_x >= -127 && kb_slave.mouse_x <= 127 && kb_slave.mouse_y >= -127 && kb_slave.mouse_y <= 127) {
mouse_sync = timer_read32(); // Perform the sync if requested
} if (timer_elapsed32(last_sync) >= 5) {
} if (transaction_rpc_recv(RPC_ID_POINTER_STATE_SYNC, sizeof(kb_pointer), &kb_pointer)) {
last_sync = timer_read32();
} }
} }
} }
} }
void housekeeping_task_kb(void) { void housekeeping_task_kb(void) {
// Update kb_state so we can send to slave // Update kb_config so we can send to slave
kb_state_update(); kb_config_update();
// Data sync from master to slave // Data sync from master to slave
kb_state_sync(); kb_config_sync();
kb_pointer_sync();
kb_post_state_update(); }
void kb_pointer_sync_send(int8_t x, int8_t y) {
kb_pointer.mouse_x = x;
kb_pointer.mouse_y = y;
}
kb_pointer_data_t kb_pointer_sync_get(void) { return (kb_pointer_data_t){.mouse_x = kb_pointer.mouse_x, .mouse_y = kb_pointer.mouse_y}; }
void trackball_set_cpi(uint16_t cpi) {
kb_config.device_cpi = cpi;
if (!is_keyboard_left()) {
pmw_set_cpi(cpi);
}
} }
#endif

View file

@ -30,9 +30,6 @@
# define TRACKBALL_DPI_DEFAULT 0 # define TRACKBALL_DPI_DEFAULT 0
#endif #endif
extern kb_runtime_config_t kb_state;
extern kb_slave_data_t kb_slave;
keyboard_config_t keyboard_config; keyboard_config_t keyboard_config;
uint16_t dpi_array[] = TRACKBALL_DPI_OPTIONS; uint16_t dpi_array[] = TRACKBALL_DPI_OPTIONS;
#define DPI_OPTION_SIZE (sizeof(dpi_array) / sizeof(uint16_t)) #define DPI_OPTION_SIZE (sizeof(dpi_array) / sizeof(uint16_t))
@ -40,18 +37,20 @@ uint16_t dpi_array[] = TRACKBALL_DPI_OPTIONS;
bool BurstState = false; // init burst state for Trackball module bool BurstState = false; // init burst state for Trackball module
uint16_t MotionStart = 0; // Timer for accel, 0 is resting state uint16_t MotionStart = 0; // Timer for accel, 0 is resting state
__attribute__((weak)) void process_mouse_user(report_mouse_t* mouse_report, int16_t x, int16_t y) { __attribute__((weak)) void process_mouse_user(report_mouse_t* mouse_report, int8_t x, int8_t y) {
mouse_report->x = x; mouse_report->x = x;
mouse_report->y = y; mouse_report->y = y;
} }
__attribute__((weak)) void process_mouse(report_mouse_t* mouse_report) { __attribute__((weak)) kb_pointer_data_t process_mouse(void) {
kb_pointer_data_t temp_data = {.mouse_x = 0, .mouse_y = 0};
report_pmw_t data = pmw_read_burst(); report_pmw_t data = pmw_read_burst();
if (data.isOnSurface && data.isMotion) { if (data.isOnSurface && data.isMotion) {
// Reset timer if stopped moving // Reset timer if stopped moving
if (!data.isMotion) { if (!data.isMotion) {
if (MotionStart != 0) MotionStart = 0; if (MotionStart != 0) MotionStart = 0;
return; return temp_data;
} }
// Set timer if new motion // Set timer if new motion
@ -78,9 +77,10 @@ __attribute__((weak)) void process_mouse(report_mouse_t* mouse_report) {
if (debug_mouse) dprintf("Cons] X: %d, Y: %d\n", data.dx, data.dy); if (debug_mouse) dprintf("Cons] X: %d, Y: %d\n", data.dx, data.dy);
// dprintf("Elapsed:%u, X: %f Y: %\n", i, pgm_read_byte(firmware_data+i)); // dprintf("Elapsed:%u, X: %f Y: %\n", i, pgm_read_byte(firmware_data+i));
mouse_report->x = -data.dx; temp_data.mouse_x = -data.dx;
mouse_report->y = data.dy; temp_data.mouse_y = data.dy;
} }
return temp_data;
} }
bool process_record_kb(uint16_t keycode, keyrecord_t* record) { bool process_record_kb(uint16_t keycode, keyrecord_t* record) {
@ -118,6 +118,7 @@ bool process_record_kb(uint16_t keycode, keyrecord_t* record) {
return true; return true;
} }
__attribute__((weak)) void keyboard_pre_init_sync(void) {}
// Hardware Setup // Hardware Setup
void keyboard_pre_init_kb(void) { void keyboard_pre_init_kb(void) {
@ -137,6 +138,7 @@ void keyboard_pre_init_kb(void) {
writePin(DEBUG_LED_PIN, debug_enable); writePin(DEBUG_LED_PIN, debug_enable);
#endif #endif
keyboard_pre_init_sync();
keyboard_pre_init_user(); keyboard_pre_init_user();
} }
@ -149,11 +151,22 @@ void pointing_device_init(void) {
trackball_set_cpi(dpi_array[keyboard_config.dpi_config]); trackball_set_cpi(dpi_array[keyboard_config.dpi_config]);
} }
static bool has_report_changed(report_mouse_t new, report_mouse_t old) { return (new.buttons != old.buttons) || (new.x&& new.x != old.x) || (new.y&& new.y != old.y) || (new.h&& new.h != old.h) || (new.v&& new.v != old.v); }
void pointing_device_task(void) { void pointing_device_task(void) {
report_mouse_t mouse_report = pointing_device_get_report(); report_mouse_t mouse_report = pointing_device_get_report();
if (!is_keyboard_left()) { process_mouse(&mouse_report); } kb_pointer_data_t data = {.mouse_x = mouse_report.x, .mouse_y = mouse_report.y};
if (is_keyboard_left()) {
if (is_keyboard_master()) {
data = kb_pointer_sync_get();
process_mouse_user(&mouse_report, data.mouse_x, data.mouse_y);
}
} else {
data = process_mouse();
if (!is_keyboard_master()) {
kb_pointer_sync_send(data.mouse_x, data.mouse_y);
} else {
process_mouse_user(&mouse_report, data.mouse_x, data.mouse_y);
}
}
pointing_device_set_report(mouse_report); pointing_device_set_report(mouse_report);
pointing_device_send(); pointing_device_send();
@ -169,49 +182,18 @@ void eeconfig_init_kb(void) {
eeconfig_init_user(); eeconfig_init_user();
} }
__attribute__((weak)) void matrix_init_sub_kb(void) {}
void matrix_init_kb(void) { void matrix_init_kb(void) {
// is safe to just read DPI setting since matrix init // is safe to just read DPI setting since matrix init
// comes before pointing device init. // comes before pointing device init.
keyboard_config.raw = eeconfig_read_kb(); keyboard_config.raw = eeconfig_read_kb();
if (keyboard_config.dpi_config > DPI_OPTION_SIZE) { eeconfig_init_kb(); } if (keyboard_config.dpi_config > DPI_OPTION_SIZE) { eeconfig_init_kb(); }
matrix_init_sub_kb();
matrix_init_user(); matrix_init_user();
} }
#ifdef POINTING_DEVICE_ENABLE __attribute__((weak)) void matrix_scan_sub_kb(void) {}
void pointing_device_send(void) { void matrix_scan_kb(void) {
static report_mouse_t old_report = {}; matrix_scan_sub_kb();
report_mouse_t mouseReport = pointing_device_get_report(); matrix_scan_user();
if (is_keyboard_master()) {
int8_t x = mouseReport.x, y = mouseReport.y;
mouseReport.x = 0;
mouseReport.y = 0;
process_mouse_user(&mouseReport, x, y);
if (has_report_changed(mouseReport, old_report)) { host_mouse_send(&mouseReport); }
} else {
master_mouse_send(mouseReport.x, mouseReport.y);
}
mouseReport.x = 0;
mouseReport.y = 0;
mouseReport.v = 0;
mouseReport.h = 0;
old_report = mouseReport;
pointing_device_set_report(mouseReport);
} }
#endif
#ifdef POINTING_DEVICE_ENABLE
void master_mouse_send(int8_t x, int8_t y) {
#ifdef SPLIT_TRANSACTION_IDS_KB
kb_slave.mouse_x += x;
kb_slave.mouse_y += y;
#endif
}
void trackball_set_cpi(uint16_t cpi) {
#ifdef SPLIT_TRANSACTION_IDS_KB
kb_state.device_cpi = cpi;
#endif
if (!is_keyboard_left()) {
pmw_set_cpi(cpi);
}
}
#endif

View file

@ -25,9 +25,6 @@
# include "4x6_right.h" # include "4x6_right.h"
#endif #endif
void process_mouse(report_mouse_t* mouse_report);
void process_mouse_user(report_mouse_t* mouse_report, int16_t x, int16_t y);
typedef union { typedef union {
uint32_t raw; uint32_t raw;
struct { struct {
@ -42,14 +39,19 @@ enum ploopy_keycodes {
KEYMAP_SAFE_RANGE, KEYMAP_SAFE_RANGE,
}; };
void master_mouse_send(int8_t x, int8_t y);
void trackball_set_cpi(uint16_t cpi);
typedef struct { typedef struct {
uint16_t device_cpi; uint16_t device_cpi;
} kb_runtime_config_t; } kb_config_data_t;
typedef struct { typedef struct {
int16_t mouse_x; int8_t mouse_x;
int16_t mouse_y; int8_t mouse_y;
} kb_slave_data_t; } kb_pointer_data_t;
kb_pointer_data_t process_mouse(void);
void process_mouse_user(report_mouse_t* mouse_report, int8_t x, int8_t y);
void kb_pointer_sync_send(int8_t x, int8_t y);
kb_pointer_data_t kb_pointer_sync_get(void);
void trackball_set_cpi(uint16_t cpi);
void matrix_init_sub_kb(void);
void matrix_scan_sub_kb(void);

View file

@ -12,7 +12,6 @@ SWAP_HANDS_ENABLE = no
SPACE_CADET_ENABLE = no SPACE_CADET_ENABLE = no
INDICATOR_LIGHTS = no INDICATOR_LIGHTS = no
RGBLIGHT_TWINKLE = no
RGBLIGHT_STARTUP_ANIMATION = no RGBLIGHT_STARTUP_ANIMATION = no
BOOTLOADER = qmk-dfu BOOTLOADER = qmk-dfu

View file

@ -12,7 +12,6 @@ SPACE_CADET_ENABLE = no
NO_SECRETS = yes NO_SECRETS = yes
INDICATOR_LIGHTS = no INDICATOR_LIGHTS = no
RGBLIGHT_TWINKLE = no
LAYOUTS = ortho_5x7 LAYOUTS = ortho_5x7
# SRC := $(filter-out serial.c matrix.c i2c.c split_util.c,$(SRC)) # SRC := $(filter-out serial.c matrix.c i2c.c split_util.c,$(SRC))

View file

@ -10,7 +10,6 @@ NKRO_ENABLE = yes
SPACE_CADET_ENABLE = no SPACE_CADET_ENABLE = no
INDICATOR_LIGHTS = yes INDICATOR_LIGHTS = yes
RGBLIGHT_TWINKLE = no
RGBLIGHT_STARTUP_ANIMATION = yes RGBLIGHT_STARTUP_ANIMATION = yes

View file

@ -30,3 +30,5 @@
// # define OLED_LOGO_CORNE // # define OLED_LOGO_CORNE
// # define OLED_LOGO_GOTHAM // # define OLED_LOGO_GOTHAM
#define OLED_LOGO_SCIFI #define OLED_LOGO_SCIFI
#define ENCODER_RESOLUTION 2

View file

@ -15,7 +15,6 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>. * along with this program. If not, see <http://www.gnu.org/licenses/>.
*/ */
#include QMK_KEYBOARD_H #include QMK_KEYBOARD_H
#include <stdio.h>
#ifdef HAPTIC_ENABLE #ifdef HAPTIC_ENABLE
# include "haptic.h" # include "haptic.h"
@ -90,15 +89,35 @@ void oled_task_user(void) {
oled_scroll_off(); oled_scroll_off();
oled_write_P(PSTR("SplitKB's Zima"), false); oled_write_P(PSTR("SplitKB's Zima"), false);
char layer[2] = {0}; char layer[2] = {0};
snprintf(layer, sizeof(layer), "%d", get_highest_layer(layer_state)); uint8_t n = get_highest_layer(layer_state);
layer[1] = '\0';
layer[0] = '0' + n % 10;
oled_write_P(PSTR(" L:"), false); oled_write_P(PSTR(" L:"), false);
oled_write_ln(layer, false); oled_write_ln(layer, false);
oled_write_ln_P(PSTR("--------------"), false); oled_write_ln_P(PSTR("--------------"), false);
if (rgblight_is_enabled()) { if (rgblight_is_enabled()) {
oled_write_P(PSTR("HSV: "), false); oled_write_P(PSTR("HSV: "), false);
char rgbs[14]; char hsv_char[4];
snprintf(rgbs, sizeof(rgbs), "%3d, %3d, %3d", rgblight_get_hue(), rgblight_get_sat(), rgblight_get_val()); n = rgblight_get_hue();
oled_write_ln(rgbs, false); hsv_char[3] = '\0';
hsv_char[2] = '0' + n % 10;
hsv_char[1] = (n /= 10) % 10 ? '0' + (n) % 10 : (n / 10) % 10 ? '0' : ' ';
hsv_char[0] = n / 10 ? '0' + n / 10 : ' ';
oled_write(hsv_char, false);
oled_write_P(PSTR(", "), false);
n = rgblight_get_sat();
hsv_char[3] = '\0';
hsv_char[2] = '0' + n % 10;
hsv_char[1] = (n /= 10) % 10 ? '0' + (n) % 10 : (n / 10) % 10 ? '0' : ' ';
hsv_char[0] = n / 10 ? '0' + n / 10 : ' ';
oled_write(hsv_char, false);
oled_write_P(PSTR(", "), false);
n = rgblight_get_val();
hsv_char[3] = '\0';
hsv_char[2] = '0' + n % 10;
hsv_char[1] = (n /= 10) % 10 ? '0' + (n) % 10 : (n / 10) % 10 ? '0' : ' ';
hsv_char[0] = n / 10 ? '0' + n / 10 : ' ';
oled_write_ln(hsv_char, false);
} else { } else {
oled_write_ln_P(PSTR("RGB LIGHT DISABLED"), false); oled_write_ln_P(PSTR("RGB LIGHT DISABLED"), false);
} }
@ -125,10 +144,11 @@ bool process_record_user(uint16_t keycode, keyrecord_t* record) {
} }
bool encoder_update_user(uint8_t index, bool clockwise) { bool encoder_update_user(uint8_t index, bool clockwise) {
oled_timer = timer_read32();
if (clockwise) { if (clockwise) {
tap_code16(KC_VOLU); tap_code_delay(KC_VOLU, 10);
} else { } else {
tap_code16(KC_VOLD); tap_code_delay(KC_VOLD, 10);
} }
return true; return false;
} }

View file

@ -7,7 +7,6 @@ SPACE_CADET_ENABLE = no
ifeq ($(strip $(KEYBOARD)), ergodox_ez) ifeq ($(strip $(KEYBOARD)), ergodox_ez)
RGBLIGHT_ENABLE = yes RGBLIGHT_ENABLE = yes
RGB_MATRIX_ENABLE = yes RGB_MATRIX_ENABLE = yes
RGBLIGHT_TWINKLE = no
INDICATOR_LIGHTS = no INDICATOR_LIGHTS = no
RGBLIGHT_STARTUP_ANIMATION = yes RGBLIGHT_STARTUP_ANIMATION = yes
PIMORONI_TRACKBALL_ENABLE = yes PIMORONI_TRACKBALL_ENABLE = yes

View file

@ -28,6 +28,8 @@
# define RGBLIGHT_EFFECT_SNAKE_LENGTH 2 # define RGBLIGHT_EFFECT_SNAKE_LENGTH 2
#endif // RGBLIGHT_ENABLE #endif // RGBLIGHT_ENABLE
#define RGBLIGHT_ALL_ANIMATIONS
#if defined(KEYBOARD_primekb_prime_m) #if defined(KEYBOARD_primekb_prime_m)
# undef PRODUCT # undef PRODUCT
# define PRODUCT Drashna Hacked Prime_M Macro Pad # define PRODUCT Drashna Hacked Prime_M Macro Pad

View file

@ -4,6 +4,5 @@ BACKLIGHT_ENABLE = no
NO_SECRETS = yes NO_SECRETS = yes
BOOTMAGIC_ENABLE = lite # Enable Bootmagic Lite BOOTMAGIC_ENABLE = lite # Enable Bootmagic Lite
INDICATOR_LIGHTS = no INDICATOR_LIGHTS = no
RGBLIGHT_TWINKLE = yes
MAKE_BOOTLOADER = yes MAKE_BOOTLOADER = yes
RGBLIGHT_STARTUP_ANIMATION = yes RGBLIGHT_STARTUP_ANIMATION = yes

View file

@ -75,6 +75,7 @@
# define PRODUCT Drashna Hacked Planck Rev6 # define PRODUCT Drashna Hacked Planck Rev6
# elif defined(KEYBOARD_planck_ez) # elif defined(KEYBOARD_planck_ez)
# define PRODUCT Drashna Hacked Planck EZ # define PRODUCT Drashna Hacked Planck EZ
# define DYNAMIC_KEYMAP_EEPROM_MAX_ADDR 4095
# endif # endif
#endif #endif
#undef NO_USB_STARTUP_CHECK #undef NO_USB_STARTUP_CHECK

View file

@ -11,7 +11,6 @@ ifneq ($(strip $(KEYBOARD)), planck/rev6)
ifeq ($(strip $(LAYOUT_HAS_RGB)), yes) ifeq ($(strip $(LAYOUT_HAS_RGB)), yes)
RGBLIGHT_ENABLE = yes RGBLIGHT_ENABLE = yes
INDICATOR_LIGHTS = yes INDICATOR_LIGHTS = yes
RGBLIGHT_TWINKLE = yes
RGBLIGHT_STARTUP_ANIMATION = yes RGBLIGHT_STARTUP_ANIMATION = yes
endif endif
else else
@ -37,7 +36,6 @@ ifeq ($(strip $(KEYBOARD)), planck/ez)
ENCODER_MAP_ENABLE = yes ENCODER_MAP_ENABLE = yes
RGB_MATRIX_ENABLE = yes RGB_MATRIX_ENABLE = yes
INDICATOR_LIGHTS = yes INDICATOR_LIGHTS = yes
RGBLIGHT_TWINKLE = yes
RGBLIGHT_STARTUP_ANIMATION = yes RGBLIGHT_STARTUP_ANIMATION = yes
CONSOLE_ENABLE = yes CONSOLE_ENABLE = yes
COMMAND_ENABLE = yes COMMAND_ENABLE = yes

View file

@ -12,7 +12,6 @@ ifeq ($(strip $(KEYBOARD)), fractal)
AUDIO_SUPPORTED = yes AUDIO_SUPPORTED = yes
RGBLIGHT_SUPPORTED = yes RGBLIGHT_SUPPORTED = yes
RGBLIGHT_ENABLE = yes RGBLIGHT_ENABLE = yes
RGBLIGHT_TWINKLE = yes
RGBLIGHT_STARTUP_ANIMATION = yes RGBLIGHT_STARTUP_ANIMATION = yes
BOOTLOADER = qmk-dfu BOOTLOADER = qmk-dfu
endif endif

View file

@ -26,6 +26,12 @@ enum crkbd_keycodes { RGBRST = NEW_SAFE_RANGE };
* of use. K## is a placeholder to pass through the individual keycodes * of use. K## is a placeholder to pass through the individual keycodes
*/ */
#ifdef CONVERT_TO_PROTON_C
# define MID_TMB ET_RAIS
#else
# define MID_TMB KC_ENT
#endif
// clang-format off // clang-format off
#define LAYOUT_split_3x6_3_wrapper(...) LAYOUT_split_3x6_3(__VA_ARGS__) #define LAYOUT_split_3x6_3_wrapper(...) LAYOUT_split_3x6_3(__VA_ARGS__)
#define LAYOUT_split_3x6_3_base( \ #define LAYOUT_split_3x6_3_base( \
@ -37,7 +43,7 @@ enum crkbd_keycodes { RGBRST = NEW_SAFE_RANGE };
KC_ESC, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, KC_MINS, \ KC_ESC, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, KC_MINS, \
ALT_T(KC_TAB), K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, RALT_T(K1B), \ ALT_T(KC_TAB), K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, RALT_T(K1B), \
OS_LSFT, CTL_T(K21), K22, K23, K24, K25, K26, K27, K28, K29, RCTL_T(K2A), OS_RSFT, \ OS_LSFT, CTL_T(K21), K22, K23, K24, K25, K26, K27, K28, K29, RCTL_T(K2A), OS_RSFT, \
OS_LGUI, KC_SPC, BK_LWER, DL_RAIS, KC_ENT, OS_RGUI \ OS_LGUI, KC_SPC, BK_LWER, DL_RAIS, MID_TMB, OS_RGUI \
) )
#define LAYOUT_base_wrapper(...) LAYOUT_split_3x6_3_base(__VA_ARGS__) #define LAYOUT_base_wrapper(...) LAYOUT_split_3x6_3_base(__VA_ARGS__)
@ -104,12 +110,6 @@ uint16_t get_tapping_term(uint16_t keycode, keyrecord_t *record) {
} }
#endif #endif
void matrix_slave_scan_user(void) {
#ifdef RGB_MATRIX_ENABLE
rgb_matrix_task();
#endif
}
#ifdef RGB_MATRIX_ENABLE #ifdef RGB_MATRIX_ENABLE
void suspend_power_down_keymap(void) { rgb_matrix_set_suspend_state(true); } void suspend_power_down_keymap(void) { rgb_matrix_set_suspend_state(true); }

View file

@ -30,8 +30,15 @@
# ifdef WPM_ENABLE # ifdef WPM_ENABLE
# define SPLIT_WPM_ENABLE # define SPLIT_WPM_ENABLE
# endif # endif
# ifdef OLED_DRIVER_ENABLE
# define SPLIT_OLED_ENABLE
# endif
# if defined(__AVR__) && !defined(SELECT_SOFT_SERIAL_SPEED)
# define SELECT_SOFT_SERIAL_SPEED 1 # define SELECT_SOFT_SERIAL_SPEED 1
# endif
# ifdef CUSTOM_SPLIT_TRANSPORT_SYNC
# define SPLIT_TRANSACTION_IDS_USER RPC_ID_USER_STATE_SYNC, RPC_ID_USER_KEYMAP_SYNC, RPC_ID_USER_CONFIG_SYNC # define SPLIT_TRANSACTION_IDS_USER RPC_ID_USER_STATE_SYNC, RPC_ID_USER_KEYMAP_SYNC, RPC_ID_USER_CONFIG_SYNC
# endif
#endif #endif
#ifdef AUDIO_ENABLE #ifdef AUDIO_ENABLE
@ -65,23 +72,6 @@
#ifdef RGBLIGHT_ENABLE #ifdef RGBLIGHT_ENABLE
# define RGBLIGHT_SLEEP # define RGBLIGHT_SLEEP
# undef RGBLIGHT_ANIMATIONS
# if defined(__AVR__) && !defined(__AVR_AT90USB1286__)
# define RGBLIGHT_EFFECT_BREATHING
# define RGBLIGHT_EFFECT_SNAKE
# define RGBLIGHT_EFFECT_KNIGHT
# else
# define RGBLIGHT_EFFECT_BREATHING
# define RGBLIGHT_EFFECT_RAINBOW_MOOD
# define RGBLIGHT_EFFECT_RAINBOW_SWIRL
# define RGBLIGHT_EFFECT_SNAKE
# define RGBLIGHT_EFFECT_KNIGHT
// # define RGBLIGHT_EFFECT_CHRISTMAS
// # define RGBLIGHT_EFFECT_STATIC_GRADIENT
// # define RGBLIGHT_EFFECT_RGB_TEST
// # define RGBLIGHT_EFFECT_ALTERNATING
# define RGBLIGHT_EFFECT_TWINKLE
# endif
# define RGBLIGHT_EFFECT_TWINKLE_LIFE 250 # define RGBLIGHT_EFFECT_TWINKLE_LIFE 250
# define RGBLIGHT_EFFECT_TWINKLE_PROBABILITY 1 / 24 # define RGBLIGHT_EFFECT_TWINKLE_PROBABILITY 1 / 24
#endif // RGBLIGHT_ENABLE #endif // RGBLIGHT_ENABLE
@ -107,8 +97,10 @@
# define DISABLE_RGB_MATRIX_CYCLE_ALL # define DISABLE_RGB_MATRIX_CYCLE_ALL
# define DISABLE_RGB_MATRIX_CYCLE_LEFT_RIGHT # define DISABLE_RGB_MATRIX_CYCLE_LEFT_RIGHT
# define DISABLE_RGB_MATRIX_CYCLE_UP_DOWN # define DISABLE_RGB_MATRIX_CYCLE_UP_DOWN
// # define DISABLE_RGB_MATRIX_CYCLE_OUT_IN # if defined(SPLIT_KEYBOARD) || defined(KEYBOARD_ergodox_ez) || defined(KEYBOARD_moonlander)
# define DISABLE_RGB_MATRIX_CYCLE_OUT_IN
// # define DISABLE_RGB_MATRIX_CYCLE_OUT_IN_DUAL // # define DISABLE_RGB_MATRIX_CYCLE_OUT_IN_DUAL
# endif
# define DISABLE_RGB_MATRIX_RAINBOW_MOVING_CHEVRON # define DISABLE_RGB_MATRIX_RAINBOW_MOVING_CHEVRON
# define DISABLE_RGB_MATRIX_DUAL_BEACON # define DISABLE_RGB_MATRIX_DUAL_BEACON
# define DISABLE_RGB_MATRIX_CYCLE_PINWHEEL # define DISABLE_RGB_MATRIX_CYCLE_PINWHEEL
@ -117,6 +109,12 @@
# define DISABLE_RGB_MATRIX_RAINBOW_PINWHEELS # define DISABLE_RGB_MATRIX_RAINBOW_PINWHEELS
# define DISABLE_RGB_MATRIX_RAINDROPS # define DISABLE_RGB_MATRIX_RAINDROPS
# define DISABLE_RGB_MATRIX_JELLYBEAN_RAINDROPS # define DISABLE_RGB_MATRIX_JELLYBEAN_RAINDROPS
# define DISABLE_RGB_MATRIX_HUE_BREATHING
# define DISABLE_RGB_MATRIX_HUE_PENDULUM
# define DISABLE_RGB_MATRIX_HUE_WAVE
# define DISABLE_RGB_MATRIX_PIXEL_RAIN
# define DISABLE_RGB_MATRIX_PIXEL_FLOW
# define DISABLE_RGB_MATRIX_PIXEL_FRACTAL
// # define DISABLE_RGB_MATRIX_TYPING_HEATMAP // # define DISABLE_RGB_MATRIX_TYPING_HEATMAP
# define DISABLE_RGB_MATRIX_DIGITAL_RAIN # define DISABLE_RGB_MATRIX_DIGITAL_RAIN
# define DISABLE_RGB_MATRIX_SOLID_REACTIVE # define DISABLE_RGB_MATRIX_SOLID_REACTIVE
@ -132,6 +130,14 @@
# define DISABLE_RGB_MATRIX_SOLID_SPLASH # define DISABLE_RGB_MATRIX_SOLID_SPLASH
# define DISABLE_RGB_MATRIX_SOLID_MULTISPLASH # define DISABLE_RGB_MATRIX_SOLID_MULTISPLASH
# endif // AVR # endif // AVR
# ifndef RGB_MATRIX_REST_MODE
# if defined(SPLIT_KEYBOARD) || defined(KEYBOARD_ergodox_ez) || defined(KEYBOARD_moonlander)
# define RGB_MATRIX_REST_MODE RGB_MATRIX_CYCLE_OUT_IN_DUAL
# else
# define RGB_MATRIX_REST_MODE RGB_MATRIX_CYCLE_OUT_IN
# endif
# endif
# define RGB_MATRIX_STARTUP_MODE RGB_MATRIX_REST_MODE
#endif // RGB_MATRIX_ENABLE #endif // RGB_MATRIX_ENABLE
#ifdef OLED_DRIVER_ENABLE #ifdef OLED_DRIVER_ENABLE
@ -182,8 +188,6 @@
# define TAPPING_TERM_PER_KEY # define TAPPING_TERM_PER_KEY
#endif #endif
#define FORCE_NKRO
#ifndef TAPPING_TOGGLE #ifndef TAPPING_TOGGLE
# define TAPPING_TOGGLE 1 # define TAPPING_TOGGLE 1
#endif #endif
@ -209,7 +213,12 @@
# undef LOCKING_RESYNC_ENABLE # undef LOCKING_RESYNC_ENABLE
#endif #endif
#define LAYER_STATE_16BIT #if !defined(LAYER_STATE_16BIT) && !defined(LAYER_STATE_8BIT) && !defined(LAYER_STATE_32BIT)
# define LAYER_STATE_16BIT
#endif
#ifndef DYNAMIC_KEYMAP_LAYER_COUNT
# define DYNAMIC_KEYMAP_LAYER_COUNT 11
#endif
#ifdef CONVERT_TO_PROTON_C #ifdef CONVERT_TO_PROTON_C
// pins that are available but not present on Pro Micro // pins that are available but not present on Pro Micro

View file

@ -50,7 +50,6 @@ bool mod_key_press(uint16_t code, uint16_t mod_code, bool pressed, uint16_t this
} }
__attribute__((weak)) void keyboard_pre_init_keymap(void) {} __attribute__((weak)) void keyboard_pre_init_keymap(void) {}
void keyboard_pre_init_user(void) { void keyboard_pre_init_user(void) {
userspace_config.raw = eeconfig_read_user(); userspace_config.raw = eeconfig_read_user();
keyboard_pre_init_keymap(); keyboard_pre_init_keymap();
@ -59,11 +58,10 @@ void keyboard_pre_init_user(void) {
// This allows for a global, userspace functions, and continued // This allows for a global, userspace functions, and continued
// customization of the keymap. Use _keymap instead of _user // customization of the keymap. Use _keymap instead of _user
// functions in the keymaps // functions in the keymaps
__attribute__((weak)) void matrix_init_keymap(void) {}
__attribute__((weak)) void matrix_init_secret(void) {}
// Call user matrix init, set default RGB colors and then // Call user matrix init, set default RGB colors and then
// call the keymap's init function // call the keymap's init function
__attribute__((weak)) void matrix_init_keymap(void) {}
__attribute__((weak)) void matrix_init_secret(void) {}
void matrix_init_user(void) { void matrix_init_user(void) {
#if defined(BOOTLOADER_CATERINA) && defined(__AVR__) #if defined(BOOTLOADER_CATERINA) && defined(__AVR__)
DDRD &= ~(1 << 5); DDRD &= ~(1 << 5);
@ -75,10 +73,14 @@ void matrix_init_user(void) {
matrix_init_secret(); matrix_init_secret();
matrix_init_keymap(); matrix_init_keymap();
#if defined(AUDIO_ENABLE) && defined(SPLIT_KEYBOARD)
if (!is_keyboard_master()) {
stop_all_notes();
}
#endif
} }
__attribute__((weak)) void keyboard_post_init_keymap(void) {} __attribute__((weak)) void keyboard_post_init_keymap(void) {}
void keyboard_post_init_user(void) { void keyboard_post_init_user(void) {
#if defined(RGBLIGHT_ENABLE) #if defined(RGBLIGHT_ENABLE)
keyboard_post_init_rgb_light(); keyboard_post_init_rgb_light();
@ -92,12 +94,11 @@ void keyboard_post_init_user(void) {
keyboard_post_init_keymap(); keyboard_post_init_keymap();
} }
__attribute__((weak)) void shutdown_keymap(void) {}
#ifdef RGB_MATRIX_ENABLE #ifdef RGB_MATRIX_ENABLE
void rgb_matrix_update_pwm_buffers(void); void rgb_matrix_update_pwm_buffers(void);
#endif #endif
__attribute__((weak)) void shutdown_keymap(void) {}
void shutdown_user(void) { void shutdown_user(void) {
#ifdef RGBLIGHT_ENABLE #ifdef RGBLIGHT_ENABLE
rgblight_enable_noeeprom(); rgblight_enable_noeeprom();
@ -113,7 +114,6 @@ void shutdown_user(void) {
} }
__attribute__((weak)) void suspend_power_down_keymap(void) {} __attribute__((weak)) void suspend_power_down_keymap(void) {}
void suspend_power_down_user(void) { void suspend_power_down_user(void) {
#ifdef OLED_DRIVER_ENABLE #ifdef OLED_DRIVER_ENABLE
oled_off(); oled_off();
@ -122,7 +122,6 @@ void suspend_power_down_user(void) {
} }
__attribute__((weak)) void suspend_wakeup_init_keymap(void) {} __attribute__((weak)) void suspend_wakeup_init_keymap(void) {}
void suspend_wakeup_init_user(void) { void suspend_wakeup_init_user(void) {
if (layer_state_is(_GAMEPAD)) { if (layer_state_is(_GAMEPAD)) {
layer_off(_GAMEPAD); layer_off(_GAMEPAD);
@ -133,12 +132,10 @@ void suspend_wakeup_init_user(void) {
suspend_wakeup_init_keymap(); suspend_wakeup_init_keymap();
} }
__attribute__((weak)) void matrix_scan_keymap(void) {}
__attribute__((weak)) void matrix_scan_secret(void) {}
// No global matrix scan code, so just run keymap's matrix // No global matrix scan code, so just run keymap's matrix
// scan function // scan function
__attribute__((weak)) void matrix_scan_keymap(void) {}
__attribute__((weak)) void matrix_scan_secret(void) {}
void matrix_scan_user(void) { void matrix_scan_user(void) {
static bool has_ran_yet; static bool has_ran_yet;
if (!has_ran_yet) { if (!has_ran_yet) {
@ -166,10 +163,9 @@ void matrix_scan_user(void) {
float doom_song[][2] = SONG(E1M1_DOOM); float doom_song[][2] = SONG(E1M1_DOOM);
#endif #endif
__attribute__((weak)) layer_state_t layer_state_set_keymap(layer_state_t state) { return state; }
// on layer change, no matter where the change was initiated // on layer change, no matter where the change was initiated
// Then runs keymap's layer change check // Then runs keymap's layer change check
__attribute__((weak)) layer_state_t layer_state_set_keymap(layer_state_t state) { return state; }
layer_state_t layer_state_set_user(layer_state_t state) { layer_state_t layer_state_set_user(layer_state_t state) {
if (!is_keyboard_master()) { if (!is_keyboard_master()) {
return state; return state;
@ -194,9 +190,8 @@ layer_state_t layer_state_set_user(layer_state_t state) {
return state; return state;
} }
__attribute__((weak)) layer_state_t default_layer_state_set_keymap(layer_state_t state) { return state; }
// Runs state check and changes underglow color and animation // Runs state check and changes underglow color and animation
__attribute__((weak)) layer_state_t default_layer_state_set_keymap(layer_state_t state) { return state; }
layer_state_t default_layer_state_set_user(layer_state_t state) { layer_state_t default_layer_state_set_user(layer_state_t state) {
if (!is_keyboard_master()) { if (!is_keyboard_master()) {
return state; return state;
@ -212,22 +207,14 @@ layer_state_t default_layer_state_set_user(layer_state_t state) {
} }
__attribute__((weak)) void led_set_keymap(uint8_t usb_led) {} __attribute__((weak)) void led_set_keymap(uint8_t usb_led) {}
// Any custom LED code goes here.
// So far, I only have keyboard specific code,
// So nothing goes here.
void led_set_user(uint8_t usb_led) { led_set_keymap(usb_led); } void led_set_user(uint8_t usb_led) { led_set_keymap(usb_led); }
__attribute__((weak)) void eeconfig_init_keymap(void) {} __attribute__((weak)) void eeconfig_init_keymap(void) {}
void eeconfig_init_user(void) { void eeconfig_init_user(void) {
userspace_config.raw = 0; userspace_config.raw = 0;
userspace_config.rgb_layer_change = true; userspace_config.rgb_layer_change = true;
eeconfig_update_user(userspace_config.raw); eeconfig_update_user(userspace_config.raw);
eeconfig_init_keymap(); eeconfig_init_keymap();
#ifdef VIA_ENABLE
via_eeprom_reset();
#endif
keyboard_init(); keyboard_init();
} }
@ -237,3 +224,39 @@ bool hasAllBitsInMask(uint8_t value, uint8_t mask) {
return (value & mask) == mask; return (value & mask) == mask;
} }
#ifdef SPLIT_KEYBOARD
# if defined(AUDIO_ENABLE)
bool delayed_tasks_run = false;
# endif
__attribute__((weak)) void matrix_slave_scan_keymap(void) {}
void matrix_slave_scan_user(void) {
# if defined(AUDIO_ENABLE)
# if !defined(NO_MUSIC_MODE)
music_task();
# endif
if (!is_keyboard_master()) {
static uint16_t delayed_task_timer = 0;
if (!delayed_tasks_run) {
if (!delayed_task_timer) {
delayed_task_timer = timer_read();
} else if (timer_elapsed(delayed_task_timer) > 300) {
audio_startup();
delayed_tasks_run = true;
}
}
}
# endif
# ifdef SEQUENCER_ENABLE
sequencer_task();
# endif
# ifdef LED_MATRIX_ENABLE
led_matrix_task();
# endif
# ifdef HAPTIC_ENABLE
haptic_task();
# endif
matrix_slave_scan_keymap();
}
#endif

View file

@ -94,6 +94,9 @@ layer_state_t default_layer_state_set_keymap(layer_state_t state);
void led_set_keymap(uint8_t usb_led); void led_set_keymap(uint8_t usb_led);
void eeconfig_init_keymap(void); void eeconfig_init_keymap(void);
bool hasAllBitsInMask(uint8_t value, uint8_t mask); bool hasAllBitsInMask(uint8_t value, uint8_t mask);
#ifdef SPLIT_KEYBOARD
void matrix_slave_scan_keymap(void);
#endif
// clang-format off // clang-format off
typedef union { typedef union {
@ -126,7 +129,3 @@ We use custom codes here, so we can substitute the right stuff
# define KC_D3_3 KC_3 # define KC_D3_3 KC_3
# define KC_D3_4 KC_4 # define KC_D3_4 KC_4
#endif // TAP_DANCE_ENABLE #endif // TAP_DANCE_ENABLE
#if defined(DRASHNA_CUSTOM_TRANSPORT) && defined(POINTING_DEVICE_ENABLE)
void master_mouse_send(int8_t x, int8_t y);
#endif

View file

@ -18,7 +18,7 @@
#ifndef KEYLOGGER_LENGTH #ifndef KEYLOGGER_LENGTH
// # ifdef OLED_DISPLAY_128X64 // # ifdef OLED_DISPLAY_128X64
# define KEYLOGGER_LENGTH ((int)(OLED_DISPLAY_HEIGHT / OLED_FONT_WIDTH)) # define KEYLOGGER_LENGTH ((uint8_t)(OLED_DISPLAY_HEIGHT / OLED_FONT_WIDTH))
// # else // # else
// # define KEYLOGGER_LENGTH (uint8_t *(OLED_DISPLAY_WIDTH / OLED_FONT_HEIGHT)) // # define KEYLOGGER_LENGTH (uint8_t *(OLED_DISPLAY_WIDTH / OLED_FONT_HEIGHT))
// # endif // # endif
@ -160,17 +160,21 @@ void render_matrix_scan_rate(void) {
void render_mod_status(uint8_t modifiers) { void render_mod_status(uint8_t modifiers) {
static const char PROGMEM mod_status[5][3] = {{0xE8, 0xE9, 0}, {0xE4, 0xE5, 0}, {0xE6, 0xE7, 0}, {0xEA, 0xEB, 0}, {0xEC, 0xED, 0}}; static const char PROGMEM mod_status[5][3] = {{0xE8, 0xE9, 0}, {0xE4, 0xE5, 0}, {0xE6, 0xE7, 0}, {0xEA, 0xEB, 0}, {0xEC, 0xED, 0}};
oled_write_P(PSTR(OLED_RENDER_MODS_NAME), false); oled_write_P(PSTR(OLED_RENDER_MODS_NAME), false);
#if defined(OLED_DISPLAY_128X64)
oled_write_P(mod_status[0], (modifiers & MOD_BIT(KC_LSHIFT)));
oled_write_P(mod_status[!keymap_config.swap_lctl_lgui ? 3 : 4], (modifiers & MOD_BIT(KC_LGUI)));
oled_write_P(mod_status[2], (modifiers & MOD_BIT(KC_LALT)));
oled_write_P(mod_status[1], (modifiers & MOD_BIT(KC_LCTL)));
oled_write_P(mod_status[1], (modifiers & MOD_BIT(KC_RCTL)));
oled_write_P(mod_status[2], (modifiers & MOD_BIT(KC_RALT)));
oled_write_P(mod_status[!keymap_config.swap_lctl_lgui ? 3 : 4], (modifiers & MOD_BIT(KC_RGUI)));
oled_write_P(mod_status[0], (modifiers & MOD_BIT(KC_RSHIFT)));
#else
oled_write_P(mod_status[0], (modifiers & MOD_MASK_SHIFT)); oled_write_P(mod_status[0], (modifiers & MOD_MASK_SHIFT));
oled_write_P(mod_status[!keymap_config.swap_lctl_lgui ? 3 : 4], (modifiers & MOD_MASK_GUI)); oled_write_P(mod_status[!keymap_config.swap_lctl_lgui ? 3 : 4], (modifiers & MOD_MASK_GUI));
#if !defined(OLED_DISPLAY_128X64)
oled_write_P(PSTR(" "), false); oled_write_P(PSTR(" "), false);
#endif
oled_write_P(mod_status[2], (modifiers & MOD_MASK_ALT)); oled_write_P(mod_status[2], (modifiers & MOD_MASK_ALT));
oled_write_P(mod_status[1], (modifiers & MOD_MASK_CTRL)); oled_write_P(mod_status[1], (modifiers & MOD_MASK_CTRL));
render_matrix_scan_rate();
#if defined(OLED_DISPLAY_128X64)
oled_advance_page(true);
#endif #endif
} }
@ -279,7 +283,7 @@ void render_user_status(void) {
#endif #endif
} }
__attribute__((weak)) void oled_driver_render_logo(void) { void oled_driver_render_logo(void) {
// clang-format off // clang-format off
static const char PROGMEM qmk_logo[] = { static const char PROGMEM qmk_logo[] = {
0x80,0x81,0x82,0x83,0x84,0x85,0x86,0x87,0x88,0x89,0x8a,0x8b,0x8c,0x8d,0x8e,0x8f,0x90,0x91,0x92,0x93,0x94, 0x80,0x81,0x82,0x83,0x84,0x85,0x86,0x87,0x88,0x89,0x8a,0x8b,0x8c,0x8d,0x8e,0x8f,0x90,0x91,0x92,0x93,0x94,
@ -289,75 +293,86 @@ __attribute__((weak)) void oled_driver_render_logo(void) {
oled_write_P(qmk_logo, false); oled_write_P(qmk_logo, false);
} }
void render_wpm(void) { void render_wpm(uint8_t padding) {
#ifdef WPM_ENABLE #ifdef WPM_ENABLE
uint8_t n = get_current_wpm(); uint8_t n = get_current_wpm();
# ifdef OLED_DISPLAY_128X64
char wpm_counter[4]; char wpm_counter[4];
wpm_counter[3] = '\0'; wpm_counter[3] = '\0';
wpm_counter[2] = '0' + n % 10; wpm_counter[2] = '0' + n % 10;
wpm_counter[1] = (n /= 10) % 10 ? '0' + (n) % 10 : (n / 10) % 10 ? '0' : ' '; wpm_counter[1] = (n /= 10) % 10 ? '0' + (n) % 10 : (n / 10) % 10 ? '0' : ' ';
wpm_counter[0] = n / 10 ? '0' + n / 10 : ' '; wpm_counter[0] = n / 10 ? '0' + n / 10 : ' ';
# else
char wpm_counter[6];
wpm_counter[5] = '\0';
wpm_counter[4] = '0' + n % 10;
wpm_counter[3] = (n /= 10) % 10 ? '0' + (n) % 10 : (n / 10) % 10 ? '0' : ' ';
wpm_counter[2] = n / 10 ? '0' + n / 10 : ' ';
wpm_counter[1] = ' ';
wpm_counter[0] = ' ';
# endif
oled_write_P(PSTR(OLED_RENDER_WPM_COUNTER), false); oled_write_P(PSTR(OLED_RENDER_WPM_COUNTER), false);
if (padding) {
for (uint8_t n = padding; n > 0; n--) {
oled_write_P(PSTR(" "), false);
}
}
oled_write(wpm_counter, false); oled_write(wpm_counter, false);
#endif #endif
} }
#if defined(KEYBOARD_handwired_tractyl_manuform_5x6_right) #if defined(KEYBOARD_handwired_tractyl_manuform_5x6_right)
extern kb_config_data_t kb_config;
extern kb_runtime_config_t kb_state; void render_pointing_dpi_status(uint8_t padding) {
void render_pointing_dpi_status(void) { char dpi_status[5];
char dpi_status[6]; uint16_t n = kb_config.device_cpi;
uint16_t n = kb_state.device_cpi; dpi_status[4] = '\0';
dpi_status[5] = '\0'; dpi_status[3] = '0' + n % 10;
dpi_status[4] = '0' + n % 10;
dpi_status[3] = (n /= 10) % 10 ? '0' + (n) % 10 : (n / 10) % 10 ? '0' : ' ';
dpi_status[2] = (n /= 10) % 10 ? '0' + (n) % 10 : (n / 10) % 10 ? '0' : ' '; dpi_status[2] = (n /= 10) % 10 ? '0' + (n) % 10 : (n / 10) % 10 ? '0' : ' ';
dpi_status[1] = n / 10 ? '0' + n / 10 : ' '; dpi_status[1] = (n /= 10) % 10 ? '0' + (n) % 10 : (n / 10) % 10 ? '0' : ' ';
dpi_status[0] = ' '; dpi_status[0] = n / 10 ? '0' + n / 10 : ' ';
oled_write_P(PSTR(" DPI: "), false); oled_write_P(PSTR("DPI: "), false);
if (padding) {
for (uint8_t n = padding; n > 0; n--) {
oled_write_P(PSTR(" "), false);
}
}
oled_write(dpi_status, false); oled_write(dpi_status, false);
} }
#endif #endif
void render_status_secondary(void) { __attribute__((weak)) void oled_driver_render_logo_right(void) {
#if defined(OLED_DISPLAY_128X64) #if defined(OLED_DISPLAY_128X64)
oled_driver_render_logo(); oled_driver_render_logo();
#endif
/* Show Keyboard Layout */
render_default_layer_state(); render_default_layer_state();
render_layer_state(); oled_set_cursor(0, 4);
render_mod_status(get_mods() | get_oneshot_mods()); #else
#if !defined(OLED_DISPLAY_128X64) && defined(WPM_ENABLE) render_default_layer_state();
render_wpm();
#endif #endif
// render_keylock_status(host_keyboard_leds());
} }
void render_status_main(void) { __attribute__((weak)) void oled_driver_render_logo_left(void) {
#if defined(OLED_DISPLAY_128X64) #if defined(OLED_DISPLAY_128X64)
oled_driver_render_logo(); oled_driver_render_logo();
# ifdef DEBUG_MATRIX_SCAN_RATE # ifdef DEBUG_MATRIX_SCAN_RATE
render_matrix_scan_rate(); render_matrix_scan_rate();
# elif defined(WPM_ENABLE) # elif defined(WPM_ENABLE)
render_wpm(); render_wpm(0);
# endif # endif
oled_write_P(PSTR(" "), false);
# if defined(KEYBOARD_handwired_tractyl_manuform_5x6_right) # if defined(KEYBOARD_handwired_tractyl_manuform_5x6_right)
render_pointing_dpi_status(); render_pointing_dpi_status(1);
# endif # endif
oled_write_P(PSTR("\n"), false); oled_set_cursor(0, 4);
#else #else
render_default_layer_state(); render_default_layer_state();
#endif #endif
}
void render_status_secondary(void) {
oled_driver_render_logo_right();
/* Show Keyboard Layout */
render_layer_state();
render_mod_status(get_mods() | get_oneshot_mods());
#if !defined(OLED_DISPLAY_128X64) && defined(WPM_ENABLE)
render_wpm(2);
#endif
// render_keylock_status(host_keyboard_leds());
}
void render_status_main(void) {
oled_driver_render_logo_left();
/* Show Keyboard Layout */ /* Show Keyboard Layout */
// render_keylock_status(host_keyboard_leds()); // render_keylock_status(host_keyboard_leds());
render_bootmagic_status(); render_bootmagic_status();

View file

@ -23,6 +23,19 @@ void oled_driver_render_logo(void);
bool process_record_user_oled(uint16_t keycode, keyrecord_t *record); bool process_record_user_oled(uint16_t keycode, keyrecord_t *record);
oled_rotation_t oled_init_keymap(oled_rotation_t rotation); oled_rotation_t oled_init_keymap(oled_rotation_t rotation);
extern uint32_t oled_timer; extern uint32_t oled_timer;
void render_keylogger_status(void);
void render_default_layer_state(void);
void render_layer_state(void);
void render_keylock_status(uint8_t led_usb_state);
void render_matrix_scan_rate(void);
void render_mod_status(uint8_t modifiers);
void render_bootmagic_status(void);
void render_user_status(void);
void oled_driver_render_logo(void);
void render_wpm(uint8_t padding);
void render_pointing_dpi_status(uint8_t padding);
void oled_driver_render_logo_left(void);
void oled_driver_render_logo_right(void);
#ifdef OLED_DISPLAY_128X64 #ifdef OLED_DISPLAY_128X64
# define OLED_RENDER_KEYLOGGER "Keylogger: " # define OLED_RENDER_KEYLOGGER "Keylogger: "

View file

@ -0,0 +1,40 @@
/* Copyright 2020 Christopher Courtney, aka Drashna Jael're (@drashna) <drashna@live.com>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#pragma once
// because layouts seem to not be respecting config.h order atm
#ifdef RGBLIGHT_ENABLE
# undef RGBLIGHT_ANIMATIONS
# if defined(__AVR__) && (!defined(__AVR_AT90USB1286__) && !defined(RGBLIGHT_ALL_ANIMATIONS))
# define RGBLIGHT_EFFECT_BREATHING
# define RGBLIGHT_EFFECT_SNAKE
# define RGBLIGHT_EFFECT_KNIGHT
# else
# define RGBLIGHT_EFFECT_BREATHING
# define RGBLIGHT_EFFECT_RAINBOW_MOOD
# define RGBLIGHT_EFFECT_RAINBOW_SWIRL
# define RGBLIGHT_EFFECT_SNAKE
# define RGBLIGHT_EFFECT_KNIGHT
# if defined(RGBLIGHT_ALL_ANIMATIONS)
# define RGBLIGHT_EFFECT_CHRISTMAS
# define RGBLIGHT_EFFECT_STATIC_GRADIENT
# define RGBLIGHT_EFFECT_RGB_TEST
# define RGBLIGHT_EFFECT_ALTERNATING
# endif
# define RGBLIGHT_EFFECT_TWINKLE
# endif
#endif

View file

@ -19,12 +19,11 @@
uint16_t copy_paste_timer; uint16_t copy_paste_timer;
__attribute__((weak)) bool process_record_keymap(uint16_t keycode, keyrecord_t *record) { return true; }
__attribute__((weak)) bool process_record_secrets(uint16_t keycode, keyrecord_t *record) { return true; }
// Defines actions tor my global custom keycodes. Defined in drashna.h file // Defines actions tor my global custom keycodes. Defined in drashna.h file
// Then runs the _keymap's record handier if not processed here // Then runs the _keymap's record handier if not processed here
__attribute__((weak)) bool process_record_keymap(uint16_t keycode, keyrecord_t *record) { return true; }
__attribute__((weak)) bool process_record_secrets(uint16_t keycode, keyrecord_t *record) { return true; }
bool process_record_user(uint16_t keycode, keyrecord_t *record) { bool process_record_user(uint16_t keycode, keyrecord_t *record) {
// If console is enabled, it will print the matrix position and status of each key pressed // If console is enabled, it will print the matrix position and status of each key pressed
#ifdef KEYLOGGER_ENABLE #ifdef KEYLOGGER_ENABLE
@ -203,3 +202,6 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
} }
return true; return true;
} }
__attribute__((weak)) void post_process_record_keymap(uint16_t keycode, keyrecord_t *record) {}
void post_process_record_user(uint16_t keycode, keyrecord_t *record) { post_process_record_keymap(keycode, record); }

View file

@ -51,6 +51,7 @@ enum userspace_custom_keycodes {
bool process_record_secrets(uint16_t keycode, keyrecord_t *record); bool process_record_secrets(uint16_t keycode, keyrecord_t *record);
bool process_record_keymap(uint16_t keycode, keyrecord_t *record); bool process_record_keymap(uint16_t keycode, keyrecord_t *record);
void post_process_record_keymap(uint16_t keycode, keyrecord_t *record);
#define LOWER MO(_LOWER) #define LOWER MO(_LOWER)
#define RAISE MO(_RAISE) #define RAISE MO(_RAISE)

View file

@ -20,11 +20,6 @@
extern led_config_t g_led_config; extern led_config_t g_led_config;
static uint32_t hypno_timer; static uint32_t hypno_timer;
#if defined(SPLIT_KEYBOARD) || defined(KEYBOARD_ergodox_ez) || defined(KEYBOARD_crkbd)
# define RGB_MATRIX_REST_MODE RGB_MATRIX_CYCLE_OUT_IN_DUAL
#else
# define RGB_MATRIX_REST_MODE RGB_MATRIX_CYCLE_OUT_IN
#endif
void rgb_matrix_layer_helper(uint8_t hue, uint8_t sat, uint8_t val, uint8_t mode, uint8_t speed, uint8_t led_type, uint8_t led_min, uint8_t led_max) { void rgb_matrix_layer_helper(uint8_t hue, uint8_t sat, uint8_t val, uint8_t mode, uint8_t speed, uint8_t led_type, uint8_t led_min, uint8_t led_max) {
HSV hsv = {hue, sat, val}; HSV hsv = {hue, sat, val};

View file

@ -23,106 +23,19 @@
bool has_initialized; bool has_initialized;
void rgblight_sethsv_default_helper(uint8_t index) { rgblight_sethsv_at(rgblight_get_hue(), rgblight_get_sat(), rgblight_get_val(), index); } void rgblight_sethsv_default_helper(uint8_t index) { rgblight_sethsv_at(rgblight_get_hue(), rgblight_get_sat(), rgblight_get_val(), index); }
void rgblight_set_hsv_and_mode(uint8_t hue, uint8_t sat, uint8_t val, uint8_t mode) {
# ifdef RGBLIGHT_TWINKLE rgblight_sethsv_noeeprom(hue, sat, val);
static rgblight_fadeout lights[RGBLED_NUM]; // wait_us(175); // Add a slight delay between color and mode to ensure it's processed correctly
rgblight_mode_noeeprom(mode);
/* Handler for fading/twinkling effect */
void scan_rgblight_fadeout(void) { // Don't effing change this function .... rgblight_sethsv is supppppper intensive
bool litup = false;
for (uint8_t light_index = 0; light_index < RGBLED_NUM; ++light_index) {
if (lights[light_index].enabled && sync_timer_elapsed(lights[light_index].timer) > 10) {
rgblight_fadeout *light = &lights[light_index];
litup = true;
if (light->life) {
light->life -= 1;
if (get_highest_layer(layer_state) == 0) {
sethsv(light->hue + rand() % 0xF, 255, light->life, (LED_TYPE *)&led[light_index]);
}
light->timer = sync_timer_read();
} else {
if (light->enabled && get_highest_layer(layer_state) == 0) {
rgblight_sethsv_default_helper(light_index);
}
litup = light->enabled = false;
}
}
}
if (litup && get_highest_layer(layer_state) == 0) {
rgblight_set();
}
} }
/* Triggers a LED to fade/twinkle. bool process_record_user_rgb_light(uint16_t keycode, keyrecord_t *record) { return true; }
* This function handles the selection of the LED and prepres for it to be used.
*/
void start_rgb_light(void) {
uint8_t indices[RGBLED_NUM];
uint8_t indices_count = 0;
uint8_t min_life = 0xFF;
uint8_t min_life_index = -1;
for (uint8_t index = 0; index < RGBLED_NUM; ++index) {
if (lights[index].enabled) {
if (min_life_index == -1 || lights[index].life < min_life) {
min_life = lights[index].life;
min_life_index = index;
}
continue;
}
indices[indices_count] = index;
++indices_count;
}
uint8_t light_index;
if (!indices_count) {
light_index = min_life_index;
} else {
light_index = indices[rand() % indices_count];
}
rgblight_fadeout *light = &lights[light_index];
light->enabled = true;
light->timer = sync_timer_read();
light->life = 0xC0 + rand() % 0x40;
light->hue = rgblight_get_hue() + (rand() % 0xB4) - 0x54;
rgblight_sethsv_at(light->hue, 255, light->life, light_index);
}
# endif
bool process_record_user_rgb_light(uint16_t keycode, keyrecord_t *record) {
uint16_t temp_keycode = keycode;
// Filter out the actual keycode from MT and LT keys.
if ((keycode >= QK_MOD_TAP && keycode <= QK_MOD_TAP_MAX) || (keycode >= QK_LAYER_TAP && keycode <= QK_LAYER_TAP_MAX)) {
temp_keycode &= 0xFF;
}
switch (temp_keycode) {
# ifdef RGBLIGHT_TWINKLE
case KC_A ... KC_SLASH:
case KC_F1 ... KC_F12:
case KC_INSERT ... KC_UP:
case KC_KP_SLASH ... KC_KP_DOT:
case KC_F13 ... KC_F24:
case KC_AUDIO_MUTE ... KC_MEDIA_REWIND:
if (record->event.pressed) {
start_rgb_light();
}
break;
# endif // RGBLIGHT_TWINKLE
}
return true;
}
# if defined(RGBLIGHT_STARTUP_ANIMATION) # if defined(RGBLIGHT_STARTUP_ANIMATION)
static bool is_enabled; static bool is_enabled;
static bool is_rgblight_startup; static bool is_rgblight_startup;
static uint8_t old_hue; static HSV old_hsv;
static uint8_t old_mode;
static uint16_t rgblight_startup_loop_timer; static uint16_t rgblight_startup_loop_timer;
# endif # endif
@ -130,37 +43,35 @@ void keyboard_post_init_rgb_light(void) {
# if defined(RGBLIGHT_STARTUP_ANIMATION) # if defined(RGBLIGHT_STARTUP_ANIMATION)
is_enabled = rgblight_is_enabled(); is_enabled = rgblight_is_enabled();
if (userspace_config.rgb_layer_change) { if (userspace_config.rgb_layer_change) {
rgblight_enable_noeeprom();
}
if (rgblight_is_enabled()) {
layer_state_set_rgb_light(layer_state); layer_state_set_rgb_light(layer_state);
old_hue = rgblight_get_hue(); }
old_hsv = rgblight_get_hsv();
old_mode = rgblight_get_mode();
rgblight_mode_noeeprom(RGBLIGHT_MODE_STATIC_LIGHT); rgblight_mode_noeeprom(RGBLIGHT_MODE_STATIC_LIGHT);
is_rgblight_startup = true; is_rgblight_startup = true;
}
# endif # endif
if (userspace_config.rgb_layer_change) {
layer_state_set_rgb_light(layer_state); layer_state_set_rgb_light(layer_state);
}
} }
void matrix_scan_rgb_light(void) { void matrix_scan_rgb_light(void) {
# ifdef RGBLIGHT_TWINKLE
scan_rgblight_fadeout();
# endif // RGBLIGHT_ENABLE
# if defined(RGBLIGHT_STARTUP_ANIMATION) # if defined(RGBLIGHT_STARTUP_ANIMATION)
if (is_rgblight_startup && is_keyboard_master()) { if (is_rgblight_startup && is_keyboard_master()) {
if (sync_timer_elapsed(rgblight_startup_loop_timer) > 10) { if (sync_timer_elapsed(rgblight_startup_loop_timer) > 10) {
static uint8_t counter; static uint8_t counter;
counter++; counter++;
rgblight_sethsv_noeeprom((counter + old_hue) % 255, 255, 255); rgblight_sethsv_noeeprom((counter + old_hsv.h) % 255, 255, 255);
rgblight_startup_loop_timer = sync_timer_read(); rgblight_startup_loop_timer = sync_timer_read();
if (counter == 255) { if (counter == 255) {
is_rgblight_startup = false; is_rgblight_startup = false;
if (!is_enabled) {
rgblight_disable_noeeprom();
}
if (userspace_config.rgb_layer_change) { if (userspace_config.rgb_layer_change) {
layer_state_set_rgb_light(layer_state); layer_state_set_rgb_light(layer_state);
} else {
rgblight_set_hsv_and_mode(old_hsv.h, old_hsv.s, old_hsv.v, old_mode);
}
if (!is_enabled) {
rgblight_disable_noeeprom();
} }
} }
} }
@ -168,12 +79,6 @@ void matrix_scan_rgb_light(void) {
# endif # endif
} }
void rgblight_set_hsv_and_mode(uint8_t hue, uint8_t sat, uint8_t val, uint8_t mode) {
rgblight_sethsv_noeeprom(hue, sat, val);
// wait_us(175); // Add a slight delay between color and mode to ensure it's processed correctly
rgblight_mode_noeeprom(mode);
}
layer_state_t layer_state_set_rgb_light(layer_state_t state) { layer_state_t layer_state_set_rgb_light(layer_state_t state) {
# ifdef RGBLIGHT_ENABLE # ifdef RGBLIGHT_ENABLE
if (userspace_config.rgb_layer_change) { if (userspace_config.rgb_layer_change) {

View file

@ -17,22 +17,9 @@
#pragma once #pragma once
#include "quantum.h" #include "quantum.h"
#if defined(RGBLIGHT_TWINKLE)
typedef struct {
bool enabled;
uint8_t hue;
uint16_t timer;
uint8_t life;
} rgblight_fadeout;
#endif
bool process_record_user_rgb_light(uint16_t keycode, keyrecord_t *record); bool process_record_user_rgb_light(uint16_t keycode, keyrecord_t *record);
void keyboard_post_init_rgb_light(void); void keyboard_post_init_rgb_light(void);
void matrix_scan_rgb_light(void); void matrix_scan_rgb_light(void);
layer_state_t layer_state_set_rgb_light(layer_state_t state); layer_state_t layer_state_set_rgb_light(layer_state_t state);
layer_state_t default_layer_state_set_rgb_light(layer_state_t state); layer_state_t default_layer_state_set_rgb_light(layer_state_t state);
void rgblight_sethsv_default_helper(uint8_t index); void rgblight_sethsv_default_helper(uint8_t index);
#if defined(RGBLIGHT_TWINKLE)
void scan_rgblight_fadeout(void);
#endif

View file

@ -29,9 +29,6 @@ CUSTOM_RGBLIGHT ?= yes
ifeq ($(strip $(RGBLIGHT_ENABLE)), yes) ifeq ($(strip $(RGBLIGHT_ENABLE)), yes)
ifeq ($(strip $(CUSTOM_RGBLIGHT)), yes) ifeq ($(strip $(CUSTOM_RGBLIGHT)), yes)
SRC += rgb_stuff.c SRC += rgb_stuff.c
ifeq ($(strip $(RGBLIGHT_TWINKLE)), yes)
OPT_DEFS += -DRGBLIGHT_TWINKLE
endif
ifeq ($(strip $(RGBLIGHT_NOEEPROM)), yes) ifeq ($(strip $(RGBLIGHT_NOEEPROM)), yes)
OPT_DEFS += -DRGBLIGHT_NOEEPROM OPT_DEFS += -DRGBLIGHT_NOEEPROM
endif endif
@ -81,8 +78,12 @@ ifeq ($(strip $(PIMORONI_TRACKBALL_ENABLE)), yes)
QUANTUM_LIB_SRC += i2c_master.c QUANTUM_LIB_SRC += i2c_master.c
endif endif
ifeq ($(strip $(SPLIT_KEYBOARD)), yes) CUSTOM_SPLIT_TRANSPORT_SYNC ?= yes
ifeq ($(strip $(CUSTOM_SPLIT_TRANSPORT_SYNC)), yes)
ifeq ($(strip $(SPLIT_KEYBOARD)), yes)
QUANTUM_LIB_SRC += transport_sync.c QUANTUM_LIB_SRC += transport_sync.c
OPT_DEFS += -DCUSTOM_SPLIT_TRANSPORT_SYNC
endif
endif endif
# DEBUG_MATRIX_SCAN_RATE_ENABLE = api # DEBUG_MATRIX_SCAN_RATE_ENABLE = api

View file

@ -1,30 +1,44 @@
#ifdef SPLIT_TRANSACTION_IDS_USER /* Copyright 2020 Christopher Courtney, aka Drashna Jael're (@drashna) <drashna@live.com>
# include "transport_sync.h" *
# include "transactions.h" * This program is free software: you can redistribute it and/or modify
# include <string.h> * it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
# ifdef UNICODE_ENABLE #include "transport_sync.h"
#include "transactions.h"
#include <string.h>
#ifdef UNICODE_ENABLE
extern unicode_config_t unicode_config; extern unicode_config_t unicode_config;
# endif #endif
# ifdef AUDIO_ENABLE #ifdef AUDIO_ENABLE
# include "audio.h" # include "audio.h"
# endif extern bool delayed_tasks_run;
# if defined(POINTING_DEVICE_ENABLE) && defined(KEYBOARD_handwired_tractyl_manuform) #endif
#if defined(POINTING_DEVICE_ENABLE) && defined(KEYBOARD_handwired_tractyl_manuform)
extern bool tap_toggling; extern bool tap_toggling;
# endif #endif
# ifdef SWAP_HANDS_ENABLE #ifdef SWAP_HANDS_ENABLE
extern bool swap_hands; extern bool swap_hands;
# endif #endif
extern userspace_config_t userspace_config; extern userspace_config_t userspace_config;
typedef struct { __attribute__((aligned(8))) typedef struct {
bool oled_on;
bool audio_enable; bool audio_enable;
bool audio_clicky_enable; bool audio_clicky_enable;
bool tap_toggling; bool tap_toggling;
bool unicode_mode; bool unicode_mode;
bool swap_hands; bool swap_hands;
uint8_t reserved :2;
} user_runtime_config_t; } user_runtime_config_t;
uint16_t transport_keymap_config = 0; uint16_t transport_keymap_config = 0;
@ -57,37 +71,27 @@ void keyboard_post_init_transport_sync(void) {
void user_transport_update(void) { void user_transport_update(void) {
if (is_keyboard_master()) { if (is_keyboard_master()) {
# ifdef OLED_DRIVER_ENABLE
user_state.oled_on = is_oled_on();
# endif
transport_keymap_config = keymap_config.raw; transport_keymap_config = keymap_config.raw;
transport_userspace_config = userspace_config.raw; transport_userspace_config = userspace_config.raw;
# ifdef AUDIO_ENABLE #ifdef AUDIO_ENABLE
user_state.audio_enable = is_audio_on(); user_state.audio_enable = is_audio_on();
user_state.audio_clicky_enable = is_clicky_on(); user_state.audio_clicky_enable = is_clicky_on();
# endif #endif
# if defined(POINTING_DEVICE_ENABLE) && defined(KEYBOARD_handwired_tractyl_manuform) #if defined(POINTING_DEVICE_ENABLE) && defined(KEYBOARD_handwired_tractyl_manuform)
user_state.tap_toggling = tap_toggling; user_state.tap_toggling = tap_toggling;
# endif #endif
# ifdef SWAP_HANDS_ENABLE #ifdef SWAP_HANDS_ENABLE
user_state.swap_hands = swap_hands; user_state.swap_hands = swap_hands;
# endif #endif
} else { } else {
# ifdef OLED_DRIVER_ENABLE
if (user_state.oled_on) {
oled_on();
} else {
oled_off();
}
# endif
keymap_config.raw = transport_keymap_config; keymap_config.raw = transport_keymap_config;
userspace_config.raw = transport_userspace_config; userspace_config.raw = transport_userspace_config;
# ifdef UNICODE_ENABLE #ifdef UNICODE_ENABLE
unicode_config.input_mode = user_state.unicode_mode; unicode_config.input_mode = user_state.unicode_mode;
# endif #endif
# ifdef AUDIO_ENABLE #ifdef AUDIO_ENABLE
if (delayed_tasks_run) {
if (user_state.audio_enable != is_audio_on()) { if (user_state.audio_enable != is_audio_on()) {
if (user_state.audio_enable) { if (user_state.audio_enable) {
audio_on(); audio_on();
@ -102,13 +106,14 @@ void user_transport_update(void) {
clicky_off(); clicky_off();
} }
} }
# endif }
# if defined(POINTING_DEVICE_ENABLE) && defined(KEYBOARD_handwired_tractyl_manuform) #endif
#if defined(POINTING_DEVICE_ENABLE) && defined(KEYBOARD_handwired_tractyl_manuform)
tap_toggling = user_state.tap_toggling; tap_toggling = user_state.tap_toggling;
# endif #endif
# ifdef SWAP_HANDS_ENABLE #ifdef SWAP_HANDS_ENABLE
swap_hands = user_state.swap_hands; swap_hands = user_state.swap_hands;
# endif #endif
} }
} }
@ -185,4 +190,3 @@ void housekeeping_task_user(void) {
// Data sync from master to slave // Data sync from master to slave
user_transport_sync(); user_transport_sync();
} }
#endif