diff options
author | Drashna Jaelre <drashna@live.com> | 2022-03-06 22:12:17 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-03-06 22:12:17 -0800 |
commit | ff6c70415c536e6435023627197550889ffa1501 (patch) | |
tree | 79fd0a25632f7ed2483542b8ab0731b5b2709bbd | |
parent | d8971d707eddea5d16ef5fa3dad807b494aed39f (diff) |
[Keymap] Drashna Mouse keys and oled updates (#16556)
37 files changed, 776 insertions, 465 deletions
diff --git a/keyboards/bastardkb/charybdis/3x5/keymaps/drashna/keymap.c b/keyboards/bastardkb/charybdis/3x5/keymaps/drashna/keymap.c index aba169dbb5..1af9868855 100644 --- a/keyboards/bastardkb/charybdis/3x5/keymaps/drashna/keymap.c +++ b/keyboards/bastardkb/charybdis/3x5/keymaps/drashna/keymap.c @@ -58,9 +58,9 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { ), [_MOUSE] = LAYOUT_charybdis_3x5( - _______, _______, _______, S_D_MOD, DPI_MOD, KC_WH_U, _______, _______, _______, _______, + _______, _______, _______, _______, _______, KC_WH_U, DPI_RMOD,DPI_MOD, S_D_RMOD,S_D_MOD, _______, _______, _______, _______, _______, KC_WH_D, KC_BTN1, KC_BTN3, KC_BTN2, KC_BTN6, - _______, _______, _______, S_D_RMOD,DPI_RMOD, KC_BTN7, KC_BTN4, KC_BTN5, KC_BTN8, _______, + _______, _______, _______, _______, _______, KC_BTN7, KC_BTN4, KC_BTN5, KC_BTN8, _______, _______, SNIPING, _______, _______, _______ ), [_LOWER] = LAYOUT_charybdis_3x5_wrapper( diff --git a/keyboards/bastardkb/charybdis/3x5/keymaps/drashna/mcuconf.h b/keyboards/bastardkb/charybdis/3x5/keymaps/drashna/mcuconf.h index d868eae48e..05b5776ac3 100644 --- a/keyboards/bastardkb/charybdis/3x5/keymaps/drashna/mcuconf.h +++ b/keyboards/bastardkb/charybdis/3x5/keymaps/drashna/mcuconf.h @@ -21,8 +21,8 @@ #undef STM32_I2C_USE_I2C1 #define STM32_I2C_USE_I2C1 TRUE -#undef STM32_I2C_I2C1_RX_DMA_STREAM -#define STM32_I2C_I2C1_RX_DMA_STREAM STM32_DMA_STREAM_ID(1, 0) +// #undef STM32_I2C_I2C1_RX_DMA_STREAM +// #define STM32_I2C_I2C1_RX_DMA_STREAM STM32_DMA_STREAM_ID(1, 0) #undef STM32_I2C_I2C1_TX_DMA_STREAM #define STM32_I2C_I2C1_TX_DMA_STREAM STM32_DMA_STREAM_ID(1, 1) @@ -35,19 +35,9 @@ #undef STM32_SPI_USE_SPI1 #define STM32_SPI_USE_SPI1 TRUE -#undef STM32_SPI_SPI1_RX_DMA_STREAM -#define STM32_SPI_SPI1_RX_DMA_STREAM STM32_DMA_STREAM_ID(2, 0) -#undef STM32_SPI_SPI1_TX_DMA_STREAM -#define STM32_SPI_SPI1_TX_DMA_STREAM STM32_DMA_STREAM_ID(2, 3) - #undef STM32_SERIAL_USE_USART2 #define STM32_SERIAL_USE_USART2 TRUE -#undef STM32_UART_USART2_RX_DMA_STREAM -#define STM32_UART_USART2_RX_DMA_STREAM STM32_DMA_STREAM_ID(1, 5) -#undef STM32_UART_USART2_TX_DMA_STREAM -#define STM32_UART_USART2_TX_DMA_STREAM STM32_DMA_STREAM_ID(1, 6) - #undef STM32_GPT_USE_TIM4 #define STM32_GPT_USE_TIM4 TRUE diff --git a/keyboards/bastardkb/charybdis/3x5/keymaps/drashna/rules.mk b/keyboards/bastardkb/charybdis/3x5/keymaps/drashna/rules.mk index d23bf99aac..0cff2a7a2e 100644 --- a/keyboards/bastardkb/charybdis/3x5/keymaps/drashna/rules.mk +++ b/keyboards/bastardkb/charybdis/3x5/keymaps/drashna/rules.mk @@ -2,7 +2,10 @@ MCU = STM32F411 # Bootloader selection -BOOTLOADER = stm32-dfu +# BOOTLOADER = stm32-dfu +BOOTLOADER := tinyuf2 + +LTO_ENABLE := no BOOTMAGIC_ENABLE = yes # Enable Bootmagic Lite KEYBOARD_SHARED_EP = yes @@ -20,3 +23,5 @@ NKRO_ENABLE = yes CONSOLE_ENABLE = yes AUTOCORRECTION_ENABLE = yes + +DEBOUNCE_TYPE = asym_eager_defer_pk diff --git a/keyboards/bastardkb/charybdis/4x6/keymaps/drashna/chconf.h b/keyboards/bastardkb/charybdis/4x6/keymaps/drashna/chconf.h new file mode 100644 index 0000000000..8b55eaeef0 --- /dev/null +++ b/keyboards/bastardkb/charybdis/4x6/keymaps/drashna/chconf.h @@ -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> diff --git a/keyboards/bastardkb/charybdis/4x6/keymaps/drashna/config.h b/keyboards/bastardkb/charybdis/4x6/keymaps/drashna/config.h new file mode 100644 index 0000000000..f384318dc4 --- /dev/null +++ b/keyboards/bastardkb/charybdis/4x6/keymaps/drashna/config.h @@ -0,0 +1,91 @@ +/** + * Copyright 2021 Charly Delay <charly@codesink.dev> (@0xcharly) + * + * 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 + +#undef MATRIX_COL_PINS +#define MATRIX_COL_PINS \ + { B0, B1, B10, B3, B4, B5 } +#undef MATRIX_COL_PINS_RIGHT +#define MATRIX_COL_PINS_RIGHT \ + { B0, B1, B10, B3, B4, B5 } + +#undef MATRIX_ROW_PINS +#define MATRIX_ROW_PINS \ + { B15, A2, B8, A8, B9 } +#undef MATRIX_ROW_PINS_RIGHT +#define MATRIX_ROW_PINS_RIGHT \ + { B15, A2, B8, A8, B9 } + +#define DIODE_DIRECTION ROW2COL +#define SPLIT_HAND_PIN A3 + +#undef RGB_DI_PIN +#define RGB_DI_PIN A1 +#define WS2812_EXTERNAL_PULLUP +#define WS2812_PWM_DRIVER PWMD2 +#define WS2812_PWM_CHANNEL 2 +#define WS2812_PWM_PAL_MODE 1 +#define WS2812_EXTERNAL_PULLUP +#define WS2812_DMA_STREAM STM32_DMA1_STREAM1 +#define WS2812_DMA_CHANNEL 3 +#define WS2812_PWM_TARGET_PERIOD 800000 + +#define DEBUG_LED_PIN C13 + +#undef SOFT_SERIAL_PIN +// #define SERIAL_USART_FULL_DUPLEX // Enable full duplex operation mode. +#define SERIAL_USART_TX_PIN A9 +// #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 +// // #define SERIAL_USART_PIN_SWAP // swap RX and TX pins on master +// // To use the highest possible baudrate (3.75Mbit/s) uncomment the following +// // line, this can result in dropped communications so lower the speed if there +// // are many timeouts. +// // #define SERIAL_USART_SPEED (STM32_PCLK2 >> 4) + +#define CRC8_USE_TABLE +#define CRC8_OPTIMIZE_SPEED + +/* spi config for eeprom and pmw3360 sensor */ +#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 + +#undef PMW3360_CS_PIN +#define PMW3360_CS_PIN B14 +#define PMW3360_CS_MODE 3 +#define PMW3360_CS_DIVISOR 64 + +#define CHARYBDIS_MINIMUM_DEFAULT_DPI 1200 +#define CHARYBDIS_DEFAULT_DPI_CONFIG_STEP 400 +#define CHARYBDIS_MINIMUM_SNIPING_DPI 200 +#define CHARYBDIS_SNIPING_DPI_CONFIG_STEP 100 + +/* RGB Matrix. */ + +#undef RGB_MATRIX_MAXIMUM_BRIGHTNESS +#define RGB_MATRIX_MAXIMUM_BRIGHTNESS 150 diff --git a/keyboards/bastardkb/charybdis/4x6/keymaps/drashna/halconf.h b/keyboards/bastardkb/charybdis/4x6/keymaps/drashna/halconf.h new file mode 100644 index 0000000000..97a288d7bd --- /dev/null +++ b/keyboards/bastardkb/charybdis/4x6/keymaps/drashna/halconf.h @@ -0,0 +1,26 @@ +/* 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_PWM TRUE +#define HAL_USE_SERIAL TRUE +// #define HAL_USE_I2C TRUE +#define HAL_USE_SPI TRUE +#define SPI_USE_WAIT TRUE +#define SPI_SELECT_MODE SPI_SELECT_MODE_PAD +// #define HAL_USE_GPT TRUE + +#include_next <halconf.h> diff --git a/keyboards/bastardkb/charybdis/4x6/keymaps/drashna/keymap.c b/keyboards/bastardkb/charybdis/4x6/keymaps/drashna/keymap.c new file mode 100644 index 0000000000..e26ffc14aa --- /dev/null +++ b/keyboards/bastardkb/charybdis/4x6/keymaps/drashna/keymap.c @@ -0,0 +1,132 @@ +/** + * Copyright 2021 Charly Delay <charly@codesink.dev> (@0xcharly) + * + * 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 "drashna.h" + +#define LAYOUT_charybdis_4x6_wrapper(...) LAYOUT_charybdis_4x6(__VA_ARGS__) +#define LAYOUT_charybdis_4x6_base( \ + K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, \ + K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, \ + K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A \ + ) \ + LAYOUT_charybdis_4x6_wrapper( \ + KC_ESC, ________________NUMBER_LEFT________________, ________________NUMBER_RIGHT_______________, UC_CLUE, \ + SH_TT, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, SH_TT, \ + LALT_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, \ + KC_GRV, OS_LALT, OS_LGUI, TT(_MOUSE), KC_ENT, \ + KC_SPC, BK_LWER, DL_RAIS \ + ) + +#define LAYOUT_base_wrapper(...) LAYOUT_charybdis_4x6_base(__VA_ARGS__) + +// clang-format off +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [_DEFAULT_LAYER_1] = LAYOUT_base_wrapper( + _________________QWERTY_L1_________________, _________________QWERTY_R1_________________, + _________________QWERTY_L2_________________, _________________QWERTY_R2_________________, + _________________QWERTY_L3_________________, _________________QWERTY_R3_________________ + ), + + [_DEFAULT_LAYER_2] = LAYOUT_base_wrapper( + ______________COLEMAK_MOD_DH_L1____________, ______________COLEMAK_MOD_DH_R1____________, + ______________COLEMAK_MOD_DH_L2____________, ______________COLEMAK_MOD_DH_R2____________, + ______________COLEMAK_MOD_DH_L3____________, ______________COLEMAK_MOD_DH_R3____________ + ), + [_DEFAULT_LAYER_3] = LAYOUT_base_wrapper( + _________________COLEMAK_L1________________, _________________COLEMAK_R1________________, + _________________COLEMAK_L2________________, _________________COLEMAK_R2________________, + _________________COLEMAK_L3________________, _________________COLEMAK_R3________________ + ), + + [_DEFAULT_LAYER_4] = LAYOUT_base_wrapper( + _________________DVORAK_L1_________________, _________________DVORAK_R1_________________, + _________________DVORAK_L2_________________, _________________DVORAK_R2_________________, + _________________DVORAK_L3_________________, _________________DVORAK_R3_________________ + ), + + + + [_MOUSE] = LAYOUT_charybdis_4x6( + _______, _______, _______, _______, _______, _______, DRGSCRL, DPI_RMOD,DPI_MOD, S_D_RMOD,S_D_MOD, SNP_TOG, + _______, _______, _______, _______, _______, _______, KC_WH_U, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, KC_WH_D, KC_BTN1, KC_BTN3, KC_BTN2, KC_BTN6, SNIPING, + _______, _______, _______, _______, _______, _______, KC_BTN7, KC_BTN4, KC_BTN5, KC_BTN8, _______, _______, + _______, _______, _______, _______, _______, + _______, _______, _______ + ), + [_GAMEPAD] = LAYOUT_charybdis_4x6( + KC_ESC, KC_NO, KC_1, KC_2, KC_3, KC_4, _______, _______, _______, _______, _______, _______, + KC_F1, KC_K, KC_Q, KC_W, KC_E, KC_R, _______, _______, _______, _______, _______, _______, + KC_TAB, KC_G, KC_A, KC_S, KC_D, KC_F, _______, _______, _______, _______, _______, _______, + KC_LCTL, KC_LSFT, KC_Z, KC_X, KC_C, KC_H, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, + _______, _______, _______ + ), + [_DIABLO] = LAYOUT_charybdis_4x6( + KC_ESC, KC_V, KC_D, KC_LALT, KC_NO, KC_NO, KC_F9, KC_F10, KC_F11, KC_F12, KC_NO, KC_NO, + KC_TAB, KC_S, KC_I, KC_F, KC_M, KC_T, _______, _______, _______, _______, _______, _______, + KC_Q, KC_1, KC_2, KC_3, KC_4, KC_G, _______, _______, _______, _______, _______, _______, + KC_LCTL, KC_D3_1, KC_D3_2, KC_D3_3, KC_D3_4, KC_Z, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, + _______, _______, _______ + ), + [_DIABLOII] = LAYOUT_charybdis_4x6( + KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_GRV, _______, _______, _______, _______, _______, _______, + KC_TAB, KC_A, KC_T, KC_Q, KC_I, KC_M, _______, _______, _______, _______, _______, _______, + KC_S, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, _______, _______, _______, _______, _______, _______, + KC_LCTL, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, + _______, _______, _______ + ), + + [_LOWER] = LAYOUT_charybdis_4x6_wrapper( + KC_F12, _________________FUNC_LEFT_________________, _________________FUNC_RIGHT________________, KC_F11, + _______, _________________LOWER_L1__________________, _________________LOWER_R1__________________, _______, + _______, _________________LOWER_L2__________________, _________________LOWER_R2__________________, KC_PIPE, + _______, _________________LOWER_L3__________________, _________________LOWER_R3__________________, _______, + _______, _______, _______, _______, _______, + _______, _______, _______ + ), + + [_RAISE] = LAYOUT_charybdis_4x6_wrapper( + KC_F12, _________________FUNC_LEFT_________________, _________________FUNC_RIGHT________________, KC_F11, + KC_GRV, _________________RAISE_L1__________________, _________________RAISE_R1__________________, _______, + _______, _________________RAISE_L2__________________, _________________RAISE_R2__________________, KC_BSLS, + _______, _________________RAISE_L3__________________, _________________RAISE_R3__________________, _______, + _______, _______, _______, _______, _______, + _______, _______, _______ + ) + +}; +// clang-format on + + +void matrix_init_keyemap(void) { setPinInputHigh(A0); } + +void matrix_scan_keymap(void) { + if (!readPin(A0)) { + reset_keyboard(); + } +} + +#ifdef USB_VBUS_PIN +bool usb_vbus_state(void) { + setPinInputLow(USB_VBUS_PIN); + wait_us(5); + return readPin(USB_VBUS_PIN); +} +#endif diff --git a/keyboards/bastardkb/charybdis/4x6/keymaps/drashna/mcuconf.h b/keyboards/bastardkb/charybdis/4x6/keymaps/drashna/mcuconf.h new file mode 100644 index 0000000000..0f60612d79 --- /dev/null +++ b/keyboards/bastardkb/charybdis/4x6/keymaps/drashna/mcuconf.h @@ -0,0 +1,44 @@ +/* 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_I2C_I2C1_RX_DMA_STREAM +// #define STM32_I2C_I2C1_RX_DMA_STREAM STM32_DMA_STREAM_ID(1, 0) +#undef STM32_I2C_I2C1_TX_DMA_STREAM +#define STM32_I2C_I2C1_TX_DMA_STREAM STM32_DMA_STREAM_ID(1, 1) + +#undef STM32_PWM_USE_TIM2 +#define STM32_PWM_USE_TIM2 TRUE + +#undef STM32_PWM_USE_TIM3 +#define STM32_PWM_USE_TIM3 TRUE + +#undef STM32_SPI_USE_SPI1 +#define STM32_SPI_USE_SPI1 TRUE + +#undef STM32_SERIAL_USE_USART1 +#define STM32_SERIAL_USE_USART1 TRUE + +#undef STM32_GPT_USE_TIM4 +#define STM32_GPT_USE_TIM4 TRUE + +#undef STM32_ST_USE_TIMER +#define STM32_ST_USE_TIMER 5 diff --git a/keyboards/bastardkb/charybdis/4x6/keymaps/drashna/rules.mk b/keyboards/bastardkb/charybdis/4x6/keymaps/drashna/rules.mk new file mode 100644 index 0000000000..ab86b1b8ba --- /dev/null +++ b/keyboards/bastardkb/charybdis/4x6/keymaps/drashna/rules.mk @@ -0,0 +1,24 @@ +# MCU name +MCU = STM32F411 + +# Bootloader selection +BOOTLOADER = stm32-dfu +# BOOTLOADER := tinyuf2 + +LTO_ENABLE := no + +BOOTMAGIC_ENABLE = yes # Enable Bootmagic Lite +KEYBOARD_SHARED_EP = yes +MOUSE_SHARED_EP = yes + +EEPROM_DRIVER = spi +WS2812_DRIVER = pwm +SERIAL_DRIVER = usart + +MOUSEKEY_ENABLE = yes +NKRO_ENABLE = yes +CONSOLE_ENABLE = yes + +AUTOCORRECTION_ENABLE = yes + +DEBOUNCE_TYPE = asym_eager_defer_pk diff --git a/keyboards/handwired/tractyl_manuform/5x6_right/f411/mcuconf.h b/keyboards/handwired/tractyl_manuform/5x6_right/f411/mcuconf.h index d868eae48e..05b5776ac3 100644 --- a/keyboards/handwired/tractyl_manuform/5x6_right/f411/mcuconf.h +++ b/keyboards/handwired/tractyl_manuform/5x6_right/f411/mcuconf.h @@ -21,8 +21,8 @@ #undef STM32_I2C_USE_I2C1 #define STM32_I2C_USE_I2C1 TRUE -#undef STM32_I2C_I2C1_RX_DMA_STREAM -#define STM32_I2C_I2C1_RX_DMA_STREAM STM32_DMA_STREAM_ID(1, 0) +// #undef STM32_I2C_I2C1_RX_DMA_STREAM +// #define STM32_I2C_I2C1_RX_DMA_STREAM STM32_DMA_STREAM_ID(1, 0) #undef STM32_I2C_I2C1_TX_DMA_STREAM #define STM32_I2C_I2C1_TX_DMA_STREAM STM32_DMA_STREAM_ID(1, 1) @@ -35,19 +35,9 @@ #undef STM32_SPI_USE_SPI1 #define STM32_SPI_USE_SPI1 TRUE -#undef STM32_SPI_SPI1_RX_DMA_STREAM -#define STM32_SPI_SPI1_RX_DMA_STREAM STM32_DMA_STREAM_ID(2, 0) -#undef STM32_SPI_SPI1_TX_DMA_STREAM -#define STM32_SPI_SPI1_TX_DMA_STREAM STM32_DMA_STREAM_ID(2, 3) - #undef STM32_SERIAL_USE_USART2 #define STM32_SERIAL_USE_USART2 TRUE -#undef STM32_UART_USART2_RX_DMA_STREAM -#define STM32_UART_USART2_RX_DMA_STREAM STM32_DMA_STREAM_ID(1, 5) -#undef STM32_UART_USART2_TX_DMA_STREAM -#define STM32_UART_USART2_TX_DMA_STREAM STM32_DMA_STREAM_ID(1, 6) - #undef STM32_GPT_USE_TIM4 #define STM32_GPT_USE_TIM4 TRUE diff --git a/keyboards/handwired/tractyl_manuform/5x6_right/info.json b/keyboards/handwired/tractyl_manuform/5x6_right/info.json index 51eb009aa5..81a308fd21 100644 --- a/keyboards/handwired/tractyl_manuform/5x6_right/info.json +++ b/keyboards/handwired/tractyl_manuform/5x6_right/info.json @@ -1,7 +1,6 @@ { "keyboard_name": "Tractyl Manuform 5x6", "url": "", - "maintainer": "drashna", "layouts": { "LAYOUT_5x6_right": { "layout": [ diff --git a/keyboards/handwired/tractyl_manuform/5x6_right/keymaps/drashna/config.h b/keyboards/handwired/tractyl_manuform/5x6_right/keymaps/drashna/config.h index c3a30d2bc8..2a7a18f01b 100644 --- a/keyboards/handwired/tractyl_manuform/5x6_right/keymaps/drashna/config.h +++ b/keyboards/handwired/tractyl_manuform/5x6_right/keymaps/drashna/config.h @@ -22,3 +22,8 @@ #ifdef OLED_DRIVER_SH1107 # undef OLED_DISPLAY_128X64 #endif + +# define CHARYBDIS_MINIMUM_DEFAULT_DPI 1200 +# define CHARYBDIS_DEFAULT_DPI_CONFIG_STEP 200 +# define CHARYBDIS_MINIMUM_SNIPING_DPI 400 +# define CHARYBDIS_SNIPING_DPI_CONFIG_STEP 200 diff --git a/keyboards/handwired/tractyl_manuform/5x6_right/keymaps/drashna/keymap.c b/keyboards/handwired/tractyl_manuform/5x6_right/keymaps/drashna/keymap.c index 570760cf66..82fd4cbea3 100644 --- a/keyboards/handwired/tractyl_manuform/5x6_right/keymaps/drashna/keymap.c +++ b/keyboards/handwired/tractyl_manuform/5x6_right/keymaps/drashna/keymap.c @@ -60,13 +60,13 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { ), [_MOUSE] = LAYOUT_5x6_right( - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, - _______, _______, _______, _______, _______, _______, KC_WH_U, DPI_MOD, DPI_RMOD,S_D_MOD, S_D_RMOD,DRGSCRL, + _______, _______, _______, _______, _______, _______, DRGSCRL, DPI_RMOD,DPI_MOD, S_D_RMOD,S_D_MOD, SNP_TOG, + _______, _______, _______, _______, _______, _______, KC_WH_U, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_WH_D, KC_BTN1, KC_BTN3, KC_BTN2, KC_BTN6, SNIPING, _______, _______, _______, _______, _______, _______, KC_BTN7, KC_BTN4, KC_BTN5, KC_BTN8, _______, _______, _______, _______, _______, _______, _______, _______, KC_BTN3, - _______, KC_ACCEL, _______, + _______, _______, _______, _______, _______, _______, _______ ), [_GAMEPAD] = LAYOUT_5x6_right( @@ -104,30 +104,30 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { _______, _________________LOWER_L1__________________, _________________LOWER_R1__________________, _______, _______, _________________LOWER_L2__________________, _________________LOWER_R2__________________, KC_PIPE, _______, _________________LOWER_L3__________________, _________________LOWER_R3__________________, _______, - _______, _______, _______, _______, - _______, _______, _______, - _______, _______, _______, - _______, _______, _______, _______ + _______, _______, _______, _______, + _______, _______, _______, + _______, _______, _______, + _______, _______, _______, _______ ), [_RAISE] = LAYOUT_5x6_right_wrapper( - KC_F12, _________________FUNC_LEFT_________________, _________________FUNC_RIGHT________________, KC_F11, - KC_GRV, _________________RAISE_L1__________________, _________________RAISE_R1__________________, _______, - _______, _________________RAISE_L2__________________, _________________RAISE_R2__________________, KC_BSLS, - _______, _________________RAISE_L3__________________, _________________RAISE_R3__________________, _______, - _______, _______, _______, _______, - _______, _______, _______, - _______, _______, _______, - _______, _______, _______, _______ + KC_F12, _________________FUNC_LEFT_________________, _________________FUNC_RIGHT________________, KC_F11, + KC_GRV, _________________RAISE_L1__________________, _________________RAISE_R1__________________, _______, + _______, _________________RAISE_L2__________________, _________________RAISE_R2__________________, KC_BSLS, + _______, _________________RAISE_L3__________________, _________________RAISE_R3__________________, _______, + _______, _______, _______, _______, + _______, _______, _______, + _______, _______, _______, + _______, _______, _______, _______ ), [_ADJUST] = LAYOUT_5x6_right_wrapper( - KC_MAKE, KC_WIDE,KC_AUSSIE,KC_SCRIPT,KC_ZALGO,KC_NOMODE, KC_NOMODE,KC_BLOCKS,KC_REGIONAL,_______,_______, KC_RST, - VRSN, _________________ADJUST_L1_________________, _________________ADJUST_R1_________________, EEP_RST, - KEYLOCK, _________________ADJUST_L2_________________, _________________ADJUST_R2_________________, TG_MODS, - UC_MOD, _________________ADJUST_L3_________________, _________________ADJUST_R3_________________, KC_MPLY, - TG(_DIABLOII), AUTO_CTN, TG_GAME, TG_DBLO, - _______, REBOOT, KC_NUKE, - _______, _______, _______, - _______, _______, KC_NUKE, _______ + KC_MAKE, KC_WIDE,KC_AUSSIE,KC_SCRIPT,KC_ZALGO,KC_NOMODE, KC_NOMODE,KC_BLOCKS,KC_REGIONAL,_______,_______, KC_RST, + VRSN, _________________ADJUST_L1_________________, _________________ADJUST_R1_________________, EEP_RST, + KEYLOCK, _________________ADJUST_L2_________________, _________________ADJUST_R2_________________, TG_MODS, + UC_MOD, _________________ADJUST_L3_________________, _________________ADJUST_R3_________________, KC_MPLY, + TG(_DIABLOII), AUTO_CTN, TG_GAME, TG_DBLO, + _______, REBOOT, KC_NUKE, + _______, _______, _______, + _______, _______, KC_NUKE, _______ ), }; @@ -149,6 +149,16 @@ const uint16_t PROGMEM encoder_map[][NUM_ENCODERS][2] = { }; // clang-format on #else + +deferred_token encoder_token = INVALID_DEFERRED_TOKEN; +static int8_t last_direction = -1; + +static uint32_t encoder_callback(uint32_t trigger_time, void *cb_arg) { + unregister_code(last_direction ? KC_WH_D : KC_WH_U); + last_direction = -1; + return 0; +} + bool encoder_update_user(uint8_t index, bool clockwise) { # ifdef SWAP_HANDS_ENABLE if (swap_hands) { @@ -158,7 +168,20 @@ bool encoder_update_user(uint8_t index, bool clockwise) { if (index == 0) { tap_code_delay(clockwise ? KC_VOLD : KC_VOLU, 5); } else if (index == 1) { - tap_code_delay(clockwise ? KC_WH_D : KC_WH_U, 5); + if (last_direction != clockwise || encoder_token == INVALID_DEFERRED_TOKEN) { + uint8_t keycode = clockwise ? KC_WH_D : KC_WH_U; + last_direction = clockwise; + if (encoder_token != INVALID_DEFERRED_TOKEN) { + if (cancel_deferred_exec(encoder_token)) { + encoder_token = INVALID_DEFERRED_TOKEN; + } + unregister_code(clockwise ? KC_WH_U : KC_WH_D); + } + register_code(keycode); + encoder_token = defer_exec(MOUSEKEY_WHEEL_DELAY + MOUSEKEY_WHEEL_INTERVAL, encoder_callback, NULL); + } else { + extend_deferred_exec(encoder_token, MOUSEKEY_WHEEL_INTERVAL); + } } return false; } @@ -167,7 +190,9 @@ bool encoder_update_user(uint8_t index, bool clockwise) { #ifdef OLED_ENABLE extern uint16_t typing_mode; -oled_rotation_t oled_init_keymap(oled_rotation_t rotation) { return OLED_ROTATION_180; } +oled_rotation_t oled_init_keymap(oled_rotation_t rotation) { + return OLED_ROTATION_180; +} void oled_render_large_display(void) { if (is_keyboard_left()) { @@ -176,13 +201,16 @@ void oled_render_large_display(void) { oled_advance_page(true); oled_advance_page(true); + // clang-format off static const char PROGMEM logo[] = { 0x80, 0x81, 0x82, 0x83, 0x84, 0x85, 0x86, 0x87, 0x88, 0x89, 0x8A, 0x8B, 0x8C, 0x8D, 0x8E, 0x8F, 0x90, 0x91, 0x92, 0x93, 0x94, 0xA0, 0xA1, 0xA2, 0xA3, 0xA4, 0xA5, 0xA6, 0xA7, 0xA8, 0xA9, 0xAA, 0xAB, 0xAC, 0xAD, 0xAE, 0xAF, 0xB0, 0xB1, 0xB2, 0xB3, 0xB4, 0xC0, 0xC1, 0xC2, 0xC3, 0xC4, 0xC5, 0xC6, 0xC7, 0xC8, 0xC9, 0xCA, 0xCB, 0xCC, 0xCD, 0xCE, 0xCF, 0xD0, 0xD1, 0xD2, 0xD3, 0xD4, 0x00 }; + // clang-format on oled_write_P(logo, false); +# ifdef CUSTOM_UNICODE_ENABLE oled_set_cursor(1, 14); oled_write_ln_P(PSTR("Unicode:"), false); switch (typing_mode) { @@ -204,10 +232,14 @@ void oled_render_large_display(void) { case KC_ZALGO: oled_write_P(PSTR(" Zalgo"), false); break; - default: + case KC_NOMODE: oled_write_P(PSTR(" Normal"), false); break; + default: + oled_write_P(PSTR(" Unknown"), false); + break; } +# endif } } #endif diff --git a/keyboards/handwired/tractyl_manuform/5x6_right/keymaps/drashna/rules.mk b/keyboards/handwired/tractyl_manuform/5x6_right/keymaps/drashna/rules.mk index 9ef58ab5ec..4cad07ef66 100644 --- a/keyboards/handwired/tractyl_manuform/5x6_right/keymaps/drashna/rules.mk +++ b/keyboards/handwired/tractyl_manuform/5x6_right/keymaps/drashna/rules.mk @@ -10,6 +10,7 @@ ENCODER_ENABLE = yes ENCODER_MAP_ENABLE = yes AUTOCORRECTION_ENABLE = yes CAPS_WORD_ENABLE = yes +DEFERRED_EXEC_ENABLE = yes ifeq ($(strip $(KEYBOARD)), handwired/tractyl_manuform/5x6_right/elite_c) RGBLIGHT_ENABLE = no diff --git a/keyboards/handwired/tractyl_manuform/config.h b/keyboards/handwired/tractyl_manuform/config.h index f9160ea148..821f9be9b6 100644 --- a/keyboards/handwired/tractyl_manuform/config.h +++ b/keyboards/handwired/tractyl_manuform/config.h @@ -22,7 +22,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. /* USB Device descriptor parameter */ #define VENDOR_ID 0x44DD -#define MANUFACTURER Drashna /* disable debug print */ // #define NO_DEBUG diff --git a/keyboards/handwired/tractyl_manuform/info.json b/keyboards/handwired/tractyl_manuform/info.json new file mode 100644 index 0000000000..7214e6773b --- /dev/null +++ b/keyboards/handwired/tractyl_manuform/info.json @@ -0,0 +1,4 @@ +{ + "manufacturer": "QMK Community", + "maintainer": "Drashna Jael're" +} diff --git a/keyboards/handwired/tractyl_manuform/tractyl_manuform.c b/keyboards/handwired/tractyl_manuform/tractyl_manuform.c index 033146134d..0ae49b6397 100644 --- a/keyboards/handwired/tractyl_manuform/tractyl_manuform.c +++ b/keyboards/handwired/tractyl_manuform/tractyl_manuform.c @@ -247,7 +247,7 @@ static bool has_shift_mod(void) { * - default DPI: internal table index/actual DPI * - sniping DPI: internal table index/actual DPI */ -static void debug_charybdis_config_to_console(charybdis_config_t* config) { +__attribute__((unused)) static void debug_charybdis_config_to_console(charybdis_config_t* config) { # ifdef CONSOLE_ENABLE dprintf("(charybdis) process_record_kb: config = {\n" "\traw = 0x%04X,\n" @@ -264,7 +264,6 @@ static void debug_charybdis_config_to_console(charybdis_config_t* config) { bool process_record_kb(uint16_t keycode, keyrecord_t* record) { if (!process_record_user(keycode, record)) { - debug_charybdis_config_to_console(&g_charybdis_config); return false; } # ifndef NO_CHARYBDIS_KEYCODES @@ -321,7 +320,6 @@ bool process_record_kb(uint16_t keycode, keyrecord_t* record) { pointing_device_send(); } # endif // !MOUSEKEY_ENABLE - debug_charybdis_config_to_console(&g_charybdis_config); return true; } diff --git a/keyboards/handwired/tractyl_manuform/tractyl_manuform.h b/keyboards/handwired/tractyl_manuform/tractyl_manuform.h index 197aee985e..b62b6f7553 100644 --- a/keyboards/handwired/tractyl_manuform/tractyl_manuform.h +++ b/keyboards/handwired/tractyl_manuform/tractyl_manuform.h @@ -24,8 +24,6 @@ # include "4x6_right.h" #endif -#ifdef POINTING_DEVICE_ENABLE -# ifndef NO_CHARYBDIS_KEYCODES enum charybdis_keycodes { # ifdef VIA_ENABLE POINTER_DEFAULT_DPI_FORWARD = USER00, @@ -50,8 +48,8 @@ enum charybdis_keycodes { # define SNP_TOG SNIPING_MODE_TOGGLE # define DRGSCRL DRAGSCROLL_MODE # define DRG_TOG DRAGSCROLL_MODE_TOGGLE -# endif // !NO_CHARYBDIS_KEYCODES +#ifdef POINTING_DEVICE_ENABLE /** \brief Return the current DPI value for the pointer's default mode. */ uint16_t charybdis_get_pointer_default_dpi(void); diff --git a/keyboards/splitkb/kyria/keymaps/drashna/rules.mk b/keyboards/splitkb/kyria/keymaps/drashna/rules.mk index ddba0780a2..3ddcddbee3 100644 --- a/keyboards/splitkb/kyria/keymaps/drashna/rules.mk +++ b/keyboards/splitkb/kyria/keymaps/drashna/rules.mk @@ -20,6 +20,7 @@ ifeq ($(strip $(KEYBOARD)), splitkb/kyria/rev1/proton_c) CTPC = yes AUTOCORRECTION_ENABLE = yes CAPS_WORD_ENABLE = yes + OLED_DRIVER = custom DEBUG_MATRIX_SCAN_RATE_ENABLE = api else LTO_ENABLE = yes diff --git a/layouts/community/ortho_4x12/drashna/rules.mk b/layouts/community/ortho_4x12/drashna/rules.mk index 2905fb0fd4..e5c25d6fd5 100644 --- a/layouts/community/ortho_4x12/drashna/rules.mk +++ b/layouts/community/ortho_4x12/drashna/rules.mk @@ -1,24 +1,22 @@ -BOOTMAGIC_ENABLE = yes # Enable Bootmagic Lite +BOOTMAGIC_ENABLE = yes # Enable Bootmagic Lite MOUSEKEY_ENABLE = no # Mouse keys -EXTRAKEY_ENABLE = yes # Audio control and System control +EXTRAKEY_ENABLE = yes # Audio control and System control TAP_DANCE_ENABLE = no -SPACE_CADET_ENABLE = no NKRO_ENABLE = yes CAPS_WORD_ENABLE = no +CONSOLE_ENABLE = no +COMMAND_ENABLE = no +BACKLIGHT_ENABLE = no -ifneq ($(strip $(KEYBOARD)), planck/rev6) - CONSOLE_ENABLE = no - COMMAND_ENABLE = no - ifeq ($(strip $(LAYOUT_HAS_RGB)), yes) - RGBLIGHT_ENABLE = yes - INDICATOR_LIGHTS = yes - RGBLIGHT_STARTUP_ANIMATION = yes - endif -else +ifeq ($(strip $(LAYOUT_HAS_RGB)), yes) + RGBLIGHT_ENABLE = yes +endif + +ifeq ($(strip $(KEYBOARD)), planck/rev6) CONSOLE_ENABLE = yes RGBLIGHT_ENABLE = yes - RGBLIGHT_STARTUP_ANIMATION = yes RGB_MATRIX_ENABLE = no + RGBLIGHT_STARTUP_ANIMATION = yes AUDIO_ENABLE = yes EEPROM_DRIVER = i2c ENCODER_MAP_ENABLE = yes diff --git a/layouts/community/ortho_5x12/drashna/rules.mk b/layouts/community/ortho_5x12/drashna/rules.mk index 98ac829092..57cc3ce0be 100644 --- a/layouts/community/ortho_5x12/drashna/rules.mk +++ b/layouts/community/ortho_5x12/drashna/rules.mk @@ -1,7 +1,7 @@ -BOOTMAGIC_ENABLE = no # Enable Bootmagic Lite -MOUSEKEY_ENABLE = no # Mouse keys(+4700) -EXTRAKEY_ENABLE = yes # Audio control and System control(+450) -CONSOLE_ENABLE = no # Console for debug(+400) +BOOTMAGIC_ENABLE = yes # Enable Bootmagic Lite +MOUSEKEY_ENABLE = no # Mouse keys +EXTRAKEY_ENABLE = yes # Audio control and System control +CONSOLE_ENABLE = no # Console for debug COMMAND_ENABLE = no # Commands for debug and configuration TAP_DANCE_ENABLE = no NKRO_ENABLE = yes @@ -12,7 +12,7 @@ ifeq ($(strip $(KEYBOARD)), fractal) AUDIO_SUPPORTED = yes RGBLIGHT_SUPPORTED = yes RGBLIGHT_ENABLE = yes - RGBLIGHT_STARTUP_ANIMATION = yes + RGBLIGHT_STARTUP_ANIMATION = no BOOTLOADER = qmk-dfu CUSTOM_UNICODE_ENABLE = no endif diff --git a/layouts/community/split_3x6_3/drashna/keymap.c b/layouts/community/split_3x6_3/drashna/keymap.c index 4bd4618d0c..1bc758fce9 100644 --- a/layouts/community/split_3x6_3/drashna/keymap.c +++ b/layouts/community/split_3x6_3/drashna/keymap.c @@ -123,7 +123,7 @@ uint8_t current_kaki_frame = 0; uint8_t current_rtogi_frame = 0; // uint8_t current_ltogi_frame = 0; // clang-format off -void render_kitty(void) { +void render_small_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', 32x32px @@ -228,7 +228,7 @@ void render_kitty(void) { } void oled_driver_render_logo_right(void) { - render_kitty(); + render_small_kitty(); oled_set_cursor(0, 4); render_default_layer_state(); diff --git a/users/drashna/callbacks.c b/users/drashna/callbacks.c index f01aab433e..c11a381dee 100644 --- a/users/drashna/callbacks.c +++ b/users/drashna/callbacks.c @@ -33,10 +33,10 @@ void matrix_init_user(void) { __attribute__((weak)) void keyboard_post_init_keymap(void) {} void keyboard_post_init_user(void) { -#if defined(RGBLIGHT_ENABLE) +#if defined(CUSTOM_RGBLIGHT) keyboard_post_init_rgb_light(); #endif -#if defined(RGB_MATRIX_ENABLE) +#if defined(CUSTOM_RGB_MATRIX) keyboard_post_init_rgb_matrix(); #endif #if defined(SPLIT_KEYBOARD) && defined(SPLIT_TRANSACTION_IDS_USER) @@ -104,8 +104,10 @@ void matrix_scan_user(void) { #ifdef TAP_DANCE_ENABLE // Run Diablo 3 macro checking code. run_diablo_macro_check(); #endif // TAP_DANCE_ENABLE - -#if defined(RGB_MATRIX_ENABLE) +#ifdef CAPS_WORD_ENABLE + caps_word_task(); +#endif +#if defined(CUSTOM_RGB_MATRIX) matrix_scan_rgb_matrix(); #endif matrix_scan_secret(); @@ -126,12 +128,12 @@ layer_state_t layer_state_set_user(layer_state_t state) { } state = update_tri_layer_state(state, _RAISE, _LOWER, _ADJUST); -#if defined(POINTING_DEVICE_ENABLE) +#if defined(CUSTOM_POINTING_DEVICE) state = layer_state_set_pointing(state); #endif -#if defined(RGBLIGHT_ENABLE) +#if defined(CUSTOM_RGBLIGHT) state = layer_state_set_rgb_light(state); -#endif // RGBLIGHT_ENABLE +#endif // CUSTOM_RGBLIGHT #if defined(AUDIO_ENABLE) && !defined(__arm__) static bool is_gamepad_on = false; if (layer_state_cmp(state, _GAMEPAD) != is_gamepad_on) { @@ -156,9 +158,9 @@ layer_state_t default_layer_state_set_user(layer_state_t s state = default_layer_state_set_keymap(state); #if 0 -# if defined(RGBLIGHT_ENABLE) || defined(RGB_MATRIX_ENABLE) +# if defined(CUSTOM_RGBLIGHT) || defined(RGB_MATRIX_ENABLE) state = default_layer_state_set_rgb(state); -# endif // RGBLIGHT_ENABLE +# endif #endif return state; } diff --git a/users/drashna/callbacks.h b/users/drashna/callbacks.h index f6ac6b88de..5fe5f6a808 100644 --- a/users/drashna/callbacks.h +++ b/users/drashna/callbacks.h @@ -23,3 +23,6 @@ void matrix_init_unicode(void); #ifdef SPLIT_KEYBOARD void matrix_slave_scan_keymap(void); #endif +#ifdef CAPS_WORD_ENABLE +# include "keyrecords/caps_word.h" +#endif diff --git a/users/drashna/config.h b/users/drashna/config.h index f55ed36bc2..4551c3504f 100644 --- a/users/drashna/config.h +++ b/users/drashna/config.h @@ -291,4 +291,6 @@ # ifndef OLED_BRIGHTNESS # define OLED_BRIGHTNESS 50 # endif +# undef OLED_UPDATE_INTERVAL +# define OLED_UPDATE_INTERVAL 100 #endif diff --git a/users/drashna/keyrecords/caps_word.c b/users/drashna/keyrecords/caps_word.c index 0c7cd6cfe5..a152b2387b 100644 --- a/users/drashna/keyrecords/caps_word.c +++ b/users/drashna/keyrecords/caps_word.c @@ -1,83 +1,139 @@ -// Copyright 2021 Google LLC. -// SPDX-License-Identifier: Apache-2.0 - #include "caps_word.h" -#ifndef IS_COMMAND -# define IS_COMMAND() (get_mods() == MOD_MASK_SHIFT) -#endif - -bool caps_word_enabled = false; -bool caps_word_shifted = false; - -/** - * @brief Handler for Caps Word feature. - * - * This checks the keycodes, and applies shift to the correct keys, if and when needid. - * - * @param keycode Keycode from matrix - * @param record keyrecord_t data structure - * @return true Continue processing keycode and sent to host - * @return false Stop processing keycode, and do not send to host - */ +static bool caps_word_active = false; + +#if CAPS_WORD_IDLE_TIMEOUT > 0 +# if CAPS_WORD_IDLE_TIMEOUT < 100 || CAPS_WORD_IDLE_TIMEOUT > 30000 +// Constrain timeout to a sensible range. With the 16-bit timer, the longest +// representable timeout is 32768 ms, rounded here to 30000 ms = half a minute. +# error "caps_word: CAPS_WORD_IDLE_TIMEOUT must be between 100 and 30000 ms" +# endif + +static uint16_t idle_timer = 0; + +void caps_word_task(void) { + if (caps_word_active && timer_expired(timer_read(), idle_timer)) { + caps_word_set(false); + } +} +#endif // CAPS_WORD_IDLE_TIMEOUT > 0 + bool process_caps_word(uint16_t keycode, keyrecord_t* record) { - if (!caps_word_enabled) { +#ifndef NO_ACTION_ONESHOT + const uint8_t mods = get_mods() | get_oneshot_mods(); +#else + const uint8_t mods = get_mods(); +#endif // NO_ACTION_ONESHOT + + if (!caps_word_active) { // Pressing both shift keys at the same time enables caps word. - if (IS_COMMAND()) { - clear_mods(); - clear_oneshot_mods(); - caps_word_shifted = false; - caps_word_enabled = true; + if ((mods & MOD_MASK_SHIFT) == MOD_MASK_SHIFT) { + caps_word_set(true); // Activate Caps Word. return false; } return true; + } else { +#if CAPS_WORD_IDLE_TIMEOUT > 0 + idle_timer = record->event.time + CAPS_WORD_IDLE_TIMEOUT; +#endif // CAPS_WORD_IDLE_TIMEOUT > 0 } if (!record->event.pressed) { return true; } - if (!((get_mods() | get_oneshot_mods()) & ~MOD_MASK_SHIFT)) { + if (!(mods & ~MOD_MASK_SHIFT)) { switch (keycode) { + // Ignore MO, TO, TG, TT, and OSL layer switch keys. + case QK_MOMENTARY ... QK_MOMENTARY_MAX: + case QK_TO ... QK_TO_MAX: + case QK_TOGGLE_LAYER ... QK_TOGGLE_LAYER_MAX: + case QK_LAYER_TAP_TOGGLE ... QK_LAYER_TAP_TOGGLE_MAX: + case QK_ONE_SHOT_LAYER ... QK_ONE_SHOT_LAYER_MAX: + return true; + +#ifndef NO_ACTION_TAPPING case QK_MOD_TAP ... QK_MOD_TAP_MAX: - case QK_LAYER_TAP ... QK_LAYER_TAP_MAX: - // Earlier return if this has not been considered tapped yet. if (record->tap.count == 0) { + // Deactivate if a mod becomes active through holding a mod-tap key. + caps_word_set(false); return true; } - // Get the base tapping keycode of a mod- or layer-tap key. keycode &= 0xff; - } + break; - switch (keycode) { - // Letter keys should be shifted. - case KC_A ... KC_Z: - if (!caps_word_shifted) { - register_code(KC_LSFT); +# ifndef NO_ACTION_LAYER + case QK_LAYER_TAP ... QK_LAYER_TAP_MAX: +# endif // NO_ACTION_LAYER + if (record->tap.count == 0) { + return true; } - caps_word_shifted = true; - return true; + keycode &= 0xff; + break; +#endif // NO_ACTION_TAPPING - // Keycodes that continue caps word but shouldn't get shifted. - case KC_1 ... KC_0: - case KC_BSPC: - case KC_MINS: - case KC_UNDS: - if (caps_word_shifted) { - unregister_code(KC_LSFT); +#ifdef SWAP_HANDS_ENABLE + case QK_SWAP_HANDS ... QK_SWAP_HANDS_MAX: + if (keycode > 0x56F0 || record->tap.count == 0) { + return true; } - caps_word_shifted = false; - return true; + keycode &= 0xff; + break; +#endif // SWAP_HANDS_ENABLE + } - // Any other keycode disables caps word. + if (caps_word_press_user(keycode)) { + return true; } } - // Disable caps word. - caps_word_enabled = false; - if (caps_word_shifted) { - unregister_code(KC_LSFT); - } - caps_word_shifted = false; + caps_word_set(false); // Deactivate Caps Word. return true; } + +void caps_word_set(bool active) { + if (active != caps_word_active) { + if (active) { + clear_mods(); +#ifndef NO_ACTION_ONESHOT + clear_oneshot_mods(); +#endif // NO_ACTION_ONESHOT +#if CAPS_WORD_IDLE_TIMEOUT > 0 + idle_timer = timer_read() + CAPS_WORD_IDLE_TIMEOUT; +#endif // CAPS_WORD_IDLE_TIMEOUT > 0 + } else if ((get_weak_mods() & MOD_BIT(KC_LSFT)) != 0) { + // If the weak shift mod is still on, turn it off and send an update to + // the host computer. + del_weak_mods(MOD_BIT(KC_LSFT)); + send_keyboard_report(); + } + + caps_word_active = active; + caps_word_set_user(active); + } +} + +bool caps_word_get(void) { + return caps_word_active; +} + +__attribute__((weak)) void caps_word_set_user(bool active) {} + +__attribute__((weak)) bool caps_word_press_user(uint16_t keycode) { + switch (keycode) { + // Keycodes that continue Caps Word, with shift applied. + case KC_A ... KC_Z: + add_weak_mods(MOD_BIT(KC_LSFT)); // Apply shift to the next key. + return true; + + // Keycodes that continue Caps Word, without shifting. + case KC_1 ... KC_0: + case KC_BSPC: + case KC_MINS: + case KC_UNDS: + return true; + + default: + return false; // Deactivate Caps Word. + } +} diff --git a/users/drashna/keyrecords/caps_word.h b/users/drashna/keyrecords/caps_word.h index 79e410ddda..4279d7e831 100644 --- a/users/drashna/keyrecords/caps_word.h +++ b/users/drashna/keyrecords/caps_word.h @@ -5,4 +5,81 @@ #include "drashna.h" +// Call this function from `process_record_user()` to implement Caps Word. bool process_caps_word(uint16_t keycode, keyrecord_t* record); + +// If CAPS_WORD_IDLE_TIMEOUT is set, call `caps_word_task()` from +// `matrix_scan_user()` as described above. +// +// If CAPS_WORD_IDLE_TIMEOUT isn't set, calling this function has no effect (but +// will still compile). +#if CAPS_WORD_IDLE_TIMEOUT > 0 +void caps_word_task(void); +#else +static inline void caps_word_task(void) {} +#endif + +// Activates or deactivates Caps Word. For instance activate Caps Word with a +// combo by defining a `COMBO_ACTION` that calls `caps_word_set(true)`: +// +// void process_combo_event(uint16_t combo_index, bool pressed) { +// switch(combo_index) { +// case CAPS_COMBO: +// if (pressed) { +// caps_word_set(true); // Activate Caps Word. +// } +// break; +// +// // Other combos... +// } +// } +void caps_word_set(bool active); + +// Returns whether Caps Word is currently active. +bool caps_word_get(void); + +// An optional callback that gets called when Caps Word turns on or off. This is +// useful to represent the current Caps Word state, e.g. by setting an LED or +// playing a sound. In your keymap, define +// +// void caps_word_set_user(bool active) { +// if (active) { +// // Do something when Caps Word activates. +// } else { +// // Do something when Caps Word deactivates. +// } +// } +void caps_word_set_user(bool active); + +// An optional callback which is called on every key press while Caps Word is +// active. When the key should be shifted (that is, a letter key), the callback +// should call `add_weak_mods(MOD_BIT(KC_LSFT))` to shift the key. The callback +// also determines whether the key should continue Caps Word. Returning true +// continues the current "word", while returning false is "word breaking" and +// deactivates Caps Word. The default callback is +// +// bool caps_word_press_user(uint16_t keycode) { +// switch (keycode) { +// // Keycodes that continue Caps Word, with shift applied. +// case KC_A ... KC_Z: +// add_weak_mods(MOD_BIT(KC_LSFT)); // Apply shift to the next key. +// return true; +// +// // Keycodes that continue Caps Word, without shifting. +// case KC_1 ... KC_0: +// case KC_BSPC: +// case KC_MINS: +// case KC_UNDS: +// return true; +// +// default: +// return false; // Deactivate Caps Word. +// } +// } +// +// To customize, copy the above function into your keymap and add/remove +// keycodes to the above cases. +// +// NOTE: Outside of this callback, you can use `caps_word_set(false)` to +// deactivate Caps Word. +bool caps_word_press_user(uint16_t keycode); diff --git a/users/drashna/keyrecords/process_records.c b/users/drashna/keyrecords/process_records.c index 160a880215..99267d88a8 100644 --- a/users/drashna/keyrecords/process_records.c +++ b/users/drashna/keyrecords/process_records.c @@ -41,21 +41,21 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { #ifdef KEYLOGGER_ENABLE uprintf("KL: kc: 0x%04X, col: %2u, row: %2u, pressed: %b, time: %5u, int: %b, count: %u\n", keycode, record->event.key.col, record->event.key.row, record->event.pressed, record->event.time, record->tap.interrupted, record->tap.count); #endif // KEYLOGGER_ENABLE -#ifdef OLED_ENABLE +#if defined(OLED_ENABLE) && defined(CUSTOM_OLED_DRIVER) process_record_user_oled(keycode, record); #endif // OLED if (!(process_record_keymap(keycode, record) && process_record_secrets(keycode, record) -#ifdef RGB_MATRIX_ENABLE +#ifdef CUSTOM_RGB_MATRIX && process_record_user_rgb_matrix(keycode, record) #endif -#ifdef RGBLIGHT_ENABLE +#ifdef CUSTOM_RGBLIGHT && process_record_user_rgb_light(keycode, record) #endif #ifdef CUSTOM_UNICODE_ENABLE && process_record_unicode(keycode, record) #endif -#if defined(POINTING_DEVICE_ENABLE) +#if defined(CUSTOM_POINTING_DEVICE) && process_record_pointing(keycode, record) #endif #ifdef CAPS_WORD_ENABLE @@ -142,26 +142,26 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { } break; case KC_RGB_T: // This allows me to use underglow as layer indication, or as normal -#if defined(RGBLIGHT_ENABLE) || defined(RGB_MATRIX_ENABLE) +#if defined(CUSTOM_RGBLIGHT) || defined(CUSTOM_RGB_MATRIX) if (record->event.pressed) { userspace_config.rgb_layer_change ^= 1; dprintf("rgblight layer change [EEPROM]: %u\n", userspace_config.rgb_layer_change); eeconfig_update_user(userspace_config.raw); if (userspace_config.rgb_layer_change) { -# if defined(RGBLIGHT_ENABLE) && defined(RGB_MATRIX_ENABLE) +# if defined(CUSTOM_RGBLIGHT) && defined(CUSTOM_RGB_MATRIX) rgblight_enable_noeeprom(); # endif layer_state_set(layer_state); // This is needed to immediately set the layer color (looks better) -# if defined(RGBLIGHT_ENABLE) && defined(RGB_MATRIX_ENABLE) +# if defined(CUSTOM_RGBLIGHT) && defined(CUSTOM_RGB_MATRIX) } else { rgblight_disable_noeeprom(); # endif } } -#endif // RGBLIGHT_ENABLE +#endif // CUSTOM_RGBLIGHT break; -#if defined(RGBLIGHT_ENABLE) || defined(RGB_MATRIX_ENABLE) +#if defined(CUSTOM_RGBLIGHT) || defined(CUSTOM_RGB_MATRIX) case RGB_TOG: // Split keyboards need to trigger on key-up for edge-case issue # ifndef SPLIT_KEYBOARD @@ -169,10 +169,10 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { # else if (!record->event.pressed) { # endif -# if defined(RGBLIGHT_ENABLE) && !defined(RGBLIGHT_DISABLE_KEYCODES) +# if defined(CUSTOM_RGBLIGHT) && !defined(RGBLIGHT_DISABLE_KEYCODES) rgblight_toggle(); # endif -# if defined(RGB_MATRIX_ENABLE) && !defined(RGB_MATRIX_DISABLE_KEYCODES) +# if defined(CUSTOM_RGB_MATRIX) && !defined(RGB_MATRIX_DISABLE_KEYCODES) rgb_matrix_toggle(); # endif } @@ -181,7 +181,7 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { case RGB_MODE_FORWARD ... RGB_MODE_GRADIENT: // quantum_keycodes.h L400 for definitions if (record->event.pressed) { bool is_eeprom_updated; -# if defined(RGBLIGHT_ENABLE) && !defined(RGBLIGHT_DISABLE_KEYCODES) +# if defined(CUSTOM_RGBLIGHT) && !defined(RGBLIGHT_DISABLE_KEYCODES) // This disables layer indication, as it's assumed that if you're changing this ... you want that disabled if (userspace_config.rgb_layer_change) { userspace_config.rgb_layer_change = false; @@ -189,7 +189,7 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { is_eeprom_updated = true; } # endif -# if defined(RGB_MATRIX_ENABLE) && defined(RGB_MATRIX_FRAMEBUFFER_EFFECTS) +# if defined(CUSTOM_RGB_MATRIX) && defined(RGB_MATRIX_FRAMEBUFFER_EFFECTS) if (userspace_config.rgb_matrix_idle_anim) { userspace_config.rgb_matrix_idle_anim = false; dprintf("RGB Matrix Idle Animation [EEPROM]: %u\n", userspace_config.rgb_matrix_idle_anim); diff --git a/users/drashna/keyrecords/process_records.h b/users/drashna/keyrecords/process_records.h index d7a81d4607..5ca2966131 100644 --- a/users/drashna/keyrecords/process_records.h +++ b/users/drashna/keyrecords/process_records.h @@ -4,8 +4,10 @@ #pragma once #include "drashna.h" -#if defined(KEYBOARD_handwired_tractyl_manuform) +#if defined(KEYBOARD_handwired_tractyl_manuform) && defined(POINTING_DEVICE_ENABLE) # define PLACEHOLDER_SAFE_RANGE KEYMAP_SAFE_RANGE +#elif defined(KEYBOARD_bastardkb_charybdis) +# define PLACEHOLDER_SAFE_RANGE CHARYBDIS_SAFE_RANGE #else # define PLACEHOLDER_SAFE_RANGE SAFE_RANGE #endif diff --git a/users/drashna/keyrecords/unicode.c b/users/drashna/keyrecords/unicode.c index 5acd51da9b..af87ee2a61 100644 --- a/users/drashna/keyrecords/unicode.c +++ b/users/drashna/keyrecords/unicode.c @@ -6,7 +6,7 @@ #include "drashna.h" #include "process_unicode_common.h" -uint16_t typing_mode; +uint16_t typing_mode = KC_NOMODE; /** * @brief Registers the unicode keystrokes based on desired unicode @@ -245,7 +245,7 @@ bool process_record_unicode(uint16_t keycode, keyrecord_t *record) { if (typing_mode != keycode) { typing_mode = keycode; } else { - typing_mode = 0; + typing_mode = KC_NOMODE; } } break; diff --git a/users/drashna/oled/oled_stuff.c b/users/drashna/oled/oled_stuff.c index 752829e0fa..2a26b8b638 100644 --- a/users/drashna/oled/oled_stuff.c +++ b/users/drashna/oled/oled_stuff.c @@ -19,6 +19,9 @@ #ifdef UNICODE_COMMON_ENABLE # include "process_unicode_common.h" #endif +# ifdef AUDIO_CLICKY +# include "process_clicky.h" +# endif #include <string.h> extern bool host_driver_disabled; @@ -26,7 +29,9 @@ extern bool host_driver_disabled; uint32_t oled_timer = 0; char keylog_str[OLED_KEYLOGGER_LENGTH] = {0}; static uint16_t log_timer = 0; +#ifdef OLED_DISPLAY_VERBOSE static const char PROGMEM display_border[3] = {0x0, 0xFF, 0x0}; +#endif deferred_token kittoken; @@ -101,12 +106,6 @@ bool process_record_user_oled(uint16_t keycode, keyrecord_t *record) { return true; } -void update_log(void) { - if (timer_elapsed(log_timer) > 750) { - // add_keylog(0); - } -} - /** * @brief Renders keylogger buffer to oled * @@ -448,20 +447,24 @@ void render_bootmagic_status(void) { #endif } -#if defined(POINTING_DEVICE_ENABLE) +#if defined(CUSTOM_POINTING_DEVICE) extern bool tap_toggling; #endif void render_user_status(void) { #ifdef AUDIO_ENABLE - bool is_audio_on = false, is_clicky_on = false; + bool is_audio_on = false, l_is_clicky_on = false; # ifdef SPLIT_KEYBOARD - is_audio_on = user_state.audio_enable; - is_clicky_on = user_state.audio_clicky_enable; + is_audio_on = user_state.audio_enable; +# ifdef AUDIO_CLICKY + l_is_clicky_on = user_state.audio_clicky_enable; +# endif # else is_audio_on = is_audio_on(); - is_clicky_on = is_clicky_on(); +# ifdef AUDIO_CLICKY + l_is_clicky_on = is_clicky_on(); +# endif # endif #endif #if defined(OLED_DISPLAY_VERBOSE) @@ -476,7 +479,7 @@ void render_user_status(void) { # if !defined(OLED_DISPLAY_VERBOSE) oled_write_P(PSTR(" "), false); # endif -#elif defined(POINTING_DEVICE_ENABLE) +#elif defined(CUSTOM_POINTING_DEVICE) static const char PROGMEM mouse_lock[3] = {0xF2, 0xF3, 0}; oled_write_P(mouse_lock, tap_toggling); #endif @@ -486,7 +489,7 @@ void render_user_status(void) { # ifdef AUDIO_CLICKY static const char PROGMEM audio_clicky_status[2][3] = {{0xF4, 0xF5, 0}, {0xF6, 0xF7, 0}}; - oled_write_P(audio_clicky_status[is_clicky_on && is_audio_on], false); + oled_write_P(audio_clicky_status[l_is_clicky_on && is_audio_on], false); # if !defined(OLED_DISPLAY_VERBOSE) oled_write_P(PSTR(" "), false); # endif @@ -540,6 +543,7 @@ void render_wpm(uint8_t padding) { // vertical_offset = 0; void render_wpm_graph(uint8_t max_lines_graph, uint8_t vertical_offset) { +#ifdef WPM_ENABLE static uint16_t timer = 0; static uint8_t x = OLED_DISPLAY_HEIGHT - 1; uint8_t currwpm = get_current_wpm(); @@ -588,6 +592,7 @@ void render_wpm_graph(uint8_t max_lines_graph, uint8_t vertical_offset) { timer = timer_read(); // refresh the timer for the next iteration } +#endif } #if defined(POINTING_DEVICE_ENABLE) @@ -625,7 +630,7 @@ __attribute__((weak)) void oled_driver_render_logo_right(void) { //#define ANIM_FRAME_DURATION 500 // how long each frame lasts in ms // #define SLEEP_TIMER 60000 // should sleep after this period of 0 wpm, needs fixing -#define OLED_ANIM_SIZE 32 // number of bytes in array, minimize for adequate firmware size, max is 1024 +#define OLED_ANIM_SIZE 36 #define OLED_ANIM_ROWS 4 #define OLED_ANIM_MAX_FRAMES 3 #if (OLED_SLEEP_FRAMES > OLED_ANIM_MAX_FRAMES) || (OLED_WAKE_FRAMES > OLED_ANIM_MAX_FRAMES) || (OLED_KAKI_FRAMES > OLED_ANIM_MAX_FRAMES) || (OLED_RTOGI_FRAMES > OLED_ANIM_MAX_FRAMES) @@ -645,247 +650,67 @@ void render_kitty(void) { // sleep frames { { - { - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x08, - 0xa8, 0x48, 0xa8, 0x18, 0x08, 0x00, 0x00, 0x00, - 0x80, 0x80, 0x80, 0x80, 0x80, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 - }, - { - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x03, - 0x02, 0x02, 0x02, 0x02, 0x02, 0x00, 0x00, 0x80, - 0x44, 0x84, 0x06, 0x05, 0x04, 0x80, 0x40, 0x20, - 0x10, 0xe0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 - }, - { - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x20, - 0x18, 0x04, 0x04, 0x02, 0x7a, 0x86, 0x01, 0x80, - 0x80, 0x01, 0x03, 0x05, 0x07, 0x01, 0x00, 0x00, - 0x80, 0x83, 0x45, 0xfa, 0x3c, 0xe0, 0x00, 0x00 - }, - { - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0x08, - 0x10, 0x10, 0x10, 0x10, 0x10, 0x33, 0x24, 0x28, - 0x28, 0x29, 0x29, 0x29, 0x3a, 0x18, 0x1c, 0x39, - 0x24, 0x24, 0x3a, 0x2d, 0x26, 0x31, 0x1f, 0x00 - } + { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x08, 0xa8, 0x48, 0xa8, 0x18, 0x08, 0x00, 0x00, 0x00, 0x80, 0x80, 0x80, 0x80, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x03, 0x02, 0x02, 0x02, 0x02, 0x02, 0x00, 0x00, 0x80, 0x44, 0x84, 0x06, 0x05, 0x04, 0x80, 0x40, 0x20, 0x10, 0xe0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x20, 0x18, 0x04, 0x04, 0x02, 0x7a, 0x86, 0x01, 0x80, 0x80, 0x01, 0x03, 0x05, 0x07, 0x01, 0x00, 0x00, 0x80, 0x83, 0x45, 0xfa, 0x3c, 0xe0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0x08, 0x10, 0x10, 0x10, 0x10, 0x10, 0x33, 0x24, 0x28, 0x28, 0x29, 0x29, 0x29, 0x3a, 0x18, 0x1c, 0x39, 0x24, 0x24, 0x3a, 0x2d, 0x26, 0x31, 0x1f, 0x00, 0x00, 0x00, 0x00, 0x00 } }, { - { - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 - }, - { - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x22, 0x22, 0x3a, 0x2a, 0x26, 0x22, 0x80, 0xc0, - 0x80, 0x00, 0x24, 0x34, 0x2c, 0xe4, 0x60, 0x10, - 0x70, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 - }, - { - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x38, - 0x04, 0x02, 0x02, 0x01, 0x79, 0x87, 0x01, 0x80, - 0x81, 0x83, 0x05, 0x05, 0x03, 0x01, 0x00, 0x00, - 0x80, 0x43, 0x05, 0xfa, 0x3c, 0xe0, 0x00, 0x00 - }, - { - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0x08, - 0x10, 0x10, 0x10, 0x10, 0x10, 0x33, 0x24, 0x28, - 0x28, 0x28, 0x29, 0x29, 0x3a, 0x18, 0x1c, 0x39, - 0x24, 0x24, 0x3a, 0x2d, 0x26, 0x31, 0x1f, 0x00 - } + { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x22, 0x22, 0x3a, 0x2a, 0x26, 0x22, 0x80, 0xc0, 0x80, 0x00, 0x24, 0x34, 0x2c, 0xe4, 0x60, 0x10, 0x70, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x38, 0x04, 0x02, 0x02, 0x01, 0x79, 0x87, 0x01, 0x80, 0x81, 0x83, 0x05, 0x05, 0x03, 0x01, 0x00, 0x00, 0x80, 0x43, 0x05, 0xfa, 0x3c, 0xe0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0x08, 0x10, 0x10, 0x10, 0x10, 0x10, 0x33, 0x24, 0x28, 0x28, 0x28, 0x29, 0x29, 0x3a, 0x18, 0x1c, 0x39, 0x24, 0x24, 0x3a, 0x2d, 0x26, 0x31, 0x1f, 0x00, 0x00, 0x00, 0x00, 0x00 } } }, // wake frames { { - { - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0xc0, 0x30, 0x08, 0x10, 0x60, 0x80, - 0x00, 0x80, 0x60, 0x10, 0x08, 0x30, 0xc0, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 - }, - { - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x7f, 0x80, 0x40, 0x40, 0x5c, 0x00, 0x01, - 0x41, 0x01, 0x00, 0x5c, 0x40, 0x40, 0x80, 0x7f, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 - }, - { - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, - 0x40, 0x40, 0x80, 0xe1, 0x12, 0x0a, 0x06, 0x00, - 0x80, 0x00, 0x06, 0x0a, 0x12, 0xe1, 0x80, 0x40, - 0x40, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 - }, - { - 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x1f, 0x14, - 0x14, 0x10, 0x10, 0x11, 0x1f, 0x10, 0x10, 0x18, - 0x0f, 0x18, 0x10, 0x10, 0x1f, 0x11, 0x10, 0x10, - 0x14, 0x14, 0x1f, 0x1c, 0x14, 0x14, 0x14, 0x08 - } + { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x30, 0x08, 0x10, 0x60, 0x80, 0x00, 0x80, 0x60, 0x10, 0x08, 0x30, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7f, 0x80, 0x40, 0x40, 0x5c, 0x00, 0x01, 0x41, 0x01, 0x00, 0x5c, 0x40, 0x40, 0x80, 0x7f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x40, 0x40, 0x80, 0xe1, 0x12, 0x0a, 0x06, 0x00, 0x80, 0x00, 0x06, 0x0a, 0x12, 0xe1, 0x80, 0x40, 0x40, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + { 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x1f, 0x14, 0x14, 0x10, 0x10, 0x11, 0x1f, 0x10, 0x10, 0x18, 0x0f, 0x18, 0x10, 0x10, 0x1f, 0x11, 0x10, 0x10, 0x14, 0x14, 0x1f, 0x1c, 0x14, 0x14, 0x14, 0x08, 0x00, 0x00, 0x00, 0x00 } }, { - { - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0xc0, 0x30, 0x08, 0x10, 0x60, 0x80, - 0x00, 0x80, 0x60, 0x10, 0x08, 0x30, 0xc0, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 - }, - { - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x7f, 0x90, 0x12, 0x0a, 0x02, 0xf4, 0x09, - 0x0d, 0xf1, 0x04, 0x02, 0x0a, 0x12, 0x90, 0x7f, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 - }, - { - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, - 0x40, 0x40, 0x80, 0xe1, 0x12, 0x0a, 0x06, 0x01, - 0x81, 0x00, 0x06, 0x0a, 0x12, 0xe1, 0x80, 0x40, - 0x40, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 - }, - { - 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x1f, 0x14, - 0x14, 0x10, 0x10, 0x11, 0x1f, 0x10, 0x10, 0x18, - 0x0f, 0x18, 0x10, 0x10, 0x1f, 0x11, 0x10, 0x10, - 0x14, 0x14, 0x1f, 0x1c, 0x14, 0x14, 0x14, 0x08 - } + { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x30, 0x08, 0x10, 0x60, 0x80, 0x00, 0x80, 0x60, 0x10, 0x08, 0x30, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7f, 0x90, 0x12, 0x0a, 0x02, 0xf4, 0x09, 0x0d, 0xf1, 0x04, 0x02, 0x0a, 0x12, 0x90, 0x7f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x40, 0x40, 0x80, 0xe1, 0x12, 0x0a, 0x06, 0x01, 0x81, 0x00, 0x06, 0x0a, 0x12, 0xe1, 0x80, 0x40, 0x40, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + { 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x1f, 0x14, 0x14, 0x10, 0x10, 0x11, 0x1f, 0x10, 0x10, 0x18, 0x0f, 0x18, 0x10, 0x10, 0x1f, 0x11, 0x10, 0x10, 0x14, 0x14, 0x1f, 0x1c, 0x14, 0x14, 0x14, 0x08, 0x00, 0x00, 0x00, 0x00 } } }, // kaki frames { { - { - 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x40, 0x40, - 0x80, 0x80, 0x80, 0x00, 0xfc, 0x84, 0x08, 0x08, - 0x10, 0x20, 0x40, 0x40, 0x80, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 - }, - { - 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x1e, 0x60, - 0x80, 0x00, 0x00, 0x91, 0xa1, 0x80, 0x00, 0x00, - 0x22, 0x84, 0x40, 0x50, 0x48, 0xc1, 0x3e, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 - }, - { - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, - 0x40, 0x41, 0x82, 0xe2, 0x12, 0x0a, 0x06, 0x00, - 0x80, 0x88, 0x4f, 0x02, 0x22, 0xe2, 0x9f, 0x40, - 0x40, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 - }, - { - 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x1f, 0x14, - 0x14, 0x10, 0x10, 0x11, 0x1f, 0x10, 0x10, 0x18, - 0x0f, 0x18, 0x14, 0x10, 0x10, 0x10, 0x10, 0x10, - 0x14, 0x14, 0x1f, 0x1a, 0x0a, 0x0a, 0x04, 0x00 - } + { 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x40, 0x40, 0x80, 0x80, 0x80, 0x00, 0xfc, 0x84, 0x08, 0x08, 0x10, 0x20, 0x40, 0x40, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + { 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x1e, 0x60, 0x80, 0x00, 0x00, 0x91, 0xa1, 0x80, 0x00, 0x00, 0x22, 0x84, 0x40, 0x50, 0x48, 0xc1, 0x3e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x40, 0x41, 0x82, 0xe2, 0x12, 0x0a, 0x06, 0x00, 0x80, 0x88, 0x4f, 0x02, 0x22, 0xe2, 0x9f, 0x40, 0x40, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + { 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x1f, 0x14, 0x14, 0x10, 0x10, 0x11, 0x1f, 0x10, 0x10, 0x18, 0x0f, 0x18, 0x14, 0x10, 0x10, 0x10, 0x10, 0x10, 0x14, 0x14, 0x1f, 0x1a, 0x0a, 0x0a, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00 } }, { - { - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0xf0, 0x10, 0x20, 0x20, 0x40, 0x40, 0x80, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 - }, - { - 0x00, 0x00, 0x06, 0x1a, 0x22, 0xc2, 0x04, 0x04, - 0x04, 0x07, 0x00, 0xc0, 0x20, 0x10, 0x80, 0x80, - 0x01, 0x01, 0x02, 0xfc, 0xfe, 0x02, 0x3c, 0x20, - 0x40, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 - }, - { - 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0x0d, 0x8d, - 0x55, 0x50, 0x94, 0xf0, 0x10, 0x09, 0x08, 0x00, - 0x80, 0x00, 0x06, 0x09, 0x1b, 0xee, 0x00, 0x00, - 0x00, 0x00, 0x81, 0xfe, 0x00, 0x00, 0x00, 0x00 - }, - { - 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x1f, 0x14, - 0x14, 0x10, 0x10, 0x11, 0x1f, 0x10, 0x10, 0x18, - 0x0f, 0x18, 0x10, 0x10, 0x1f, 0x19, 0x18, 0x1c, - 0x14, 0x16, 0x15, 0x14, 0x14, 0x14, 0x14, 0x08 - } + { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x10, 0x20, 0x20, 0x40, 0x40, 0x80, 0x00, 0x00, 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, 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, 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, 0x80, 0x40, 0x80, 0x00, - 0x00, 0x00, 0x00, 0x00, 0xe0, 0x10, 0x20, 0x40, - 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 - }, - { - 0x00, 0x00, 0x00, 0x00, 0x0f, 0xf0, 0x00, 0x01, - 0x02, 0x04, 0x04, 0x03, 0x80, 0x40, 0x40, 0x20, - 0x00, 0x01, 0x02, 0x8c, 0x70, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 - }, - { - 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0x0d, 0x8d, - 0x55, 0x50, 0x94, 0xf0, 0x10, 0x0a, 0x0e, 0x1d, - 0x95, 0x24, 0x24, 0x27, 0x13, 0xe1, 0x01, 0x01, - 0x01, 0x01, 0x02, 0xfc, 0x00, 0x00, 0x00, 0x00 - }, - { - 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x1f, 0x14, - 0x14, 0x10, 0x10, 0x11, 0x1f, 0x10, 0x10, 0x18, - 0x0f, 0x18, 0x10, 0x10, 0x1f, 0x19, 0x18, 0x1c, - 0x14, 0x14, 0x17, 0x14, 0x14, 0x14, 0x14, 0x08 - } + { 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, 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, 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, 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 } } }, // rtogi frames { { - { - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0xc0, 0x20, 0x10, 0x10, 0x08, 0x04, 0x02, - 0x01, 0x0f, 0x90, 0x10, 0x20, 0xf0, 0xf8, 0xf8 - }, - { - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, - 0x40, 0x20, 0x10, 0x10, 0x08, 0x08, 0x08, 0x08, - 0x48, 0x47, 0x88, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x08, 0x88, 0xc7, 0xc4, 0x62, 0x23, 0x11, 0x3f - }, - { - 0x80, 0x40, 0x20, 0x10, 0x88, 0xcc, 0x43, 0x80, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0xc0, - 0x80, 0x80, 0xc0, 0xe1, 0xfe, 0xb8, 0x88, 0x0c, - 0x04, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 - }, - { - 0x00, 0x01, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, - 0x01, 0x01, 0x01, 0x06, 0x04, 0x04, 0x04, 0x04, - 0x05, 0x04, 0x04, 0x04, 0x07, 0x07, 0x07, 0x03, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 - } + { 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, 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 }, + { 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, 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, 0xc0, 0x20, 0x10, 0x10, 0x08, 0x04, 0x02, - 0x01, 0x1f, 0xa0, 0x20, 0x40, 0x80, 0x00, 0xf0 - }, - { - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, - 0x40, 0x20, 0x10, 0x10, 0x08, 0x08, 0x08, 0x08, - 0x48, 0x47, 0x88, 0x00, 0x00, 0x00, 0x00, 0x24, - 0x24, 0x28, 0x6b, 0x40, 0xa0, 0x99, 0x86, 0xff - }, - { - 0x0f, 0x11, 0x22, 0x44, 0x48, 0x4c, 0x43, 0x80, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0xc0, - 0x80, 0x80, 0xc0, 0xe1, 0xfe, 0xb8, 0x88, 0x0c, - 0x04, 0x06, 0x06, 0x06, 0x0e, 0x0e, 0x06, 0x01 - }, - { - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x01, 0x01, 0x01, 0x06, 0x04, 0x04, 0x04, 0x04, - 0x05, 0x04, 0x04, 0x04, 0x07, 0x07, 0x07, 0x03, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 - } + { 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, 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 }, + { 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, 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 } } } }; @@ -899,7 +724,7 @@ void render_kitty(void) { uint32_t kitty_animation_phases(uint32_t triger_time, void *cb_arg) { static uint32_t anim_frame_duration = 500; -#ifdef POINTING_DEVICE_ENABLE +#ifdef CUSTOM_POINTING_DEVICE if (tap_toggling) { animation_frame = (animation_frame + 1) % OLED_RTOGI_FRAMES; animation_type = 3; @@ -953,7 +778,7 @@ void oled_driver_render_logo_left(void) { render_matrix_scan_rate(2); # endif oled_set_cursor(7, 2); -# if defined(KEYBOARD_bastardkb_charybdis) || defined(KEYBOARD_handwired_tractyl_manuform) +# if (defined(KEYBOARD_bastardkb_charybdis) || defined(KEYBOARD_handwired_tractyl_manuform)) && defined(POINTING_DEVICE_ENABLE) render_pointing_dpi_status(charybdis_get_pointer_sniping_enabled() ? charybdis_get_pointer_sniping_dpi() : charybdis_get_pointer_default_dpi(), 1); // credit and thanks to jaspertandy on discord for these images @@ -1054,7 +879,6 @@ oled_rotation_t oled_init_user(oled_rotation_t rotation) { __attribute__((weak)) bool oled_task_keymap(void) { return true; } bool oled_task_user(void) { - update_log(); if (is_keyboard_master()) { #ifndef OLED_DISPLAY_TEST diff --git a/users/drashna/oled/sh110x.c b/users/drashna/oled/sh110x.c index c850a47538..cfdae1db16 100644 --- a/users/drashna/oled/sh110x.c +++ b/users/drashna/oled/sh110x.c @@ -26,8 +26,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. #include "keyboard.h" -// Used commands from spec sheet: https://cdn-shop.adafruit.com/datasheets/SSD1306.pdf -// for SH1106: https://www.velleman.eu/downloads/29/infosheets/sh1106_datasheet.pdf +// for SH1107: https://www.displayfuture.com/Display/datasheet/controller/SH1107.pdf // Fundamental Commands #define CONTRAST 0x81 @@ -97,17 +96,8 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. #define OLED_ALL_BLOCKS_MASK (((((OLED_BLOCK_TYPE)1 << (OLED_BLOCK_COUNT - 1)) - 1) << 1) | 1) -#define OLED_IC_HAS_HORIZONTAL_MODE (OLED_IC == OLED_IC_SSD1306) -#define OLED_IC_COM_PINS_ARE_COLUMNS (OLED_IC == OLED_IC_SH1107) - #ifndef OLED_COM_PIN_COUNT -# if OLED_IC == OLED_IC_SH1106 -# define OLED_COM_PIN_COUNT 64 -# elif OLED_IC == OLED_IC_SH1107 -# define OLED_COM_PIN_COUNT 128 -# else -# error Invalid OLED_IC value -# endif +# define OLED_COM_PIN_COUNT 128 #endif #ifndef OLED_COM_PIN_OFFSET @@ -203,24 +193,12 @@ bool oled_init(oled_rotation_t rotation) { DISPLAY_CLOCK, 0x80, MULTIPLEX_RATIO, -#if OLED_IC_COM_PINS_ARE_COLUMNS OLED_DISPLAY_WIDTH - 1, -#else - OLED_DISPLAY_HEIGHT - 1, -#endif - DISPLAY_OFFSET, + SH1107_DISPLAY_START_LINE, 0x00, - DISPLAY_START_LINE | 0x00, CHARGE_PUMP, 0x14, -#if (OLED_IC != OLED_IC_SH1106) - // MEMORY_MODE is unsupported on SH1106 (Page Addressing only) - MEMORY_MODE, - 0x00, // Horizontal addressing mode -#elif OLED_IC == OLED_IC_SH1107 - // Page addressing mode SH1107_MEMORY_MODE_PAGE, -#endif }; if (I2C_TRANSMIT_P(display_setup1) != I2C_STATUS_SUCCESS) { print("oled_init cmd set 1 failed\n"); @@ -229,7 +207,11 @@ bool oled_init(oled_rotation_t rotation) { if (!HAS_FLAGS(oled_rotation, OLED_ROTATION_180)) { static const uint8_t PROGMEM display_normal[] = { - I2C_CMD, SEGMENT_REMAP_INV, COM_SCAN_DEC, DISPLAY_OFFSET, OLED_COM_PIN_OFFSET, + I2C_CMD, + SEGMENT_REMAP_INV, + COM_SCAN_DEC, + DISPLAY_OFFSET, + OLED_COM_PIN_OFFSET, }; if (I2C_TRANSMIT_P(display_normal) != I2C_STATUS_SUCCESS) { print("oled_init cmd normal rotation failed\n"); @@ -237,7 +219,11 @@ bool oled_init(oled_rotation_t rotation) { } } else { static const uint8_t PROGMEM display_flipped[] = { - I2C_CMD, SEGMENT_REMAP, COM_SCAN_INC, DISPLAY_OFFSET, (OLED_COM_PIN_COUNT - OLED_COM_PIN_OFFSET) % OLED_COM_PIN_COUNT, + I2C_CMD, + SEGMENT_REMAP, + COM_SCAN_INC, + DISPLAY_OFFSET, + (OLED_COM_PIN_COUNT - OLED_COM_PIN_OFFSET) % OLED_COM_PIN_COUNT, }; if (I2C_TRANSMIT_P(display_flipped) != I2C_STATUS_SUCCESS) { print("display_flipped failed\n"); @@ -245,7 +231,18 @@ bool oled_init(oled_rotation_t rotation) { } } - static const uint8_t PROGMEM display_setup2[] = {I2C_CMD, COM_PINS, OLED_COM_PINS, CONTRAST, OLED_BRIGHTNESS, PRE_CHARGE_PERIOD, 0x22, VCOM_DETECT, 0x35, DISPLAY_ALL_ON_RESUME, NORMAL_DISPLAY, DEACTIVATE_SCROLL, DISPLAY_ON}; if (I2C_TRANSMIT_P(display_setup2) != I2C_STATUS_SUCCESS) { + static const uint8_t PROGMEM display_setup2[] = { + I2C_CMD, COM_PINS, + OLED_COM_PINS, + CONTRAST, OLED_BRIGHTNESS, + PRE_CHARGE_PERIOD, 0x22, + VCOM_DETECT, 0x35, + DISPLAY_ALL_ON_RESUME, + NORMAL_DISPLAY, + DEACTIVATE_SCROLL, + DISPLAY_ON + }; + if (I2C_TRANSMIT_P(display_setup2) != I2C_STATUS_SUCCESS) { print("display_setup2 failed\n"); return false; } @@ -277,22 +274,11 @@ static void calc_bounds(uint8_t update_start, uint8_t *cmd_array) { // Calculate commands to set memory addressing bounds. uint8_t start_page = OLED_BLOCK_SIZE * update_start / OLED_DISPLAY_WIDTH; uint8_t start_column = OLED_BLOCK_SIZE * update_start % OLED_DISPLAY_WIDTH; -#if !OLED_IC_HAS_HORIZONTAL_MODE // Commands for Page Addressing Mode. Sets starting page and column; has no end bound. // Column value must be split into high and low nybble and sent as two commands. cmd_array[0] = PAM_PAGE_ADDR | start_page; cmd_array[1] = PAM_SETCOLUMN_LSB | ((OLED_COLUMN_OFFSET + start_column) & 0x0f); cmd_array[2] = PAM_SETCOLUMN_MSB | ((OLED_COLUMN_OFFSET + start_column) >> 4 & 0x0f); - cmd_array[3] = NOP; - cmd_array[4] = NOP; - cmd_array[5] = NOP; -#else - // Commands for use in Horizontal Addressing mode. - cmd_array[1] = start_column + OLED_COLUMN_OFFSET; - cmd_array[4] = start_page; - cmd_array[2] = (OLED_BLOCK_SIZE + OLED_DISPLAY_WIDTH - 1) % OLED_DISPLAY_WIDTH + cmd_array[1]; - cmd_array[5] = (OLED_BLOCK_SIZE + OLED_DISPLAY_WIDTH - 1) / OLED_DISPLAY_WIDTH - 1 + cmd_array[4]; -#endif } static void calc_bounds_90(uint8_t update_start, uint8_t *cmd_array) { @@ -310,19 +296,12 @@ static void calc_bounds_90(uint8_t update_start, uint8_t *cmd_array) { // Top page number for a block which is at the bottom edge of the screen. const uint8_t bottom_block_top_page = (height_in_pages - page_inc_per_block) % height_in_pages; -#if !OLED_IC_HAS_HORIZONTAL_MODE // Only the Page Addressing Mode is supported uint8_t start_page = bottom_block_top_page - (OLED_BLOCK_SIZE * update_start % OLED_DISPLAY_HEIGHT / 8); uint8_t start_column = OLED_BLOCK_SIZE * update_start / OLED_DISPLAY_HEIGHT * 8; cmd_array[0] = PAM_PAGE_ADDR | start_page; cmd_array[1] = PAM_SETCOLUMN_LSB | ((OLED_COLUMN_OFFSET + start_column) & 0x0f); cmd_array[2] = PAM_SETCOLUMN_MSB | ((OLED_COLUMN_OFFSET + start_column) >> 4 & 0x0f); -#else - cmd_array[1] = OLED_BLOCK_SIZE * update_start / OLED_DISPLAY_HEIGHT * 8 + OLED_COLUMN_OFFSET; - cmd_array[4] = bottom_block_top_page - (OLED_BLOCK_SIZE * update_start % OLED_DISPLAY_HEIGHT / 8); - cmd_array[2] = (OLED_BLOCK_SIZE + OLED_DISPLAY_HEIGHT - 1) / OLED_DISPLAY_HEIGHT * 8 - 1 + cmd_array[1]; - cmd_array[5] = (OLED_BLOCK_SIZE + OLED_DISPLAY_HEIGHT - 1) % OLED_DISPLAY_HEIGHT / 8 + cmd_array[4]; -#endif } uint8_t crot(uint8_t a, int8_t n) { @@ -358,11 +337,7 @@ void oled_render(void) { } // Set column & page position -#if OLED_IC_HAS_HORIZONTAL_MODE - static uint8_t display_start[] = {I2C_CMD, COLUMN_ADDR, 0, OLED_DISPLAY_WIDTH - 1, PAGE_ADDR, 0, OLED_DISPLAY_HEIGHT / 8 - 1}; -#else static uint8_t display_start[] = {I2C_CMD, PAM_PAGE_ADDR, PAM_SETCOLUMN_LSB, PAM_SETCOLUMN_MSB}; -#endif if (!HAS_FLAGS(oled_rotation, OLED_ROTATION_90)) { calc_bounds(update_start, &display_start[1]); // Offset from I2C_CMD byte at the start } else { @@ -392,13 +367,6 @@ void oled_render(void) { rotate_90(&oled_buffer[OLED_BLOCK_SIZE * update_start + source_map[i]], &temp_buffer[target_map[i]]); } -#if OLED_IC_HAS_HORIZONTAL_MODE - // Send render data chunk after rotating - if (I2C_WRITE_REG(I2C_DATA, &temp_buffer[0], OLED_BLOCK_SIZE) != I2C_STATUS_SUCCESS) { - print("oled_render90 data failed\n"); - return; - } -#else // For SH1106 or SH1107 the data chunk must be split into separate pieces for each page const uint8_t columns_in_block = (OLED_BLOCK_SIZE + OLED_DISPLAY_HEIGHT - 1) / OLED_DISPLAY_HEIGHT * 8; const uint8_t num_pages = OLED_BLOCK_SIZE / columns_in_block; @@ -417,7 +385,6 @@ void oled_render(void) { return; } } -#endif } // Turn on display if it is off @@ -825,7 +792,7 @@ void oled_task(void) { } #else oled_set_cursor(0, 0); - oled_task_kb(); + oled_task_kbr(); #endif #if OLED_SCROLL_TIMEOUT > 0 @@ -856,5 +823,6 @@ void oled_task(void) { #endif } + __attribute__((weak)) bool oled_task_kb(void) { return oled_task_user(); } __attribute__((weak)) bool oled_task_user(void) { return true; } diff --git a/users/drashna/pointing/pointing.c b/users/drashna/pointing/pointing.c index d0a83e2c26..2e313ba574 100644 --- a/users/drashna/pointing/pointing.c +++ b/users/drashna/pointing/pointing.c @@ -118,7 +118,7 @@ bool process_record_pointing(uint16_t keycode, keyrecord_t* record) { } layer_state_t layer_state_set_pointing(layer_state_t state) { - if (layer_state_cmp(state, _GAMEPAD) || layer_state_cmp(state, _DIABLO)) { + if (layer_state_cmp(state, _GAMEPAD) || layer_state_cmp(state, _DIABLO) || layer_state_cmp(state, _DIABLOII)) { state |= ((layer_state_t)1 << _MOUSE); } return state; diff --git a/users/drashna/post_config.h b/users/drashna/post_config.h index 0c9bda2eeb..2d5e6438d6 100644 --- a/users/drashna/post_config.h +++ b/users/drashna/post_config.h @@ -37,10 +37,9 @@ # define RGB_MATRIX_STARTUP_MODE RGB_MATRIX_REST_MODE #endif -#ifdef QMK_KEYS_PER_SCAN -# undef QMK_KEYS_PER_SCAN +#ifndef QMK_KEYS_PER_SCAN +# define QMK_KEYS_PER_SCAN 8 #endif -#define QMK_KEYS_PER_SCAN 4 #ifdef MOUSEKEY_ENABLE // mouse movement config diff --git a/users/drashna/rgb/rgb_stuff.c b/users/drashna/rgb/rgb_stuff.c index 09071f7151..7d2cf0c73d 100644 --- a/users/drashna/rgb/rgb_stuff.c +++ b/users/drashna/rgb/rgb_stuff.c @@ -24,7 +24,6 @@ static bool is_rgblight_startup; static HSV old_hsv; static uint8_t old_mode; deferred_token rgb_startup_token; -# endif uint32_t rgb_startup_animation(uint32_t triger_time, void *cb_arg) { if (is_rgblight_startup && is_keyboard_master()) { @@ -45,6 +44,7 @@ uint32_t rgb_startup_animation(uint32_t triger_time, void *cb_arg) { } return is_rgblight_startup ? 10 : 0; } +# endif void keyboard_post_init_rgb_light(void) { # if defined(RGBLIGHT_STARTUP_ANIMATION) @@ -56,11 +56,11 @@ void keyboard_post_init_rgb_light(void) { old_mode = rgblight_get_mode(); rgblight_mode_noeeprom(RGBLIGHT_MODE_STATIC_LIGHT); is_rgblight_startup = true; + rgb_startup_token = defer_exec(300, rgb_startup_animation, NULL); # endif if (userspace_config.rgb_layer_change) { layer_state_set_rgb_light(layer_state); } - rgb_startup_token = defer_exec(300, rgb_startup_animation, NULL); } diff --git a/users/drashna/rules.mk b/users/drashna/rules.mk index 4bc71b6939..12fa956b7d 100644 --- a/users/drashna/rules.mk +++ b/users/drashna/rules.mk @@ -53,6 +53,7 @@ CUSTOM_RGBLIGHT ?= yes ifeq ($(strip $(RGBLIGHT_ENABLE)), yes) ifeq ($(strip $(CUSTOM_RGBLIGHT)), yes) SRC += $(USER_PATH)/rgb/rgb_stuff.c + OPT_DEFS += -DCUSTOM_RGBLIGHT ifeq ($(strip $(RGBLIGHT_NOEEPROM)), yes) OPT_DEFS += -DRGBLIGHT_NOEEPROM endif @@ -67,6 +68,7 @@ CUSTOM_RGB_MATRIX ?= yes ifeq ($(strip $(RGB_MATRIX_ENABLE)), yes) ifeq ($(strip $(CUSTOM_RGB_MATRIX)), yes) SRC += $(USER_PATH)/rgb/rgb_matrix_stuff.c + OPT_DEFS += -DCUSTOM_RGB_MATRIX endif endif @@ -86,7 +88,7 @@ ifeq ($(strip $(OLED_ENABLE)), yes) QUANTUM_LIB_SRC += i2c_master.c endif ifeq ($(strip $(CUSTOM_OLED_DRIVER)), yes) - OPT_DEFS += -DCUSTOM_OLED_DRIVER_CODE + OPT_DEFS += -DCUSTOM_OLED_DRIVER SRC += $(USER_PATH)/oled/oled_stuff.c endif ifeq ($(strip $(OLED_DISPLAY_TEST)), yes) @@ -99,6 +101,7 @@ CUSTOM_POINTING_DEVICE ?= yes ifeq ($(strip $(POINTING_DEVICE_ENABLE)), yes) ifeq ($(strip $(CUSTOM_POINTING_DEVICE)), yes) SRC += $(USER_PATH)/pointing/pointing.c + OPT_DEFS += -DCUSTOM_POINTING_DEVICE endif endif diff --git a/users/drashna/split/transport_sync.c b/users/drashna/split/transport_sync.c index 4c113ec257..539a18900c 100644 --- a/users/drashna/split/transport_sync.c +++ b/users/drashna/split/transport_sync.c @@ -57,7 +57,7 @@ void user_config_sync(uint8_t initiator2target_buffer_size, const void* initiato void watchdog_handler(uint8_t in_buflen, const void* in_data, uint8_t out_buflen, void* out_data) { watchdog_ping_done = true; } #endif -#ifdef OLED_ENABLE +#ifdef CUSTOM_OLED_DRIVER # include "oled/oled_stuff.h" void keylogger_string_sync(uint8_t initiator2target_buffer_size, const void* initiator2target_buffer, uint8_t target2initiator_buffer_size, void* target2initiator_buffer) { if (initiator2target_buffer_size == OLED_KEYLOGGER_LENGTH) { @@ -71,7 +71,7 @@ void keyboard_post_init_transport_sync(void) { transaction_register_rpc(RPC_ID_USER_STATE_SYNC, user_state_sync); transaction_register_rpc(RPC_ID_USER_KEYMAP_SYNC, user_keymap_sync); transaction_register_rpc(RPC_ID_USER_CONFIG_SYNC, user_config_sync); -#ifdef OLED_ENABLE +#ifdef CUSTOM_OLED_DRIVER transaction_register_rpc(RPC_ID_USER_KEYLOG_STR, keylogger_string_sync); #endif @@ -92,7 +92,7 @@ void user_transport_update(void) { user_state.audio_enable = is_audio_on(); user_state.audio_clicky_enable = is_clicky_on(); #endif -#if defined(POINTING_DEVICE_ENABLE) && defined(KEYBOARD_handwired_tractyl_manuform) +#if defined(CUSTOM_POINTING_DEVICE) user_state.tap_toggling = tap_toggling; #endif #ifdef UNICODE_COMMON_ENABLE @@ -111,7 +111,7 @@ void user_transport_update(void) { #ifdef UNICODE_COMMON_ENABLE unicode_config.input_mode = user_state.unicode_mode; #endif -#if defined(POINTING_DEVICE_ENABLE) && defined(KEYBOARD_handwired_tractyl_manuform) +#if defined(CUSTOM_POINTING_DEVICE) tap_toggling = user_state.tap_toggling; #endif #ifdef SWAP_HANDS_ENABLE @@ -127,7 +127,7 @@ void user_transport_sync(void) { static uint16_t last_keymap = 0; static uint32_t last_config = 0, last_sync[4], last_user_state = 0; bool needs_sync = false; -#ifdef OLED_ENABLE +#ifdef CUSTOM_OLED_DRIVER static char keylog_temp[OLED_KEYLOGGER_LENGTH] = {0}; #endif @@ -187,7 +187,7 @@ void user_transport_sync(void) { needs_sync = false; } -#ifdef OLED_ENABLE +#ifdef CUSTOM_OLED_DRIVER // Check if the state values are different if (memcmp(&keylog_str, &keylog_temp, OLED_KEYLOGGER_LENGTH)) { needs_sync = true; |