Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix for multiple AMUX usage #23155

Merged
merged 1 commit into from
Feb 26, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions keyboards/cipulot/common/ec_switch_matrix.c
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,10 @@ void ec_noise_floor(void) {
for (uint8_t amux = 0; amux < AMUX_COUNT; amux++) {
disable_unused_amux(amux);
for (uint8_t col = 0; col < amux_n_col_sizes[amux]; col++) {
uint8_t adjusted_col = amux == 0 ? col : col + amux_n_col_sizes[amux - 1];
uint8_t sum = 0;
for (uint8_t i = 0; i < (amux > 0 ? amux : 0); i++)
sum += amux_n_col_sizes[i];
uint8_t adjusted_col = col + sum;
for (uint8_t row = 0; row < MATRIX_ROWS; row++) {
ec_config.noise_floor[row][adjusted_col] += ec_readkey_raw(amux, row, col);
}
Expand All @@ -178,7 +181,10 @@ bool ec_matrix_scan(matrix_row_t current_matrix[]) {
disable_unused_amux(amux);
for (uint8_t col = 0; col < amux_n_col_sizes[amux]; col++) {
for (uint8_t row = 0; row < MATRIX_ROWS; row++) {
uint8_t adjusted_col = amux == 0 ? col : col + amux_n_col_sizes[amux - 1];
uint8_t sum = 0;
for (uint8_t i = 0; i < (amux > 0 ? amux : 0); i++)
sum += amux_n_col_sizes[i];
uint8_t adjusted_col = col + sum;
sw_value[row][adjusted_col] = ec_readkey_raw(amux, row, col);

if (ec_config.bottoming_calibration) {
Expand Down
Loading