Skip to content

Commit

Permalink
Remove matrix_key_count() (#16603)
Browse files Browse the repository at this point in the history
* Remove `matrix_key_count()`

* Remove `matrix_bitpop()`
  • Loading branch information
fauxpark authored Mar 10, 2022
1 parent dc8db65 commit bd70f52
Show file tree
Hide file tree
Showing 51 changed files with 4 additions and 527 deletions.
9 changes: 0 additions & 9 deletions keyboards/40percentclub/ut47/matrix.c
Original file line number Diff line number Diff line change
Expand Up @@ -118,15 +118,6 @@ void matrix_print(void)
}
}

uint8_t matrix_key_count(void)
{
uint8_t count = 0;
for (uint8_t i = 0; i < MATRIX_ROWS; i++) {
count += bitpop16(matrix[i]);
}
return count;
}

/* Column pin configuration
* col: 0 1 2 3 4 5 6 7 8 9 10 11
* pin: D7 E6 B4 B5 B6 B2 B3 B1 F7 F6 F5 F4
Expand Down
9 changes: 0 additions & 9 deletions keyboards/amj96/matrix.c
Original file line number Diff line number Diff line change
Expand Up @@ -130,15 +130,6 @@ void matrix_print(void)
}
}

uint8_t matrix_key_count(void)
{
uint8_t count = 0;
for (uint8_t i = 0; i < MATRIX_ROWS; i++) {
count += bitpop16(matrix[i]);
}
return count;
}

/* Column pin configuration
* col: 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
* pin: F7 F6 F5 F4 F1 F0 E6 D7 D6 D5 D1 D0 B7 B6 B0 C7
Expand Down
12 changes: 0 additions & 12 deletions keyboards/bpiphany/hid_liber/matrix.c
Original file line number Diff line number Diff line change
Expand Up @@ -245,15 +245,3 @@ void matrix_print(void)
print("\n");
}
}

uint8_t matrix_key_count(void)
{
uint8_t count = 0;
for (uint8_t i = 0; i < MATRIX_ROWS; i++) {
for (uint8_t j = 0; j < MATRIX_COLS; j++) {
if (matrix_is_on(i, j))
count++;
}
}
return count;
}
8 changes: 0 additions & 8 deletions keyboards/bpiphany/kitten_paw/matrix.c
Original file line number Diff line number Diff line change
Expand Up @@ -132,14 +132,6 @@ void matrix_print(void) {
}
}

uint8_t matrix_key_count(void) {
uint8_t count = 0;
for (uint8_t i = 0; i < MATRIX_ROWS; i++) {
count += bitpop32(matrix[i]);
}
return count;
}

static uint8_t read_rows(void) {
return
(PINC&(1<<7) ? 0 : (1<<0)) |
Expand Down
9 changes: 0 additions & 9 deletions keyboards/bpiphany/pegasushoof/2013/matrix.c
Original file line number Diff line number Diff line change
Expand Up @@ -132,15 +132,6 @@ void matrix_print(void)
}
}

uint8_t matrix_key_count(void)
{
uint8_t count = 0;
for (uint8_t i = 0; i < MATRIX_ROWS; i++) {
count += bitpop16(matrix[i]);
}
return count;
}

static matrix_row_t read_cols(void)
{
return
Expand Down
9 changes: 0 additions & 9 deletions keyboards/bpiphany/pegasushoof/2015/matrix.c
Original file line number Diff line number Diff line change
Expand Up @@ -111,15 +111,6 @@ void matrix_print(void)
}
}

uint8_t matrix_key_count(void)
{
uint8_t count = 0;
for (uint8_t i = 0; i < matrix_rows(); i++) {
count += bitpop16(matrix_get_row(i));
}
return count;
}

static matrix_row_t read_cols(void)
{
return
Expand Down
7 changes: 0 additions & 7 deletions keyboards/bpiphany/tiger_lily/matrix.c
Original file line number Diff line number Diff line change
Expand Up @@ -146,10 +146,3 @@ void matrix_print(void) {
}
#endif
}

uint8_t matrix_key_count(void) {
uint8_t count = 0;
for (uint8_t row = 0; row < MATRIX_ROWS; row++)
count += bitpop32(matrix[row]);
return count;
}
7 changes: 0 additions & 7 deletions keyboards/bpiphany/unloved_bastard/matrix.c
Original file line number Diff line number Diff line change
Expand Up @@ -147,10 +147,3 @@ void matrix_print(void) {
}
#endif
}

uint8_t matrix_key_count(void) {
uint8_t count = 0;
for (uint8_t row = 0; row < MATRIX_ROWS; row++)
count += bitpop32(matrix[row]);
return count;
}
1 change: 0 additions & 1 deletion keyboards/converter/ibm_terminal/matrix.c
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.

#define print_matrix_row(row) print_bin_reverse8(matrix_get_row(row))
#define print_matrix_header() print("\nr/c 01234567\n")
#define matrix_bitpop(i) bitpop(matrix[i])
#define ROW_SHIFTER ((uint8_t)1)


Expand Down
9 changes: 0 additions & 9 deletions keyboards/converter/palm_usb/matrix.c
Original file line number Diff line number Diff line change
Expand Up @@ -379,12 +379,3 @@ void matrix_print(void)
print("\n");
}
}

uint8_t matrix_key_count(void)
{
uint8_t count = 0;
for (uint8_t i = 0; i < MATRIX_ROWS; i++) {
count += bitpop(matrix[i]);
}
return count;
}
9 changes: 0 additions & 9 deletions keyboards/converter/sun_usb/matrix.c
Original file line number Diff line number Diff line change
Expand Up @@ -179,12 +179,3 @@ void matrix_print(void)
print("\n");
}
}

uint8_t matrix_key_count(void)
{
uint8_t count = 0;
for (uint8_t i = 0; i < MATRIX_ROWS; i++) {
count += bitpop(matrix[i]);
}
return count;
}
12 changes: 0 additions & 12 deletions keyboards/converter/usb_usb/custom_matrix.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -225,18 +225,6 @@ extern "C"
return row_bits;
}

uint8_t matrix_key_count(void) {
uint8_t count = 0;

count += bitpop(local_keyboard_report.mods);
for (uint8_t i = 0; i < KEYBOARD_REPORT_KEYS; i++) {
if (IS_ANY(local_keyboard_report.keys[i])) {
count++;
}
}
return count;
}

void matrix_print(void) {
print("\nr/c 0123456789ABCDEF\n");
for (uint8_t row = 0; row < matrix_rows(); row++) {
Expand Down
16 changes: 1 addition & 15 deletions keyboards/dc01/arrow/matrix.c
Original file line number Diff line number Diff line change
Expand Up @@ -48,17 +48,14 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#if (MATRIX_COLS <= 8)
# define print_matrix_header() print("\nr/c 01234567\n")
# define print_matrix_row(row) print_bin_reverse8(matrix_get_row(row))
# define matrix_bitpop(i) bitpop(matrix[i])
# define ROW_SHIFTER ((uint8_t)1)
#elif (MATRIX_COLS <= 16)
# define print_matrix_header() print("\nr/c 0123456789ABCDEF\n")
# define print_matrix_row(row) print_bin_reverse16(matrix_get_row(row))
# define matrix_bitpop(i) bitpop16(matrix[i])
# define ROW_SHIFTER ((uint16_t)1)
#elif (MATRIX_COLS <= 32)
# define print_matrix_header() print("\nr/c 0123456789ABCDEF0123456789ABCDEF\n")
# define print_matrix_row(row) print_bin_reverse32(matrix_get_row(row))
# define matrix_bitpop(i) bitpop32(matrix[i])
# define ROW_SHIFTER ((uint32_t)1)
#endif

Expand Down Expand Up @@ -234,17 +231,6 @@ void matrix_print(void)
}
}

uint8_t matrix_key_count(void)
{
uint8_t count = 0;
for (uint8_t i = 0; i < MATRIX_ROWS; i++) {
count += matrix_bitpop(i);
}
return count;
}



#if (DIODE_DIRECTION == COL2ROW)

static void init_cols(void)
Expand Down Expand Up @@ -388,4 +374,4 @@ static void unselect_cols(void)
void matrix_setup(void){
i2c_slave_init(SLAVE_I2C_ADDRESS); //setup address of slave i2c
sei(); //enable interupts
}
}
14 changes: 0 additions & 14 deletions keyboards/dc01/left/matrix.c
Original file line number Diff line number Diff line change
Expand Up @@ -52,17 +52,14 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#if (MATRIX_COLS <= 8)
# define print_matrix_header() print("\nr/c 01234567\n")
# define print_matrix_row(row) print_bin_reverse8(matrix_get_row(row))
# define matrix_bitpop(i) bitpop(matrix[i])
# define ROW_SHIFTER ((uint8_t)1)
#elif (MATRIX_COLS <= 16)
# define print_matrix_header() print("\nr/c 0123456789ABCDEF\n")
# define print_matrix_row(row) print_bin_reverse16(matrix_get_row(row))
# define matrix_bitpop(i) bitpop16(matrix[i])
# define ROW_SHIFTER ((uint16_t)1)
#elif (MATRIX_COLS <= 32)
# define print_matrix_header() print("\nr/c 0123456789ABCDEF0123456789ABCDEF\n")
# define print_matrix_row(row) print_bin_reverse32(matrix_get_row(row))
# define matrix_bitpop(i) bitpop32(matrix[i])
# define ROW_SHIFTER ((uint32_t)1)
#endif

Expand Down Expand Up @@ -259,17 +256,6 @@ void matrix_print(void)
}
}

uint8_t matrix_key_count(void)
{
uint8_t count = 0;
for (uint8_t i = 0; i < MATRIX_ROWS; i++) {
count += matrix_bitpop(i);
}
return count;
}



#if (DIODE_DIRECTION == COL2ROW)

static void init_cols(void)
Expand Down
16 changes: 1 addition & 15 deletions keyboards/dc01/numpad/matrix.c
Original file line number Diff line number Diff line change
Expand Up @@ -48,17 +48,14 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#if (MATRIX_COLS <= 8)
# define print_matrix_header() print("\nr/c 01234567\n")
# define print_matrix_row(row) print_bin_reverse8(matrix_get_row(row))
# define matrix_bitpop(i) bitpop(matrix[i])
# define ROW_SHIFTER ((uint8_t)1)
#elif (MATRIX_COLS <= 16)
# define print_matrix_header() print("\nr/c 0123456789ABCDEF\n")
# define print_matrix_row(row) print_bin_reverse16(matrix_get_row(row))
# define matrix_bitpop(i) bitpop16(matrix[i])
# define ROW_SHIFTER ((uint16_t)1)
#elif (MATRIX_COLS <= 32)
# define print_matrix_header() print("\nr/c 0123456789ABCDEF0123456789ABCDEF\n")
# define print_matrix_row(row) print_bin_reverse32(matrix_get_row(row))
# define matrix_bitpop(i) bitpop32(matrix[i])
# define ROW_SHIFTER ((uint32_t)1)
#endif

Expand Down Expand Up @@ -234,17 +231,6 @@ void matrix_print(void)
}
}

uint8_t matrix_key_count(void)
{
uint8_t count = 0;
for (uint8_t i = 0; i < MATRIX_ROWS; i++) {
count += matrix_bitpop(i);
}
return count;
}



#if (DIODE_DIRECTION == COL2ROW)

static void init_cols(void)
Expand Down Expand Up @@ -388,4 +374,4 @@ static void unselect_cols(void)
void matrix_setup(void){
i2c_slave_init(SLAVE_I2C_ADDRESS); //setup address of slave i2c
sei(); //enable interupts
}
}
16 changes: 1 addition & 15 deletions keyboards/dc01/right/matrix.c
Original file line number Diff line number Diff line change
Expand Up @@ -49,17 +49,14 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#if (MATRIX_COLS <= 8)
# define print_matrix_header() print("\nr/c 01234567\n")
# define print_matrix_row(row) print_bin_reverse8(matrix_get_row(row))
# define matrix_bitpop(i) bitpop(matrix[i])
# define ROW_SHIFTER ((uint8_t)1)
#elif (MATRIX_COLS <= 16)
# define print_matrix_header() print("\nr/c 0123456789ABCDEF\n")
# define print_matrix_row(row) print_bin_reverse16(matrix_get_row(row))
# define matrix_bitpop(i) bitpop16(matrix[i])
# define ROW_SHIFTER ((uint16_t)1)
#elif (MATRIX_COLS <= 32)
# define print_matrix_header() print("\nr/c 0123456789ABCDEF0123456789ABCDEF\n")
# define print_matrix_row(row) print_bin_reverse32(matrix_get_row(row))
# define matrix_bitpop(i) bitpop32(matrix[i])
# define ROW_SHIFTER ((uint32_t)1)
#endif

Expand Down Expand Up @@ -235,17 +232,6 @@ void matrix_print(void)
}
}

uint8_t matrix_key_count(void)
{
uint8_t count = 0;
for (uint8_t i = 0; i < MATRIX_ROWS; i++) {
count += matrix_bitpop(i);
}
return count;
}



#if (DIODE_DIRECTION == COL2ROW)

static void init_cols(void)
Expand Down Expand Up @@ -389,4 +375,4 @@ static void unselect_cols(void)
void matrix_setup(void){
i2c_slave_init(SLAVE_I2C_ADDRESS); //setup address of slave i2c
sei(); //enable interupts
}
}
12 changes: 0 additions & 12 deletions keyboards/dichotomy/matrix.c
Original file line number Diff line number Diff line change
Expand Up @@ -34,17 +34,14 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#if (MATRIX_COLS <= 8)
# define print_matrix_header() print("\nr/c 01234567\n")
# define print_matrix_row(row) print_bin_reverse8(matrix_get_row(row))
# define matrix_bitpop(i) bitpop(matrix[i])
# define ROW_SHIFTER ((uint8_t)1)
#elif (MATRIX_COLS <= 16)
# define print_matrix_header() print("\nr/c 0123456789ABCDEF\n")
# define print_matrix_row(row) print_bin_reverse16(matrix_get_row(row))
# define matrix_bitpop(i) bitpop16(matrix[i])
# define ROW_SHIFTER ((uint16_t)1)
#elif (MATRIX_COLS <= 32)
# define print_matrix_header() print("\nr/c 0123456789ABCDEF0123456789ABCDEF\n")
# define print_matrix_row(row) print_bin_reverse32(matrix_get_row(row))
# define matrix_bitpop(i) bitpop32(matrix[i])
# define ROW_SHIFTER ((uint32_t)1)
#endif

Expand Down Expand Up @@ -215,12 +212,3 @@ void matrix_print(void)
print("\n");
}
}

uint8_t matrix_key_count(void)
{
uint8_t count = 0;
for (uint8_t i = 0; i < MATRIX_ROWS; i++) {
count += matrix_bitpop(i);
}
return count;
}
11 changes: 1 addition & 10 deletions keyboards/duck/jetfire/matrix.c
Original file line number Diff line number Diff line change
Expand Up @@ -136,15 +136,6 @@ void matrix_print(void)
}
}

uint8_t matrix_key_count(void)
{
uint8_t count = 0;
for (uint8_t i = 0; i < MATRIX_ROWS; i++) {
count += bitpop32(matrix[i]);
}
return count;
}

static void init_ports(void)
{
// Rows are inputs (inputs are 0)
Expand Down Expand Up @@ -268,4 +259,4 @@ static void select_col(uint8_t col)
PORTB |= 0b00000001;
break;
}
}
}
Loading

0 comments on commit bd70f52

Please sign in to comment.