Remove some unnecessary matrix externs (#25975)

This commit is contained in:
Joel Challis 2026-02-10 16:47:25 +00:00 committed by GitHub
parent 08a064c56d
commit 9aec0e2c9f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
7 changed files with 3 additions and 35 deletions

View File

@ -17,9 +17,6 @@
#include "ec_switch_matrix.h"
#include "matrix.h"
extern matrix_row_t raw_matrix[MATRIX_ROWS]; // raw values
extern matrix_row_t matrix[MATRIX_ROWS]; // debounced values
// Custom matrix init function
void matrix_init_custom(void) {
// Initialize EC

View File

@ -17,9 +17,6 @@
#include "ec_switch_matrix.h"
#include "matrix.h"
extern matrix_row_t raw_matrix[MATRIX_ROWS]; // raw values
extern matrix_row_t matrix[MATRIX_ROWS]; // debounced values
// Custom matrix init function
void matrix_init_custom(void) {
// Initialize EC

View File

@ -17,9 +17,6 @@
#include "ec_switch_matrix.h"
#include "matrix.h"
extern matrix_row_t raw_matrix[MATRIX_ROWS]; // raw values
extern matrix_row_t matrix[MATRIX_ROWS]; // debounced values
// Custom matrix init function
void matrix_init_custom(void) {
// Initialize EC

View File

@ -61,9 +61,6 @@ static bool starting_up = false;
#define ENC_BONGO 9
#endif //bongocat
extern matrix_row_t matrix[MATRIX_ROWS];
char* enc_mode_str[] = {
#ifdef BONGOCAT
/* Splash */ "",
@ -394,7 +391,7 @@ void write_bongochar_at_pixel_xy(uint8_t x, uint8_t y, uint8_t data, bool invert
bool is_key_down(void) {
for (uint8_t i = 0; i < MATRIX_ROWS; i++) {
if (matrix[i] > 0) {
if (matrix_get_row(i) > 0) {
return true;
}
}
@ -488,10 +485,10 @@ bool is_new_tap(void) {
static matrix_row_t old_matrix[] = { 0, 0, 0, 0, 0, 0 };
bool new_tap = false;
for (uint8_t i = 0; i < MATRIX_ROWS; i++) {
if (matrix[i] > old_matrix[i]) { // more 1's detected, there was a new tap
if (matrix_get_row(i) > old_matrix[i]) { // more 1's detected, there was a new tap
new_tap = true;
}
old_matrix[i] = matrix[i];
old_matrix[i] = matrix_get_row(i);
}
return new_tap;
}

View File

@ -1,9 +1,6 @@
// Copyright 2023 Cameron Varley (@RustedAperture)
// SPDX-License-Identifier: GPL-2.0-or-later
/*
* scan matrix
*/
#include "matrix.h"
#include <string.h>
#include "atomic_util.h"
@ -11,13 +8,8 @@
#include "print.h"
#include "debug.h"
/* matrix state(1:on, 0:off) */
extern matrix_row_t matrix[MATRIX_ROWS]; // debounced values
extern matrix_row_t raw_matrix[MATRIX_ROWS]; // raw values
static const pin_t row_pins[MATRIX_ROWS] = MATRIX_ROW_PINS;
static const pin_t col_pins[MATRIX_COLS] = MATRIX_COL_PINS;
#define MATRIX_ROW_SHIFTER ((matrix_row_t)1)
static inline void gpio_atomic_set_pin_output_low(pin_t pin) {
ATOMIC_BLOCK_FORCEON {

View File

@ -35,10 +35,6 @@
#define ROWS_PER_HAND (MATRIX_ROWS / 2)
/* matrix state(1:on, 0:off) */
extern matrix_row_t raw_matrix[MATRIX_ROWS]; // raw values
extern matrix_row_t matrix[MATRIX_ROWS]; // debounced values
// row offsets for each hand
static uint8_t thisHand, thatHand;

View File

@ -1,9 +1,6 @@
// Copyright 2022 Christopher Courtney, aka Drashna Jael're (@drashna) <drashna@live.com>
// SPDX-License-Identifier: GPL-2.0-or-later
/*
* scan matrix
*/
#include "matrix.h"
#include <string.h>
#include "atomic_util.h"
@ -12,13 +9,8 @@
#include "util.h"
#include "debounce.h"
/* matrix state(1:on, 0:off) */
extern matrix_row_t matrix[MATRIX_ROWS]; // debounced values
extern matrix_row_t raw_matrix[MATRIX_ROWS]; // raw values
static const pin_t row_pins[MATRIX_ROWS] = MATRIX_ROW_PINS;
static const pin_t col_pins[MATRIX_COLS] = MATRIX_COL_PINS;
#define MATRIX_ROW_SHIFTER ((matrix_row_t)1)
static inline void gpio_atomic_set_pin_output_low(pin_t pin) {
ATOMIC_BLOCK_FORCEON {