diff options
| author | Nick Brassel <nick@tzarc.org> | 2022-03-08 16:58:05 +1100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-03-08 16:58:05 +1100 |
| commit | 2f6751e48a37699cfd999e0afd8731ca3962611c (patch) | |
| tree | c64605c10a8f8f758f46be209d79210bbf15c167 /quantum/split_common | |
| parent | 2218690d0b718dc68de4c5d093f1ec8e55d82d00 (diff) | |
Asymmetric encoders, encoder tests. (#16068)
Diffstat (limited to 'quantum/split_common')
| -rw-r--r-- | quantum/split_common/transactions.c | 4 | ||||
| -rw-r--r-- | quantum/split_common/transport.h | 3 |
2 files changed, 3 insertions, 4 deletions
diff --git a/quantum/split_common/transactions.c b/quantum/split_common/transactions.c index cffbccaeee..105bf918cb 100644 --- a/quantum/split_common/transactions.c +++ b/quantum/split_common/transactions.c | |||
| @@ -180,7 +180,7 @@ static void master_matrix_handlers_slave(matrix_row_t master_matrix[], matrix_ro | |||
| 180 | 180 | ||
| 181 | static bool encoder_handlers_master(matrix_row_t master_matrix[], matrix_row_t slave_matrix[]) { | 181 | static bool encoder_handlers_master(matrix_row_t master_matrix[], matrix_row_t slave_matrix[]) { |
| 182 | static uint32_t last_update = 0; | 182 | static uint32_t last_update = 0; |
| 183 | uint8_t temp_state[NUMBER_OF_ENCODERS]; | 183 | uint8_t temp_state[NUM_ENCODERS_MAX_PER_SIDE]; |
| 184 | 184 | ||
| 185 | bool okay = read_if_checksum_mismatch(GET_ENCODERS_CHECKSUM, GET_ENCODERS_DATA, &last_update, temp_state, split_shmem->encoders.state, sizeof(temp_state)); | 185 | bool okay = read_if_checksum_mismatch(GET_ENCODERS_CHECKSUM, GET_ENCODERS_DATA, &last_update, temp_state, split_shmem->encoders.state, sizeof(temp_state)); |
| 186 | if (okay) encoder_update_raw(temp_state); | 186 | if (okay) encoder_update_raw(temp_state); |
| @@ -188,7 +188,7 @@ static bool encoder_handlers_master(matrix_row_t master_matrix[], matrix_row_t s | |||
| 188 | } | 188 | } |
| 189 | 189 | ||
| 190 | static void encoder_handlers_slave(matrix_row_t master_matrix[], matrix_row_t slave_matrix[]) { | 190 | static void encoder_handlers_slave(matrix_row_t master_matrix[], matrix_row_t slave_matrix[]) { |
| 191 | uint8_t encoder_state[NUMBER_OF_ENCODERS]; | 191 | uint8_t encoder_state[NUM_ENCODERS_MAX_PER_SIDE]; |
| 192 | encoder_state_raw(encoder_state); | 192 | encoder_state_raw(encoder_state); |
| 193 | // Always prepare the encoder state for read. | 193 | // Always prepare the encoder state for read. |
| 194 | memcpy(split_shmem->encoders.state, encoder_state, sizeof(encoder_state)); | 194 | memcpy(split_shmem->encoders.state, encoder_state, sizeof(encoder_state)); |
diff --git a/quantum/split_common/transport.h b/quantum/split_common/transport.h index 26bd136728..e62679990a 100644 --- a/quantum/split_common/transport.h +++ b/quantum/split_common/transport.h | |||
| @@ -42,7 +42,6 @@ bool transport_execute_transaction(int8_t id, const void *initiator2target_buf, | |||
| 42 | 42 | ||
| 43 | #ifdef ENCODER_ENABLE | 43 | #ifdef ENCODER_ENABLE |
| 44 | # include "encoder.h" | 44 | # include "encoder.h" |
| 45 | # define NUMBER_OF_ENCODERS (sizeof((pin_t[])ENCODERS_PAD_A) / sizeof(pin_t)) | ||
| 46 | #endif // ENCODER_ENABLE | 45 | #endif // ENCODER_ENABLE |
| 47 | 46 | ||
| 48 | #ifdef BACKLIGHT_ENABLE | 47 | #ifdef BACKLIGHT_ENABLE |
| @@ -67,7 +66,7 @@ typedef struct _split_master_matrix_sync_t { | |||
| 67 | #ifdef ENCODER_ENABLE | 66 | #ifdef ENCODER_ENABLE |
| 68 | typedef struct _split_slave_encoder_sync_t { | 67 | typedef struct _split_slave_encoder_sync_t { |
| 69 | uint8_t checksum; | 68 | uint8_t checksum; |
| 70 | uint8_t state[NUMBER_OF_ENCODERS]; | 69 | uint8_t state[NUM_ENCODERS_MAX_PER_SIDE]; |
| 71 | } split_slave_encoder_sync_t; | 70 | } split_slave_encoder_sync_t; |
| 72 | #endif // ENCODER_ENABLE | 71 | #endif // ENCODER_ENABLE |
| 73 | 72 | ||
