1
0
Fork 0

Remove encoder in-matrix workaround code (#20389)

This commit is contained in:
jack 2023-06-19 09:46:27 -06:00 committed by GitHub
parent 74fbd5a031
commit c4a67d3f33
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
241 changed files with 1106 additions and 5235 deletions

View file

@ -12,25 +12,12 @@
#define NUMBER_OF_TOUCH_ENCODERS 2
#define TOUCH_ENCODER_OPTIONS TOUCH_SEGMENTS + 2
#define NUMBER_OF_ENCODERS 4
#define ENCODER_OPTIONS 2
typedef struct PACKED {
uint8_t r;
uint8_t c;
} encodermap_t;
// this maps encoders and then touch encoders to their respective electrical matrix entry
// mapping is row (y) then column (x) when looking at the electrical layout
const encodermap_t encoder_map[NUMBER_OF_ENCODERS][ENCODER_OPTIONS] =
{
{ { 5, 0 }, { 5, 1 } }, // Encoder 1 matrix entries
{ { 5, 2 }, { 5, 3 } }, // Encoder 2 matrix entries
{ { 12, 0 }, { 12, 1 } }, // Encoder 3 matrix entries
{ { 12, 2 }, { 12, 3 } }, // Encoder 4 matrix entries
};
const encodermap_t touch_encoder_map[NUMBER_OF_TOUCH_ENCODERS][TOUCH_ENCODER_OPTIONS] =
const encodermap_t touch_encoder_map[NUMBER_OF_TOUCH_ENCODERS][TOUCH_ENCODER_OPTIONS] =
{
{ { 6, 0 }, { 6, 1 }, { 6, 2 }, { 6, 3 }, { 6, 4 } }, // Touch Encoder 1 matrix entries
{ { 13, 0 }, { 13, 1 }, { 13, 2 }, { 13, 3 }, { 13, 4 } } // Touch Encoder 2 matrix entries
@ -44,24 +31,6 @@ static void process_encoder_matrix(encodermap_t pos) {
action_exec(MAKE_KEYEVENT(pos.r, pos.c, false));
}
bool encoder_update_kb(uint8_t index, bool clockwise) {
if (!encoder_update_user(index, clockwise))
return false;
// Mapping clockwise (typically increase) to zero, and counter clockwise (decrease) to 1
process_encoder_matrix(encoder_map[index][clockwise ? 0 : 1]);
return false;
}
bool touch_encoder_update_kb(uint8_t index, bool clockwise) {
if (!touch_encoder_update_user(index, clockwise))
return false;
// Mapping clockwise (typically increase) to zero, and counter clockwise (decrease) to 1
process_encoder_matrix(touch_encoder_map[index][clockwise ? 0 : 1]);
return false;
}
bool touch_encoder_tapped_kb(uint8_t index, uint8_t section) {
if (!touch_encoder_tapped_user(index, section))
return false;