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

@ -13,27 +13,12 @@
#define NUMBER_OF_TOUCH_ENCODERS 2
#define TOUCH_ENCODER_OPTIONS TOUCH_SEGMENTS + 2
#define NUMBER_OF_ENCODERS 6
#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 0 matrix entries
{ { 5, 2 }, { 5, 3 } }, // Encoder 1 matrix entries
{ { 5, 4 }, { 5, 5 } }, // Encoder 2 matrix entries
{ { 11, 0 }, { 11, 1 } }, // Encoder 3 matrix entries
{ { 11, 2 }, { 11, 3 } }, // Encoder 4 matrix entries
{ { 11, 4 }, { 11, 5 } } // Encoder 5 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] =
{
{ { 1, 7 }, { 0, 7 }, { 2, 7 }, { 5, 6 }, { 5, 7 }, }, // Touch Encoder 0 matrix entries
{ { 7, 7 }, { 6, 7 }, { 8, 7 }, { 11, 6 }, { 11, 7 }, } // Touch Encoder 1 matrix entries
@ -43,7 +28,7 @@ static bool limit_lightning = true;
RGB rgb_matrix_hsv_to_rgb(HSV hsv) {
if (limit_lightning) hsv.v /= 2;
return hsv_to_rgb(hsv);
return hsv_to_rgb(hsv);
}
bool dip_switch_update_kb(uint8_t index, bool active) {
@ -72,15 +57,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;
@ -189,7 +165,7 @@ void rgb_matrix_increase_flags(void)
#endif
__attribute__((weak))
__attribute__((weak))
void render_layer_status(void) {
// Keymap specific, expected to be overridden
// Host Keyboard Layer Status
@ -245,7 +221,7 @@ oled_rotation_t oled_init_kb(oled_rotation_t rotation) {
bool oled_task_kb(void) {
if (!oled_task_user())
return false;
if (is_keyboard_left()) {
render_icon();
oled_write_P(PSTR(" "), false);