aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--keyboards/bastardkb/charybdis/3x5/keymaps/drashna/chconf.h38
-rw-r--r--keyboards/bastardkb/charybdis/3x5/keymaps/drashna/config.h109
-rw-r--r--keyboards/bastardkb/charybdis/3x5/keymaps/drashna/halconf.h26
-rw-r--r--keyboards/bastardkb/charybdis/3x5/keymaps/drashna/keymap.c100
-rw-r--r--keyboards/bastardkb/charybdis/3x5/keymaps/drashna/mcuconf.h55
-rw-r--r--keyboards/bastardkb/charybdis/3x5/keymaps/drashna/rules.mk22
-rw-r--r--keyboards/handwired/tractyl_manuform/5x6_right/keymaps/drashna/config.h4
-rw-r--r--keyboards/handwired/tractyl_manuform/5x6_right/keymaps/drashna/keymap.c52
-rw-r--r--keyboards/splitkb/kyria/keymaps/drashna/config.h13
-rw-r--r--keyboards/splitkb/kyria/keymaps/drashna/keymap.c27
-rw-r--r--keyboards/splitkb/kyria/keymaps/drashna/rules.mk2
-rw-r--r--users/drashna/callbacks.c7
-rw-r--r--users/drashna/config.h5
-rw-r--r--users/drashna/keyrecords/process_records.c5
-rw-r--r--users/drashna/keyrecords/unicode.c7
-rw-r--r--users/drashna/oled/oled_stuff.c410
-rw-r--r--users/drashna/oled/oled_stuff.h24
-rw-r--r--users/drashna/pointing/pointing.c20
-rw-r--r--users/drashna/rgb/rgb_stuff.c46
-rw-r--r--users/drashna/rules.mk1
-rw-r--r--users/drashna/split/transport_sync.c11
-rw-r--r--users/drashna/split/transport_sync.h2
22 files changed, 797 insertions, 189 deletions
diff --git a/keyboards/bastardkb/charybdis/3x5/keymaps/drashna/chconf.h b/keyboards/bastardkb/charybdis/3x5/keymaps/drashna/chconf.h
new file mode 100644
index 000000000..8b55eaeef
--- /dev/null
+++ b/keyboards/bastardkb/charybdis/3x5/keymaps/drashna/chconf.h
@@ -0,0 +1,38 @@
1/* Copyright 2020 QMK
2 *
3 * This program is free software: you can redistribute it and/or modify
4 * it under the terms of the GNU General Public License as published by
5 * the Free Software Foundation, either version 2 of the License, or
6 * (at your option) any later version.
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
12 *
13 * You should have received a copy of the GNU General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 */
16
17/*
18 * This file was auto-generated by:
19 * `qmk chibios-confmigrate -i keyboards/handwired/onekey/blackpill_f411/chconf.h -r platforms/chibios/common/configs/chconf.h`
20 */
21
22#pragma once
23
24#define CH_CFG_ST_FREQUENCY 10000
25
26#define CH_CFG_FACTORY_OBJECTS_REGISTRY TRUE
27
28#define CH_CFG_FACTORY_GENERIC_BUFFERS TRUE
29
30#define CH_CFG_FACTORY_SEMAPHORES TRUE
31
32#define CH_CFG_FACTORY_MAILBOXES TRUE
33
34#define CH_CFG_FACTORY_OBJ_FIFOS TRUE
35
36#define CH_CFG_FACTORY_PIPES TRUE
37
38#include_next <chconf.h>
diff --git a/keyboards/bastardkb/charybdis/3x5/keymaps/drashna/config.h b/keyboards/bastardkb/charybdis/3x5/keymaps/drashna/config.h
new file mode 100644
index 000000000..4633db2fc
--- /dev/null
+++ b/keyboards/bastardkb/charybdis/3x5/keymaps/drashna/config.h
@@ -0,0 +1,109 @@
1/*
2
3Copyright 2021 Quentin LEBASTARD <qlebastard@gmail.com>
4
5This program is free software: you can redistribute it and/or modify
6it under the terms of the GNU General Public License as published by
7the Free Software Foundation, either version 2 of the License, or
8(at your option) any later version.
9
10This program is distributed in the hope that it will be useful,
11but WITHOUT ANY WARRANTY; without even the implied warranty of
12MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13GNU General Public License for more details.
14
15You should have received a copy of the GNU General Public License
16along with this program. If not, see <http://www.gnu.org/licenses/>.
17*/
18
19#pragma once
20
21#undef PRODUCT
22#define PRODUCT Charybdis Nano (Blackpill)
23
24#undef MATRIX_ROW_PINS
25#define MATRIX_ROW_PINS \
26 { B12, B13, B14, B15 }
27#undef MATRIX_COL_PINS
28#define MATRIX_COL_PINS \
29 { A15, B3, B4, B5, B6 }
30
31
32#undef MATRIX_ROW_PINS_RIGHT
33#define MATRIX_ROW_PINS_RIGHT \
34 { B12, B13, B14, B15 }
35#undef MATRIX_COL_PINS_RIGHT
36#define MATRIX_COL_PINS_RIGHT \
37 { A15, B3, B4, B5, B6 }
38
39#define USB_VBUS_PIN B10
40#define SPLIT_HAND_PIN C14 // high = left, low = right
41
42// WS2812 RGB LED strip input and number of LEDs
43#undef RGB_DI_PIN
44#define RGB_DI_PIN A1
45#undef RGB_MATRIX_MAXIMUM_BRIGHTNESS
46#define RGB_MATRIX_MAXIMUM_BRIGHTNESS 150
47#define WS2812_PWM_DRIVER PWMD2 // default: PWMD2
48#define WS2812_PWM_CHANNEL 2 // default: 2
49#define WS2812_PWM_PAL_MODE 1 // Pin "alternate function", see the respective datasheet for the appropriate values for your MCU. default: 2
50#define WS2812_EXTERNAL_PULLUP
51//#define WS2812_PWM_COMPLEMENTARY_OUTPUT // Define for a complementary timer output (TIMx_CHyN); omit for a normal timer output (TIMx_CHy).
52#define WS2812_DMA_STREAM STM32_DMA1_STREAM7 // DMA Stream for TIMx_UP, see the respective reference manual for the appropriate values for your MCU.
53#define WS2812_DMA_CHANNEL 3 // DMA Channel for TIMx_UP, see the respective reference manual for the appropriate values for your MCU.
54#define WS2812_PWM_TARGET_PERIOD 800000
55
56#define DEBUG_LED_PIN C13
57
58/* Audio config */
59#define AUDIO_PIN B1
60#define AUDIO_PWM_DRIVER PWMD3
61#define AUDIO_PWM_CHANNEL 4
62#define AUDIO_PWM_PAL_MODE 2
63#define AUDIO_STATE_TIMER GPTD4
64
65/* serial.c configuration for split keyboard */
66#undef SOFT_SERIAL_PIN
67#define SERIAL_USART_FULL_DUPLEX // Enable full duplex operation mode.
68#define SERIAL_USART_TX_PIN A2
69#define SERIAL_USART_RX_PIN A3
70#define SERIAL_USART_DRIVER SD2
71#define SERIAL_USART_TX_PAL_MODE 7 // Pin "alternate function", see the respective datasheet for the appropriate values for your MCU. default: 7
72#define SERIAL_USART_RX_PAL_MODE 7 // Pin "alternate function", see the respective datasheet for the appropriate values for your MCU. default: 7
73#define SERIAL_USART_TIMEOUT 100 // USART driver timeout. default 100
74// #define SERIAL_USART_PIN_SWAP // swap RX and TX pins on master
75// To use the highest possible baudrate (3.75Mbit/s) uncomment the following
76// line, this can result in dropped communications so lower the speed if there
77// are many timeouts.
78// #define SERIAL_USART_SPEED (STM32_PCLK2 >> 4)
79
80#define CRC8_USE_TABLE
81#define CRC8_OPTIMIZE_SPEED
82
83/* spi config for eeprom and pmw3360 sensor */
84#define SPI_DRIVER SPID1
85#define SPI_SCK_PIN A5
86#define SPI_SCK_PAL_MODE 5
87#define SPI_MOSI_PIN A7
88#define SPI_MOSI_PAL_MODE 5
89#define SPI_MISO_PIN A6
90#define SPI_MISO_PAL_MODE 5
91
92/* eeprom config */
93#define EXTERNAL_EEPROM_SPI_SLAVE_SELECT_PIN A4
94#define EXTERNAL_EEPROM_SPI_CLOCK_DIVISOR 64
95// #define EXTERNAL_EEPROM_BYTE_COUNT 8196
96// #define EXTERNAL_EEPROM_PAGE_SIZE 32
97// #define EXTERNAL_EEPROM_ADDRESS_SIZE 2
98
99/* pmw3360 config */
100#undef PMW3360_CS_PIN
101#define PMW3360_CS_PIN B0
102#define PMW3360_SPI_MODE 3
103#define PMW3360_SPI_DIVISOR 64
104
105
106# define CHARYBDIS_MINIMUM_DEFAULT_DPI 1200
107# define CHARYBDIS_DEFAULT_DPI_CONFIG_STEP 400
108# define CHARYBDIS_MINIMUM_SNIPING_DPI 200
109# define CHARYBDIS_SNIPING_DPI_CONFIG_STEP 100
diff --git a/keyboards/bastardkb/charybdis/3x5/keymaps/drashna/halconf.h b/keyboards/bastardkb/charybdis/3x5/keymaps/drashna/halconf.h
new file mode 100644
index 000000000..39644726c
--- /dev/null
+++ b/keyboards/bastardkb/charybdis/3x5/keymaps/drashna/halconf.h
@@ -0,0 +1,26 @@
1/* Copyright 2020 Nick Brassel (tzarc)
2 *
3 * This program is free software: you can redistribute it and/or modify
4 * it under the terms of the GNU General Public License as published by
5 * the Free Software Foundation, either version 3 of the License, or
6 * (at your option) any later version.
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
12 *
13 * You should have received a copy of the GNU General Public License
14 * along with this program. If not, see <https://www.gnu.org/licenses/>.
15 */
16#pragma once
17
18#define HAL_USE_PWM TRUE
19#define HAL_USE_SERIAL TRUE
20#define HAL_USE_I2C TRUE
21#define HAL_USE_SPI TRUE
22#define SPI_USE_WAIT TRUE
23#define SPI_SELECT_MODE SPI_SELECT_MODE_PAD
24#define HAL_USE_GPT TRUE
25
26#include_next <halconf.h>
diff --git a/keyboards/bastardkb/charybdis/3x5/keymaps/drashna/keymap.c b/keyboards/bastardkb/charybdis/3x5/keymaps/drashna/keymap.c
new file mode 100644
index 000000000..aba169dbb
--- /dev/null
+++ b/keyboards/bastardkb/charybdis/3x5/keymaps/drashna/keymap.c
@@ -0,0 +1,100 @@
1/*
2 * Copyright 2021 Quentin LEBASTARD <qlebastard@gmail.com>
3 * Copyright 2021 Drashna Jael're @drashna
4 *
5 * This program is free software: you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation, either version 2 of the License, or
8 * (at your option) any later version.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with this program. If not, see <http://www.gnu.org/licenses/>.
17 */
18
19#include "drashna.h"
20
21#define LAYOUT_charybdis_3x5_wrapper(...) LAYOUT_charybdis_3x5(__VA_ARGS__)
22#define LAYOUT_charybdis_3x5_base( \
23 K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, \
24 K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, \
25 K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A \
26 ) \
27 LAYOUT_charybdis_3x5 ( \
28 K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, \
29 ALT_T(K11), K12, K13, K14, GUI_T(K15), LGUI_T(K16), K17, K18, K19, LALT_T(K1A), \
30 CTL_T(K21), K22, K23, K24, K25, K26, K27, K28, K29, RCTL_T(K2A), \
31 LSFT_T(KC_GRV), KC_SPC, BK_LWER, DL_RAIS, RSFT_T(KC_ENT) \
32 )
33#define LAYOUT_charybdis_3x5_base_wrapper(...) LAYOUT_charybdis_3x5_base(__VA_ARGS__)
34
35const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
36
37 [_DEFAULT_LAYER_1] = LAYOUT_charybdis_3x5_base_wrapper(
38 _________________QWERTY_L1_________________, _________________QWERTY_R1_________________,
39 _________________QWERTY_L2_________________, _________________QWERTY_R2_________________,
40 _________________QWERTY_L3_________________, _________________QWERTY_R3_________________
41 ),
42
43 [_DEFAULT_LAYER_2] = LAYOUT_charybdis_3x5_base_wrapper(
44 ______________COLEMAK_MOD_DH_L1____________, ______________COLEMAK_MOD_DH_R1____________,
45 ______________COLEMAK_MOD_DH_L2____________, ______________COLEMAK_MOD_DH_R2____________,
46 ______________COLEMAK_MOD_DH_L3____________, ______________COLEMAK_MOD_DH_R3____________
47 ),
48 [_DEFAULT_LAYER_3] = LAYOUT_charybdis_3x5_base_wrapper(
49 _________________COLEMAK_L1________________, _________________COLEMAK_R1________________,
50 _________________COLEMAK_L2________________, _________________COLEMAK_R2________________,
51 _________________COLEMAK_L3________________, _________________COLEMAK_R3________________
52 ),
53
54 [_DEFAULT_LAYER_4] = LAYOUT_charybdis_3x5_base_wrapper(
55 _________________DVORAK_L1_________________, _________________DVORAK_R1_________________,
56 _________________DVORAK_L2_________________, _________________DVORAK_R2_________________,
57 _________________DVORAK_L3_________________, _________________DVORAK_R3_________________
58 ),
59
60 [_MOUSE] = LAYOUT_charybdis_3x5(
61 _______, _______, _______, S_D_MOD, DPI_MOD, KC_WH_U, _______, _______, _______, _______,
62 _______, _______, _______, _______, _______, KC_WH_D, KC_BTN1, KC_BTN3, KC_BTN2, KC_BTN6,
63 _______, _______, _______, S_D_RMOD,DPI_RMOD, KC_BTN7, KC_BTN4, KC_BTN5, KC_BTN8, _______,
64 _______, SNIPING, _______, _______, _______
65 ),
66 [_LOWER] = LAYOUT_charybdis_3x5_wrapper(
67 _________________LOWER_L1__________________, _________________LOWER_R1__________________,
68 _________________LOWER_L2__________________, _________________LOWER_R2__________________,
69 _________________LOWER_L3__________________, _________________LOWER_R3__________________,
70 _______, _______, _______, _______, AUTO_CTN
71 ),
72 [_RAISE] = LAYOUT_charybdis_3x5_wrapper(
73 _________________RAISE_L1__________________, _________________RAISE_R1__________________,
74 _________________RAISE_L2__________________, _________________RAISE_R2__________________,
75 _________________RAISE_L3__________________, _________________RAISE_R3__________________,
76 REBOOT, KEYLOCK, _______, _______, _______
77 ),
78 [_ADJUST] = LAYOUT_charybdis_3x5_wrapper(
79 _________________ADJUST_L1_________________, _________________ADJUST_R1_________________,
80 _________________ADJUST_L2_________________, _________________ADJUST_R2_________________,
81 _________________ADJUST_L3_________________, _________________ADJUST_R3_________________,
82 EEP_RST, KC_NUKE, _______, _______, RESET
83 ),
84};
85
86void matrix_init_keyemap(void) { setPinInputHigh(A0); }
87
88void matrix_scan_keymap(void) {
89 if (!readPin(A0)) {
90 reset_keyboard();
91 }
92}
93
94#ifdef USB_VBUS_PIN
95bool usb_vbus_state(void) {
96 setPinInputLow(USB_VBUS_PIN);
97 wait_us(5);
98 return readPin(USB_VBUS_PIN);
99}
100#endif
diff --git a/keyboards/bastardkb/charybdis/3x5/keymaps/drashna/mcuconf.h b/keyboards/bastardkb/charybdis/3x5/keymaps/drashna/mcuconf.h
new file mode 100644
index 000000000..d868eae48
--- /dev/null
+++ b/keyboards/bastardkb/charybdis/3x5/keymaps/drashna/mcuconf.h
@@ -0,0 +1,55 @@
1/* Copyright 2020 Nick Brassel (tzarc)
2 *
3 * This program is free software: you can redistribute it and/or modify
4 * it under the terms of the GNU General Public License as published by
5 * the Free Software Foundation, either version 3 of the License, or
6 * (at your option) any later version.
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
12 *
13 * You should have received a copy of the GNU General Public License
14 * along with this program. If not, see <https://www.gnu.org/licenses/>.
15 */
16
17#pragma once
18
19#include_next "mcuconf.h"
20
21#undef STM32_I2C_USE_I2C1
22#define STM32_I2C_USE_I2C1 TRUE
23
24#undef STM32_I2C_I2C1_RX_DMA_STREAM
25#define STM32_I2C_I2C1_RX_DMA_STREAM STM32_DMA_STREAM_ID(1, 0)
26#undef STM32_I2C_I2C1_TX_DMA_STREAM
27#define STM32_I2C_I2C1_TX_DMA_STREAM STM32_DMA_STREAM_ID(1, 1)
28
29#undef STM32_PWM_USE_TIM2
30#define STM32_PWM_USE_TIM2 TRUE
31
32#undef STM32_PWM_USE_TIM3
33#define STM32_PWM_USE_TIM3 TRUE
34
35#undef STM32_SPI_USE_SPI1
36#define STM32_SPI_USE_SPI1 TRUE
37
38#undef STM32_SPI_SPI1_RX_DMA_STREAM
39#define STM32_SPI_SPI1_RX_DMA_STREAM STM32_DMA_STREAM_ID(2, 0)
40#undef STM32_SPI_SPI1_TX_DMA_STREAM
41#define STM32_SPI_SPI1_TX_DMA_STREAM STM32_DMA_STREAM_ID(2, 3)
42
43#undef STM32_SERIAL_USE_USART2
44#define STM32_SERIAL_USE_USART2 TRUE
45
46#undef STM32_UART_USART2_RX_DMA_STREAM
47#define STM32_UART_USART2_RX_DMA_STREAM STM32_DMA_STREAM_ID(1, 5)
48#undef STM32_UART_USART2_TX_DMA_STREAM
49#define STM32_UART_USART2_TX_DMA_STREAM STM32_DMA_STREAM_ID(1, 6)
50
51#undef STM32_GPT_USE_TIM4
52#define STM32_GPT_USE_TIM4 TRUE
53
54#undef STM32_ST_USE_TIMER
55#define STM32_ST_USE_TIMER 5
diff --git a/keyboards/bastardkb/charybdis/3x5/keymaps/drashna/rules.mk b/keyboards/bastardkb/charybdis/3x5/keymaps/drashna/rules.mk
new file mode 100644
index 000000000..d23bf99aa
--- /dev/null
+++ b/keyboards/bastardkb/charybdis/3x5/keymaps/drashna/rules.mk
@@ -0,0 +1,22 @@
1# MCU name
2MCU = STM32F411
3
4# Bootloader selection
5BOOTLOADER = stm32-dfu
6
7BOOTMAGIC_ENABLE = yes # Enable Bootmagic Lite
8KEYBOARD_SHARED_EP = yes
9MOUSE_SHARED_EP = yes
10
11EEPROM_DRIVER = spi
12WS2812_DRIVER = pwm
13SERIAL_DRIVER = usart
14AUDIO_DRIVER = pwm_hardware
15
16AUDIO_SUPPORTED = yes
17AUDIO_ENABLE = yes
18MOUSEKEY_ENABLE = yes
19NKRO_ENABLE = yes
20CONSOLE_ENABLE = yes
21
22AUTOCORRECTION_ENABLE = yes
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 0b33138ec..c3a30d2bc 100644
--- a/keyboards/handwired/tractyl_manuform/5x6_right/keymaps/drashna/config.h
+++ b/keyboards/handwired/tractyl_manuform/5x6_right/keymaps/drashna/config.h
@@ -16,9 +16,7 @@
16 16
17#pragma once 17#pragma once
18 18
19#define TRACKBALL_DPI_OPTIONS { 1200, 1800, 2600, 3400 } 19#define DEBOUNCE 45
20
21#define DEBOUNCE 60
22#define ENCODER_DEFAULT_POS 0x3 20#define ENCODER_DEFAULT_POS 0x3
23 21
24#ifdef OLED_DRIVER_SH1107 22#ifdef OLED_DRIVER_SH1107
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 b5310b37d..fa1e8897e 100644
--- a/keyboards/handwired/tractyl_manuform/5x6_right/keymaps/drashna/keymap.c
+++ b/keyboards/handwired/tractyl_manuform/5x6_right/keymaps/drashna/keymap.c
@@ -60,9 +60,9 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
60 ), 60 ),
61 61
62 [_MOUSE] = LAYOUT_5x6_right( 62 [_MOUSE] = LAYOUT_5x6_right(
63 _______, _______, _______, _______, _______, _______, DPI_CONFIG, _______, _______, _______, _______, _______, 63 _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
64 _______, _______, _______, _______, _______, _______, KC_WH_U, _______, _______, _______, _______, _______, 64 _______, _______, _______, _______, _______, _______, KC_WH_U, _______, _______, _______, _______, _______,
65 _______, _______, _______, _______, _______, _______, KC_WH_D, KC_BTN1, KC_BTN3, KC_BTN2, KC_BTN6, _______, 65 _______, _______, _______, _______, _______, _______, KC_WH_D, KC_BTN1, KC_BTN3, KC_BTN2, KC_BTN6, DPI_CONFIG,
66 _______, _______, _______, _______, _______, _______, KC_BTN7, KC_BTN4, KC_BTN5, KC_BTN8, _______, _______, 66 _______, _______, _______, _______, _______, _______, KC_BTN7, KC_BTN4, KC_BTN5, KC_BTN8, _______, _______,
67 _______, _______, _______, _______, 67 _______, _______, _______, _______,
68 _______, _______, KC_BTN3, 68 _______, _______, KC_BTN3,
@@ -70,7 +70,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
70 _______, _______, _______, _______ 70 _______, _______, _______, _______
71 ), 71 ),
72 [_GAMEPAD] = LAYOUT_5x6_right( 72 [_GAMEPAD] = LAYOUT_5x6_right(
73 KC_ESC, KC_NO, KC_1, KC_2, KC_3, KC_4, DPI_CONFIG, _______, _______, _______, _______, _______, 73 KC_ESC, KC_NO, KC_1, KC_2, KC_3, KC_4, _______, _______, _______, _______, _______, _______,
74 KC_F1, KC_K, KC_Q, KC_W, KC_E, KC_R, _______, _______, _______, _______, _______, _______, 74 KC_F1, KC_K, KC_Q, KC_W, KC_E, KC_R, _______, _______, _______, _______, _______, _______,
75 KC_TAB, KC_G, KC_A, KC_S, KC_D, KC_F, _______, _______, _______, _______, _______, _______, 75 KC_TAB, KC_G, KC_A, KC_S, KC_D, KC_F, _______, _______, _______, _______, _______, _______,
76 KC_LCTL, KC_LSFT, KC_Z, KC_X, KC_C, KC_H, _______, _______, _______, _______, _______, _______, 76 KC_LCTL, KC_LSFT, KC_Z, KC_X, KC_C, KC_H, _______, _______, _______, _______, _______, _______,
@@ -145,7 +145,7 @@ const uint16_t PROGMEM encoder_map[][NUM_ENCODERS][2] = {
145 [_MEDIA] = { { _______, _______ }, { _______, _______ } }, 145 [_MEDIA] = { { _______, _______ }, { _______, _______ } },
146 [_RAISE] = { { _______, _______ }, { KC_PGDN, KC_PGUP } }, 146 [_RAISE] = { { _______, _______ }, { KC_PGDN, KC_PGUP } },
147 [_LOWER] = { { RGB_MOD, RGB_RMOD}, { RGB_HUD, RGB_HUI } }, 147 [_LOWER] = { { RGB_MOD, RGB_RMOD}, { RGB_HUD, RGB_HUI } },
148 [_ADJUST] = { { CK_DOWN, CK_UP }, { _______, _F______ } }, 148 [_ADJUST] = { { CK_DOWN, CK_UP }, { _______, _______ } },
149}; 149};
150// clang-format on 150// clang-format on
151#else 151#else
@@ -165,5 +165,49 @@ bool encoder_update_user(uint8_t index, bool clockwise) {
165#endif 165#endif
166 166
167#ifdef OLED_ENABLE 167#ifdef OLED_ENABLE
168extern uint16_t typing_mode;
169
168oled_rotation_t oled_init_keymap(oled_rotation_t rotation) { return OLED_ROTATION_180; } 170oled_rotation_t oled_init_keymap(oled_rotation_t rotation) { return OLED_ROTATION_180; }
171
172void oled_render_large_display(void) {
173 if (is_keyboard_left()) {
174 render_wpm_graph(54, 64);
175 } else {
176 oled_advance_page(true);
177 oled_advance_page(true);
178
179 static const char PROGMEM logo[] = {
180 0x80, 0x81, 0x82, 0x83, 0x84, 0x85, 0x86, 0x87, 0x88, 0x89, 0x8A, 0x8B, 0x8C, 0x8D, 0x8E, 0x8F, 0x90, 0x91, 0x92, 0x93, 0x94,
181 0xA0, 0xA1, 0xA2, 0xA3, 0xA4, 0xA5, 0xA6, 0xA7, 0xA8, 0xA9, 0xAA, 0xAB, 0xAC, 0xAD, 0xAE, 0xAF, 0xB0, 0xB1, 0xB2, 0xB3, 0xB4,
182 0xC0, 0xC1, 0xC2, 0xC3, 0xC4, 0xC5, 0xC6, 0xC7, 0xC8, 0xC9, 0xCA, 0xCB, 0xCC, 0xCD, 0xCE, 0xCF, 0xD0, 0xD1, 0xD2, 0xD3, 0xD4, 0x00
183 };
184 oled_write_P(logo, false);
185
186 oled_set_cursor(1, 14);
187 oled_write_ln_P(PSTR("Unicode:"), false);
188 switch (typing_mode) {
189 case KC_WIDE:
190 oled_write_P(PSTR(" Wide"), false);
191 break;
192 case KC_SCRIPT:
193 oled_write_P(PSTR(" Script"), false);
194 break;
195 case KC_BLOCKS:
196 oled_write_P(PSTR(" Blocks"), false);
197 break;
198 case KC_REGIONAL:
199 oled_write_P(PSTR(" Regional"), false);
200 break;
201 case KC_AUSSIE:
202 oled_write_P(PSTR(" Aussie"), false);
203 break;
204 case KC_ZALGO:
205 oled_write_P(PSTR(" Zalgo"), false);
206 break;
207 default:
208 oled_write_P(PSTR(" Normal"), false);
209 break;
210 }
211 }
212}
169#endif 213#endif
diff --git a/keyboards/splitkb/kyria/keymaps/drashna/config.h b/keyboards/splitkb/kyria/keymaps/drashna/config.h
index 8239e28cd..89a162a9b 100644
--- a/keyboards/splitkb/kyria/keymaps/drashna/config.h
+++ b/keyboards/splitkb/kyria/keymaps/drashna/config.h
@@ -19,17 +19,21 @@
19#define EE_HANDS 19#define EE_HANDS
20 20
21#ifdef OLED_ENABLE 21#ifdef OLED_ENABLE
22# define OLED_DISPLAY_128X64 22# ifdef OLED_DRIVER_SH1107
23# undef OLED_DISPLAY_128X64
24# define OLED_DISPLAY_128X128
25# endif
23#endif 26#endif
24 27
25#ifdef RGBLIGHT_ENABLE 28#ifdef RGBLIGHT_ENABLE
26# define RGBLIGHT_SLEEP 29# define RGBLIGHT_SLEEP
27# define RGBLIGHT_LIMIT_VAL 200 30# undef RGBLIGHT_LIMIT_VAL
31# define RGBLIGHT_LIMIT_VAL 120
28# define RGBLIGHT_HUE_STEP 8 32# define RGBLIGHT_HUE_STEP 8
29# define RGBLIGHT_SAT_STEP 8 33# define RGBLIGHT_SAT_STEP 8
30# define RGBLIGHT_VAL_STEP 8 34# define RGBLIGHT_VAL_STEP 8
31# define RGBLIGHT_SPLIT 35# define RGBLIGHT_SPLIT
32// # define RGBLIGHT_LAYERS 36# define RGBLIGHT_LAYERS
33#endif 37#endif
34 38
35#define KEYLOGGER_LENGTH 10 39#define KEYLOGGER_LENGTH 10
@@ -41,3 +45,6 @@
41#define BOOTMAGIC_LITE_COLUMN 7 45#define BOOTMAGIC_LITE_COLUMN 7
42#define BOOTMAGIC_LITE_ROW_RIGHT 4 46#define BOOTMAGIC_LITE_ROW_RIGHT 4
43#define BOOTMAGIC_LITE_COLUMN_RIGHT 7 47#define BOOTMAGIC_LITE_COLUMN_RIGHT 7
48
49#define I2C1_CLOCK_SPEED 400000
50#define I2C1_DUTY_CYCLE FAST_DUTY_CYCLE_2
diff --git a/keyboards/splitkb/kyria/keymaps/drashna/keymap.c b/keyboards/splitkb/kyria/keymaps/drashna/keymap.c
index 1346616b2..41ef4b270 100644
--- a/keyboards/splitkb/kyria/keymaps/drashna/keymap.c
+++ b/keyboards/splitkb/kyria/keymaps/drashna/keymap.c
@@ -121,7 +121,32 @@ const uint16_t PROGMEM encoder_map[][NUM_ENCODERS][2] = {
121// clang-format on 121// clang-format on
122 122
123#ifdef OLED_ENABLE 123#ifdef OLED_ENABLE
124oled_rotation_t oled_init_keymap(oled_rotation_t rotation) { return OLED_ROTATION_180; } 124oled_rotation_t oled_init_keymap(oled_rotation_t rotation) {
125#ifdef OLED_DRIVER_SH1107
126 return OLED_ROTATION_0;
127#else
128 return OLED_ROTATION_180;
129#endif
130}
131
132void oled_render_large_display(void) {
133 if (is_keyboard_left()) {
134 render_wpm_graph(54, 64);
135 } else {
136 static const char PROGMEM kyria_logo[] = {
137 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128,128,192,224,240,112,120, 56, 60, 28, 30, 14, 14, 14, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 14, 14, 14, 30, 28, 60, 56,120,112,240,224,192,128,128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
138 0, 0, 0, 0, 0, 0, 0,192,224,240,124, 62, 31, 15, 7, 3, 1,128,192,224,240,120, 56, 60, 28, 30, 14, 14, 7, 7,135,231,127, 31,255,255, 31,127,231,135, 7, 7, 14, 14, 30, 28, 60, 56,120,240,224,192,128, 1, 3, 7, 15, 31, 62,124,240,224,192, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
139 0, 0, 0, 0,240,252,255, 31, 7, 1, 0, 0,192,240,252,254,255,247,243,177,176, 48, 48, 48, 48, 48, 48, 48,120,254,135, 1, 0, 0,255,255, 0, 0, 1,135,254,120, 48, 48, 48, 48, 48, 48, 48,176,177,243,247,255,254,252,240,192, 0, 0, 1, 7, 31,255,252,240, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
140 0, 0, 0,255,255,255, 0, 0, 0, 0, 0,254,255,255, 1, 1, 7, 30,120,225,129,131,131,134,134,140,140,152,152,177,183,254,248,224,255,255,224,248,254,183,177,152,152,140,140,134,134,131,131,129,225,120, 30, 7, 1, 1,255,255,254, 0, 0, 0, 0, 0,255,255,255, 0, 0, 0, 0,255,255, 0, 0,192,192, 48, 48, 0, 0,240,240, 0, 0, 0, 0, 0, 0,240,240, 0, 0,240,240,192,192, 48, 48, 48, 48,192,192, 0, 0, 48, 48,243,243, 0, 0, 0, 0, 0, 0, 48, 48, 48, 48, 48, 48,192,192, 0, 0, 0, 0, 0,
141 0, 0, 0,255,255,255, 0, 0, 0, 0, 0,127,255,255,128,128,224,120, 30,135,129,193,193, 97, 97, 49, 49, 25, 25,141,237,127, 31, 7,255,255, 7, 31,127,237,141, 25, 25, 49, 49, 97, 97,193,193,129,135, 30,120,224,128,128,255,255,127, 0, 0, 0, 0, 0,255,255,255, 0, 0, 0, 0, 63, 63, 3, 3, 12, 12, 48, 48, 0, 0, 0, 0, 51, 51, 51, 51, 51, 51, 15, 15, 0, 0, 63, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 48, 48, 63, 63, 48, 48, 0, 0, 12, 12, 51, 51, 51, 51, 51, 51, 63, 63, 0, 0, 0, 0, 0,
142 0, 0, 0, 0, 15, 63,255,248,224,128, 0, 0, 3, 15, 63,127,255,239,207,141, 13, 12, 12, 12, 12, 12, 12, 12, 30,127,225,128, 0, 0,255,255, 0, 0,128,225,127, 30, 12, 12, 12, 12, 12, 12, 12, 13,141,207,239,255,127, 63, 15, 3, 0, 0,128,224,248,255, 63, 15, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
143 0, 0, 0, 0, 0, 0, 0, 3, 7, 15, 62,124,248,240,224,192,128, 1, 3, 7, 15, 30, 28, 60, 56,120,112,112,224,224,225,231,254,248,255,255,248,254,231,225,224,224,112,112,120, 56, 60, 28, 30, 15, 7, 3, 1,128,192,224,240,248,124, 62, 15, 7, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
144 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 3, 7, 15, 14, 30, 28, 60, 56,120,112,112,112,224,224,224,224,224,224,224,224,224,224,224,224,224,224,224,224,112,112,112,120, 56, 60, 28, 30, 14, 15, 7, 3, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
145 };
146 // clang-format on
147 oled_write_raw_P(kyria_logo, sizeof(kyria_logo));
148 }
149}
125#endif 150#endif
126 151
127#ifdef ENCODER_ENABLE 152#ifdef ENCODER_ENABLE
diff --git a/keyboards/splitkb/kyria/keymaps/drashna/rules.mk b/keyboards/splitkb/kyria/keymaps/drashna/rules.mk
index 3cdfe1bec..ddba0780a 100644
--- a/keyboards/splitkb/kyria/keymaps/drashna/rules.mk
+++ b/keyboards/splitkb/kyria/keymaps/drashna/rules.mk
@@ -20,8 +20,10 @@ ifeq ($(strip $(KEYBOARD)), splitkb/kyria/rev1/proton_c)
20 CTPC = yes 20 CTPC = yes
21 AUTOCORRECTION_ENABLE = yes 21 AUTOCORRECTION_ENABLE = yes
22 CAPS_WORD_ENABLE = yes 22 CAPS_WORD_ENABLE = yes
23 DEBUG_MATRIX_SCAN_RATE_ENABLE = api
23else 24else
24 LTO_ENABLE = yes 25 LTO_ENABLE = yes
25 BOOTLOADER = qmk-hid 26 BOOTLOADER = qmk-hid
26 BOOTLOADER_SIZE = 512 27 BOOTLOADER_SIZE = 512
28 CUSTOM_UNICODE_ENABLE = no
27endif 29endif
diff --git a/users/drashna/callbacks.c b/users/drashna/callbacks.c
index ffc777692..f01aab433 100644
--- a/users/drashna/callbacks.c
+++ b/users/drashna/callbacks.c
@@ -105,16 +105,9 @@ void matrix_scan_user(void) {
105 run_diablo_macro_check(); 105 run_diablo_macro_check();
106#endif // TAP_DANCE_ENABLE 106#endif // TAP_DANCE_ENABLE
107 107
108#if defined(RGBLIGHT_ENABLE)
109 matrix_scan_rgb_light();
110#endif // RGBLIGHT_ENABLE
111#if defined(RGB_MATRIX_ENABLE) 108#if defined(RGB_MATRIX_ENABLE)
112 matrix_scan_rgb_matrix(); 109 matrix_scan_rgb_matrix();
113#endif 110#endif
114#if defined(POINTING_DEVICE_ENABLE)
115 matrix_scan_pointing();
116#endif
117
118 matrix_scan_secret(); 111 matrix_scan_secret();
119 112
120 matrix_scan_keymap(); 113 matrix_scan_keymap();
diff --git a/users/drashna/config.h b/users/drashna/config.h
index a6b4beb74..f55ed36bc 100644
--- a/users/drashna/config.h
+++ b/users/drashna/config.h
@@ -279,7 +279,7 @@
279# define OLED_DISPLAY_WIDTH 128 279# define OLED_DISPLAY_WIDTH 128
280# define OLED_DISPLAY_HEIGHT 128 280# define OLED_DISPLAY_HEIGHT 128
281# define OLED_MATRIX_SIZE (OLED_DISPLAY_HEIGHT / 8 * OLED_DISPLAY_WIDTH) 281# define OLED_MATRIX_SIZE (OLED_DISPLAY_HEIGHT / 8 * OLED_DISPLAY_WIDTH)
282# define OLED_BLOCK_TYPE uint16_t 282# define OLED_BLOCK_TYPE uint32_t
283# define OLED_SOURCE_MAP \ 283# define OLED_SOURCE_MAP \
284 { 0, 8, 16, 24, 32, 40, 48, 56 } 284 { 0, 8, 16, 24, 32, 40, 48, 56 }
285# define OLED_TARGET_MAP \ 285# define OLED_TARGET_MAP \
@@ -288,4 +288,7 @@
288# define OLED_BLOCK_SIZE (OLED_MATRIX_SIZE / OLED_BLOCK_COUNT) 288# define OLED_BLOCK_SIZE (OLED_MATRIX_SIZE / OLED_BLOCK_COUNT)
289# define OLED_COM_PINS COM_PINS_ALT 289# define OLED_COM_PINS COM_PINS_ALT
290# define OLED_IC OLED_IC_SH1107 290# define OLED_IC OLED_IC_SH1107
291# ifndef OLED_BRIGHTNESS
292# define OLED_BRIGHTNESS 50
293# endif
291#endif 294#endif
diff --git a/users/drashna/keyrecords/process_records.c b/users/drashna/keyrecords/process_records.c
index 012a57f7e..160a88021 100644
--- a/users/drashna/keyrecords/process_records.c
+++ b/users/drashna/keyrecords/process_records.c
@@ -10,7 +10,7 @@
10# include "autocorrection/autocorrection.h" 10# include "autocorrection/autocorrection.h"
11#endif 11#endif
12#ifdef __AVR__ 12#ifdef __AVR__
13#include <avr/wdt.h> 13# include <avr/wdt.h>
14#endif 14#endif
15 15
16uint16_t copy_paste_timer; 16uint16_t copy_paste_timer;
@@ -36,7 +36,7 @@ __attribute__((weak)) bool process_record_secrets(uint16_t keycode, keyrecord_t
36 * @return true Continue processing keycode and send to host 36 * @return true Continue processing keycode and send to host
37 * @return false Stop process keycode and do not send to host 37 * @return false Stop process keycode and do not send to host
38 */ 38 */
39bool process_record_user(uint16_t keycode, keyrecord_t *record) { 39bool process_record_user(uint16_t keycode, keyrecord_t *record) {
40 // If console is enabled, it will print the matrix position and status of each key pressed 40 // If console is enabled, it will print the matrix position and status of each key pressed
41#ifdef KEYLOGGER_ENABLE 41#ifdef KEYLOGGER_ENABLE
42 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); 42 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);
@@ -234,7 +234,6 @@ bool process_record_user(uint16_t keycode, keyrecord_t *re
234 software_reset(); 234 software_reset();
235 } 235 }
236 return false; 236 return false;
237
238 } 237 }
239 return true; 238 return true;
240} 239}
diff --git a/users/drashna/keyrecords/unicode.c b/users/drashna/keyrecords/unicode.c
index db2058e5d..5acd51da9 100644
--- a/users/drashna/keyrecords/unicode.c
+++ b/users/drashna/keyrecords/unicode.c
@@ -181,7 +181,6 @@ bool process_record_aussie(uint16_t keycode, keyrecord_t *record) {
181bool process_record_zalgo(uint16_t keycode, keyrecord_t *record) { 181bool process_record_zalgo(uint16_t keycode, keyrecord_t *record) {
182 if ((KC_A <= keycode) && (keycode <= KC_0)) { 182 if ((KC_A <= keycode) && (keycode <= KC_0)) {
183 if (record->event.pressed) { 183 if (record->event.pressed) {
184
185 tap_code16_nomods(keycode); 184 tap_code16_nomods(keycode);
186 185
187 int number = (rand() % (8 + 1 - 2)) + 2; 186 int number = (rand() % (8 + 1 - 2)) + 2;
@@ -285,13 +284,11 @@ bool process_record_unicode(uint16_t keycode, keyrecord_t *record) {
285 } else if (typing_mode == KC_ZALGO) { 284 } else if (typing_mode == KC_ZALGO) {
286 return process_record_zalgo(keycode, record); 285 return process_record_zalgo(keycode, record);
287 } 286 }
288 return process_unicode_common(keycode, record); 287 return true;
289} 288}
290 289
291/** 290/**
292 * @brief Initialize the default unicode mode on firmware startu 291 * @brief Initialize the default unicode mode on firmware startu
293 * 292 *
294 */ 293 */
295void matrix_init_unicode(void) { 294void matrix_init_unicode(void) { unicode_input_mode_init(); }
296 unicode_input_mode_init();
297}
diff --git a/users/drashna/oled/oled_stuff.c b/users/drashna/oled/oled_stuff.c
index eeca010de..c850c5336 100644
--- a/users/drashna/oled/oled_stuff.c
+++ b/users/drashna/oled/oled_stuff.c
@@ -1,4 +1,5 @@
1/* Copyright 2020 Christopher Courtney, aka Drashna Jael're (@drashna) <drashna@live.com> 1/* Copyright 2020 Christopher Courtney, aka Drashna Jael're (@drashna) <drashna@live.com>
2 * Copyright 2021 John Ezra - wpm graph
2 * 3 *
3 * This program is free software: you can redistribute it and/or modify 4 * This program is free software: you can redistribute it and/or modify
4 * it under the terms of the GNU General Public License as published by 5 * it under the terms of the GNU General Public License as published by
@@ -15,17 +16,17 @@
15 */ 16 */
16 17
17#include "drashna.h" 18#include "drashna.h"
18#ifdef CUSTOM_UNICODE_ENABLE 19#ifdef UNICODE_COMMON_ENABLE
19# include "process_unicode_common.h" 20# include "process_unicode_common.h"
20#endif 21#endif
21#include <string.h> 22#include <string.h>
22 23
23extern bool host_driver_disabled; 24extern bool host_driver_disabled;
24 25
25uint32_t oled_timer = 0; 26uint32_t oled_timer = 0;
26char keylog_str[OLED_KEYLOGGER_LENGTH] = {0}; 27char keylog_str[OLED_KEYLOGGER_LENGTH] = {0};
27static uint16_t log_timer = 0; 28static uint16_t log_timer = 0;
28static const char PROGMEM display_border[3] = {0x0, 0xFF, 0x0}; 29static const char PROGMEM display_border[3] = {0x0, 0xFF, 0x0};
29 30
30deferred_token kittoken; 31deferred_token kittoken;
31 32
@@ -112,7 +113,7 @@ void update_log(void) {
112 */ 113 */
113void render_keylogger_status(void) { 114void render_keylogger_status(void) {
114#ifdef OLED_DISPLAY_VERBOSE 115#ifdef OLED_DISPLAY_VERBOSE
115 oled_set_cursor(1, 7); 116 oled_set_cursor(1, 6);
116#endif 117#endif
117 oled_write_P(PSTR(OLED_RENDER_KEYLOGGER), false); 118 oled_write_P(PSTR(OLED_RENDER_KEYLOGGER), false);
118 oled_write(keylog_str, false); 119 oled_write(keylog_str, false);
@@ -127,7 +128,7 @@ void render_keylogger_status(void) {
127 */ 128 */
128void render_default_layer_state(void) { 129void render_default_layer_state(void) {
129#ifdef OLED_DISPLAY_VERBOSE 130#ifdef OLED_DISPLAY_VERBOSE
130 oled_set_cursor(5, 2); 131 oled_set_cursor(1, 1);
131#endif 132#endif
132 oled_write_P(PSTR(OLED_RENDER_LAYOUT_NAME), false); 133 oled_write_P(PSTR(OLED_RENDER_LAYOUT_NAME), false);
133 switch (get_highest_layer(default_layer_state)) { 134 switch (get_highest_layer(default_layer_state)) {
@@ -155,111 +156,166 @@ void render_default_layer_state(void) {
155 */ 156 */
156void render_layer_state(void) { 157void render_layer_state(void) {
157#ifdef OLED_DISPLAY_VERBOSE 158#ifdef OLED_DISPLAY_VERBOSE
158 static const char PROGMEM tri_layer_image[4][3][18] = { 159 // clang-format off
160 static const char PROGMEM tri_layer_image[][3][24] = {
161 // base
159 { 162 {
160 { 163 {
161 0x80, 0x80, 0x40, 0x40, 0x20, 0x20, 164 0x00, 0x00, 0x00, 0x80, 0x80, 0x40,
162 0x10, 0x10, 0x08, 0x08, 0x10, 0x10, 165 0x40, 0x20, 0x20, 0x10, 0x10, 0x08,
163 0x20, 0x20, 0x40, 0x40, 0x80, 0x80 166 0x08, 0x10, 0x10, 0x20, 0x20, 0x40,
167 0x40, 0x80, 0x80, 0x00, 0x00, 0x00
164 }, 168 },
165 { 169 {
166 0x88, 0x88, 0x5D, 0x5D, 0x3E, 0x3E, 170 0x00, 0x00, 0x00, 0x88, 0x88, 0x5D,
167 0x7C, 0x7C, 0xF8, 0xF8, 0x7C, 0x7C, 171 0x5D, 0x3E, 0x3E, 0x7C, 0x7C, 0xF8,
168 0x3E, 0x3E, 0x5D, 0x5D, 0x88, 0x88 172 0xF8, 0x7C, 0x7C, 0x3E, 0x3E, 0x5D,
173 0x5D, 0x88, 0x88, 0x00, 0x00, 0x00
169 }, 174 },
170 { 175 {
171 0x00, 0x00, 0x01, 0x01, 0x02, 0x02, 176 0x00, 0x00, 0x00, 0x00, 0x00, 0x01,
172 0x04, 0x04, 0x08, 0x08, 0x04, 0x04, 177 0x01, 0x02, 0x02, 0x04, 0x04, 0x08,
173 0x02, 0x02, 0x01, 0x01, 0x00, 0x00 178 0x08, 0x04, 0x04, 0x02, 0x02, 0x01,
179 0x01, 0x00, 0x00, 0x00, 0x00, 0x00
174 } 180 }
175 }, 181 },
182 // raise
176 { 183 {
177 { 184 {
178 0x80, 0x80, 0xC0, 0xC0, 0xE0, 0xE0, 185 0x00, 0x00, 0x00, 0x80, 0x80, 0xC0,
179 0xF0, 0xF0, 0xF8, 0xF8, 0xF0, 0xF0, 186 0xC0, 0xE0, 0xE0, 0xF0, 0xF0, 0xF8,
180 0xE0, 0xE0, 0xC0, 0xC0, 0x80, 0x80 187 0xF8, 0xF0, 0xF0, 0xE0, 0xE0, 0xC0,
188 0xC0, 0x80, 0x80, 0x00, 0x00, 0x00
181 }, 189 },
182 { 190 {
183 0x88, 0x88, 0x55, 0x55, 0x23, 0x23, 191 0x00, 0x00, 0x00, 0x88, 0x88, 0x55,
184 0x47, 0x47, 0x8F, 0x8F, 0x47, 0x47, 192 0x55, 0x23, 0x23, 0x47, 0x47, 0x8F,
185 0x23, 0x23, 0x55, 0x55, 0x88, 0x88 193 0x8F, 0x47, 0x47, 0x23, 0x23, 0x55,
194 0x55, 0x88, 0x88, 0x00, 0x00, 0x00
186 }, 195 },
187 { 196 {
188 0x00, 0x00, 0x01, 0x01, 0x02, 0x02, 197 0x00, 0x00, 0x00, 0x00, 0x00, 0x01,
189 0x04, 0x04, 0x08, 0x08, 0x04, 0x04, 198 0x01, 0x02, 0x02, 0x04, 0x04, 0x08,
190 0x02, 0x02, 0x01, 0x01, 0x00, 0x00 199 0x08, 0x04, 0x04, 0x02, 0x02, 0x01,
200 0x01, 0x00, 0x00, 0x00, 0x00, 0x00
191 } 201 }
192 }, 202 },
203 // lower
193 { 204 {
194 { 205 {
195 0x80, 0x80, 0x40, 0x40, 0x20, 0x20, 206 0x00, 0x00, 0x00, 0x80, 0x80, 0x40,
196 0x10, 0x10, 0x08, 0x08, 0x10, 0x10, 207 0x40, 0x20, 0x20, 0x10, 0x10, 0x08,
197 0x20, 0x20, 0x40, 0x40, 0x80, 0x80 208 0x08, 0x10, 0x10, 0x20, 0x20, 0x40,
209 0x40, 0x80, 0x80, 0x00, 0x00, 0x00
198 }, 210 },
199 { 211 {
200 0x88, 0x88, 0xD5, 0xD5, 0xE2, 0xE2, 212 0x00, 0x00, 0x00, 0x88, 0x88, 0xD5,
201 0xC4, 0xC4, 0x88, 0x88, 0xC4, 0xC4, 213 0xD5, 0xE2, 0xE2, 0xC4, 0xC4, 0x88,
202 0xE2, 0xE2, 0xD5, 0xD5, 0x88, 0x88 214 0x88, 0xC4, 0xC4, 0xE2, 0xE2, 0xD5,
215 0xD5, 0x88, 0x88, 0x00, 0x00, 0x00
203 }, 216 },
204 { 217 {
205 0x00, 0x00, 0x01, 0x01, 0x03, 0x03, 218 0x00, 0x00, 0x00, 0x00, 0x00, 0x01,
206 0x07, 0x07, 0x0F, 0x0F, 0x07, 0x07, 219 0x01, 0x03, 0x03, 0x07, 0x07, 0x0F,
207 0x03, 0x03, 0x01, 0x01, 0x00, 0x00 220 0x0F, 0x07, 0x07, 0x03, 0x03, 0x01,
221 0x01, 0x00, 0x00, 0x00, 0x00, 0x00
208 } 222 }
209 }, 223 },
224 // adjust
210 { 225 {
211 { 226 {
212 0x80, 0x80, 0x40, 0xC0, 0x60, 0xA0, 227 0x00, 0x00, 0x00, 0x80, 0x80, 0x40,
213 0x50, 0xB0, 0x58, 0xA8, 0x50, 0xB0, 228 0xC0, 0x60, 0xA0, 0x50, 0xB0, 0x58,
214 0x60, 0xA0, 0x40, 0xC0, 0x80, 0x80 229 0xA8, 0x50, 0xB0, 0x60, 0xA0, 0x40,
230 0xC0, 0x80, 0x80, 0x00, 0x00, 0x00
215 }, 231 },
216 { 232 {
217 0x88, 0x88, 0x5D, 0xD5, 0x6B, 0xB6, 233 0x00, 0x00, 0x00, 0x88, 0x88, 0x5D,
218 0x6D, 0xD6, 0xAD, 0xDA, 0x6D, 0xD6, 234 0xD5, 0x6B, 0xB6, 0x6D, 0xD6, 0xAD,
219 0x6B, 0xB6, 0x5D, 0xD5, 0x88, 0x88 235 0xDA, 0x6D, 0xD6, 0x6B, 0xB6, 0x5D,
236 0xD5, 0x88, 0x88, 0x00, 0x00, 0x00
220 }, 237 },
221 { 238 {
222 0x00, 0x00, 0x01, 0x01, 0x03, 0x02, 239 0x00, 0x00, 0x00, 0x00, 0x00, 0x01,
223 0x05, 0x06, 0x0D, 0x0A, 0x05, 0x06, 240 0x01, 0x03, 0x02, 0x05, 0x06, 0x0D,
224 0x03, 0x02, 0x01, 0x01, 0x00, 0x00 241 0x0A, 0x05, 0x06, 0x03, 0x02, 0x01,
242 0x01, 0x00, 0x00, 0x00, 0x00, 0x00
225 } 243 }
244 },
245 // blank
246 {
247 { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
248 { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
249 { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }
250 },
251 // better gamepad
252 {
253 { 0, 0, 0,192,224,224,112,240,240,240,240,144,144,240,240,240,240,112,224,224,192, 0, 0, 0 },
254 { 128,248,255,255,255,254,252,230,195,195,230,255,255,254,247,227,246,253,254,255,255,255,248,128 },
255 { 7, 15, 15, 15, 7, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 7, 15, 15, 15, 7 }
256
257 },
258 // mouse
259 {
260 { 0, 0, 0, 0, 0, 0, 0, 0,192, 32, 32, 32,160, 32, 32, 32,192, 0, 0, 0, 0, 0, 0, 0 },
261 { 0, 0, 0, 0, 0, 0, 0,240, 15, 0, 0, 0, 3, 0, 0, 0, 15,240, 0, 0, 0, 0, 0, 0 },
262 { 0, 0, 0, 0, 0, 0, 0, 3, 6, 4, 4, 4, 4, 4, 4, 4, 6, 3, 0, 0, 0, 0, 0, 0 }
226 } 263 }
227 }; 264 };
228 265
229 uint8_t layer_is = 0; 266
267 // clang-format on
268 uint8_t layer_is[4] = { 0, 4, 4, 4};
230 if (layer_state_is(_ADJUST)) { 269 if (layer_state_is(_ADJUST)) {
231 layer_is = 3; 270 layer_is[0] = 3;
232 } else if (layer_state_is(_RAISE)) { 271 } else if (layer_state_is(_RAISE)) {
233 layer_is = 1; 272 layer_is[0] = 1;
234 } else if (layer_state_is(_LOWER)) { 273 } else if (layer_state_is(_LOWER)) {
235 layer_is = 2; 274 layer_is[0] = 2;
275 }
276
277 if (layer_state_is(_MOUSE)) {
278 layer_is[1] = 6;
236 } 279 }
280 if (layer_state_is(_GAMEPAD)) {
281 layer_is[2] = 5;
282 }
283
237 284
238 oled_set_cursor(1, 2); 285 oled_set_cursor(1, 2);
239 oled_write_raw_P(tri_layer_image[layer_is][0], sizeof(tri_layer_image[0][0])); 286 oled_write_raw_P(tri_layer_image[layer_is[0]][0], sizeof(tri_layer_image[0][0]));
240 oled_set_cursor(5, 3); 287 oled_set_cursor(5, 2);
288 oled_write_raw_P(tri_layer_image[layer_is[1]][0], sizeof(tri_layer_image[0][0]));
289 oled_set_cursor(9, 2);
290 oled_write_raw_P(tri_layer_image[layer_is[2]][0], sizeof(tri_layer_image[0][0]));
291 oled_set_cursor(14, 2);
241 oled_write_P(PSTR("Diablo2"), layer_state_is(_DIABLOII)); 292 oled_write_P(PSTR("Diablo2"), layer_state_is(_DIABLOII));
242 oled_write_P(PSTR(" "), false);
243 oled_write_P(PSTR("Diablo3"), layer_state_is(_DIABLO));
244 oled_advance_page(true); 293 oled_advance_page(true);
245 294
246 oled_set_cursor(1, 3); 295 oled_set_cursor(1, 3);
247 oled_write_raw_P(tri_layer_image[layer_is][1], sizeof(tri_layer_image[0][0])); 296 oled_write_raw_P(tri_layer_image[layer_is[0]][1], sizeof(tri_layer_image[0][0]));
248 oled_set_cursor(5, 4); 297 oled_set_cursor(5, 3);
249 oled_write_P(PSTR("GamePad"), layer_state_is(_GAMEPAD)); 298 oled_write_raw_P(tri_layer_image[layer_is[1]][1], sizeof(tri_layer_image[0][0]));
250 oled_write_P(PSTR(" "), false); 299 oled_set_cursor(9, 3);
251 oled_write_P(PSTR("Mouse"), layer_state_is(_MOUSE)); 300 oled_write_raw_P(tri_layer_image[layer_is[2]][1], sizeof(tri_layer_image[0][0]));
301 oled_set_cursor(14, 3);
302 oled_write_P(PSTR("Diablo3"), layer_state_is(_DIABLO));
252 oled_advance_page(true); 303 oled_advance_page(true);
253 304
254 oled_set_cursor(1, 4); 305 oled_set_cursor(1, 4);
255 oled_write_raw_P(tri_layer_image[layer_is][2], sizeof(tri_layer_image[0][0])); 306 oled_write_raw_P(tri_layer_image[layer_is[0]][2], sizeof(tri_layer_image[0][0]));
256 307 oled_set_cursor(5, 4);
308 oled_write_raw_P(tri_layer_image[layer_is[1]][2], sizeof(tri_layer_image[0][0]));
309 oled_set_cursor(9, 4);
310 oled_write_raw_P(tri_layer_image[layer_is[2]][2], sizeof(tri_layer_image[0][0]));
311 oled_set_cursor(14, 4);
312 oled_write_P(PSTR("Media"), layer_state_is(_MEDIA));
257#else 313#else
258 oled_write_P(PSTR(OLED_RENDER_LAYER_NAME), false); 314 oled_write_P(PSTR(OLED_RENDER_LAYER_NAME), false);
259 oled_write_P(PSTR(OLED_RENDER_LAYER_LOWER), layer_state_is(_LOWER)); 315 oled_write_P(PSTR(OLED_RENDER_LAYER_LOWER), layer_state_is(_LOWER));
260 oled_write_P(PSTR(OLED_RENDER_LAYER_RAISE), layer_state_is(_RAISE)); 316 oled_write_P(PSTR(OLED_RENDER_LAYER_RAISE), layer_state_is(_RAISE));
261 oled_advance_page(true);
262#endif 317#endif
318 oled_advance_page(true);
263} 319}
264 320
265/** 321/**
@@ -288,9 +344,14 @@ void render_keylock_status(uint8_t led_usb_state) {
288 * @brief Renders the matrix scan rate to the host system 344 * @brief Renders the matrix scan rate to the host system
289 * 345 *
290 */ 346 */
291void render_matrix_scan_rate(void) { 347void render_matrix_scan_rate(uint8_t padding) {
292#ifdef DEBUG_MATRIX_SCAN_RATE 348#ifdef DEBUG_MATRIX_SCAN_RATE
293 oled_write_P(PSTR("MS:"), false); 349 oled_write_P(PSTR("MS:"), false);
350 if (padding) {
351 for (uint8_t n = padding; n > 0; n--) {
352 oled_write_P(PSTR(" "), false);
353 }
354 }
294 oled_write(get_u16_str(get_matrix_scan_rate(), ' '), false); 355 oled_write(get_u16_str(get_matrix_scan_rate(), ' '), false);
295#endif 356#endif
296} 357}
@@ -337,7 +398,7 @@ void render_bootmagic_status(void) {
337 398
338 bool is_bootmagic_on; 399 bool is_bootmagic_on;
339#ifdef OLED_DISPLAY_VERBOSE 400#ifdef OLED_DISPLAY_VERBOSE
340 oled_set_cursor(7, 4); 401 oled_set_cursor(7, 3);
341 is_bootmagic_on = !keymap_config.swap_lctl_lgui; 402 is_bootmagic_on = !keymap_config.swap_lctl_lgui;
342#else 403#else
343 is_bootmagic_on = keymap_config.swap_lctl_lgui; 404 is_bootmagic_on = keymap_config.swap_lctl_lgui;
@@ -366,11 +427,12 @@ void render_bootmagic_status(void) {
366 oled_write_P(PSTR(" "), false); 427 oled_write_P(PSTR(" "), false);
367#ifdef AUTOCORRECTION_ENABLE 428#ifdef AUTOCORRECTION_ENABLE
368 oled_write_P(PSTR("CRCT"), userspace_config.autocorrection); 429 oled_write_P(PSTR("CRCT"), userspace_config.autocorrection);
430 oled_write_P(PSTR(" "), false);
369#else 431#else
370 oled_write_P(PSTR(OLED_RENDER_BOOTMAGIC_NOGUI), keymap_config.no_gui); 432 oled_write_P(PSTR(OLED_RENDER_BOOTMAGIC_NOGUI), keymap_config.no_gui);
371#endif 433#endif
372#ifdef OLED_DISPLAY_VERBOSE 434#ifdef OLED_DISPLAY_VERBOSE
373 oled_set_cursor(7, 5); 435 oled_set_cursor(7, 4);
374 if (keymap_config.swap_lctl_lgui) { 436 if (keymap_config.swap_lctl_lgui) {
375 oled_write_P(logo[1][1], is_bootmagic_on); 437 oled_write_P(logo[1][1], is_bootmagic_on);
376 } else { 438 } else {
@@ -382,6 +444,7 @@ void render_bootmagic_status(void) {
382#ifdef SWAP_HANDS_ENABLE 444#ifdef SWAP_HANDS_ENABLE
383 oled_write_P(PSTR(" "), false); 445 oled_write_P(PSTR(" "), false);
384 oled_write_P(PSTR(OLED_RENDER_BOOTMAGIC_SWAP), swap_hands); 446 oled_write_P(PSTR(OLED_RENDER_BOOTMAGIC_SWAP), swap_hands);
447 oled_write_P(PSTR(" "), false);
385#endif 448#endif
386} 449}
387 450
@@ -402,7 +465,7 @@ void render_user_status(void) {
402# endif 465# endif
403#endif 466#endif
404#if defined(OLED_DISPLAY_VERBOSE) 467#if defined(OLED_DISPLAY_VERBOSE)
405 oled_set_cursor(1, 6); 468 oled_set_cursor(1, 5);
406#endif 469#endif
407 oled_write_P(PSTR(OLED_RENDER_USER_NAME), false); 470 oled_write_P(PSTR(OLED_RENDER_USER_NAME), false);
408#if !defined(OLED_DISPLAY_VERBOSE) 471#if !defined(OLED_DISPLAY_VERBOSE)
@@ -434,9 +497,9 @@ void render_user_status(void) {
434 oled_write_P(rgb_layer_status[userspace_config.rgb_layer_change], false); 497 oled_write_P(rgb_layer_status[userspace_config.rgb_layer_change], false);
435 static const char PROGMEM cat_mode[2][3] = {{0xF8, 0xF9, 0}, {0xF6, 0xF7, 0}}; 498 static const char PROGMEM cat_mode[2][3] = {{0xF8, 0xF9, 0}, {0xF6, 0xF7, 0}};
436 oled_write_P(cat_mode[0], host_driver_disabled); 499 oled_write_P(cat_mode[0], host_driver_disabled);
437#if defined(CUSTOM_UNICODE_ENABLE) 500#if defined(UNICODE_COMMON_ENABLE)
438 static const char PROGMEM uc_mod_status[5][3] = {{0xEA, 0xEB, 0}, {0xEC, 0xED, 0}}; 501 static const char PROGMEM uc_mod_status[5][3] = {{0xEC, 0xED, 0}, {0x20, 0x20, 0}, {0x20, 0x20, 0}, {0x20, 0x20, 0}, {0xEA, 0xEB, 0}};
439 oled_write_P(uc_mod_status[get_unicode_input_mode() == UC_MAC], false); 502 oled_write_P(uc_mod_status[get_unicode_input_mode()], false);
440#endif 503#endif
441 if (userspace_config.nuke_switch) { 504 if (userspace_config.nuke_switch) {
442#if !defined(OLED_DISPLAY_VERBOSE) 505#if !defined(OLED_DISPLAY_VERBOSE)
@@ -466,9 +529,69 @@ void render_wpm(uint8_t padding) {
466#endif 529#endif
467} 530}
468 531
469#if defined(KEYBOARD_handwired_tractyl_manuform) || defined(KEYBOARD_bastardkb_charybdis) 532//============= USER CONFIG PARAMS ===============
470extern kb_config_data_t kb_config; 533// wpm graph originally designed by john-ezra
471void render_pointing_dpi_status(uint8_t padding) { 534
535// for 128x128:
536// max_lines_graph = 54;
537// vertical_offset = 64;
538// for 128x64:
539// max_lines_graph = 64;
540// vertical_offset = 0;
541
542void render_wpm_graph(uint8_t max_lines_graph, uint8_t vertical_offset) {
543 static uint16_t timer = 0;
544 static uint8_t x = OLED_DISPLAY_HEIGHT - 1;
545 uint8_t currwpm = get_current_wpm();
546 float max_wpm = OLED_WPM_GRAPH_MAX_WPM;
547
548 if (timer_elapsed(timer) > OLED_WPM_GRAPH_REFRESH_INTERVAL) { // check if it's been long enough before refreshing graph
549 x = (max_lines_graph - 1) - ((currwpm / max_wpm) * (max_lines_graph - 1)); // main calculation to plot graph line
550 for (uint8_t i = 0; i <= OLED_WPM_GRAPH_GRAPH_LINE_THICKNESS - 1; i++) { // first draw actual value line
551 oled_write_pixel(3, x + i + vertical_offset, true);
552 }
553# ifdef OLED_WPM_GRAPH_VERTICAL_LINE
554 static uint8_t vert_count = 0;
555 if (vert_count == OLED_WPM_GRAPH_VERTCAL_LINE_INTERVAL) {
556 vert_count = 0;
557 while (x <= (max_lines_graph - 1)) {
558 oled_write_pixel(3, x + vertical_offset, true);
559 x++;
560 }
561 } else {
562 for (uint8_t i = (max_lines_graph - 1); i > x; i--) {
563 if (i % OLED_WPM_GRAPH_AREA_FILL_INTERVAL == 0) {
564 oled_write_pixel(3, i + vertical_offset, true);
565 }
566 }
567 vert_count++;
568 }
569# else
570 for (int i = (max_lines_graph - 1); i > x; i--) {
571 if (i % OLED_WPM_GRAPH_AREA_FILL_INTERVAL == 0) {
572 oled_write_pixel(3, i + vertical_offset, true);
573 }
574 }
575# endif
576 oled_pan(false); // then move the entire graph one pixel to the right
577 static const char PROGMEM display_border[3] = {0x0, 0xFF, 0x0};
578 for (uint8_t i = 0; i < 7; i++) {
579 oled_set_cursor(0, i + 8);
580 oled_write_raw_P(display_border, sizeof(display_border));
581 oled_set_cursor(21, i + 8);
582 oled_write_raw_P(display_border, sizeof(display_border));
583 }
584 static const char PROGMEM footer_image[] = {0, 3, 4, 8, 16, 32, 64, 128, 128, 128, 128, 128, 128, 128, 192, 224, 240, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 240, 224, 192, 128, 128, 128, 128, 128, 128, 128, 64, 32, 16, 8, 4, 3, 0};
585 oled_set_cursor(0, 15);
586
587 oled_write_raw_P(footer_image, sizeof(footer_image));
588
589 timer = timer_read(); // refresh the timer for the next iteration
590 }
591}
592
593#if defined(POINTING_DEVICE_ENABLE)
594void render_pointing_dpi_status(uint16_t cpi, uint8_t padding) {
472 oled_write_P(PSTR("CPI:"), false); 595 oled_write_P(PSTR("CPI:"), false);
473 if (padding) { 596 if (padding) {
474 for (uint8_t n = padding - 1; n > 0; n--) { 597 for (uint8_t n = padding - 1; n > 0; n--) {
@@ -476,17 +599,15 @@ void render_pointing_dpi_status(uint8_t padding) {
476 } 599 }
477 } 600 }
478 601
479 oled_write(get_u16_str(kb_config.device_cpi, ' '), false); 602 oled_write(get_u16_str(cpi, ' '), false);
480} 603}
481#endif 604#endif
482 605
483__attribute__((weak)) void oled_driver_render_logo_right(void) { 606__attribute__((weak)) void oled_driver_render_logo_right(void) {
484#if defined(OLED_DISPLAY_VERBOSE) 607#if defined(OLED_DISPLAY_VERBOSE)
485 oled_set_cursor(0, 2); 608 oled_set_cursor(0, 1);
486 render_default_layer_state();
487#else
488 render_default_layer_state();
489#endif 609#endif
610 render_default_layer_state();
490} 611}
491 612
492// WPM-responsive animation stuff here 613// WPM-responsive animation stuff here
@@ -511,8 +632,8 @@ __attribute__((weak)) void oled_driver_render_logo_right(void) {
511# error frame size too large 632# error frame size too large
512#endif 633#endif
513 634
514static uint8_t animation_frame = 0; 635static uint8_t animation_frame = 0;
515static uint8_t animation_type = 0; 636static uint8_t animation_type = 0;
516 637
517void render_kitty(void) { 638void render_kitty(void) {
518 // Images credit j-inc(/James Incandenza) and pixelbenny. 639 // Images credit j-inc(/James Incandenza) and pixelbenny.
@@ -771,28 +892,28 @@ void render_kitty(void) {
771 // clang-format on 892 // clang-format on
772 893
773 for (uint8_t i = 0; i < 4; i++) { 894 for (uint8_t i = 0; i < 4; i++) {
774 oled_set_cursor(1, i + 2); 895 oled_set_cursor(1, i + 1);
775 oled_write_raw_P(animation[animation_type][animation_frame][i], OLED_ANIM_SIZE); 896 oled_write_raw_P(animation[animation_type][animation_frame][i], OLED_ANIM_SIZE);
776 } 897 }
777} 898}
778 899
779uint32_t kitty_animation_phases(uint32_t triger_time, void *cb_arg) { 900uint32_t kitty_animation_phases(uint32_t triger_time, void *cb_arg) {
780 uint32_t anim_frame_duration = 500; 901 static uint32_t anim_frame_duration = 500;
781 // can't change animation frame duration here, otherwise, it gets stuck.
782 // weirdly, it seems to work fine if it's in keymap.c but not here.
783 // Should move this block to the deferred execution?
784#ifdef POINTING_DEVICE_ENABLE 902#ifdef POINTING_DEVICE_ENABLE
785 if (tap_toggling) { 903 if (tap_toggling) {
786 animation_frame = (animation_frame + 1) % OLED_RTOGI_FRAMES; 904 animation_frame = (animation_frame + 1) % OLED_RTOGI_FRAMES;
787 animation_type = 3; 905 animation_type = 3;
788 anim_frame_duration = 300; 906 anim_frame_duration = 300;
789 } else 907 } else
790#endif 908#endif
791 { 909 {
910#ifdef WPM_ENABLE
792 if (get_current_wpm() <= OLED_SLEEP_SPEED) { 911 if (get_current_wpm() <= OLED_SLEEP_SPEED) {
912#endif
793 animation_frame = (animation_frame + 1) % OLED_SLEEP_FRAMES; 913 animation_frame = (animation_frame + 1) % OLED_SLEEP_FRAMES;
794 animation_type = 0; 914 animation_type = 0;
795 anim_frame_duration = 500; 915 anim_frame_duration = 500;
916#ifdef WPM_ENABLE
796 } else if (get_current_wpm() > OLED_WAKE_SPEED) { 917 } else if (get_current_wpm() > OLED_WAKE_SPEED) {
797 animation_frame = (animation_frame + 1) % OLED_WAKE_FRAMES; 918 animation_frame = (animation_frame + 1) % OLED_WAKE_FRAMES;
798 animation_type = 1; 919 animation_type = 1;
@@ -802,13 +923,14 @@ uint32_t kitty_animation_phases(uint32_t triger_time, void *cb_arg) {
802 animation_type = 2; 923 animation_type = 2;
803 anim_frame_duration = 500; 924 anim_frame_duration = 500;
804 } 925 }
926#endif
805 } 927 }
806 return anim_frame_duration; 928 return anim_frame_duration;
807} 929}
808 930
809void oled_driver_render_logo_left(void) { 931void oled_driver_render_logo_left(void) {
810#if defined(OLED_DISPLAY_VERBOSE) 932#if defined(OLED_DISPLAY_VERBOSE)
811 oled_set_cursor(0, 2); 933 oled_set_cursor(0, 1);
812 render_kitty(); 934 render_kitty();
813 935
814# if defined(KEYBOARD_handwired_tractyl_manuform) 936# if defined(KEYBOARD_handwired_tractyl_manuform)
@@ -817,39 +939,82 @@ void oled_driver_render_logo_left(void) {
817# elif defined(KEYBOARD_bastardkb_charybdis) 939# elif defined(KEYBOARD_bastardkb_charybdis)
818 oled_set_cursor(6, 0); 940 oled_set_cursor(6, 0);
819 oled_write_P(PSTR("Charybdis"), true); 941 oled_write_P(PSTR("Charybdis"), true);
942# elif defined(KEYBOARD_splitkb_kyria)
943 oled_set_cursor(7, 0);
944 oled_write_P(PSTR("SplitKB"), true);
820# else 945# else
821 oled_set_cursor(8, 0); 946 oled_set_cursor(8, 0);
822 oled_write_P(PSTR("Left"), true); 947 oled_write_P(PSTR("Left"), true);
823# endif 948# endif
824 oled_set_cursor(7, 2); 949 oled_set_cursor(7, 1);
825# if defined(DEBUG_MATRIX_SCAN_RATE) 950# if defined(WPM_ENABLE)
826 render_matrix_scan_rate();
827# elif defined(WPM_ENABLE)
828 render_wpm(1); 951 render_wpm(1);
952# elif defined(DEBUG_MATRIX_SCAN_RATE)
953 render_matrix_scan_rate(2);
829# endif 954# endif
830 oled_set_cursor(7, 3); 955 oled_set_cursor(7, 2);
831# if defined(KEYBOARD_handwired_tractyl_manuform) 956# if defined(KEYBOARD_bastardkb_charybdis)
832 render_pointing_dpi_status(0); 957 render_pointing_dpi_status(charybdis_get_pointer_sniping_enabled() ? charybdis_get_pointer_sniping_dpi() : charybdis_get_pointer_default_dpi(), 1);
833# elif defined(KEYBOARD_bastardkb_charybdis) 958
834 render_pointing_dpi_status(1); 959// credit and thanks to jaspertandy on discord for these images
960 static const char PROGMEM mouse_logo[3][2][16] = {
961 // mouse icon
962 {
963 { 0, 0, 0, 252, 2, 2, 2, 58, 2, 2, 2, 252, 0, 0, 0, 0 },
964 { 0, 0, 63, 96, 64, 64, 64, 64, 64, 64, 64, 96, 63, 0, 0, 0 }
965 },
966 // crosshair icon
967 {
968 { 128, 240, 136, 228, 146, 138, 202, 127, 202, 138, 146, 228, 136, 240, 128, 0 },
969 { 0, 7, 8, 19, 36, 40, 41, 127, 41, 40, 36, 19, 8, 7, 0, 0 }
970 },
971 // dragscroll icon
972 {
973 { 0, 0, 112, 136, 156, 2, 15, 1, 15, 2, 140, 68, 56, 0, 0, 0 },
974 { 0, 0, 2, 6, 15, 28, 60, 124, 60, 28, 15, 6, 2, 0, 0, 0 }
975 }
976 };
977
978
979 uint8_t image_index = 0;
980# ifdef OLED_DISPLAY_TEST
981 image_index = animation_frame;
982# else
983 if (charybdis_get_pointer_sniping_enabled()) {
984 image_index = 1;
985 } else if (charybdis_get_pointer_dragscroll_enabled()) {
986 image_index = 2;
987 }
988# endif
989
990 oled_set_cursor(17, 1);
991 oled_write_raw_P(mouse_logo[image_index][0], 16);
992 oled_set_cursor(17, 2);
993 oled_write_raw_P(mouse_logo[image_index][1], 16);
994# elif defined(WPM_ENABLE) && defined(DEBUG_MATRIX_SCAN_RATE)
995 render_matrix_scan_rate(2);
835# endif 996# endif
836 oled_set_cursor(0, 6); 997
998 oled_set_cursor(0, 5);
837#else 999#else
838 render_default_layer_state(); 1000 render_default_layer_state();
839#endif 1001#endif
840} 1002}
841 1003
842void render_status_secondary(void) { 1004void render_status_right(void) {
843# if defined(KEYBOARD_handwired_tractyl_manuform) 1005#if defined(KEYBOARD_handwired_tractyl_manuform)
844 oled_set_cursor(7, 0); 1006 oled_set_cursor(7, 0);
845 oled_write_P(PSTR("Manuform"), true); 1007 oled_write_P(PSTR("Manuform"), true);
846# elif defined(KEYBOARD_bastardkb_charybdis) 1008#elif defined(KEYBOARD_bastardkb_charybdis)
847 oled_set_cursor(6, 0); 1009 oled_set_cursor(6, 0);
848 oled_write_P(PSTR("Charybdis"), true); 1010 oled_write_P(PSTR("Charybdis"), true);
849# else 1011#elif defined(KEYBOARD_splitkb_kyria)
1012 oled_set_cursor(8, 0);
1013 oled_write_P(PSTR("Kyria"), true);
1014#else
850 oled_set_cursor(8, 0); 1015 oled_set_cursor(8, 0);
851 oled_write_P(PSTR("Right"), true); 1016 oled_write_P(PSTR("Right"), true);
852# endif 1017#endif
853 oled_driver_render_logo_right(); 1018 oled_driver_render_logo_right();
854 /* Show Keyboard Layout */ 1019 /* Show Keyboard Layout */
855 render_layer_state(); 1020 render_layer_state();
@@ -860,16 +1025,18 @@ void render_status_secondary(void) {
860 render_keylock_status(host_keyboard_leds()); 1025 render_keylock_status(host_keyboard_leds());
861} 1026}
862 1027
863void render_status_main(void) { 1028void render_status_left(void) {
864 oled_driver_render_logo_left(); 1029 oled_driver_render_logo_left();
865 1030
866 /* Show Keyboard Layout */ 1031 /* Show Keyboard Layout */
867 render_bootmagic_status(); 1032 render_bootmagic_status();
868 render_user_status(); 1033 render_user_status();
869 1034
870 // render_keylogger_status(); 1035 render_keylogger_status();
871} 1036}
872 1037
1038__attribute__((weak)) void oled_render_large_display(void) {}
1039
873__attribute__((weak)) oled_rotation_t oled_init_keymap(oled_rotation_t rotation) { return rotation; } 1040__attribute__((weak)) oled_rotation_t oled_init_keymap(oled_rotation_t rotation) { return rotation; }
874 1041
875oled_rotation_t oled_init_user(oled_rotation_t rotation) { 1042oled_rotation_t oled_init_user(oled_rotation_t rotation) {
@@ -884,12 +1051,14 @@ oled_rotation_t oled_init_user(oled_rotation_t rotation) {
884 return oled_init_keymap(rotation); 1051 return oled_init_keymap(rotation);
885} 1052}
886 1053
1054__attribute__((weak)) bool oled_task_keymap(void) { return true; }
1055
887bool oled_task_user(void) { 1056bool oled_task_user(void) {
888 update_log(); 1057 update_log();
889 1058
890 if (is_keyboard_master()) { 1059 if (is_keyboard_master()) {
891#ifndef OLED_DISPLAY_TEST 1060#ifndef OLED_DISPLAY_TEST
892 if (timer_elapsed32(oled_timer) > 30000) { 1061 if (timer_elapsed32(oled_timer) > 60000) {
893 oled_off(); 1062 oled_off();
894 return false; 1063 return false;
895 } else 1064 } else
@@ -898,14 +1067,23 @@ bool oled_task_user(void) {
898 oled_on(); 1067 oled_on();
899 } 1068 }
900 } 1069 }
1070
1071 if (!oled_task_keymap()) {
1072 return false;
1073 }
1074
1075#if defined(OLED_DISPLAY_128X128)
1076 oled_set_cursor(0, 7);
1077 oled_render_large_display();
1078#endif
1079
901#if defined(OLED_DISPLAY_VERBOSE) 1080#if defined(OLED_DISPLAY_VERBOSE)
902 static const char PROGMEM header_image[] = { 1081 static const char PROGMEM header_image[] = {
903 0,192, 32, 16, 8, 4, 2, 1, 1, 1, 1, 1, 1, 1, 1, 3, 7, 15, 31, 63,127,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,127, 63, 31, 15, 7, 3, 1, 1, 1, 1, 1, 1, 1, 1, 2, 4, 8, 16, 32,192, 0, 1082 0, 192, 32, 16, 8, 4, 2, 1, 1, 1, 1, 1, 1, 1, 1, 3, 7, 15, 31, 63, 127, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 127, 63, 31, 15, 7, 3, 1, 1, 1, 1, 1, 1, 1, 1, 2, 4, 8, 16, 32, 192, 0,
904 0,255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 3, 7, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 7, 3, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,255, 0 1083 // 0,255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 3, 7, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 7, 3, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,255, 0
905 }; 1084 };
906 static const char PROGMEM footer_image[] = { 1085 static const char PROGMEM footer_image[] = {0, 3, 4, 8, 16, 32, 64, 128, 128, 128, 128, 128, 128, 128, 192, 224, 240, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 240, 224, 192, 128, 128, 128, 128, 128, 128, 128, 64, 32, 16, 8, 4, 3, 0};
907 0, 3, 4, 8, 16, 32, 64,128,128,128,128,128,128,128,192,224,240,248,248,248,248,248,248,248,248,248,248,248,248,248,248,248,248,248,248,248,248,248,248,248,248,248,248,248,248,248,248,248,248,248,248,248,248,248,248,248,248,248,248,248,248,248,248,248,248,248,248,248,248,248,248,248,248,248,248,248,248,248,248,248,248,248,248,248,248,248,248,248,248,248,248,248,248,248,248,248,248,248,248,248,248,248,248,248,248,248,248,248,248,248,248,240,224,192,128,128,128,128,128,128,128, 64, 32, 16, 8, 4, 3, 0 1086 oled_set_cursor(0, 0);
908 };
909 oled_write_raw_P(header_image, sizeof(header_image)); 1087 oled_write_raw_P(header_image, sizeof(header_image));
910 oled_set_cursor(0, 1); 1088 oled_set_cursor(0, 1);
911#endif 1089#endif
@@ -913,16 +1091,10 @@ bool oled_task_user(void) {
913#ifndef OLED_DISPLAY_TEST 1091#ifndef OLED_DISPLAY_TEST
914 if (is_keyboard_left()) { 1092 if (is_keyboard_left()) {
915#endif 1093#endif
916 render_status_main(); // Renders the current keyboard state (layer, lock, caps, scroll, etc) 1094 render_status_left();
917#ifndef OLED_DISPLAY_TEST 1095#ifndef OLED_DISPLAY_TEST
918 } else { 1096 } else {
919 render_status_secondary(); 1097 render_status_right();
920 }
921#endif
922
923#if defined(OLED_DISPLAY_128X128)
924 if (is_keyboard_left()) {
925 render_keylogger_status();
926 } 1098 }
927#endif 1099#endif
928 1100
@@ -933,7 +1105,7 @@ bool oled_task_user(void) {
933# else 1105# else
934 num_of_rows = 7; 1106 num_of_rows = 7;
935# endif 1107# endif
936 for (uint8_t i= 1; i < num_of_rows; i++) { 1108 for (uint8_t i = 1; i < num_of_rows; i++) {
937 oled_set_cursor(0, i); 1109 oled_set_cursor(0, i);
938 oled_write_raw_P(display_border, sizeof(display_border)); 1110 oled_write_raw_P(display_border, sizeof(display_border));
939 oled_set_cursor(21, i); 1111 oled_set_cursor(21, i);
diff --git a/users/drashna/oled/oled_stuff.h b/users/drashna/oled/oled_stuff.h
index 985153c2f..7245f6131 100644
--- a/users/drashna/oled/oled_stuff.h
+++ b/users/drashna/oled/oled_stuff.h
@@ -28,15 +28,17 @@ void render_keylogger_status(void);
28void render_default_layer_state(void); 28void render_default_layer_state(void);
29void render_layer_state(void); 29void render_layer_state(void);
30void render_keylock_status(uint8_t led_usb_state); 30void render_keylock_status(uint8_t led_usb_state);
31void render_matrix_scan_rate(void); 31void render_matrix_scan_rate(uint8_t padding);
32void render_mod_status(uint8_t modifiers); 32void render_mod_status(uint8_t modifiers);
33void render_bootmagic_status(void); 33void render_bootmagic_status(void);
34void render_user_status(void); 34void render_user_status(void);
35void oled_driver_render_logo(void); 35void oled_driver_render_logo(void);
36void render_wpm(uint8_t padding); 36void render_wpm(uint8_t padding);
37void render_pointing_dpi_status(uint8_t padding); 37void render_pointing_dpi_status(uint16_t cpi, uint8_t padding);
38void oled_driver_render_logo_left(void); 38void oled_driver_render_logo_left(void);
39void oled_driver_render_logo_right(void); 39void oled_driver_render_logo_right(void);
40void oled_render_large_display(void);
41void render_wpm_graph(uint8_t max_lines_graph, uint8_t vertical_offset);
40 42
41#if defined(OLED_DISPLAY_128X128) || defined(OLED_DISPLAY_128X64) 43#if defined(OLED_DISPLAY_128X128) || defined(OLED_DISPLAY_128X64)
42# define OLED_DISPLAY_VERBOSE 44# define OLED_DISPLAY_VERBOSE
@@ -47,7 +49,7 @@ void oled_driver_render_logo_right(void);
47# endif 49# endif
48# define OLED_RENDER_LAYOUT_NAME "Layout: " 50# define OLED_RENDER_LAYOUT_NAME "Layout: "
49# define OLED_RENDER_LAYOUT_QWERTY "Qwerty" 51# define OLED_RENDER_LAYOUT_QWERTY "Qwerty"
50# define OLED_RENDER_LAYOUT_COLEMAK_DH "ColemkDH" 52# define OLED_RENDER_LAYOUT_COLEMAK_DH "Colemak DH"
51# define OLED_RENDER_LAYOUT_COLEMAK "Colemak" 53# define OLED_RENDER_LAYOUT_COLEMAK "Colemak"
52# define OLED_RENDER_LAYOUT_DVORAK "Dvorak" 54# define OLED_RENDER_LAYOUT_DVORAK "Dvorak"
53# define OLED_RENDER_LAYOUT_WORKMAN "Workman" 55# define OLED_RENDER_LAYOUT_WORKMAN "Workman"
@@ -139,3 +141,19 @@ void oled_driver_render_logo_right(void);
139 141
140 142
141extern char keylog_str[OLED_KEYLOGGER_LENGTH]; 143extern char keylog_str[OLED_KEYLOGGER_LENGTH];
144
145#ifndef OLED_WPM_GRAPH_MAX_WPM
146# define OLED_WPM_GRAPH_MAX_WPM 120
147#endif
148#ifndef OLED_WPM_GRAPH_REFRESH_INTERVAL
149# define OLED_WPM_GRAPH_REFRESH_INTERVAL 300
150#endif
151#ifndef OLED_WPM_GRAPH_AREA_FILL_INTERVAL
152# define OLED_WPM_GRAPH_AREA_FILL_INTERVAL 3
153#endif
154#ifndef OLED_WPM_GRAPH_VERTCAL_LINE_INTERVAL
155# define OLED_WPM_GRAPH_VERTCAL_LINE_INTERVAL 3
156#endif
157#ifndef OLED_WPM_GRAPH_GRAPH_LINE_THICKNESS
158# define OLED_WPM_GRAPH_GRAPH_LINE_THICKNESS 2
159#endif
diff --git a/users/drashna/pointing/pointing.c b/users/drashna/pointing/pointing.c
index 0116ce090..0dcfe73f3 100644
--- a/users/drashna/pointing/pointing.c
+++ b/users/drashna/pointing/pointing.c
@@ -42,19 +42,15 @@ report_mouse_t pointing_device_task_user(report_mouse_t mouse_report) {
42 layer_on(_MOUSE); 42 layer_on(_MOUSE);
43 } 43 }
44 } 44 }
45 } 45 } else if (timer_elapsed(mouse_timer) > 650 && layer_state_is(_MOUSE) && !mouse_keycode_tracker && !tap_toggling) {
46 return pointing_device_task_keymap(mouse_report);
47}
48
49void matrix_scan_pointing(void) {
50 if (timer_elapsed(mouse_timer) > 650 && layer_state_is(_MOUSE) && !mouse_keycode_tracker && !tap_toggling) {
51 layer_off(_MOUSE); 46 layer_off(_MOUSE);
52 } 47 } else if (tap_toggling) {
53 if (tap_toggling) {
54 if (!layer_state_is(_MOUSE)) { 48 if (!layer_state_is(_MOUSE)) {
55 layer_on(_MOUSE); 49 layer_on(_MOUSE);
56 } 50 }
57 } 51 }
52
53 return pointing_device_task_keymap(mouse_report);
58} 54}
59 55
60bool process_record_pointing(uint16_t keycode, keyrecord_t* record) { 56bool process_record_pointing(uint16_t keycode, keyrecord_t* record) {
@@ -86,7 +82,7 @@ bool process_record_pointing(uint16_t keycode, keyrecord_t* record) {
86 case MO(_MOUSE): 82 case MO(_MOUSE):
87#if defined(KEYBOARD_ploopy) || defined(KEYBOARD_handwired_tractyl_manuform) 83#if defined(KEYBOARD_ploopy) || defined(KEYBOARD_handwired_tractyl_manuform)
88 case DPI_CONFIG: 84 case DPI_CONFIG:
89#elif defined(KEYBOARD_bastardkb_charybdis) 85#elif defined(KEYBOARD_bastardkb_charybdis) && !defined(NO_CHARYBDIS_KEYCODES)
90 case SAFE_RANGE ... (CHARYBDIS_SAFE_RANGE-1): 86 case SAFE_RANGE ... (CHARYBDIS_SAFE_RANGE-1):
91#endif 87#endif
92 case KC_MS_UP ... KC_MS_WH_RIGHT: 88 case KC_MS_UP ... KC_MS_WH_RIGHT:
@@ -98,6 +94,12 @@ bool process_record_pointing(uint16_t keycode, keyrecord_t* record) {
98 record->event.pressed ? mouse_keycode_tracker++ : mouse_keycode_tracker--; 94 record->event.pressed ? mouse_keycode_tracker++ : mouse_keycode_tracker--;
99 mouse_timer = timer_read(); 95 mouse_timer = timer_read();
100 break; 96 break;
97 case QK_ONE_SHOT_MOD ... QK_ONE_SHOT_MOD_MAX:
98 break;
99 case QK_MOD_TAP ... QK_MOD_TAP_MAX:
100 if (record->event.pressed || !record->tap.count) {
101 break;
102 }
101 default: 103 default:
102 if (IS_NOEVENT(record->event)) break; 104 if (IS_NOEVENT(record->event)) break;
103 if ((keycode >= QK_LAYER_TAP && keycode <= QK_LAYER_TAP_MAX) && (((keycode >> 0x8) & 0xF) == _MOUSE)) { 105 if ((keycode >= QK_LAYER_TAP && keycode <= QK_LAYER_TAP_MAX) && (((keycode >> 0x8) & 0xF) == _MOUSE)) {
diff --git a/users/drashna/rgb/rgb_stuff.c b/users/drashna/rgb/rgb_stuff.c
index e0422334a..09071f715 100644
--- a/users/drashna/rgb/rgb_stuff.c
+++ b/users/drashna/rgb/rgb_stuff.c
@@ -23,9 +23,29 @@ static bool is_enabled;
23static bool is_rgblight_startup; 23static bool is_rgblight_startup;
24static HSV old_hsv; 24static HSV old_hsv;
25static uint8_t old_mode; 25static uint8_t old_mode;
26static uint16_t rgblight_startup_loop_timer; 26deferred_token rgb_startup_token;
27# endif 27# endif
28 28
29uint32_t rgb_startup_animation(uint32_t triger_time, void *cb_arg) {
30 if (is_rgblight_startup && is_keyboard_master()) {
31 static uint8_t counter = 0;
32 counter++;
33 rgblight_sethsv_noeeprom((counter + old_hsv.h) % 255, 255, 255);
34 if (counter >= 255) {
35 is_rgblight_startup = false;
36 if (userspace_config.rgb_layer_change) {
37 layer_state_set_rgb_light(layer_state);
38 } else {
39 rgblight_set_hsv_and_mode(old_hsv.h, old_hsv.s, old_hsv.v, old_mode);
40 }
41 if (!is_enabled) {
42 rgblight_disable_noeeprom();
43 }
44 }
45 }
46 return is_rgblight_startup ? 10 : 0;
47}
48
29void keyboard_post_init_rgb_light(void) { 49void keyboard_post_init_rgb_light(void) {
30# if defined(RGBLIGHT_STARTUP_ANIMATION) 50# if defined(RGBLIGHT_STARTUP_ANIMATION)
31 is_enabled = rgblight_is_enabled(); 51 is_enabled = rgblight_is_enabled();
@@ -40,30 +60,8 @@ void keyboard_post_init_rgb_light(void) {
40 if (userspace_config.rgb_layer_change) { 60 if (userspace_config.rgb_layer_change) {
41 layer_state_set_rgb_light(layer_state); 61 layer_state_set_rgb_light(layer_state);
42 } 62 }
43} 63 rgb_startup_token = defer_exec(300, rgb_startup_animation, NULL);
44 64
45void matrix_scan_rgb_light(void) {
46# if defined(RGBLIGHT_STARTUP_ANIMATION)
47 if (is_rgblight_startup && is_keyboard_master()) {
48 if (sync_timer_elapsed(rgblight_startup_loop_timer) > 10) {
49 static uint8_t counter;
50 counter++;
51 rgblight_sethsv_noeeprom((counter + old_hsv.h) % 255, 255, 255);
52 rgblight_startup_loop_timer = sync_timer_read();
53 if (counter == 255) {
54 is_rgblight_startup = false;
55 if (userspace_config.rgb_layer_change) {
56 layer_state_set_rgb_light(layer_state);
57 } else {
58 rgblight_set_hsv_and_mode(old_hsv.h, old_hsv.s, old_hsv.v, old_mode);
59 }
60 if (!is_enabled) {
61 rgblight_disable_noeeprom();
62 }
63 }
64 }
65 }
66# endif
67} 65}
68 66
69layer_state_t layer_state_set_rgb_light(layer_state_t state) { 67layer_state_t layer_state_set_rgb_light(layer_state_t state) {
diff --git a/users/drashna/rules.mk b/users/drashna/rules.mk
index 553cc2cbc..4bc71b693 100644
--- a/users/drashna/rules.mk
+++ b/users/drashna/rules.mk
@@ -58,6 +58,7 @@ ifeq ($(strip $(RGBLIGHT_ENABLE)), yes)
58 endif 58 endif
59 ifeq ($(strip $(RGBLIGHT_STARTUP_ANIMATION)), yes) 59 ifeq ($(strip $(RGBLIGHT_STARTUP_ANIMATION)), yes)
60 OPT_DEFS += -DRGBLIGHT_STARTUP_ANIMATION 60 OPT_DEFS += -DRGBLIGHT_STARTUP_ANIMATION
61 DEFERRED_EXEC_ENABLE = yes
61 endif 62 endif
62 endif 63 endif
63endif 64endif
diff --git a/users/drashna/split/transport_sync.c b/users/drashna/split/transport_sync.c
index 2509e448c..4c113ec25 100644
--- a/users/drashna/split/transport_sync.c
+++ b/users/drashna/split/transport_sync.c
@@ -8,7 +8,7 @@
8# include <avr/wdt.h> 8# include <avr/wdt.h>
9#endif 9#endif
10 10
11#ifdef CUSTOM_UNICODE_ENABLE 11#ifdef UNICODE_COMMON_ENABLE
12# include "process_unicode_common.h" 12# include "process_unicode_common.h"
13extern unicode_config_t unicode_config; 13extern unicode_config_t unicode_config;
14#endif 14#endif
@@ -58,7 +58,7 @@ void watchdog_handler(uint8_t in_buflen, const void* in_data, uint8_t out_buflen
58#endif 58#endif
59 59
60#ifdef OLED_ENABLE 60#ifdef OLED_ENABLE
61#include "oled/oled_stuff.h" 61# include "oled/oled_stuff.h"
62void keylogger_string_sync(uint8_t initiator2target_buffer_size, const void* initiator2target_buffer, uint8_t target2initiator_buffer_size, void* target2initiator_buffer) { 62void keylogger_string_sync(uint8_t initiator2target_buffer_size, const void* initiator2target_buffer, uint8_t target2initiator_buffer_size, void* target2initiator_buffer) {
63 if (initiator2target_buffer_size == OLED_KEYLOGGER_LENGTH) { 63 if (initiator2target_buffer_size == OLED_KEYLOGGER_LENGTH) {
64 memcpy(&keylog_str, initiator2target_buffer, initiator2target_buffer_size); 64 memcpy(&keylog_str, initiator2target_buffer, initiator2target_buffer_size);
@@ -95,7 +95,7 @@ void user_transport_update(void) {
95#if defined(POINTING_DEVICE_ENABLE) && defined(KEYBOARD_handwired_tractyl_manuform) 95#if defined(POINTING_DEVICE_ENABLE) && defined(KEYBOARD_handwired_tractyl_manuform)
96 user_state.tap_toggling = tap_toggling; 96 user_state.tap_toggling = tap_toggling;
97#endif 97#endif
98#ifdef UNICODE_ENABLE 98#ifdef UNICODE_COMMON_ENABLE
99 user_state.unicode_mode = unicode_config.input_mode; 99 user_state.unicode_mode = unicode_config.input_mode;
100#endif 100#endif
101#ifdef SWAP_HANDS_ENABLE 101#ifdef SWAP_HANDS_ENABLE
@@ -108,7 +108,7 @@ void user_transport_update(void) {
108 keymap_config.raw = transport_keymap_config; 108 keymap_config.raw = transport_keymap_config;
109 userspace_config.raw = transport_userspace_config; 109 userspace_config.raw = transport_userspace_config;
110 user_state.raw = transport_user_state; 110 user_state.raw = transport_user_state;
111#ifdef UNICODE_ENABLE 111#ifdef UNICODE_COMMON_ENABLE
112 unicode_config.input_mode = user_state.unicode_mode; 112 unicode_config.input_mode = user_state.unicode_mode;
113#endif 113#endif
114#if defined(POINTING_DEVICE_ENABLE) && defined(KEYBOARD_handwired_tractyl_manuform) 114#if defined(POINTING_DEVICE_ENABLE) && defined(KEYBOARD_handwired_tractyl_manuform)
@@ -128,7 +128,7 @@ void user_transport_sync(void) {
128 static uint32_t last_config = 0, last_sync[4], last_user_state = 0; 128 static uint32_t last_config = 0, last_sync[4], last_user_state = 0;
129 bool needs_sync = false; 129 bool needs_sync = false;
130#ifdef OLED_ENABLE 130#ifdef OLED_ENABLE
131 static char keylog_temp[OLED_KEYLOGGER_LENGTH] = { 0 }; 131 static char keylog_temp[OLED_KEYLOGGER_LENGTH] = {0};
132#endif 132#endif
133 133
134 // Check if the state values are different 134 // Check if the state values are different
@@ -228,7 +228,6 @@ void user_transport_sync(void) {
228 } 228 }
229 } 229 }
230#endif 230#endif
231
232} 231}
233 232
234void housekeeping_task_user(void) { 233void housekeeping_task_user(void) {
diff --git a/users/drashna/split/transport_sync.h b/users/drashna/split/transport_sync.h
index 884586dfd..f38fdcf1e 100644
--- a/users/drashna/split/transport_sync.h
+++ b/users/drashna/split/transport_sync.h
@@ -15,7 +15,7 @@ typedef union {
15 bool audio_enable :1; 15 bool audio_enable :1;
16 bool audio_clicky_enable :1; 16 bool audio_clicky_enable :1;
17 bool tap_toggling :1; 17 bool tap_toggling :1;
18 bool unicode_mode :1; 18 uint8_t unicode_mode :3;
19 bool swap_hands :1; 19 bool swap_hands :1;
20 bool host_driver_disabled :1; 20 bool host_driver_disabled :1;
21 }; 21 };