diff --git a/KeyboardConfig.cpp b/KeyboardConfig.cpp index 68207380..32cb6434 100644 --- a/KeyboardConfig.cpp +++ b/KeyboardConfig.cpp @@ -54,35 +54,33 @@ void implementation_finish_scanning_row(byte row) { rightsx1509.updatePinState(right_rowpins[row], HIGH); } -uint8_t implementation_scan_left_col(byte row, byte col,uint8_t state) { +void implementation_scan_left_col(byte row, byte col,uint8_t *state) { //If we see an electrical connection on I->J, - state <<= 1; + *state <<= 1; if (left_initted && leftsx1509.readPrefetchedPin(left_colpins[col])) { - state |= 0; + *state |= 0; } else { - state |= 1; + *state |= 1; } - return state; } -uint8_t implementation_scan_right_col(byte row, byte col, uint8_t state) { +void implementation_scan_right_col(byte row, byte col, uint8_t *state) { //If we see an electrical connection on I->J, - state <<= 1; + *state <<= 1; if (right_initted && rightsx1509.readPrefetchedPin(right_colpins[col])) { - state |= 0; + *state |= 0; } else { - state |= 1; + *state |= 1; } - return state; } diff --git a/KeyboardConfig.h b/KeyboardConfig.h index eb21a52e..43d8959d 100644 --- a/KeyboardConfig.h +++ b/KeyboardConfig.h @@ -29,8 +29,8 @@ static uint8_t right_rowpins[]= {8,9,10,11}; void implementation_scan_row(byte row); void implementation_finish_scanning_row(byte row); -uint8_t implementation_scan_right_col(byte row, byte col, uint8_t state); -uint8_t implementation_scan_left_col(byte row, byte col, uint8_t state); +void implementation_scan_right_col(byte row, byte col, uint8_t *state); +void implementation_scan_left_col(byte row, byte col, uint8_t *state); void implementation_pins_setup(); void make_input(sx1509Class sx1509, uint8_t pin) ; void make_output(sx1509Class sx1509, uint8_t pin) ; diff --git a/KeyboardioFirmware.ino b/KeyboardioFirmware.ino index 447d854f..e3fbab69 100644 --- a/KeyboardioFirmware.ino +++ b/KeyboardioFirmware.ino @@ -17,8 +17,8 @@ void scan_matrix() { implementation_scan_row(row); for (byte col = 0; col < LEFT_COLS; col++) { - matrixState[row][col] = implementation_scan_left_col(row,col,matrixState[row][col]); - matrixState[row][(COLS - 1) - col] = implementation_scan_right_col(row,col,matrixState[row][(COLS - 1) - col]); + implementation_scan_left_col(row,col,&matrixState[row][col]); + implementation_scan_right_col(row,col,&matrixState[row][(COLS - 1) - col]); handle_key_event(row, col);