Skip to content

Commit

Permalink
Make WPM sync opt-in to match other synced data.
Browse files Browse the repository at this point in the history
  • Loading branch information
tzarc committed Apr 18, 2021
1 parent 62e17ae commit 45687ad
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 10 deletions.
4 changes: 2 additions & 2 deletions quantum/split_common/transaction_id_define.h
Original file line number Diff line number Diff line change
Expand Up @@ -61,9 +61,9 @@ enum serial_transaction_id {
PUT_RGB_MATRIX,
#endif // defined(RGBLIGHT_ENABLE) && defined(RGBLIGHT_SPLIT)

#ifdef WPM_ENABLE
#if defined(WPM_ENABLE) && defined(SPLIT_WPM_ENABLE)
PUT_WPM,
#endif // WPM_ENABLE
#endif // defined(WPM_ENABLE) && defined(SPLIT_WPM_ENABLE)

#if defined(SPLIT_TRANSACTION_IDS_KB) || defined(SPLIT_TRANSACTION_IDS_USER)
PUT_RPC_INFO,
Expand Down
12 changes: 6 additions & 6 deletions quantum/split_common/transactions.c
Original file line number Diff line number Diff line change
Expand Up @@ -128,9 +128,9 @@ split_transaction_desc_t split_transaction_table[NUM_TOTAL_TRANSACTIONS] = {
[PUT_RGB_MATRIX] = trans_initiator2target_initializer(rgb_matrix_sync),
#endif // defined(RGBLIGHT_ENABLE) && defined(RGBLIGHT_SPLIT)

#ifdef WPM_ENABLE
#if defined(WPM_ENABLE) && defined(SPLIT_WPM_ENABLE)
[PUT_WPM] = trans_initiator2target_initializer(current_wpm),
#endif // WPM_ENABLE
#endif // defined(WPM_ENABLE) && defined(SPLIT_WPM_ENABLE)

#if defined(SPLIT_TRANSACTION_IDS_KB) || defined(SPLIT_TRANSACTION_IDS_USER)
[PUT_RPC_INFO] = trans_initiator2target_initializer_cb(rpc_info, slave_rpc_info_callback),
Expand Down Expand Up @@ -269,7 +269,7 @@ bool transactions_master(matrix_row_t master_matrix[], matrix_row_t slave_matrix
}
#endif // defined(RGBLIGHT_ENABLE) && defined(RGBLIGHT_SPLIT)

#ifdef WPM_ENABLE
#if defined(WPM_ENABLE) && defined(SPLIT_WPM_ENABLE)
static uint32_t last_wpm_update = 0;
if (timer_elapsed32(last_wpm_update) > FORCED_SYNC_THROTTLE_MS) {
last_wpm_update = timer_read32();
Expand All @@ -278,7 +278,7 @@ bool transactions_master(matrix_row_t master_matrix[], matrix_row_t slave_matrix
okay &= transport_write(PUT_WPM, &current_wpm, sizeof(current_wpm));
}
}
#endif // WPM_ENABLE
#endif // defined(WPM_ENABLE) && defined(SPLIT_WPM_ENABLE)

return okay;
}
Expand Down Expand Up @@ -344,9 +344,9 @@ void transactions_slave(matrix_row_t master_matrix[], matrix_row_t slave_matrix[
g_suspend_state = split_shmem->rgb_matrix_sync.rgb_suspend_state;
#endif

#ifdef WPM_ENABLE
#if defined(WPM_ENABLE) && defined(SPLIT_WPM_ENABLE)
set_current_wpm(split_shmem->current_wpm);
#endif
#endif // defined(WPM_ENABLE) && defined(SPLIT_WPM_ENABLE)
}

#if defined(SPLIT_TRANSACTION_IDS_KB) || defined(SPLIT_TRANSACTION_IDS_USER)
Expand Down
4 changes: 2 additions & 2 deletions quantum/split_common/transport.h
Original file line number Diff line number Diff line change
Expand Up @@ -141,9 +141,9 @@ typedef struct _split_shared_memory_t {
rgb_matrix_sync_t rgb_matrix_sync;
#endif // defined(RGB_MATRIX_ENABLE) && defined(RGB_MATRIX_SPLIT)

#ifdef WPM_ENABLE
#if defined(WPM_ENABLE) && defined(SPLIT_WPM_ENABLE)
uint8_t current_wpm;
#endif // WPM_ENABLE
#endif // defined(WPM_ENABLE) && defined(SPLIT_WPM_ENABLE)

#if defined(SPLIT_TRANSACTION_IDS_KB) || defined(SPLIT_TRANSACTION_IDS_USER)
rpc_sync_info_t rpc_info;
Expand Down

0 comments on commit 45687ad

Please sign in to comment.