Skip to content

Commit

Permalink
[Display] Fix keylogger string names
Browse files Browse the repository at this point in the history
  • Loading branch information
drashna committed Aug 9, 2024
1 parent 6deef54 commit 264f8c8
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 9 deletions.
2 changes: 1 addition & 1 deletion keyboards/bastardkb/dilemma/4x6_4/keymaps/drashna/keymap.c
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ bool oled_task_keymap(void) {
oled_write_raw_P(footer_image2, sizeof(footer_image2));
# ifdef DISPLAY_KEYLOGGER_ENABLE
oled_set_cursor(4, 15);
oled_write(oled_keylog_str, true);
oled_write(display_keylogger_string, true);
# endif
return false;
}
Expand Down
2 changes: 1 addition & 1 deletion keyboards/zsa/voyager/keymaps/drashna/keymap.c
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ bool oled_task_keymap(void) {
oled_write_raw_P(footer_image2, sizeof(footer_image2));
# ifdef DISPLAY_KEYLOGGER_ENABLE
oled_set_cursor(4, 15);
oled_write(oled_keylog_str, true);
oled_write(display_keylogger_string, true);
# endif

return false;
Expand Down
2 changes: 1 addition & 1 deletion users/drashna/split/config.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
#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_AUTOCORRECT_STR, \
RPC_ID_USER_OLED_KEYLOG_STR, RPC_ID_USER_SUSPEND_STATE_SYNC
RPC_ID_USER_DISPLAY_KEYLOG_STR, RPC_ID_USER_SUSPEND_STATE_SYNC

// autocorrect and the like require larger data sets, so we need to increase the buffer size
# define RPC_M2S_BUFFER_SIZE 64
Expand Down
11 changes: 5 additions & 6 deletions users/drashna/split/transport_sync.c
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ void user_config_sync(uint8_t initiator2target_buffer_size, const void* initiato
#if defined(AUTOCORRECT_ENABLE)
extern char autocorrected_str[2][22];
_Static_assert(sizeof(autocorrected_str) <= RPC_M2S_BUFFER_SIZE, "Autocorrect array larger than buffer size!");

#endif
/**
* @brief Sycn Autoccetion string between halves of split keyboard
*
Expand All @@ -95,11 +95,12 @@ _Static_assert(sizeof(autocorrected_str) <= RPC_M2S_BUFFER_SIZE, "Autocorrect ar
*/
void autocorrect_string_sync(uint8_t initiator2target_buffer_size, const void* initiator2target_buffer,
uint8_t target2initiator_buffer_size, void* target2initiator_buffer) {
#if defined(AUTOCORRECT_ENABLE)
if (initiator2target_buffer_size == (sizeof(autocorrected_str))) {
memcpy(&autocorrected_str, initiator2target_buffer, initiator2target_buffer_size);
}
}
#endif
}

/**
* @brief Sync keylogger string between halves of split keyboard
Expand Down Expand Up @@ -156,10 +157,8 @@ void keyboard_post_init_transport_sync(void) {
transaction_register_rpc(RPC_ID_USER_STATE_SYNC, user_state_sync);
transaction_register_rpc(RPC_ID_USER_KEYMAP_SYNC, user_keymap_sync);
transaction_register_rpc(RPC_ID_USER_CONFIG_SYNC, user_config_sync);
#if defined(AUTOCORRECT_ENABLE)
transaction_register_rpc(RPC_ID_USER_AUTOCORRECT_STR, autocorrect_string_sync);
#endif
transaction_register_rpc(RPC_ID_USER_OLED_KEYLOG_STR, keylogger_string_sync);
transaction_register_rpc(RPC_ID_USER_DISPLAY_KEYLOG_STR, keylogger_string_sync);
transaction_register_rpc(RPC_ID_USER_SUSPEND_STATE_SYNC, suspend_state_sync);
}

Expand Down Expand Up @@ -289,7 +288,7 @@ void user_transport_sync(void) {

// Perform the sync if requested
if (needs_sync) {
if (transaction_rpc_send(RPC_ID_USER_OLED_KEYLOG_STR, (DISPLAY_KEYLOGGER_LENGTH + 1),
if (transaction_rpc_send(RPC_ID_USER_DISPLAY_KEYLOG_STR, (DISPLAY_KEYLOGGER_LENGTH + 1),
&display_keylogger_string)) {
last_sync[3] = timer_read32();
}
Expand Down

0 comments on commit 264f8c8

Please sign in to comment.