diff options
author | Drashna Jaelre <drashna@live.com> | 2022-11-29 11:43:42 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-11-29 11:43:42 -0800 |
commit | 4a87af0e9af046d5fc00d930476920c0c34a57a7 (patch) | |
tree | cb2da20c670a49b9fcada84822a7bdb2bd144d60 /users | |
parent | 8a8000b4ec379448848f561f57bbe2c781376357 (diff) |
[Keymap] Drashna updates for 0.19 (#19175)
* Fix up bastardkb boards since blackpill support is officially added.
* Check for blackpill version, not elite c.
* Add checks in chibiOS config since multiple ARM controllers supported.
* Rework rules.mk for keymaps to better handle arm vs avr support
* Start moving away from `matrix_*_*` functions.
* `housekeeping_task_*` instead of `matrix_scan_*`
* `keyboard_(pre|post)_init_*` instead of `matrix_init_*`
* Add ℂℴmⅈℂ unicode input method.
* Clean up unicode code to be more compact and flexible.
* Remove/move Pro Micro LED commands to userspace and better filter them
* Fixup OLED code
* Use newer quantum keycode functions/preprocessors rather than manual bit manipulation
* Make unicode mode render much more compact/simple.
* Make qmk secrets more self contained
* Remove custom implementation of split watchdog
Diffstat (limited to 'users')
-rw-r--r-- | users/drashna/bootmagic_better.c | 2 | ||||
-rw-r--r-- | users/drashna/callbacks.c | 32 | ||||
-rw-r--r-- | users/drashna/callbacks.h | 4 | ||||
-rw-r--r-- | users/drashna/callbacks.md | 5 | ||||
-rw-r--r-- | users/drashna/drashna.c | 27 | ||||
-rw-r--r-- | users/drashna/keyrecords/process_records.h | 1 | ||||
-rw-r--r-- | users/drashna/keyrecords/unicode.c | 128 | ||||
-rw-r--r-- | users/drashna/keyrecords/unicode.h | 7 | ||||
-rw-r--r-- | users/drashna/oled/oled_stuff.c | 58 | ||||
-rw-r--r-- | users/drashna/post_config.h | 15 | ||||
-rw-r--r-- | users/drashna/rgb/rgblight_config.h | 10 | ||||
-rw-r--r-- | users/drashna/rules.mk | 7 | ||||
-rw-r--r-- | users/drashna/split/split_config.h | 5 | ||||
-rw-r--r-- | users/drashna/split/transport_sync.c | 45 |
14 files changed, 201 insertions, 145 deletions
diff --git a/users/drashna/bootmagic_better.c b/users/drashna/bootmagic_better.c index 4932e25f1d..ffd2e609ae 100644 --- a/users/drashna/bootmagic_better.c +++ b/users/drashna/bootmagic_better.c @@ -44,7 +44,7 @@ void bootmagic_lite(void) { if (matrix_get_row(row) & (1 << col)) { perform_reset = true; } -#ifdef STM32F411xE +#if defined(STM32F411xE) && !defined(CONVERTER_ENABLED) if (!readPin(A0)) { perform_reset = true; } diff --git a/users/drashna/callbacks.c b/users/drashna/callbacks.c index 40383f124f..c2f1156cee 100644 --- a/users/drashna/callbacks.c +++ b/users/drashna/callbacks.c @@ -20,22 +20,6 @@ void keyboard_pre_init_user(void) { // functions in the keymaps // Call user matrix init, set default RGB colors and then // call the keymap's init function -__attribute__((weak)) void matrix_init_keymap(void) {} -__attribute__((weak)) void matrix_init_secret(void) {} -void matrix_init_user(void) { -#if defined(BOOTLOADER_CATERINA) && defined(__AVR__) && defined(__AVR_ATmega32U4__) - DDRD &= ~(1 << 5); - PORTD &= ~(1 << 5); - - DDRB &= ~(1 << 0); - PORTB &= ~(1 << 0); -#endif -#ifdef CUSTOM_UNICODE_ENABLE - matrix_init_unicode(); -#endif - matrix_init_secret(); - matrix_init_keymap(); -} __attribute__((weak)) void keyboard_post_init_keymap(void) {} void keyboard_post_init_user(void) { @@ -51,6 +35,17 @@ void keyboard_post_init_user(void) { #ifdef I2C_SCANNER_ENABLE keyboard_post_init_i2c(); #endif +#ifdef CUSTOM_UNICODE_ENABLE + keyboard_post_init_unicode(); +#endif + +#if defined(BOOTLOADER_CATERINA) && defined(__AVR__) && defined(__AVR_ATmega32U4__) + DDRD &= ~(1 << 5); + PORTD &= ~(1 << 5); + + DDRB &= ~(1 << 0); + PORTB &= ~(1 << 0); +#endif keyboard_post_init_keymap(); } @@ -106,7 +101,6 @@ void suspend_wakeup_init_user(void) { // No global matrix scan code, so just run keymap's matrix // scan function __attribute__((weak)) void matrix_scan_keymap(void) {} -__attribute__((weak)) void matrix_scan_secret(void) {} void matrix_scan_user(void) { static bool has_ran_yet; if (!has_ran_yet) { @@ -117,9 +111,6 @@ void matrix_scan_user(void) { #ifdef TAP_DANCE_ENABLE // Run Diablo 3 macro checking code. run_diablo_macro_check(); #endif // TAP_DANCE_ENABLE -#ifdef CAPS_WORD_ENABLE - caps_word_task(); -#endif #if defined(CUSTOM_RGB_MATRIX) matrix_scan_rgb_matrix(); #endif @@ -129,7 +120,6 @@ void matrix_scan_user(void) { #ifdef CUSTOM_OLED_DRIVER matrix_scan_oled(); #endif - matrix_scan_secret(); matrix_scan_keymap(); } diff --git a/users/drashna/callbacks.h b/users/drashna/callbacks.h index 15f8997619..d3d260378d 100644 --- a/users/drashna/callbacks.h +++ b/users/drashna/callbacks.h @@ -5,7 +5,7 @@ #include "quantum.h" -void matrix_init_keymap(void); +void keyboard_post_init_keymap(void); void matrix_init_secret(void); void shutdown_keymap(void); void suspend_power_down_keymap(void); @@ -19,7 +19,7 @@ void eeconfig_init_keymap(void); void housekeeping_task_keymap(void); #ifdef CUSTOM_UNICODE_ENABLE -void matrix_init_unicode(void); +void keyboard_post_init_unicode(void); #endif #ifdef SPLIT_KEYBOARD void matrix_slave_scan_keymap(void); diff --git a/users/drashna/callbacks.md b/users/drashna/callbacks.md index a0f0d9fdae..5908a66142 100644 --- a/users/drashna/callbacks.md +++ b/users/drashna/callbacks.md @@ -15,11 +15,6 @@ My [Ergodox EZ Keymap](https://github.com/qmk/qmk_firmware/blob/master/layouts/c You can see a list of these files in [callbacks.c](callbacks.c), or a shortend list here ```c -__attribute__((weak)) void matrix_init_keymap(void) {} -void matrix_init_user(void) { - matrix_init_keymap(); -} - __attribute__((weak)) void keyboard_post_init_keymap(void) {} void keyboard_post_init_user(void) { keyboard_post_init_keymap(); diff --git a/users/drashna/drashna.c b/users/drashna/drashna.c index d63f05b590..283e82d13d 100644 --- a/users/drashna/drashna.c +++ b/users/drashna/drashna.c @@ -130,14 +130,35 @@ void keyboard_post_init_i2c(void) { } #endif -#if defined(AUTOCORRECT_ENABLE) && defined(AUDIO_ENABLE) -# ifdef USER_SONG_LIST +#if defined(AUTOCORRECT_ENABLE) +# if defined(AUDIO_ENABLE) +# ifdef USER_SONG_LIST float autocorrect_song[][2] = SONG(MARIO_GAMEOVER); -# else +# else float autocorrect_song[][2] = SONG(PLOVER_GOODBYE_SOUND); +# endif # endif + bool apply_autocorrect(uint8_t backspaces, const char *str) { + if (layer_state_is(_GAMEPAD)) { + return false; + } + // TO-DO use unicode stuff for this. Will probably have to reverse engineer + // send string to get working properly, to send char string. + +# if defined(AUDIO_ENABLE) PLAY_SONG(autocorrect_song); +# endif return true; } #endif + +#if defined(CAPS_WORD_ENABLE) && !defined(NO_ACTION_ONESHOT) +void oneshot_locked_mods_changed_user(uint8_t mods) { + if (mods & MOD_MASK_SHIFT) { + del_mods(MOD_MASK_SHIFT); + set_oneshot_locked_mods(~MOD_MASK_SHIFT & get_oneshot_locked_mods()); + caps_word_on(); + } +} +#endif diff --git a/users/drashna/keyrecords/process_records.h b/users/drashna/keyrecords/process_records.h index 2ee7551648..0acd7e010d 100644 --- a/users/drashna/keyrecords/process_records.h +++ b/users/drashna/keyrecords/process_records.h @@ -45,6 +45,7 @@ enum userspace_custom_keycodes { KC_AUSSIE, KC_ZALGO, KC_SUPER, + KC_COMIC, KC_ACCEL, NEW_SAFE_RANGE // use "NEWPLACEHOLDER for keymap specific codes }; diff --git a/users/drashna/keyrecords/unicode.c b/users/drashna/keyrecords/unicode.c index 753fca3231..16390074ca 100644 --- a/users/drashna/keyrecords/unicode.c +++ b/users/drashna/keyrecords/unicode.c @@ -7,7 +7,18 @@ #include "unicode.h" #include "process_unicode_common.h" -uint8_t typing_mode = UCTM_NO_MODE; +uint8_t unicode_typing_mode = UCTM_NO_MODE; +const char unicode_mode_str[UNCODES_MODE_END][13] PROGMEM = { + " Normal\0", + " Wide\0", + " Script\0", + " Blocks\0", + " Regional\0", + " Aussie\0", + " Zalgo\0", + "Super Script\0", + " Comic\0", +}; /** * @brief Registers the unicode keystrokes based on desired unicode @@ -91,6 +102,45 @@ DEFINE_UNICODE_RANGE_TRANSLATOR(unicode_range_translator_script, 0x1D4EA, 0x1D4D DEFINE_UNICODE_RANGE_TRANSLATOR(unicode_range_translator_boxes, 0x1F170, 0x1F170, '0', '1', 0x2002); DEFINE_UNICODE_RANGE_TRANSLATOR(unicode_range_translator_regional, 0x1F1E6, 0x1F1E6, '0', '1', 0x2003); +// DEFINE_UNICODE_LUT_TRANSLATOR(unicode_lut_translator_normal, +// 'a', // a +// 'b', // b +// 'c', // c +// 'd', // d +// 'e', // e +// 'f', // f +// 'g', // g +// 'h', // h +// 'i', // i +// 'j', // j +// 'k', // k +// 'l', // l +// 'm', // m +// 'n', // n +// 'o', // o +// 'p', // p +// 'q', // q +// 'r', // r +// 's', // s +// 't', // t +// 'u', // u +// 'v', // v +// 'w', // w +// 'x', // x +// 'y', // y +// 'z', // z +// '1', // 1 +// '2', // 2 +// '3', // 3 +// '4', // 4 +// '5', // 5 +// '6', // 6 +// '7', // 7 +// '8', // 8 +// '9', // 9 +// '0' // 0 +// ); + DEFINE_UNICODE_LUT_TRANSLATOR(unicode_lut_translator_aussie, 0x0250, // a 'q', // b @@ -169,6 +219,45 @@ DEFINE_UNICODE_LUT_TRANSLATOR(unicode_lut_translator_super, 0x2070 // 0 ); +DEFINE_UNICODE_LUT_TRANSLATOR(unicode_lut_translator_comic, + 0x212B, // a + 0x212C, // b + 0x2102, // c + 0x2145, // d + 0x2107, // e + 0x2132, // f + 0x2141, // g + 0x210D, // h + 0x2148, // i + 0x2111, // j + 'k', // k + 0x2143, // l + 'm', // m + 0x2115, // n + 0x2134, // o + 0x2119, // p + 0x211A, // q + 0x211B, // r + 0x20B7, // s + 0x20B8, // t + 0x2127, // u + 'v', // v + 0x20A9, // w + 'x', // x + 0x213D, // y + 'z', // z + '1', // 1 + '2', // 2 + '3', // 3 + '4', // 4 + '5', // 5 + '6', // 6 + '7', // 7 + '8', // 8 + '9', // 9 + '0' // 0 +); + bool process_record_aussie(uint16_t keycode, keyrecord_t *record) { bool is_shifted = (get_mods() | get_oneshot_mods()) & MOD_MASK_SHIFT; if ((KC_A <= keycode) && (keycode <= KC_0)) { @@ -280,12 +369,12 @@ bool process_record_unicode(uint16_t keycode, keyrecord_t *record) { register_unicode(0x203D); } break; - case KC_NOMODE ... KC_SUPER: + case KC_NOMODE ... KC_COMIC: if (record->event.pressed) { - if (typing_mode != keycode - KC_NOMODE) { - typing_mode = keycode - KC_NOMODE; + if (unicode_typing_mode != keycode - KC_NOMODE) { + unicode_typing_mode = keycode - KC_NOMODE; } else { - typing_mode = UCTM_NO_MODE; + unicode_typing_mode = UCTM_NO_MODE; } } break; @@ -295,23 +384,26 @@ bool process_record_unicode(uint16_t keycode, keyrecord_t *record) { return true; } - if (((keycode >= QK_MOD_TAP && keycode <= QK_MOD_TAP_MAX) || (keycode >= QK_LAYER_TAP && keycode <= QK_LAYER_TAP_MAX)) && record->tap.count) { - keycode &= 0xFF; + if (IS_QK_MOD_TAP(keycode) && record->tap.count) { + keycode = QK_MOD_TAP_GET_TAP_KEYCODE(keycode); + } + if (IS_QK_LAYER_TAP(keycode) && record->tap.count) { + keycode = QK_LAYER_TAP_GET_TAP_KEYCODE(keycode); } - if (typing_mode == UCTM_WIDE) { + if (unicode_typing_mode == UCTM_WIDE) { if (((KC_A <= keycode) && (keycode <= KC_0)) || keycode == KC_SPACE) { return process_record_glyph_replacement(keycode, record, unicode_range_translator_wide); } - } else if (typing_mode == UCTM_SCRIPT) { + } else if (unicode_typing_mode == UCTM_SCRIPT) { if (((KC_A <= keycode) && (keycode <= KC_0)) || keycode == KC_SPACE) { return process_record_glyph_replacement(keycode, record, unicode_range_translator_script); } - } else if (typing_mode == UCTM_BLOCKS) { + } else if (unicode_typing_mode == UCTM_BLOCKS) { if (((KC_A <= keycode) && (keycode <= KC_0)) || keycode == KC_SPACE) { return process_record_glyph_replacement(keycode, record, unicode_range_translator_boxes); } - } else if (typing_mode == UCTM_REGIONAL) { + } else if (unicode_typing_mode == UCTM_REGIONAL) { if (((KC_A <= keycode) && (keycode <= KC_0)) || keycode == KC_SPACE) { if (!process_record_glyph_replacement(keycode, record, unicode_range_translator_regional)) { wait_us(500); @@ -319,22 +411,26 @@ bool process_record_unicode(uint16_t keycode, keyrecord_t *record) { return false; } } - } else if (typing_mode == UCTM_SUPER) { + } else if (unicode_typing_mode == UCTM_SUPER) { if (((KC_A <= keycode) && (keycode <= KC_0))) { return process_record_glyph_replacement(keycode, record, unicode_lut_translator_super); } - } else if (typing_mode == UCTM_AUSSIE) { + } else if (unicode_typing_mode == UCTM_COMIC) { + if (((KC_A <= keycode) && (keycode <= KC_0))) { + return process_record_glyph_replacement(keycode, record, unicode_lut_translator_comic); + } + } else if (unicode_typing_mode == UCTM_AUSSIE) { return process_record_aussie(keycode, record); - } else if (typing_mode == UCTM_ZALGO) { + } else if (unicode_typing_mode == UCTM_ZALGO) { return process_record_zalgo(keycode, record); } return true; } /** - * @brief Initialize the default unicode mode on firmware startu + * @brief Initialize the default unicode mode on firmware startup * */ -void matrix_init_unicode(void) { +void keyboard_post_init_unicode(void) { unicode_input_mode_init(); } diff --git a/users/drashna/keyrecords/unicode.h b/users/drashna/keyrecords/unicode.h index 6885d4dd7f..43c2db89c0 100644 --- a/users/drashna/keyrecords/unicode.h +++ b/users/drashna/keyrecords/unicode.h @@ -3,7 +3,7 @@ #pragma once -enum unicode_typing_mode { +enum unicode_typing_modes { UCTM_NO_MODE, UCTM_WIDE, UCTM_SCRIPT, @@ -12,6 +12,9 @@ enum unicode_typing_mode { UCTM_AUSSIE, UCTM_ZALGO, UCTM_SUPER, + UCTM_COMIC, + UNCODES_MODE_END, }; -extern uint8_t typing_mode; +extern uint8_t unicode_typing_mode; +extern const PROGMEM char unicode_mode_str[UNCODES_MODE_END][13]; diff --git a/users/drashna/oled/oled_stuff.c b/users/drashna/oled/oled_stuff.c index 85a66eec7e..6dbe3b4812 100644 --- a/users/drashna/oled/oled_stuff.c +++ b/users/drashna/oled/oled_stuff.c @@ -67,18 +67,22 @@ static const char PROGMEM code_to_name[256] = { * @param record keyrecord_t data structure */ void add_keylog(uint16_t keycode, keyrecord_t *record) { - if ((keycode >= QK_MOD_TAP && keycode <= QK_MOD_TAP_MAX) || (keycode >= QK_LAYER_TAP && keycode <= QK_LAYER_TAP_MAX) || (keycode >= QK_MODS && keycode <= QK_MODS_MAX)) { - if (((keycode & 0xFF) == KC_BSPC) && mod_config(get_mods() | get_oneshot_mods()) & MOD_MASK_CTRL) { - memset(keylog_str, ' ', OLED_KEYLOGGER_LENGTH); - return; - } - if (record->tap.count) { - keycode &= 0xFF; - } else if (keycode > 0xFF) { - return; - } + if (keycode >= QK_MOD_TAP && keycode <= QK_MOD_TAP_MAX) { + keycode = QK_MOD_TAP_GET_TAP_KEYCODE(keycode); + } else if (keycode >= QK_LAYER_TAP && keycode <= QK_LAYER_TAP_MAX) { + keycode = QK_LAYER_TAP_GET_TAP_KEYCODE(keycode); + } else if (keycode >= QK_MODS && keycode <= QK_MODS_MAX) { + keycode = QK_MODS_GET_BASIC_KEYCODE(keycode); } - if (keycode > 0xFF) { + + + if ((keycode == KC_BSPC) && mod_config(get_mods() | get_oneshot_mods()) & MOD_MASK_CTRL) { + memset(keylog_str, ' ', OLED_KEYLOGGER_LENGTH); + return; + } + if (record->tap.count) { + keycode &= 0xFF; + } else if (keycode > 0xFF) { return; } @@ -426,13 +430,14 @@ void render_bootmagic_status(uint8_t col, uint8_t line) { oled_write_P(logo[0][0], !is_bootmagic_on); } #ifndef OLED_DISPLAY_VERBOSE + oled_write_P(PSTR(" "), false); oled_write_P(logo[1][1], is_bootmagic_on); oled_write_P(logo[0][1], !is_bootmagic_on); #endif oled_write_P(PSTR(" "), false); oled_write_P(PSTR(OLED_RENDER_BOOTMAGIC_NKRO), keymap_config.nkro); oled_write_P(PSTR(" "), false); -#if defined(AUTOCORRECTION_ENABLE) || defined(AUTOCORRECT_ENABLE) +#if defined(AUTOCORRECT_ENABLE) oled_write_P(PSTR("CRCT"), autocorrect_is_enabled()); oled_write_P(PSTR(" "), false); #else @@ -732,33 +737,8 @@ void render_kitty(uint8_t col, uint8_t line) { void render_unicode_mode(uint8_t col, uint8_t line) { #ifdef CUSTOM_UNICODE_ENABLE oled_set_cursor(col, line); - oled_write_ln_P(PSTR("Unicode:"), false); - switch (typing_mode) { - case UCTM_WIDE: - oled_write_P(PSTR(" Wide"), false); - break; - case UCTM_SCRIPT: - oled_write_P(PSTR(" Script"), false); - break; - case UCTM_BLOCKS: - oled_write_P(PSTR(" Blocks"), false); - break; - case UCTM_REGIONAL: - oled_write_P(PSTR(" Regional"), false); - break; - case UCTM_AUSSIE: - oled_write_P(PSTR(" Aussie"), false); - break; - case UCTM_ZALGO: - oled_write_P(PSTR(" Zalgo"), false); - break; - case UCTM_NO_MODE: - oled_write_P(PSTR(" Normal"), false); - break; - default: - oled_write_P(PSTR(" Unknown"), false); - break; - } + oled_write_P(PSTR("Unicode:"), false); + oled_write_P(unicode_mode_str[unicode_typing_mode], false); #endif } diff --git a/users/drashna/post_config.h b/users/drashna/post_config.h index 59b8cd7e42..85e60df681 100644 --- a/users/drashna/post_config.h +++ b/users/drashna/post_config.h @@ -43,6 +43,7 @@ # define RGB_MATRIX_REST_MODE RGB_MATRIX_CYCLE_OUT_IN # endif # endif +# undef RGB_MATRIX_DEFAULT_MODE # define RGB_MATRIX_DEFAULT_MODE RGB_MATRIX_REST_MODE #endif @@ -128,15 +129,15 @@ # define TAPPING_TERM 175 #endif -#ifndef SECURE_UNLOCK_SEQUENCE -# define SECURE_UNLOCK_SEQUENCE \ - { \ - {2, 1}, {2, 2}, {2, 3}, { \ - 2, 4 \ - } \ - } +#if (__has_include("../../../qmk_secrets/config.h") && !defined(NO_SECRETS)) +# include "../../../qmk_secrets/config.h" #endif #if defined(SPLIT_KEYBOARD) && defined(PROTOCOL_CHIBIOS) && !defined(USB_SUSPEND_WAKEUP_DELAY) # define USB_SUSPEND_WAKEUP_DELAY 200 #endif + +#ifdef XAP_ENABLE +# undef DYNAMIC_KEYMAP_LAYER_COUNT +# define DYNAMIC_KEYMAP_LAYER_COUNT 12 +#endif diff --git a/users/drashna/rgb/rgblight_config.h b/users/drashna/rgb/rgblight_config.h index bb2bc3b3ef..d5a6917f1c 100644 --- a/users/drashna/rgb/rgblight_config.h +++ b/users/drashna/rgb/rgblight_config.h @@ -3,6 +3,10 @@ #pragma once -# define RGBLIGHT_SLEEP -# define RGBLIGHT_EFFECT_TWINKLE_LIFE 250 -# define RGBLIGHT_EFFECT_TWINKLE_PROBABILITY 1 / 24 +#define RGBLIGHT_SLEEP +#define RGBLIGHT_EFFECT_TWINKLE_LIFE 250 +#define RGBLIGHT_EFFECT_TWINKLE_PROBABILITY 1 / 24 + +#ifdef RGBLIGHT_DEFAULT_MODE +# undef RGBLIGHT_DEFAULT_MODE +#endif diff --git a/users/drashna/rules.mk b/users/drashna/rules.mk index 76bb5debe1..980d09576b 100644 --- a/users/drashna/rules.mk +++ b/users/drashna/rules.mk @@ -132,6 +132,9 @@ ifeq ($(strip $(AUTOCORRECTION_ENABLE)), yes) AUTOCORRECT_ENABLE = yes endif -ifeq ($(strip $(BOOTMAGIC_ENABLE)), yes) - SRC += bootmagic_better.c +CUSTOM_BOOTMAGIC_ENABLE ?= yes +ifeq ($(strip $(CUSTOM_BOOTMAGIC_ENABLE)), yes) + ifeq ($(strip $(BOOTMAGIC_ENABLE)), yes) + SRC += bootmagic_better.c + endif endif diff --git a/users/drashna/split/split_config.h b/users/drashna/split/split_config.h index 66c12392d9..21ff3829bb 100644 --- a/users/drashna/split/split_config.h +++ b/users/drashna/split/split_config.h @@ -7,6 +7,9 @@ #define SPLIT_LAYER_STATE_ENABLE #define SPLIT_LED_STATE_ENABLE #define SPLIT_MODS_ENABLE +#ifndef POINTING_DEVICE_ENABLE +# define SPLIT_WATCHDOG_ENABLE +#endif #ifdef WPM_ENABLE # define SPLIT_WPM_ENABLE #endif @@ -17,5 +20,5 @@ # 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 +# define SPLIT_TRANSACTION_IDS_USER RPC_ID_USER_STATE_SYNC, RPC_ID_USER_KEYMAP_SYNC, RPC_ID_USER_CONFIG_SYNC, RPC_ID_USER_PLACEHOLDER, RPC_ID_USER_KEYLOG_STR #endif diff --git a/users/drashna/split/transport_sync.c b/users/drashna/split/transport_sync.c index 11c56849eb..0284627ed2 100644 --- a/users/drashna/split/transport_sync.c +++ b/users/drashna/split/transport_sync.c @@ -25,11 +25,6 @@ extern bool tap_toggling; extern bool swap_hands; #endif -#if defined(SPLIT_WATCHDOG_TIMEOUT) -static bool watchdog_ping_done = false; -static uint32_t watchdog_timer = 0; -#endif - extern userspace_config_t userspace_config; extern bool host_driver_disabled; @@ -54,12 +49,6 @@ void user_config_sync(uint8_t initiator2target_buffer_size, const void* initiato } } -#if defined(SPLIT_WATCHDOG_TIMEOUT) -void watchdog_handler(uint8_t in_buflen, const void* in_data, uint8_t out_buflen, void* out_data) { - watchdog_ping_done = true; -} -#endif - #ifdef CUSTOM_OLED_DRIVER # include "oled/oled_stuff.h" void keylogger_string_sync(uint8_t initiator2target_buffer_size, const void* initiator2target_buffer, uint8_t target2initiator_buffer_size, void* target2initiator_buffer) { @@ -77,14 +66,6 @@ void keyboard_post_init_transport_sync(void) { #ifdef CUSTOM_OLED_DRIVER transaction_register_rpc(RPC_ID_USER_KEYLOG_STR, keylogger_string_sync); #endif - -#if defined(SPLIT_WATCHDOG_TIMEOUT) -# if defined(PROTOCOL_LUFA) - wdt_disable(); -# endif - transaction_register_rpc(RPC_ID_USER_WATCHDOG_SYNC, watchdog_handler); - watchdog_timer = timer_read32(); -#endif } void user_transport_update(void) { @@ -103,7 +84,7 @@ void user_transport_update(void) { #endif #ifdef UNICODE_COMMON_ENABLE user_state.unicode_mode = unicode_config.input_mode; - user_state.unicode_typing_mode = typing_mode; + user_state.unicode_typing_mode = unicode_typing_mode; #endif #ifdef SWAP_HANDS_ENABLE user_state.swap_hands = swap_hands; @@ -117,7 +98,7 @@ void user_transport_update(void) { user_state.raw = transport_user_state; #ifdef UNICODE_COMMON_ENABLE unicode_config.input_mode = user_state.unicode_mode; - typing_mode = user_state.unicode_typing_mode; + unicode_typing_mode = user_state.unicode_typing_mode; #endif #if defined(OLED_ENABLE) && !defined(SPLIT_OLED_ENABLE) && defined(CUSTOM_OLED_DRIVER) is_oled_enabled = user_state.is_oled_enabled; @@ -219,28 +200,6 @@ void user_transport_sync(void) { } #endif } - -#if defined(SPLIT_WATCHDOG_TIMEOUT) - if (!watchdog_ping_done) { - if (is_keyboard_master()) { - if (timer_elapsed32(watchdog_timer) > 100) { - uint8_t any_data = 1; - if (transaction_rpc_send(RPC_ID_USER_WATCHDOG_SYNC, sizeof(any_data), &any_data)) { - watchdog_ping_done = true; // successful ping - } else { - dprint("Watchdog ping failed!\n"); - } - watchdog_timer = timer_read32(); - } - } else { - if (timer_elapsed32(watchdog_timer) > 3500) { - mcu_reset(); - while (1) { - } - } - } - } -#endif } void housekeeping_task_transport_sync(void) { |