Asymmetric encoders, encoder tests. (#16068)
This commit is contained in:
parent
2218690d0b
commit
2f6751e48a
27 changed files with 931 additions and 148 deletions
|
@ -180,7 +180,7 @@ static void master_matrix_handlers_slave(matrix_row_t master_matrix[], matrix_ro
|
|||
|
||||
static bool encoder_handlers_master(matrix_row_t master_matrix[], matrix_row_t slave_matrix[]) {
|
||||
static uint32_t last_update = 0;
|
||||
uint8_t temp_state[NUMBER_OF_ENCODERS];
|
||||
uint8_t temp_state[NUM_ENCODERS_MAX_PER_SIDE];
|
||||
|
||||
bool okay = read_if_checksum_mismatch(GET_ENCODERS_CHECKSUM, GET_ENCODERS_DATA, &last_update, temp_state, split_shmem->encoders.state, sizeof(temp_state));
|
||||
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
|
|||
}
|
||||
|
||||
static void encoder_handlers_slave(matrix_row_t master_matrix[], matrix_row_t slave_matrix[]) {
|
||||
uint8_t encoder_state[NUMBER_OF_ENCODERS];
|
||||
uint8_t encoder_state[NUM_ENCODERS_MAX_PER_SIDE];
|
||||
encoder_state_raw(encoder_state);
|
||||
// Always prepare the encoder state for read.
|
||||
memcpy(split_shmem->encoders.state, encoder_state, sizeof(encoder_state));
|
||||
|
|
|
@ -42,7 +42,6 @@ bool transport_execute_transaction(int8_t id, const void *initiator2target_buf,
|
|||
|
||||
#ifdef ENCODER_ENABLE
|
||||
# include "encoder.h"
|
||||
# define NUMBER_OF_ENCODERS (sizeof((pin_t[])ENCODERS_PAD_A) / sizeof(pin_t))
|
||||
#endif // ENCODER_ENABLE
|
||||
|
||||
#ifdef BACKLIGHT_ENABLE
|
||||
|
@ -67,7 +66,7 @@ typedef struct _split_master_matrix_sync_t {
|
|||
#ifdef ENCODER_ENABLE
|
||||
typedef struct _split_slave_encoder_sync_t {
|
||||
uint8_t checksum;
|
||||
uint8_t state[NUMBER_OF_ENCODERS];
|
||||
uint8_t state[NUM_ENCODERS_MAX_PER_SIDE];
|
||||
} split_slave_encoder_sync_t;
|
||||
#endif // ENCODER_ENABLE
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue