Browse Source

Remove some unnecessary matrix externs (#25975)

Joel Challis 5 months ago
parent
commit
9aec0e2c9f

+ 0 - 3
keyboards/cipulot/common/matrix.c

@@ -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

+ 0 - 3
keyboards/cipulot/ec_980c/matrix.c

@@ -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

+ 0 - 3
keyboards/cipulot/ec_typek/matrix.c

@@ -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

+ 3 - 6
keyboards/custommk/evo70/evo70.c

@@ -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;
 }

+ 0 - 8
keyboards/gmmk/numpad/matrix.c

@@ -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 {

+ 0 - 4
keyboards/sekigon/grs_70ec/matrix.c

@@ -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;
 

+ 0 - 8
keyboards/work_louder/micro/matrix.c

@@ -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 {