summaryrefslogtreecommitdiffstats
path: root/users/drashna/split/transport_sync.c
diff options
context:
space:
mode:
Diffstat (limited to 'users/drashna/split/transport_sync.c')
-rw-r--r--users/drashna/split/transport_sync.c55
1 files changed, 8 insertions, 47 deletions
diff --git a/users/drashna/split/transport_sync.c b/users/drashna/split/transport_sync.c
index 6b5c384480..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) {
@@ -98,12 +79,12 @@ void user_transport_update(void) {
#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_toggling;
+#if defined(POINTING_DEVICE_ENABLE) && defined(POINTING_DEVICE_AUTO_MOUSE_ENABLE)
+ user_state.tap_toggling = get_auto_mouse_toggle();
#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,13 +98,15 @@ 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;
#endif
-#if defined(CUSTOM_POINTING_DEVICE)
- tap_toggling = user_state.tap_toggling;
+#if defined(POINTING_DEVICE_ENABLE) && defined(POINTING_DEVICE_AUTO_MOUSE_ENABLE)
+ if (get_auto_mouse_toggle() != user_state.tap_toggling) {
+ auto_mouse_toggle();
+ }
#endif
#ifdef SWAP_HANDS_ENABLE
swap_hands = user_state.swap_hands;
@@ -217,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) {