From fa08cb2478e8c13a9f1c785956c95cb49bbebba3 Mon Sep 17 00:00:00 2001 From: Drashna Jaelre Date: Sun, 28 Aug 2022 12:55:19 -0700 Subject: [Keymap] Drashna keymap updates for 0.18.0 (#18184) Co-authored-by: Ryan --- .../charybdis/4x6/keymaps/drashna/config.h | 24 ++- .../charybdis/4x6/keymaps/drashna/keymap.c | 4 +- .../charybdis/4x6/keymaps/drashna/rules.mk | 1 + .../bastardkb/dilemma/keymaps/drashna/config.h | 8 + .../bastardkb/dilemma/keymaps/drashna/keymap.c | 160 ++++++++++++++ .../bastardkb/dilemma/keymaps/drashna/rules.mk | 8 + .../tractyl_manuform/5x6_right/f411/config.h | 2 +- .../tractyl_manuform/5x6_right/f411/f411.c | 2 +- .../5x6_right/keymaps/drashna/config.h | 6 + keyboards/ploopyco/mouse/keymaps/drashna/keymap.c | 19 +- keyboards/ploopyco/mouse/keymaps/drashna/rules.mk | 3 +- keyboards/splitkb/kyria/keymaps/drashna/config.h | 5 + users/drashna/autocorrect_data.h | 90 +++++++- users/drashna/callbacks.c | 20 +- users/drashna/config.h | 232 +++------------------ users/drashna/drashna.c | 131 ++++++++---- users/drashna/drashna.h | 1 - .../autocorrection/autocorrection_data.h | 1 + users/drashna/keyrecords/process_records.c | 5 +- users/drashna/keyrecords/tapping.c | 14 +- users/drashna/keyrecords/unicode.c | 2 +- users/drashna/oled/oled_config.h | 63 ++++++ users/drashna/oled/oled_stuff.c | 24 ++- users/drashna/oled/oled_stuff.h | 2 + users/drashna/pointing/pointing.c | 6 +- users/drashna/post_config.h | 16 +- users/drashna/rgb/rgb_matrix_config.h | 107 ++++++++++ users/drashna/rgb/rgblight_config.h | 8 + users/drashna/rules.mk | 9 + users/drashna/split/split_config.h | 21 ++ users/drashna/split/transport_sync.c | 14 +- users/drashna/split/transport_sync.h | 1 + 32 files changed, 714 insertions(+), 295 deletions(-) create mode 100644 keyboards/bastardkb/dilemma/keymaps/drashna/config.h create mode 100644 keyboards/bastardkb/dilemma/keymaps/drashna/keymap.c create mode 100644 keyboards/bastardkb/dilemma/keymaps/drashna/rules.mk create mode 100644 users/drashna/keyrecords/autocorrection/autocorrection_data.h create mode 100644 users/drashna/oled/oled_config.h create mode 100644 users/drashna/rgb/rgb_matrix_config.h create mode 100644 users/drashna/rgb/rgblight_config.h create mode 100644 users/drashna/split/split_config.h diff --git a/keyboards/bastardkb/charybdis/4x6/keymaps/drashna/config.h b/keyboards/bastardkb/charybdis/4x6/keymaps/drashna/config.h index 6711212cb1..7e47953d63 100644 --- a/keyboards/bastardkb/charybdis/4x6/keymaps/drashna/config.h +++ b/keyboards/bastardkb/charybdis/4x6/keymaps/drashna/config.h @@ -16,6 +16,9 @@ */ #pragma once +#undef PRODUCT +#define PRODUCT "Charybdis (4x6) Blackpill" + #undef MATRIX_COL_PINS #define MATRIX_COL_PINS \ { B0, B1, B12, B3, B4, B5 } @@ -34,7 +37,7 @@ #define DIODE_DIRECTION ROW2COL #define SPLIT_HAND_PIN A3 #undef MASTER_RIGHT -// #define USB_VBUS_PIN B10 +#define USB_VBUS_PIN B10 #undef RGB_DI_PIN #define RGB_DI_PIN A1 @@ -55,6 +58,8 @@ #define AUDIO_PWM_PAL_MODE 2 #define AUDIO_STATE_TIMER GPTD3 #define AUDIO_INIT_DELAY +#define AUDIO_ENABLE_TONE_MULTIPLEXING +#define AUDIO_TONE_MULTIPLEXING_RATE_DEFAULT 10 #undef SOFT_SERIAL_PIN // #define SERIAL_USART_FULL_DUPLEX // Enable full duplex operation mode. @@ -64,12 +69,8 @@ // #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 SERIAL_USART_SPEED 921600 +// #define SERIAL_USART_SPEED 921600 +#define SERIAL_USART_SPEED (1.5 * 1024 * 1024) #define CRC8_USE_TABLE #define CRC8_OPTIMIZE_SPEED @@ -103,3 +104,12 @@ #define RGB_MATRIX_MAXIMUM_BRIGHTNESS 150 #define CHARYBDIS_CONFIG_SYNC + +#define BOOTMAGIC_LITE_ROW 0 +#define BOOTMAGIC_LITE_COLUMN 0 +#define BOOTMAGIC_LITE_ROW_RIGHT 5 +#define BOOTMAGIC_LITE_COLUMN_RIGHT 0 +#define BOOTMAGIC_LITE_EEPROM_ROW 1 +#define BOOTMAGIC_LITE_EEPROM_COLUMN 0 +#define BOOTMAGIC_LITE_EEPROM_ROW_RIGHT 1 +#define BOOTMAGIC_LITE_EEPROM_COLUMN_RIGHT 0 diff --git a/keyboards/bastardkb/charybdis/4x6/keymaps/drashna/keymap.c b/keyboards/bastardkb/charybdis/4x6/keymaps/drashna/keymap.c index 1268d1a8ba..a0f290ad57 100644 --- a/keyboards/bastardkb/charybdis/4x6/keymaps/drashna/keymap.c +++ b/keyboards/bastardkb/charybdis/4x6/keymaps/drashna/keymap.c @@ -26,8 +26,8 @@ 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),ALT_T(K22),GUI_T(K23),K24,K25, K26,K27,RGUI_T(K28),RALT_T(K29),RCTL_T(K2A), OS_RSFT, \ - SFT_T(KC_GRV), UC_IRNY, OS_LGUI, TT(_MOUSE), KC_ENT, \ + OS_LSFT,CTL_T(K21), K22, K23, K24, K25, K26,K27,RGUI_T(K28),RALT_T(K29),RCTL_T(K2A), OS_RSFT, \ + SFT_T(KC_GRV), OS_LALT, OS_LGUI, TT(_MOUSE), KC_ENT, \ KC_SPC, BK_LWER, DL_RAIS \ ) diff --git a/keyboards/bastardkb/charybdis/4x6/keymaps/drashna/rules.mk b/keyboards/bastardkb/charybdis/4x6/keymaps/drashna/rules.mk index d9c1a5a9ba..336750bc90 100644 --- a/keyboards/bastardkb/charybdis/4x6/keymaps/drashna/rules.mk +++ b/keyboards/bastardkb/charybdis/4x6/keymaps/drashna/rules.mk @@ -31,3 +31,4 @@ TAP_DANCE_ENABLE = yes DEBOUNCE_TYPE = asym_eager_defer_pk WPM_ENABLE = yes LTO_ENABLE = no +# OPT = 3 diff --git a/keyboards/bastardkb/dilemma/keymaps/drashna/config.h b/keyboards/bastardkb/dilemma/keymaps/drashna/config.h new file mode 100644 index 0000000000..d7b1351d89 --- /dev/null +++ b/keyboards/bastardkb/dilemma/keymaps/drashna/config.h @@ -0,0 +1,8 @@ +// Copyright 2020 Christopher Courtney, aka Drashna Jael're (@drashna) +// SPDX-License-Identifier: GPL-2.0-or-later + +#pragma once + +#define CIRQUE_PINNACLE_TAP_ENABLE +#define POINTING_DEVICE_GESTURES_CURSOR_GLIDE_ENABLE +#define POINTING_DEVICE_GESTURES_SCROLL_ENABLE diff --git a/keyboards/bastardkb/dilemma/keymaps/drashna/keymap.c b/keyboards/bastardkb/dilemma/keymaps/drashna/keymap.c new file mode 100644 index 0000000000..9cd21c3c1f --- /dev/null +++ b/keyboards/bastardkb/dilemma/keymaps/drashna/keymap.c @@ -0,0 +1,160 @@ +/** + * Copyright 2022 Charly Delay (@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 . + */ + +#include "drashna.h" + +// clang-format off +#define LAYOUT_split_3x5_2_wrapper(...) LAYOUT_split_3x5_2(__VA_ARGS__) +#define LAYOUT_split_3x5_2_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_split_3x5_2 ( \ + K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, \ + ALT_T(K11), K12, K13, K14, GUI_T(K15), LGUI_T(K16), K17, K18, K19, LALT_T(K1A), \ + CTL_T(K21), K22, K23, K24, K25, K26, K27, K28, K29, RCTL_T(K2A), \ + KC_SPC, BK_LWER, DL_RAIS, RSFT_T(KC_ENT) \ + ) + +#define LAYOUT_split_3x5_2_base_wrapper(...) LAYOUT_split_3x5_2_base(__VA_ARGS__) + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + + [_DEFAULT_LAYER_1] = LAYOUT_split_3x5_2_base_wrapper( + _________________QWERTY_L1_________________, _________________QWERTY_R1_________________, + _________________QWERTY_L2_________________, _________________QWERTY_R2_________________, + _________________QWERTY_L3_________________, _________________QWERTY_R3_________________ + ), + + [_DEFAULT_LAYER_2] = LAYOUT_split_3x5_2_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_split_3x5_2_base_wrapper( + _________________COLEMAK_L1________________, _________________COLEMAK_R1________________, + _________________COLEMAK_L2________________, _________________COLEMAK_R2________________, + _________________COLEMAK_L3________________, _________________COLEMAK_R3________________ + ), + + [_DEFAULT_LAYER_4] = LAYOUT_split_3x5_2_base_wrapper( + _________________DVORAK_L1_________________, _________________DVORAK_R1_________________, + _________________DVORAK_L2_________________, _________________DVORAK_R2_________________, + _________________DVORAK_L3_________________, _________________DVORAK_R3_________________ + ), + + [_MOUSE] = LAYOUT_split_3x5_2( + _______, _______, _______, _______, _______, KC_WH_U, DPI_RMOD,DPI_MOD, S_D_RMOD,S_D_MOD, + _______, _______, _______, _______, _______, KC_WH_D, KC_BTN1, KC_BTN3, KC_BTN2, KC_BTN6, + _______, _______, _______, _______, _______, KC_BTN7, KC_BTN4, KC_BTN5, KC_BTN8, _______, + SNIPING, _______, _______, _______ + ), + [_LOWER] = LAYOUT_split_3x5_2_wrapper( + _________________LOWER_L1__________________, _________________LOWER_R1__________________, + _________________LOWER_L2__________________, _________________LOWER_R2__________________, + _________________LOWER_L3__________________, _________________LOWER_R3__________________, + _______, _______, _______, AUTO_CTN + ), + [_RAISE] = LAYOUT_split_3x5_2_wrapper( + _________________RAISE_L1__________________, _________________RAISE_R1__________________, + _________________RAISE_L2__________________, _________________RAISE_R2__________________, + _________________RAISE_L3__________________, _________________RAISE_R3__________________, + _______, _______, _______, _______ + ), + [_ADJUST] = LAYOUT_split_3x5_2_wrapper( + _________________ADJUST_L1_________________, _________________ADJUST_R1_________________, + _________________ADJUST_L2_________________, _________________ADJUST_R2_________________, + _________________ADJUST_L3_________________, _________________ADJUST_R3_________________, + KC_NUKE, _______, _______, QK_BOOT + ), +}; + + +void matrix_output_unselect_delay(uint8_t line, bool key_pressed) { + for (int32_t i = 0; i < 40; i++) { + __asm__ volatile("nop" ::: "memory"); + } +} + + +#if defined(OLED_ENABLE) && defined(OLED_DISPLAY_128X128) +# ifdef UNICODE_COMMON_ENABLE +# include "process_unicode_common.h" +# include "keyrecords/unicode.h" +# endif + +extern const char PROGMEM display_border[3]; + + +extern uint32_t oled_timer; +extern bool is_oled_enabled; + + +bool oled_task_keymap(void) { + static const char PROGMEM header_image[] = { + 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, + // 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 + }; + oled_write_raw_P(header_image, sizeof(header_image)); + oled_set_cursor(7, 0); + oled_write_P(PSTR("Rock On"), true); + + render_default_layer_state(1, 1); + render_layer_state(1, 2); + render_kitty(0, 5); + render_wpm(1, 7, 5); +# if defined(POINTING_DEVICE_ENABLE) + render_pointing_dpi_status(dilemma_get_pointer_sniping_enabled() ? dilemma_get_pointer_sniping_dpi() : dilemma_get_pointer_default_dpi(), 1, 7, 6); + render_mouse_mode(17, 6); +# elif defined(WPM_ENABLE) && defined(DEBUG_MATRIX_SCAN_RATE) + render_matrix_scan_rate(1, 7, 6); +# endif + render_bootmagic_status(7, 7); + render_user_status(1, 9); + + render_mod_status(get_mods() | get_oneshot_mods(), 1, 10); + render_keylock_status(host_keyboard_led_state(), 1, 11); + render_unicode_mode(1, 12); + +// render_rgb_hsv(1, 13); + oled_set_cursor(1, 13); + // oled_write_P(PSTR("Timer:"), false); + // oled_write(get_u8_str((uint8_t)(timer_elapsed32(oled_timer) / 1000), ' '), false); + oled_write_P(PSTR("Status: "), false); + if (is_oled_enabled) { + oled_write_P(PSTR("on "), false); + } else { + oled_write_P(PSTR("off"), false); + } + + render_keylogger_status(1, 14); + + for (uint8_t i = 1; i < 15; i++) { + oled_set_cursor(0, i); + oled_write_raw_P(display_border, sizeof(display_border)); + oled_set_cursor(21, i); + oled_write_raw_P(display_border, sizeof(display_border)); + } + + 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}; + oled_set_cursor(0, 15); + oled_write_raw_P(footer_image, sizeof(footer_image)); + + return false; +} +#endif diff --git a/keyboards/bastardkb/dilemma/keymaps/drashna/rules.mk b/keyboards/bastardkb/dilemma/keymaps/drashna/rules.mk new file mode 100644 index 0000000000..5f4afb7259 --- /dev/null +++ b/keyboards/bastardkb/dilemma/keymaps/drashna/rules.mk @@ -0,0 +1,8 @@ +SWAP_HANDS_ENABLE = no +AUTOCORRECTION_ENABLE = yes +CAPS_WORD_ENABLE = yes +CONSOLE_ENABLE = yes +KEYLOGGER_ENABLE = no +WPM_ENABLE = yes +OLED_ENABLE = yes +OLED_DRIVER = custom diff --git a/keyboards/handwired/tractyl_manuform/5x6_right/f411/config.h b/keyboards/handwired/tractyl_manuform/5x6_right/f411/config.h index 791317b9e9..f7e9cfb7d6 100644 --- a/keyboards/handwired/tractyl_manuform/5x6_right/f411/config.h +++ b/keyboards/handwired/tractyl_manuform/5x6_right/f411/config.h @@ -75,7 +75,7 @@ along with this program. If not, see . #define I2C1_SCL_PAL_MODE 4 #define I2C1_SDA_PAL_MODE 4 #define I2C1_CLOCK_SPEED 400000 -#define I2C1_DUTY_CYCLE FAST_DUTY_CYCLE_2 +#define I2C1_DUTY_CYCLE FAST_DUTY_CYCLE_16_9 /* encoder config */ #define ENCODERS_PAD_A \ diff --git a/keyboards/handwired/tractyl_manuform/5x6_right/f411/f411.c b/keyboards/handwired/tractyl_manuform/5x6_right/f411/f411.c index 990b835843..09f1b57008 100644 --- a/keyboards/handwired/tractyl_manuform/5x6_right/f411/f411.c +++ b/keyboards/handwired/tractyl_manuform/5x6_right/f411/f411.c @@ -24,7 +24,7 @@ void matrix_scan_sub_kb(void) { } } -void bootmagic_lite(void) { +__attribute__((weak)) void bootmagic_lite(void) { // We need multiple scans because debouncing can't be turned off. matrix_scan(); #if defined(DEBOUNCE) && DEBOUNCE > 0 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 daaad5f5e3..f159a69174 100644 --- a/keyboards/handwired/tractyl_manuform/5x6_right/keymaps/drashna/config.h +++ b/keyboards/handwired/tractyl_manuform/5x6_right/keymaps/drashna/config.h @@ -28,3 +28,9 @@ #define CHARYBDIS_SNIPING_DPI_CONFIG_STEP 200 #define ENCODER_DEFAULT_POS 0x3 + + +#define BOOTMAGIC_LITE_EEPROM_ROW 1 +#define BOOTMAGIC_LITE_EEPROM_COLUMN 0 +#define BOOTMAGIC_LITE_EEPROM_ROW_RIGHT 7 +#define BOOTMAGIC_LITE_EEPROM_COLUMN_RIGHT 5 diff --git a/keyboards/ploopyco/mouse/keymaps/drashna/keymap.c b/keyboards/ploopyco/mouse/keymaps/drashna/keymap.c index ee0f653dee..056a1f7903 100644 --- a/keyboards/ploopyco/mouse/keymaps/drashna/keymap.c +++ b/keyboards/ploopyco/mouse/keymaps/drashna/keymap.c @@ -19,20 +19,23 @@ // safe range starts at `PLOOPY_SAFE_RANGE` instead. +// clang-format off const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - [0] = LAYOUT(/* Base */ + [0] = LAYOUT( C(KC_C), KC_BTN1, KC_BTN3, KC_BTN2, MO(1), KC_BTN4, KC_BTN5, DPI_CONFIG), - [1] = LAYOUT(/* Base */ + [1] = LAYOUT( RGB_HUI, RGB_MOD, RGB_TOG, RGB_RMOD, MO(1), KC_VOLU, KC_VOLD, QK_BOOT) - }; +// clang-format on +#ifdef RGBLIGHT_ENABLE void eeconkfig_init_user(void) { rgblight_enable(); -#ifdef RGBLIGHT_EFFECT_TWINKLE - rgblight_mode(RGBLIGHT_MODE_TWINKLE+5); -#else - rgblight_mode(RGBLIGHT_MODE_BREATHING+5); -#endif +# ifdef RGBLIGHT_EFFECT_TWINKLE + rgblight_mode(RGBLIGHT_MODE_TWINKLE + 5); +# else + rgblight_mode(RGBLIGHT_MODE_BREATHING + 5); +# endif rgblight_sethsv(HSV_MAGENTA); } +#endif diff --git a/keyboards/ploopyco/mouse/keymaps/drashna/rules.mk b/keyboards/ploopyco/mouse/keymaps/drashna/rules.mk index 655dbfdfa0..bd3927a4b1 100644 --- a/keyboards/ploopyco/mouse/keymaps/drashna/rules.mk +++ b/keyboards/ploopyco/mouse/keymaps/drashna/rules.mk @@ -1,5 +1,6 @@ USER_NAME := not_drashna +BOOTLOADER = qmk-hid RGBLIGHT_ENABLE = yes CONSOLE_ENABLE = no -LTO_ENABLE = yes +LTO_ENABLE = yes diff --git a/keyboards/splitkb/kyria/keymaps/drashna/config.h b/keyboards/splitkb/kyria/keymaps/drashna/config.h index 1de3615d98..ffd17ebd8f 100644 --- a/keyboards/splitkb/kyria/keymaps/drashna/config.h +++ b/keyboards/splitkb/kyria/keymaps/drashna/config.h @@ -46,4 +46,9 @@ #define BOOTMAGIC_LITE_ROW_RIGHT 4 #define BOOTMAGIC_LITE_COLUMN_RIGHT 7 +#define BOOTMAGIC_LITE_EEPROM_ROW 1 +#define BOOTMAGIC_LITE_EEPROM_COLUMN 7 +#define BOOTMAGIC_LITE_EEPROM_ROW_RIGHT 5 +#define BOOTMAGIC_LITE_EEPROM_COLUMN_RIGHT 7 + #define SERIAL_USART_SPEED 921600 diff --git a/users/drashna/autocorrect_data.h b/users/drashna/autocorrect_data.h index bcb5858aa8..52ed7fa9a7 100644 --- a/users/drashna/autocorrect_data.h +++ b/users/drashna/autocorrect_data.h @@ -1,5 +1,93 @@ #if __has_include("../qmk_secrets/autocorrection_data.h") +# pragma message "Loading custom library" # include "../qmk_secrets/autocorrection_data.h" +# define AUTOCORRECTION_MIN_LENGTH AUTOCORRECT_MIN_LENGTH +# define AUTOCORRECTION_MAX_LENGTH AUTOCORRECT_MAX_LENGTH + #else -# include "autocorrect_data_default.h" +// Generated code. + +// Autocorrection dictionary (70 entries): +// :guage -> gauge +// :the:the: -> the +// :thier -> their +// :ture -> true +// accomodate -> accommodate +// acommodate -> accommodate +// aparent -> apparent +// aparrent -> apparent +// apparant -> apparent +// apparrent -> apparent +// aquire -> acquire +// becuase -> because +// cauhgt -> caught +// cheif -> chief +// choosen -> chosen +// cieling -> ceiling +// collegue -> colleague +// concensus -> consensus +// contians -> contains +// cosnt -> const +// dervied -> derived +// fales -> false +// fasle -> false +// fitler -> filter +// flase -> false +// foward -> forward +// frequecy -> frequency +// gaurantee -> guarantee +// guaratee -> guarantee +// heigth -> height +// heirarchy -> hierarchy +// inclued -> include +// interator -> iterator +// intput -> input +// invliad -> invalid +// lenght -> length +// liasion -> liaison +// libary -> library +// listner -> listener +// looses: -> loses +// looup -> lookup +// manefist -> manifest +// namesapce -> namespace +// namespcae -> namespace +// occassion -> occasion +// occured -> occurred +// ouptut -> output +// ouput -> output +// overide -> override +// postion -> position +// priviledge -> privilege +// psuedo -> pseudo +// recieve -> receive +// refered -> referred +// relevent -> relevant +// repitition -> repetition +// retrun -> return +// retun -> return +// reuslt -> result +// reutrn -> return +// saftey -> safety +// seperate -> separate +// singed -> signed +// stirng -> string +// strign -> string +// swithc -> switch +// swtich -> switch +// thresold -> threshold +// udpate -> update +// widht -> width + +#define AUTOCORRECT_MIN_LENGTH 5 // ":ture" +#define AUTOCORRECT_MAX_LENGTH 10 // "accomodate" + +#define DICTIONARY_SIZE 1104 + +static const uint8_t autocorrect_data[DICTIONARY_SIZE] PROGMEM = {108, 43, 0, 6, 71, 0, 7, 81, 0, 8, 199, 0, 9, 240, 1, 10, 250, 1, 11, 26, 2, 17, 53, 2, 18, 190, 2, 19, 202, 2, 21, 212, 2, 22, 20, 3, 23, 67, 3, 28, 16, 4, 0, 72, 50, 0, 22, 60, 0, 0, 11, 23, 44, 8, 11, 23, 44, 0, 132, 0, 8, 22, 18, 18, 15, 0, 132, 115, 101, 115, 0, 11, 23, 12, 26, 22, 0, 129, 99, 104, 0, 68, 94, 0, 8, 106, 0, 15, 174, 0, 21, 187, 0, 0, 12, 15, 25, 17, 12, 0, 131, 97, 108, 105, 100, 0, 74, 119, 0, 12, 129, 0, 21, 140, 0, 24, 165, 0, 0, 17, 12, 22, 0, 131, 103, 110, 101, 100, 0, 25, 21, 8, 7, 0, 131, 105, 118, 101, 100, 0, 72, 147, 0, 24, 156, 0, 0, 9, 8, 21, 0, 129, 114, 101, 100, 0, 6, 6, 18, 0, 129, 114, 101, 100, 0, 15, 6, 17, 12, 0, 129, 100, 101, 0, 18, 22, 8, 21, 11, 23, 0, 130, 104, 111, + 108, 100, 0, 4, 26, 18, 9, 0, 131, 114, 119, 97, 114, 100, 0, 68, 233, 0, 6, 246, 0, 7, 4, 1, 8, 16, 1, 10, 52, 1, 15, 81, 1, 21, 90, 1, 22, 117, 1, 23, 144, 1, 24, 215, 1, 25, 228, 1, 0, 6, 19, 22, 8, 16, 4, 17, 0, 130, 97, 99, 101, 0, 19, 4, 22, 8, 16, 4, 17, 0, 131, 112, 97, 99, 101, 0, 12, 21, 8, 25, 18, 0, 130, 114, 105, 100, 101, 0, 23, 0, 68, 25, 1, 17, 36, 1, 0, 21, 4, 24, 10, 0, 130, 110, 116, 101, 101, 0, 4, 21, 24, 4, 10, 0, 135, 117, 97, 114, 97, 110, 116, 101, 101, 0, 68, 59, 1, 7, 69, 1, 0, 24, 10, 44, 0, 131, 97, 117, 103, 101, 0, 8, 15, 12, 25, 12, 21, 19, 0, 130, 103, 101, 0, 22, 4, 9, 0, 130, 108, 115, 101, 0, 76, 97, 1, 24, 109, 1, 0, 24, 20, 4, 0, 132, 99, 113, 117, 105, 114, 101, 0, 23, 44, 0, + 130, 114, 117, 101, 0, 4, 0, 79, 126, 1, 24, 134, 1, 0, 9, 0, 131, 97, 108, 115, 101, 0, 6, 8, 5, 0, 131, 97, 117, 115, 101, 0, 4, 0, 71, 156, 1, 19, 193, 1, 21, 203, 1, 0, 18, 16, 0, 80, 166, 1, 18, 181, 1, 0, 18, 6, 4, 0, 135, 99, 111, 109, 109, 111, 100, 97, 116, 101, 0, 6, 6, 4, 0, 132, 109, 111, 100, 97, 116, 101, 0, 7, 24, 0, 132, 112, 100, 97, 116, 101, 0, 8, 19, 8, 22, 0, 132, 97, 114, 97, 116, 101, 0, 10, 8, 15, 15, 18, 6, 0, 130, 97, 103, 117, 101, 0, 8, 12, 6, 8, 21, 0, 131, 101, 105, 118, 101, 0, 12, 8, 11, 6, 0, 130, 105, 101, 102, 0, 17, 0, 76, 3, 2, 21, 16, 2, 0, 15, 8, 12, 6, 0, 133, 101, 105, 108, 105, 110, 103, 0, 12, 23, 22, 0, 131, 114, 105, 110, 103, 0, 70, 33, 2, 23, 44, 2, 0, 12, 23, 26, 22, 0, 131, 105, + 116, 99, 104, 0, 10, 12, 8, 11, 0, 129, 104, 116, 0, 72, 69, 2, 10, 80, 2, 18, 89, 2, 21, 156, 2, 24, 167, 2, 0, 22, 18, 18, 11, 6, 0, 131, 115, 101, 110, 0, 12, 21, 23, 22, 0, 129, 110, 103, 0, 12, 0, 86, 98, 2, 23, 124, 2, 0, 68, 105, 2, 22, 114, 2, 0, 12, 15, 0, 131, 105, 115, 111, 110, 0, 4, 6, 6, 18, 0, 131, 105, 111, 110, 0, 76, 131, 2, 22, 146, 2, 0, 23, 12, 19, 8, 21, 0, 134, 101, 116, 105, 116, 105, 111, 110, 0, 18, 19, 0, 131, 105, 116, 105, 111, 110, 0, 23, 24, 8, 21, 0, 131, 116, 117, 114, 110, 0, 85, 174, 2, 23, 183, 2, 0, 23, 8, 21, 0, 130, 117, 114, 110, 0, 8, 21, 0, 128, 114, 110, 0, 7, 8, 24, 22, 19, 0, 131, 101, 117, 100, 111, 0, 24, 18, 18, 15, 0, 129, 107, 117, 112, 0, 72, 219, 2, 18, 3, 3, 0, 76, 229, 2, 15, 238, + 2, 17, 248, 2, 0, 11, 23, 44, 0, 130, 101, 105, 114, 0, 23, 12, 9, 0, 131, 108, 116, 101, 114, 0, 23, 22, 12, 15, 0, 130, 101, 110, 101, 114, 0, 23, 4, 21, 8, 23, 17, 12, 0, 135, 116, 101, 114, 97, 116, 111, 114, 0, 72, 30, 3, 17, 38, 3, 24, 51, 3, 0, 15, 4, 9, 0, 129, 115, 101, 0, 4, 12, 23, 17, 18, 6, 0, 131, 97, 105, 110, 115, 0, 22, 17, 8, 6, 17, 18, 6, 0, 133, 115, 101, 110, 115, 117, 115, 0, 74, 86, 3, 11, 96, 3, 15, 118, 3, 17, 129, 3, 22, 218, 3, 24, 232, 3, 0, 11, 24, 4, 6, 0, 130, 103, 104, 116, 0, 71, 103, 3, 10, 110, 3, 0, 12, 26, 0, 129, 116, 104, 0, 17, 8, 15, 0, 129, 116, 104, 0, 22, 24, 8, 21, 0, 131, 115, 117, 108, 116, 0, 68, 139, 3, 8, 150, 3, 22, 210, 3, 0, 21, 4, 19, 19, 4, 0, 130, 101, 110, 116, 0, 85, 157, + 3, 25, 200, 3, 0, 68, 164, 3, 21, 175, 3, 0, 19, 4, 0, 132, 112, 97, 114, 101, 110, 116, 0, 4, 19, 0, 68, 185, 3, 19, 193, 3, 0, 133, 112, 97, 114, 101, 110, 116, 0, 4, 0, 131, 101, 110, 116, 0, 8, 15, 8, 21, 0, 130, 97, 110, 116, 0, 18, 6, 0, 130, 110, 115, 116, 0, 12, 9, 8, 17, 4, 16, 0, 132, 105, 102, 101, 115, 116, 0, 83, 239, 3, 23, 6, 4, 0, 87, 246, 3, 24, 254, 3, 0, 17, 12, 0, 131, 112, 117, 116, 0, 18, 0, 130, 116, 112, 117, 116, 0, 19, 24, 18, 0, 131, 116, 112, 117, 116, 0, 70, 29, 4, 8, 41, 4, 11, 51, 4, 21, 69, 4, 0, 8, 24, 20, 8, 21, 9, 0, 129, 110, 99, 121, 0, 23, 9, 4, 22, 0, 130, 101, 116, 121, 0, 6, 21, 4, 21, 12, 8, 11, 0, 135, 105, 101, 114, 97, 114, 99, 104, 121, 0, 4, 5, 12, 15, 0, 130, 114, 97, 114, 121, 0}; #endif diff --git a/users/drashna/callbacks.c b/users/drashna/callbacks.c index f9a3f598d3..111b5f79d7 100644 --- a/users/drashna/callbacks.c +++ b/users/drashna/callbacks.c @@ -3,6 +3,12 @@ #include "drashna.h" + +#ifdef I2C_SCANNER_ENABLE +void matrix_scan_i2c(void); +void keyboard_post_init_i2c(void); +#endif + __attribute__((weak)) void keyboard_pre_init_keymap(void) {} void keyboard_pre_init_user(void) { userspace_config.raw = eeconfig_read_user(); @@ -42,6 +48,10 @@ void keyboard_post_init_user(void) { #if defined(SPLIT_KEYBOARD) && defined(SPLIT_TRANSACTION_IDS_USER) keyboard_post_init_transport_sync(); #endif +#ifdef I2C_SCANNER_ENABLE + matrix_scan_i2c(); +#endif + keyboard_post_init_keymap(); } @@ -54,10 +64,10 @@ void shutdown_user(void) { #ifdef RGBLIGHT_ENABLE rgblight_enable_noeeprom(); rgblight_mode_noeeprom(1); - rgblight_setrgb_red(); + rgblight_setrgb(rgblight_get_val(), 0x00, 0x00); #endif // RGBLIGHT_ENABLE #ifdef RGB_MATRIX_ENABLE - rgb_matrix_set_color_all(0xFF, 0x00, 0x00); + rgb_matrix_set_color_all(rgb_matrix_get_val(), 0x00, 0x00); rgb_matrix_update_pwm_buffers(); #endif // RGB_MATRIX_ENABLE #ifdef OLED_ENABLE @@ -112,6 +122,12 @@ void matrix_scan_user(void) { #endif #if defined(CUSTOM_RGB_MATRIX) matrix_scan_rgb_matrix(); +#endif +#ifdef I2C_SCANNER_ENABLE + matrix_scan_i2c(); +#endif +#ifdef CUSTOM_OLED_DRIVER + matrix_scan_oled(); #endif matrix_scan_secret(); diff --git a/users/drashna/config.h b/users/drashna/config.h index fd1530a100..57b26786b3 100644 --- a/users/drashna/config.h +++ b/users/drashna/config.h @@ -11,26 +11,20 @@ #endif #define IS_COMMAND() (((get_mods() | get_oneshot_mods()) & MOD_MASK_SHIFT) == MOD_MASK_SHIFT) -/* Set Polling rate to 1000Hz */ -#define USB_POLLING_INTERVAL_MS 1 #if defined(SPLIT_KEYBOARD) -// # define SPLIT_TRANSPORT_MIRROR -# define SPLIT_LAYER_STATE_ENABLE -# define SPLIT_LED_STATE_ENABLE -# define SPLIT_MODS_ENABLE -# ifdef WPM_ENABLE -# define SPLIT_WPM_ENABLE -# endif -# ifdef OLED_ENABLE -# define SPLIT_OLED_ENABLE -# endif -# if defined(__AVR__) && !defined(SELECT_SOFT_SERIAL_SPEED) -# define SELECT_SOFT_SERIAL_SPEED 1 -# endif -# ifdef CUSTOM_SPLIT_TRANSPORT_SYNC -# define SPLIT_TRANSACTION_IDS_USER RPC_ID_USER_STATE_SYNC, RPC_ID_USER_KEYMAP_SYNC, RPC_ID_USER_CONFIG_SYNC, RPC_ID_USER_WATCHDOG_SYNC, RPC_ID_USER_KEYLOG_STR -# endif +# include "split/split_config.h" +#endif +#ifdef RGBLIGHT_ENABLE +# include "rgb/rgblight_config.h" +#endif // RGBLIGHT_ENABLE + +#ifdef RGB_MATRIX_ENABLE +# include "rgb/rgb_matrix_config.h" +#endif // RGB_MATRIX_ENABLE + +#ifdef OLED_ENABLE +# include "oled/oled_config.h" #endif #if defined(WPM_ENABLE) @@ -71,157 +65,6 @@ #define UNICODE_SELECTED_MODES UC_WINC, UC_MAC -#ifdef RGBLIGHT_ENABLE -# define RGBLIGHT_SLEEP -# define RGBLIGHT_EFFECT_TWINKLE_LIFE 250 -# define RGBLIGHT_EFFECT_TWINKLE_PROBABILITY 1 / 24 -#endif // RGBLIGHT_ENABLE - -#ifdef RGB_MATRIX_ENABLE -# define RGB_MATRIX_KEYPRESSES // reacts to keypresses (will slow down matrix scan by a lot) -// # define RGB_MATRIX_KEYRELEASES // reacts to keyreleases (not recommened) -# define RGB_MATRIX_FRAMEBUFFER_EFFECTS -// # define RGB_DISABLE_AFTER_TIMEOUT 0 // number of ticks to wait until disabling effects -// # define RGB_DISABLE_WHEN_USB_SUSPENDED // turn off effects when suspended - -# undef ENABLE_RGB_MATRIX_ALPHAS_MODS -# undef ENABLE_RGB_MATRIX_GRADIENT_UP_DOWN -# undef ENABLE_RGB_MATRIX_GRADIENT_LEFT_RIGHT -# undef ENABLE_RGB_MATRIX_BREATHING -# undef ENABLE_RGB_MATRIX_BAND_SAT -# undef ENABLE_RGB_MATRIX_BAND_VAL -# undef ENABLE_RGB_MATRIX_BAND_PINWHEEL_SAT -# undef ENABLE_RGB_MATRIX_BAND_PINWHEEL_VAL -# undef ENABLE_RGB_MATRIX_BAND_SPIRAL_SAT -# undef ENABLE_RGB_MATRIX_BAND_SPIRAL_VAL -# undef ENABLE_RGB_MATRIX_CYCLE_ALL -# undef ENABLE_RGB_MATRIX_CYCLE_LEFT_RIGHT -# undef ENABLE_RGB_MATRIX_CYCLE_UP_DOWN -# undef ENABLE_RGB_MATRIX_RAINBOW_MOVING_CHEVRON -# undef ENABLE_RGB_MATRIX_CYCLE_OUT_IN -# undef ENABLE_RGB_MATRIX_CYCLE_OUT_IN_DUAL -# undef ENABLE_RGB_MATRIX_CYCLE_PINWHEEL -# undef ENABLE_RGB_MATRIX_CYCLE_SPIRAL -# undef ENABLE_RGB_MATRIX_DUAL_BEACON -# undef ENABLE_RGB_MATRIX_RAINBOW_BEACON -# undef ENABLE_RGB_MATRIX_RAINBOW_PINWHEELS -# undef ENABLE_RGB_MATRIX_RAINDROPS -# undef ENABLE_RGB_MATRIX_JELLYBEAN_RAINDROPS -# undef ENABLE_RGB_MATRIX_HUE_BREATHING -# undef ENABLE_RGB_MATRIX_HUE_PENDULUM -# undef ENABLE_RGB_MATRIX_HUE_WAVE -# undef ENABLE_RGB_MATRIX_PIXEL_RAIN -# undef ENABLE_RGB_MATRIX_PIXEL_FLOW -# undef ENABLE_RGB_MATRIX_PIXEL_FRACTAL -// enabled only if RGB_MATRIX_FRAMEBUFFER_EFFECTS is defined -# undef ENABLE_RGB_MATRIX_TYPING_HEATMAP -# undef ENABLE_RGB_MATRIX_DIGITAL_RAIN -// enabled only of RGB_MATRIX_KEYPRESSES or RGB_MATRIX_KEYRELEASES is defined -# undef ENABLE_RGB_MATRIX_SOLID_REACTIVE_SIMPLE -# undef ENABLE_RGB_MATRIX_SOLID_REACTIVE -# undef ENABLE_RGB_MATRIX_SOLID_REACTIVE_WIDE -# undef ENABLE_RGB_MATRIX_SOLID_REACTIVE_MULTIWIDE -# undef ENABLE_RGB_MATRIX_SOLID_REACTIVE_CROSS -# undef ENABLE_RGB_MATRIX_SOLID_REACTIVE_MULTICROSS -# undef ENABLE_RGB_MATRIX_SOLID_REACTIVE_NEXUS -# undef ENABLE_RGB_MATRIX_SOLID_REACTIVE_MULTINEXUS -# undef ENABLE_RGB_MATRIX_SPLASH -# undef ENABLE_RGB_MATRIX_MULTISPLASH -# undef ENABLE_RGB_MATRIX_SOLID_SPLASH -# undef ENABLE_RGB_MATRIX_SOLID_MULTISPLASH - -# define ENABLE_RGB_MATRIX_TYPING_HEATMAP -# define ENABLE_RGB_MATRIX_CYCLE_OUT_IN_DUAL -# if !defined(SPLIT_KEYBOARD) && !defined(KEYBOARD_ergodox_ez) && !defined(KEYBOARD_moonlander) -# define ENABLE_RGB_MATRIX_CYCLE_OUT_IN -# endif -# if defined(__arm__) || defined(__AVR_AT90USB1286__) || defined(KEYBOARD_launchpad) -// RGB Matrix Animation modes. Explicitly enabled -// For full list of effects, see: -// https://docs.qmk.fm/#/feature_rgb_matrix?id=rgb-matrix-effects -# define ENABLE_RGB_MATRIX_GRADIENT_UP_DOWN -# define ENABLE_RGB_MATRIX_GRADIENT_LEFT_RIGHT -# define ENABLE_RGB_MATRIX_BREATHING -# define ENABLE_RGB_MATRIX_BAND_SAT -# define ENABLE_RGB_MATRIX_BAND_VAL -# define ENABLE_RGB_MATRIX_BAND_PINWHEEL_SAT -# define ENABLE_RGB_MATRIX_BAND_PINWHEEL_VAL -# define ENABLE_RGB_MATRIX_BAND_SPIRAL_SAT -# define ENABLE_RGB_MATRIX_BAND_SPIRAL_VAL -# define ENABLE_RGB_MATRIX_CYCLE_ALL -# define ENABLE_RGB_MATRIX_CYCLE_LEFT_RIGHT -# define ENABLE_RGB_MATRIX_CYCLE_UP_DOWN -# define ENABLE_RGB_MATRIX_RAINBOW_MOVING_CHEVRON -# define ENABLE_RGB_MATRIX_CYCLE_OUT_IN -# define ENABLE_RGB_MATRIX_CYCLE_PINWHEEL -# define ENABLE_RGB_MATRIX_CYCLE_SPIRAL -# define ENABLE_RGB_MATRIX_DUAL_BEACON -# define ENABLE_RGB_MATRIX_RAINBOW_BEACON -# define ENABLE_RGB_MATRIX_RAINBOW_PINWHEELS -# define ENABLE_RGB_MATRIX_RAINDROPS -# define ENABLE_RGB_MATRIX_JELLYBEAN_RAINDROPS -# define ENABLE_RGB_MATRIX_HUE_BREATHING -# define ENABLE_RGB_MATRIX_HUE_PENDULUM -# define ENABLE_RGB_MATRIX_HUE_WAVE -# define ENABLE_RGB_MATRIX_PIXEL_RAIN -# define ENABLE_RGB_MATRIX_PIXEL_FLOW -# define ENABLE_RGB_MATRIX_PIXEL_FRACTAL -# define ENABLE_RGB_MATRIX_DIGITAL_RAIN -# define ENABLE_RGB_MATRIX_SOLID_REACTIVE_SIMPLE -# define ENABLE_RGB_MATRIX_SOLID_REACTIVE -# define ENABLE_RGB_MATRIX_SOLID_REACTIVE_WIDE -# define ENABLE_RGB_MATRIX_SOLID_REACTIVE_MULTIWIDE -# define ENABLE_RGB_MATRIX_SOLID_REACTIVE_CROSS -# define ENABLE_RGB_MATRIX_SOLID_REACTIVE_MULTICROSS -# define ENABLE_RGB_MATRIX_SOLID_REACTIVE_NEXUS -# define ENABLE_RGB_MATRIX_SOLID_REACTIVE_MULTINEXUS -# define ENABLE_RGB_MATRIX_SPLASH -# define ENABLE_RGB_MATRIX_MULTISPLASH -# define ENABLE_RGB_MATRIX_SOLID_SPLASH -# define ENABLE_RGB_MATRIX_SOLID_MULTISPLASH -# endif // AVR -#endif // RGB_MATRIX_ENABLE - -#ifdef OLED_ENABLE -# ifndef OLED_UPDATE_INTERVAL -# ifdef OLED_DRIVER_SH1107 -# define OLED_UPDATE_INTERVAL 75 -# else -# ifdef SPLIT_KEYBOARD -# define OLED_UPDATE_INTERVAL 60 -# else -# define OLED_UPDATE_INTERVAL 15 -# endif -# endif -# endif -# define OLED_DISABLE_TIMEOUT -# ifdef OLED_FONT_H -# undef OLED_FONT_H -# endif -# define OLED_FONT_H "oled/drashna_font.h" -# define OLED_FONT_END 255 -// # define OLED_FONT_5X5 -// # define OLED_FONT_AZTECH -// # define OLED_FONT_BMPLAIN -// # define OLED_FONT_CRACKERS -# define OLED_FONT_DEAD_MEAL -// # define OLED_FONT_EIN -// # define OLED_FONT_HISKYF21 -// # define OLED_FONT_SQUASH -// # define OLED_FONT_ZXPIX -// # define OLED_FONT_SUPER_DIGG - -// # define OLED_LOGO_BEBOP -// # define OLED_LOGO_CORNE -// # define OLED_LOGO_GMK_BAD -// # define OLED_LOGO_GOTHAM -// # define OLED_LOGO_HUE_MANITEE -// # define OLED_LOGO_LOOSE -# define OLED_LOGO_SCIFI -// # define OLED_LOGO_SETS3N -// # define OLED_LOGO_SKEEB -#endif - // #define WPM_ESTIMATED_WORD_SIZE 5 #define WPM_ALLOW_COUNT_REGRESSION // #define WPM_UNFILTERED @@ -237,11 +80,18 @@ # define ONESHOT_TIMEOUT 3000 #endif // !ONESHOT_TIMEOUT -#define IGNORE_MOD_TAP_INTERRUPT_PER_KEY -#define PERMISSIVE_HOLD_PER_KEY -#define TAPPING_FORCE_HOLD_PER_KEY -#define RETRO_TAPPING_PER_KEY -#define TAPPING_TERM_PER_KEY +#if defined(PER_KEY_TAPPING) +# define IGNORE_MOD_TAP_INTERRUPT_PER_KEY +# define PERMISSIVE_HOLD_PER_KEY +# define TAPPING_FORCE_HOLD_PER_KEY +# define HOLD_ON_OTHER_KEY +# define RETRO_TAPPING_PER_KEY +# define HOLD_ON_OTHER_KEY_PRESS_PER_KEY +# define TAPPING_TERM_PER_KEY +#else +# define IGNORE_MOD_TAP_INTERRUPT +# undef PERMISSIVE_HOLD +#endif #ifndef TAPPING_TOGGLE # define TAPPING_TOGGLE 1 @@ -276,41 +126,7 @@ # define C15 PAL_LINE(GPIOC, 15) #endif -#ifdef OLED_DRIVER_SH1107 -# define OLED_DISPLAY_CUSTOM -# define OLED_IC_SH1107 2 -# define OLED_DISPLAY_128X128 -# define OLED_DISPLAY_WIDTH 128 -# define OLED_DISPLAY_HEIGHT 128 -# define OLED_MATRIX_SIZE (OLED_DISPLAY_HEIGHT / 8 * OLED_DISPLAY_WIDTH) -# define OLED_BLOCK_TYPE uint32_t -# define OLED_SOURCE_MAP \ - { 0, 8, 16, 24, 32, 40, 48, 56 } -# define OLED_TARGET_MAP \ - { 56, 48, 40, 32, 24, 16, 8, 0 } -# define OLED_BLOCK_COUNT (sizeof(OLED_BLOCK_TYPE) * 8) -# define OLED_BLOCK_SIZE (OLED_MATRIX_SIZE / OLED_BLOCK_COUNT) -# define OLED_COM_PINS COM_PINS_ALT -# define OLED_IC OLED_IC_SH1107 -# ifndef OLED_BRIGHTNESS -# define OLED_BRIGHTNESS 50 -# endif -#endif - -#ifdef USE_I2CV1 -# define I2C1_CLOCK_SPEED 400000 -# define I2C1_DUTY_CYCLE FAST_DUTY_CYCLE_2 -#endif #define ENABLE_COMPILE_KEYCODE #define BOTH_SHIFTS_TURNS_ON_CAPS_WORD - -#ifndef SECURE_UNLOCK_SEQUENCE -# define SECURE_UNLOCK_SEQUENCE \ - { \ - {2, 1}, {2, 2}, {2, 3}, { \ - 2, 4 \ - } \ - } -#endif diff --git a/users/drashna/drashna.c b/users/drashna/drashna.c index 6e8d4ac9bd..85f47c8cb4 100644 --- a/users/drashna/drashna.c +++ b/users/drashna/drashna.c @@ -76,49 +76,110 @@ void tap_code16_nomods(uint16_t kc) { set_mods(temp_mod); } -/** - * @brief Run shutdown routine and soft reboot firmware. - * - */ - -#ifdef HAPTIC_ENABLE -# include "haptic.h" -#endif +#ifdef I2C_SCANNER_ENABLE +# include "i2c_master.h" +# include "debug.h" -#ifdef AUDIO_ENABLE -# ifndef GOODBYE_SONG -# define GOODBYE_SONG SONG(GOODBYE_SOUND) +# ifndef I2C_SCANNER_TIMEOUT +# define I2C_SCANNER_TIMEOUT 50 # endif -float reset_song[][2] = GOODBYE_SONG; -#endif -void software_reset(void) { - clear_keyboard(); -#if defined(MIDI_ENABLE) && defined(MIDI_BASIC) - process_midi_all_notes_off(); +i2c_status_t i2c_start_bodge(uint8_t address, uint16_t timeout) { + i2c_start(address); + + // except on ChibiOS where the only way is do do "something" + uint8_t data = 0; + return i2c_readReg(address, 0, &data, sizeof(data), I2C_SCANNER_TIMEOUT); +} + +# define i2c_start i2c_start_bodge + +void do_scan(void) { + uint8_t nDevices = 0; + + dprintf("Scanning...\n"); + + for (uint8_t address = 1; address < 127; address++) { + // The i2c_scanner uses the return value of + // i2c_start to see if a device did acknowledge to the address. + i2c_status_t error = i2c_start(address << 1, I2C_SCANNER_TIMEOUT); + if (error == I2C_STATUS_SUCCESS) { + i2c_stop(); + xprintf(" I2C device found at address 0x%02X\n", I2C_SCANNER_TIMEOUT); + nDevices++; + } else { + // dprintf(" Unknown error (%u) at address 0x%02X\n", error, address); + } + } + + if (nDevices == 0) + xprintf("No I2C devices found\n"); + else + xprintf("done\n"); +} + +uint16_t scan_timer = 0; + +void matrix_scan_i2c(void) { + if (timer_elapsed(scan_timer) > 5000) { + do_scan(); + scan_timer = timer_read(); + } +} + +void keyboard_post_init_i2c(void) { + i2c_init(); + scan_timer = timer_read(); +} #endif -#ifdef AUDIO_ENABLE -# ifndef NO_MUSIC_MODE - music_all_notes_off(); -# endif - uint16_t timer_start = timer_read(); - PLAY_SONG(reset_song); - shutdown_user(); - while (timer_elapsed(timer_start) < 250) wait_ms(1); - stop_all_notes(); + +void bootmagic_lite(void) { + bool perform_reset = false; + // We need multiple scans because debouncing can't be turned off. + matrix_scan(); +#if defined(DEBOUNCE) && DEBOUNCE > 0 + wait_ms(DEBOUNCE * 2); #else - shutdown_user(); - wait_ms(250); + wait_ms(30); #endif -#ifdef HAPTIC_ENABLE - haptic_shutdown(); + matrix_scan(); + + // If the configured key (commonly Esc) is held down on power up, + // reset the EEPROM valid state and jump to bootloader. + // This isn't very generalized, but we need something that doesn't + // rely on user's keymaps in firmware or EEPROM. + uint8_t row = BOOTMAGIC_LITE_ROW, col = BOOTMAGIC_LITE_COLUMN; +#if defined(BOOTMAGIC_LITE_EEPROM_ROW) && defined(BOOTMAGIC_LITE_EEPROM_COLUMN) + uint8_t row_e = BOOTMAGIC_LITE_EEPROM_ROW, col_e = BOOTMAGIC_LITE_EEPROM_COLUMN; #endif -#if defined(PROTOCOL_LUFA) - wdt_enable(WDTO_250MS); -#elif defined(PROTOCOL_CHIBIOS) -# if defined(MCU_STM32) || defined(MCU_KINETIS) - NVIC_SystemReset(); +#if defined(SPLIT_KEYBOARD) && defined(BOOTMAGIC_LITE_ROW_RIGHT) && defined(BOOTMAGIC_LITE_COLUMN_RIGHT) + if (!is_keyboard_left()) { + row = BOOTMAGIC_LITE_ROW_RIGHT; + col = BOOTMAGIC_LITE_COLUMN_RIGHT; +#if defined(BOOTMAGIC_LITE_EEPROM_ROW) && defined(BOOTMAGIC_LITE_EEPROM_COLUMN) && defined(BOOTMAGIC_LITE_EEPROM_ROW_RIGHT) && defined(BOOTMAGIC_LITE_EEPROM_COLUMN_RIGHT) + row_e = BOOTMAGIC_LITE_EEPROM_ROW_RIGHT; + col_e = BOOTMAGIC_LITE_EEPROM_COLUMN_RIGHT; # endif + } #endif + +#if defined(BOOTMAGIC_LITE_EEPROM_ROW) && defined(BOOTMAGIC_LITE_EEPROM_COLUMN) + if (matrix_get_row(row_e) & (1 << col_e)) { + eeconfig_disable(); + perform_reset = true; + } +#endif + if (matrix_get_row(row) & (1 << col)) { + perform_reset = true; + } +#ifdef STM32F411xE + if (!readPin(A0)) { + perform_reset = true; + } +#endif + + if (perform_reset) { + bootloader_jump(); + } } diff --git a/users/drashna/drashna.h b/users/drashna/drashna.h index 0bf1de84cf..16d7cda638 100644 --- a/users/drashna/drashna.h +++ b/users/drashna/drashna.h @@ -79,7 +79,6 @@ bool mod_key_press_timer(uint16_t code, uint16_t mod_code, bool pressed); bool mod_key_press(uint16_t code, uint16_t mod_code, bool pressed, uint16_t this_timer); bool hasAllBitsInMask(uint8_t value, uint8_t mask); void tap_code16_nomods(uint16_t kc); -void software_reset(void); // clang-format off typedef union { diff --git a/users/drashna/keyrecords/autocorrection/autocorrection_data.h b/users/drashna/keyrecords/autocorrection/autocorrection_data.h new file mode 100644 index 0000000000..90484d3b12 --- /dev/null +++ b/users/drashna/keyrecords/autocorrection/autocorrection_data.h @@ -0,0 +1 @@ +#include "autocorrect_data.h" diff --git a/users/drashna/keyrecords/process_records.c b/users/drashna/keyrecords/process_records.c index c328451b75..197fd94171 100644 --- a/users/drashna/keyrecords/process_records.c +++ b/users/drashna/keyrecords/process_records.c @@ -6,9 +6,6 @@ #ifdef AUTOCORRECTION_ENABLE # include "autocorrection/autocorrection.h" #endif -#ifdef __AVR__ -# include -#endif uint16_t copy_paste_timer; bool host_driver_disabled = false; @@ -49,7 +46,7 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { #endif // If console is enabled, it will print the matrix position and status of each key pressed #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); + uprintf("KL: kc: 0x%04X, col: %2u, row: %2u, pressed: %1d, time: %5u, int: %1d, 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 #if defined(OLED_ENABLE) && defined(CUSTOM_OLED_DRIVER) process_record_user_oled(keycode, record); diff --git a/users/drashna/keyrecords/tapping.c b/users/drashna/keyrecords/tapping.c index daba25bd72..7496610c2f 100644 --- a/users/drashna/keyrecords/tapping.c +++ b/users/drashna/keyrecords/tapping.c @@ -3,6 +3,7 @@ #include "drashna.h" +#ifdef TAPPING_TERM_PER_KEY __attribute__((weak)) uint16_t get_tapping_term(uint16_t keycode, keyrecord_t *record) { switch (keycode) { case BK_LWER: @@ -11,7 +12,9 @@ __attribute__((weak)) uint16_t get_tapping_term(uint16_t keycode, keyrecord_t *r return TAPPING_TERM; } } +#endif // TAPPING_TERM_PER_KEY +#ifdef PERMISSIVE_HOLD_PER_KEY __attribute__((weak)) bool get_permissive_hold(uint16_t keycode, keyrecord_t *record) { // Immediately select the hold action when another key is tapped: // return true; @@ -22,7 +25,9 @@ __attribute__((weak)) bool get_permissive_hold(uint16_t keycode, keyrecord_t *re return false; } } +#endif // PERMISSIVE_HOLD_PER_KEY +#ifdef HOLD_ON_OTHER_KEY_PRESS_PER_KEY __attribute__((weak)) bool get_hold_on_other_key_press(uint16_t keycode, keyrecord_t *record) { // Immediately select the hold action when another key is pressed. // return true; @@ -32,10 +37,12 @@ __attribute__((weak)) bool get_hold_on_other_key_press(uint16_t keycode, keyreco // case QK_LAYER_TAP ... QK_LAYER_TAP_MAX: // return true; default: - return true; + return false; } } +#endif // HOLD_ON_OTHER_KEY_PRESS_PER_KEY +#ifdef IGNORE_MOD_TAP_INTERRUPT_PER_KEY __attribute__((weak)) bool get_ignore_mod_tap_interrupt(uint16_t keycode, keyrecord_t *record) { // Do not force the mod-tap key press to be handled as a modifier // if any other key was pressed while the mod-tap key is held down. @@ -48,17 +55,22 @@ __attribute__((weak)) bool get_ignore_mod_tap_interrupt(uint16_t keycode, keyrec return true; } } +#endif // IGNORE_MOD_TAP_INTERRUPT_PER_KEY +#ifdef TAPPING_FORCE_HOLD_PER_KEY __attribute__((weak)) bool get_tapping_force_hold(uint16_t keycode, keyrecord_t *record) { switch (keycode) { default: return false; } } +#endif // TAPPING_FORCE_HOLD_PER_KEY +#ifdef RETRO_TAPPING_PER_KEY __attribute__((weak)) bool get_retro_tapping(uint16_t keycode, keyrecord_t *record) { switch (keycode) { default: return false; } } +#endif // RETRO_TAPPING_PER_KEY diff --git a/users/drashna/keyrecords/unicode.c b/users/drashna/keyrecords/unicode.c index ea51b26061..b3fc71cb09 100644 --- a/users/drashna/keyrecords/unicode.c +++ b/users/drashna/keyrecords/unicode.c @@ -142,7 +142,7 @@ DEFINE_UNICODE_LUT_TRANSLATOR(unicode_lut_translator_super, 0x2071, // i 0x02B2, // j 0x1D4F, // k - 0x1D4F, // l + 0x02E1, // l 0x1D50, // m 0x207F, // n 0x1D52, // o diff --git a/users/drashna/oled/oled_config.h b/users/drashna/oled/oled_config.h new file mode 100644 index 0000000000..c46c0c39ce --- /dev/null +++ b/users/drashna/oled/oled_config.h @@ -0,0 +1,63 @@ +// Copyright 2020 Christopher Courtney, aka Drashna Jael're (@drashna) +// SPDX-License-Identifier: GPL-2.0-or-later + +#pragma once + +#ifndef OLED_UPDATE_INTERVAL +# ifdef OLED_DRIVER_SH1107 +# define OLED_UPDATE_INTERVAL 75 +# else +# ifdef SPLIT_KEYBOARD +# define OLED_UPDATE_INTERVAL 60 +# else +# define OLED_UPDATE_INTERVAL 15 +# endif +# endif +#endif +#define OLED_DISABLE_TIMEOUT +#ifdef OLED_FONT_H +# undef OLED_FONT_H +#endif +#define OLED_FONT_H "oled/drashna_font.h" +#define OLED_FONT_END 255 +// # define OLED_FONT_5X5 +// # define OLED_FONT_AZTECH +// # define OLED_FONT_BMPLAIN +// # define OLED_FONT_CRACKERS +#define OLED_FONT_DEAD_MEAL +// # define OLED_FONT_EIN +// # define OLED_FONT_HISKYF21 +// # define OLED_FONT_SQUASH +// # define OLED_FONT_ZXPIX +// # define OLED_FONT_SUPER_DIGG + +// # define OLED_LOGO_BEBOP +// # define OLED_LOGO_CORNE +// # define OLED_LOGO_GMK_BAD +// # define OLED_LOGO_GOTHAM +// # define OLED_LOGO_HUE_MANITEE +// # define OLED_LOGO_LOOSE +#define OLED_LOGO_SCIFI +// # define OLED_LOGO_SETS3N +// # define OLED_LOGO_SKEEB + +#ifdef OLED_DRIVER_SH1107 +# define OLED_DISPLAY_CUSTOM +# define OLED_IC_SH1107 2 +# define OLED_DISPLAY_128X128 +# define OLED_DISPLAY_WIDTH 128 +# define OLED_DISPLAY_HEIGHT 128 +# define OLED_MATRIX_SIZE (OLED_DISPLAY_HEIGHT / 8 * OLED_DISPLAY_WIDTH) +# define OLED_BLOCK_TYPE uint32_t +# define OLED_SOURCE_MAP \ + { 0, 8, 16, 24, 32, 40, 48, 56 } +# define OLED_TARGET_MAP \ + { 56, 48, 40, 32, 24, 16, 8, 0 } +# define OLED_BLOCK_COUNT (sizeof(OLED_BLOCK_TYPE) * 8) +# define OLED_BLOCK_SIZE (OLED_MATRIX_SIZE / OLED_BLOCK_COUNT) +# define OLED_COM_PINS COM_PINS_ALT +# define OLED_IC OLED_IC_SH1107 +# ifndef OLED_BRIGHTNESS +# define OLED_BRIGHTNESS 50 +# endif +#endif diff --git a/users/drashna/oled/oled_stuff.c b/users/drashna/oled/oled_stuff.c index 5baf5b558b..e082f8ab3e 100644 --- a/users/drashna/oled/oled_stuff.c +++ b/users/drashna/oled/oled_stuff.c @@ -28,6 +28,8 @@ #endif #include +bool is_oled_enabled = true; + extern bool host_driver_disabled; uint32_t oled_timer = 0; @@ -850,7 +852,7 @@ void render_status_right(void) { render_layer_state(1, 2); render_mod_status(get_mods() | get_oneshot_mods(), 1, 5); #if !defined(OLED_DISPLAY_VERBOSE) && defined(WPM_ENABLE) && !defined(STM32F303xC) - render_wpm(2); + render_wpm(2, 7, 1); #endif render_keylock_status(host_keyboard_led_state(), 1, 6); } @@ -929,16 +931,14 @@ __attribute__((weak)) bool oled_task_keymap(void) { } bool oled_task_user(void) { - if (is_keyboard_master()) { #ifndef OLED_DISPLAY_TEST - if (timer_elapsed32(oled_timer) > 60000) { - oled_off(); - return false; - } else + if (!is_oled_enabled) { + oled_off(); + return false; + } else #endif - { - oled_on(); - } + { + oled_on(); } if (!oled_task_keymap()) { @@ -990,3 +990,9 @@ bool oled_task_user(void) { return false; } + +extern bool oled_initialized; + +__attribute__((weak)) void matrix_scan_oled(void) { + is_oled_enabled = !(timer_elapsed32(oled_timer) > 60000); +} diff --git a/users/drashna/oled/oled_stuff.h b/users/drashna/oled/oled_stuff.h index 17bd9319d1..df1a6d1805 100644 --- a/users/drashna/oled/oled_stuff.h +++ b/users/drashna/oled/oled_stuff.h @@ -44,6 +44,8 @@ void render_wpm_graph(uint8_t max_lines_graph, uint8_t vertical_offse void render_kitty(uint8_t col, uint8_t line); void render_unicode_mode(uint8_t col, uint8_t line); void render_rgb_hsv(uint8_t col, uint8_t line); +void render_mouse_mode(uint8_t col, uint8_t line); +void matrix_scan_oled(void); void oled_pan_section(bool left, uint16_t y_start, uint16_t y_end, uint16_t x_start, uint16_t x_end); diff --git a/users/drashna/pointing/pointing.c b/users/drashna/pointing/pointing.c index 551034ff45..c9a7945a84 100644 --- a/users/drashna/pointing/pointing.c +++ b/users/drashna/pointing/pointing.c @@ -22,7 +22,7 @@ __attribute__((weak)) report_mouse_t pointing_device_task_keymap(report_mouse_t } report_mouse_t pointing_device_task_user(report_mouse_t mouse_report) { - int8_t x = mouse_report.x, y = mouse_report.y; + mouse_xy_report_t x = mouse_report.x, y = mouse_report.y; mouse_report.x = 0; mouse_report.y = 0; @@ -33,8 +33,8 @@ report_mouse_t pointing_device_task_user(report_mouse_t mouse_report) { #endif if (timer_elapsed(mouse_debounce_timer) > TAP_CHECK) { if (enable_acceleration) { - x = (x > 0 ? x * x / 16 + x : -x * x / 16 + x); - y = (y > 0 ? y * y / 16 + y : -y * y / 16 + y); + x = (mouse_xy_report_t)(x > 0 ? x * x / 16 + x : -x * x / 16 + x); + y = (mouse_xy_report_t)(y > 0 ? y * y / 16 + y : -y * y / 16 + y); } mouse_report.x = x; mouse_report.y = y; diff --git a/users/drashna/post_config.h b/users/drashna/post_config.h index 85c028076e..ec9aa49462 100644 --- a/users/drashna/post_config.h +++ b/users/drashna/post_config.h @@ -113,13 +113,17 @@ # endif #endif // MOUSEKEY_ENABLE -#if !defined(LAYER_STATE_16BIT) && !defined(LAYER_STATE_8BIT) && !defined(LAYER_STATE_32BIT) -# define LAYER_STATE_16BIT -#endif -#ifndef DYNAMIC_KEYMAP_LAYER_COUNT -# define DYNAMIC_KEYMAP_LAYER_COUNT 11 -#endif +#define MOUSE_EXTENDED_REPORT #ifndef TAPPING_TERM # define TAPPING_TERM 175 #endif + +#ifndef SECURE_UNLOCK_SEQUENCE +# define SECURE_UNLOCK_SEQUENCE \ + { \ + {2, 1}, {2, 2}, {2, 3}, { \ + 2, 4 \ + } \ + } +#endif diff --git a/users/drashna/rgb/rgb_matrix_config.h b/users/drashna/rgb/rgb_matrix_config.h new file mode 100644 index 0000000000..33979a198e --- /dev/null +++ b/users/drashna/rgb/rgb_matrix_config.h @@ -0,0 +1,107 @@ +// Copyright 2020 Christopher Courtney, aka Drashna Jael're (@drashna) +// SPDX-License-Identifier: GPL-2.0-or-later + +#pragma once + +#define RGB_MATRIX_KEYPRESSES // reacts to keypresses (will slow down matrix scan by a lot) +// # define RGB_MATRIX_KEYRELEASES // reacts to keyreleases (not recommened) +#define RGB_MATRIX_FRAMEBUFFER_EFFECTS +// # define RGB_DISABLE_AFTER_TIMEOUT 0 // number of ticks to wait until disabling effects +// # define RGB_DISABLE_WHEN_USB_SUSPENDED // turn off effects when suspended + +#undef ENABLE_RGB_MATRIX_ALPHAS_MODS +#undef ENABLE_RGB_MATRIX_GRADIENT_UP_DOWN +#undef ENABLE_RGB_MATRIX_GRADIENT_LEFT_RIGHT +#undef ENABLE_RGB_MATRIX_BREATHING +#undef ENABLE_RGB_MATRIX_BAND_SAT +#undef ENABLE_RGB_MATRIX_BAND_VAL +#undef ENABLE_RGB_MATRIX_BAND_PINWHEEL_SAT +#undef ENABLE_RGB_MATRIX_BAND_PINWHEEL_VAL +#undef ENABLE_RGB_MATRIX_BAND_SPIRAL_SAT +#undef ENABLE_RGB_MATRIX_BAND_SPIRAL_VAL +#undef ENABLE_RGB_MATRIX_CYCLE_ALL +#undef ENABLE_RGB_MATRIX_CYCLE_LEFT_RIGHT +#undef ENABLE_RGB_MATRIX_CYCLE_UP_DOWN +#undef ENABLE_RGB_MATRIX_RAINBOW_MOVING_CHEVRON +#undef ENABLE_RGB_MATRIX_CYCLE_OUT_IN +#undef ENABLE_RGB_MATRIX_CYCLE_OUT_IN_DUAL +#undef ENABLE_RGB_MATRIX_CYCLE_PINWHEEL +#undef ENABLE_RGB_MATRIX_CYCLE_SPIRAL +#undef ENABLE_RGB_MATRIX_DUAL_BEACON +#undef ENABLE_RGB_MATRIX_RAINBOW_BEACON +#undef ENABLE_RGB_MATRIX_RAINBOW_PINWHEELS +#undef ENABLE_RGB_MATRIX_RAINDROPS +#undef ENABLE_RGB_MATRIX_JELLYBEAN_RAINDROPS +#undef ENABLE_RGB_MATRIX_HUE_BREATHING +#undef ENABLE_RGB_MATRIX_HUE_PENDULUM +#undef ENABLE_RGB_MATRIX_HUE_WAVE +#undef ENABLE_RGB_MATRIX_PIXEL_RAIN +#undef ENABLE_RGB_MATRIX_PIXEL_FLOW +#undef ENABLE_RGB_MATRIX_PIXEL_FRACTAL +// enabled only if RGB_MATRIX_FRAMEBUFFER_EFFECTS is defined +#undef ENABLE_RGB_MATRIX_TYPING_HEATMAP +#undef ENABLE_RGB_MATRIX_DIGITAL_RAIN +// enabled only of RGB_MATRIX_KEYPRESSES or RGB_MATRIX_KEYRELEASES is defined +#undef ENABLE_RGB_MATRIX_SOLID_REACTIVE_SIMPLE +#undef ENABLE_RGB_MATRIX_SOLID_REACTIVE +#undef ENABLE_RGB_MATRIX_SOLID_REACTIVE_WIDE +#undef ENABLE_RGB_MATRIX_SOLID_REACTIVE_MULTIWIDE +#undef ENABLE_RGB_MATRIX_SOLID_REACTIVE_CROSS +#undef ENABLE_RGB_MATRIX_SOLID_REACTIVE_MULTICROSS +#undef ENABLE_RGB_MATRIX_SOLID_REACTIVE_NEXUS +#undef ENABLE_RGB_MATRIX_SOLID_REACTIVE_MULTINEXUS +#undef ENABLE_RGB_MATRIX_SPLASH +#undef ENABLE_RGB_MATRIX_MULTISPLASH +#undef ENABLE_RGB_MATRIX_SOLID_SPLASH +#undef ENABLE_RGB_MATRIX_SOLID_MULTISPLASH + +#define ENABLE_RGB_MATRIX_TYPING_HEATMAP +#define ENABLE_RGB_MATRIX_CYCLE_OUT_IN_DUAL +#if !defined(SPLIT_KEYBOARD) && !defined(KEYBOARD_ergodox_ez) && !defined(KEYBOARD_moonlander) +# define ENABLE_RGB_MATRIX_CYCLE_OUT_IN +#endif +#if defined(__arm__) || defined(__AVR_AT90USB1286__) || defined(KEYBOARD_launchpad) +// RGB Matrix Animation modes. Explicitly enabled +// For full list of effects, see: +// https://docs.qmk.fm/#/feature_rgb_matrix?id=rgb-matrix-effects +# define ENABLE_RGB_MATRIX_GRADIENT_UP_DOWN +# define ENABLE_RGB_MATRIX_GRADIENT_LEFT_RIGHT +# define ENABLE_RGB_MATRIX_BREATHING +# define ENABLE_RGB_MATRIX_BAND_SAT +# define ENABLE_RGB_MATRIX_BAND_VAL +# define ENABLE_RGB_MATRIX_BAND_PINWHEEL_SAT +# define ENABLE_RGB_MATRIX_BAND_PINWHEEL_VAL +# define ENABLE_RGB_MATRIX_BAND_SPIRAL_SAT +# define ENABLE_RGB_MATRIX_BAND_SPIRAL_VAL +# define ENABLE_RGB_MATRIX_CYCLE_ALL +# define ENABLE_RGB_MATRIX_CYCLE_LEFT_RIGHT +# define ENABLE_RGB_MATRIX_CYCLE_UP_DOWN +# define ENABLE_RGB_MATRIX_RAINBOW_MOVING_CHEVRON +# define ENABLE_RGB_MATRIX_CYCLE_OUT_IN +# define ENABLE_RGB_MATRIX_CYCLE_PINWHEEL +# define ENABLE_RGB_MATRIX_CYCLE_SPIRAL +# define ENABLE_RGB_MATRIX_DUAL_BEACON +# define ENABLE_RGB_MATRIX_RAINBOW_BEACON +# define ENABLE_RGB_MATRIX_RAINBOW_PINWHEELS +# define ENABLE_RGB_MATRIX_RAINDROPS +# define ENABLE_RGB_MATRIX_JELLYBEAN_RAINDROPS +# define ENABLE_RGB_MATRIX_HUE_BREATHING +# define ENABLE_RGB_MATRIX_HUE_PENDULUM +# define ENABLE_RGB_MATRIX_HUE_WAVE +# define ENABLE_RGB_MATRIX_PIXEL_RAIN +# define ENABLE_RGB_MATRIX_PIXEL_FLOW +# define ENABLE_RGB_MATRIX_PIXEL_FRACTAL +# define ENABLE_RGB_MATRIX_DIGITAL_RAIN +# define ENABLE_RGB_MATRIX_SOLID_REACTIVE_SIMPLE +# define ENABLE_RGB_MATRIX_SOLID_REACTIVE +# define ENABLE_RGB_MATRIX_SOLID_REACTIVE_WIDE +# define ENABLE_RGB_MATRIX_SOLID_REACTIVE_MULTIWIDE +# define ENABLE_RGB_MATRIX_SOLID_REACTIVE_CROSS +# define ENABLE_RGB_MATRIX_SOLID_REACTIVE_MULTICROSS +# define ENABLE_RGB_MATRIX_SOLID_REACTIVE_NEXUS +# define ENABLE_RGB_MATRIX_SOLID_REACTIVE_MULTINEXUS +# define ENABLE_RGB_MATRIX_SPLASH +# define ENABLE_RGB_MATRIX_MULTISPLASH +# define ENABLE_RGB_MATRIX_SOLID_SPLASH +# define ENABLE_RGB_MATRIX_SOLID_MULTISPLASH +#endif // AVR diff --git a/users/drashna/rgb/rgblight_config.h b/users/drashna/rgb/rgblight_config.h new file mode 100644 index 0000000000..bb2bc3b3ef --- /dev/null +++ b/users/drashna/rgb/rgblight_config.h @@ -0,0 +1,8 @@ +// Copyright 2020 Christopher Courtney, aka Drashna Jael're (@drashna) +// SPDX-License-Identifier: GPL-2.0-or-later + +#pragma once + +# define RGBLIGHT_SLEEP +# define RGBLIGHT_EFFECT_TWINKLE_LIFE 250 +# define RGBLIGHT_EFFECT_TWINKLE_PROBABILITY 1 / 24 diff --git a/users/drashna/rules.mk b/users/drashna/rules.mk index 38d34fb275..13ed761ba8 100644 --- a/users/drashna/rules.mk +++ b/users/drashna/rules.mk @@ -36,6 +36,10 @@ ifeq ($(strip $(PROTOCOL)), VUSB) NKRO_ENABLE := no endif +ifeq ($(strip $(PER_KEY_TAPPING)), yes) + OPT_DEFS += -DPER_KEY_TAPPING +endif + CUSTOM_UNICODE_ENABLE ?= yes ifeq ($(strip $(CUSTOM_UNICODE_ENABLE)), yes) UNICODE_ENABLE := no @@ -83,6 +87,11 @@ ifdef CONSOLE_ENABLE endif endif +ifeq ($(strip $(I2C_SCANNER_ENABLE)), yes) + OPT_DEFS += -DI2C_SCANNER_ENABLE + CONSOLE_ENABLE := yes +endif + CUSTOM_OLED_DRIVER ?= yes ifeq ($(strip $(OLED_ENABLE)), yes) ifeq ($(strip $(OLED_DRIVER)), custom) diff --git a/users/drashna/split/split_config.h b/users/drashna/split/split_config.h new file mode 100644 index 0000000000..66c12392d9 --- /dev/null +++ b/users/drashna/split/split_config.h @@ -0,0 +1,21 @@ +// Copyright 2020 Christopher Courtney, aka Drashna Jael're (@drashna) +// SPDX-License-Identifier: GPL-2.0-or-later + +#pragma once + +// # define SPLIT_TRANSPORT_MIRROR +#define SPLIT_LAYER_STATE_ENABLE +#define SPLIT_LED_STATE_ENABLE +#define SPLIT_MODS_ENABLE +#ifdef WPM_ENABLE +# define SPLIT_WPM_ENABLE +#endif +#ifdef OLED_ENABLE +# undef SPLIT_OLED_ENABLE +#endif +#if defined(__AVR__) && !defined(SELECT_SOFT_SERIAL_SPEED) +# define SELECT_SOFT_SERIAL_SPEED 1 +#endif +#ifdef CUSTOM_SPLIT_TRANSPORT_SYNC +# define SPLIT_TRANSACTION_IDS_USER RPC_ID_USER_STATE_SYNC, RPC_ID_USER_KEYMAP_SYNC, RPC_ID_USER_CONFIG_SYNC, RPC_ID_USER_WATCHDOG_SYNC, RPC_ID_USER_KEYLOG_STR +#endif diff --git a/users/drashna/split/transport_sync.c b/users/drashna/split/transport_sync.c index 2050d687ae..6b5c384480 100644 --- a/users/drashna/split/transport_sync.c +++ b/users/drashna/split/transport_sync.c @@ -4,9 +4,6 @@ #include "transport_sync.h" #include "transactions.h" #include -#ifdef __AVR__ -# include -#endif #ifdef UNICODE_COMMON_ENABLE # include "process_unicode_common.h" @@ -18,6 +15,9 @@ extern unicode_config_t unicode_config; extern audio_config_t audio_config; extern bool delayed_tasks_run; #endif +#if defined(OLED_ENABLE) && !defined(SPLIT_OLED_ENABLE) && defined(CUSTOM_OLED_DRIVER) +extern bool is_oled_enabled; +#endif #if defined(POINTING_DEVICE_ENABLE) && defined(KEYBOARD_handwired_tractyl_manuform) extern bool tap_toggling; #endif @@ -95,6 +95,9 @@ void user_transport_update(void) { user_state.audio_enable = is_audio_on(); user_state.audio_clicky_enable = is_clicky_on(); #endif +#if defined(OLED_ENABLE) && !defined(SPLIT_OLED_ENABLE) && defined(CUSTOM_OLED_DRIVER) + user_state.is_oled_enabled = is_oled_enabled; +#endif #if defined(CUSTOM_POINTING_DEVICE) user_state.tap_toggling = tap_togglin