[Core] Remove matrix_is_modified() and debounce_is_active() (#15349)

This commit is contained in:
Stefan Kerkmann 2021-11-29 17:22:10 +01:00 committed by GitHub
parent a3e9b347ec
commit c1297ceb97
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
52 changed files with 0 additions and 298 deletions

View file

@ -104,12 +104,6 @@ uint8_t matrix_scan(void)
return 1; return 1;
} }
bool matrix_is_modified(void)
{
if (debouncing) return false;
return true;
}
inline inline
bool matrix_is_on(uint8_t row, uint8_t col) bool matrix_is_on(uint8_t row, uint8_t col)
{ {

View file

@ -83,11 +83,6 @@ inline uint8_t matrix_rows(void) { return MATRIX_ROWS; }
inline uint8_t matrix_cols(void) { return MATRIX_COLS; } inline uint8_t matrix_cols(void) { return MATRIX_COLS; }
bool matrix_is_modified(void) {
if (debounce_active()) return false;
return true;
}
inline bool matrix_is_on(uint8_t row, uint8_t col) { return (matrix[row] & ((matrix_row_t)1 << col)); } inline bool matrix_is_on(uint8_t row, uint8_t col) { return (matrix[row] & ((matrix_row_t)1 << col)); }
inline matrix_row_t matrix_get_row(uint8_t row) { return matrix[row]; } inline matrix_row_t matrix_get_row(uint8_t row) { return matrix[row]; }

View file

@ -108,12 +108,6 @@ uint8_t matrix_scan(void)
return 1; return 1;
} }
bool matrix_is_modified(void)
{
if (debouncing) return false;
return true;
}
inline inline
bool matrix_is_on(uint8_t row, uint8_t col) bool matrix_is_on(uint8_t row, uint8_t col)
{ {

View file

@ -90,13 +90,6 @@ uint8_t matrix_cols(void) {
return MATRIX_COLS; return MATRIX_COLS;
} }
//Deprecated.
bool matrix_is_modified(void)
{
if (debounce_active()) return false;
return true;
}
inline inline
bool matrix_is_on(uint8_t row, uint8_t col) bool matrix_is_on(uint8_t row, uint8_t col)
{ {

View file

@ -90,13 +90,6 @@ uint8_t matrix_cols(void) {
return MATRIX_COLS; return MATRIX_COLS;
} }
//Deprecated.
bool matrix_is_modified(void)
{
if (debounce_active()) return false;
return true;
}
inline inline
bool matrix_is_on(uint8_t row, uint8_t col) bool matrix_is_on(uint8_t row, uint8_t col)
{ {

View file

@ -117,13 +117,6 @@ uint8_t matrix_scan(void) {
return 1; return 1;
} }
bool matrix_is_modified(void) {
if (debouncing)
return false;
else
return true;
}
inline bool matrix_is_on(uint8_t row, uint8_t col) { inline bool matrix_is_on(uint8_t row, uint8_t col) {
return (matrix[row] & ((matrix_row_t)1<<col)); return (matrix[row] & ((matrix_row_t)1<<col));
} }

View file

@ -110,13 +110,6 @@ uint8_t matrix_scan(void)
return 1; return 1;
} }
bool matrix_is_modified(void)
{
if (debouncing)
return false;
return true;
}
inline inline
bool matrix_is_on(uint8_t row, uint8_t col) bool matrix_is_on(uint8_t row, uint8_t col)
{ {

View file

@ -58,8 +58,6 @@ static uint16_t disconnect_counter = 0;
#define COL(code) ((code & COL_MASK) ) #define COL(code) ((code & COL_MASK) )
#define KEYUP(code) ((code & KEY_MASK) >>7 ) #define KEYUP(code) ((code & KEY_MASK) >>7 )
static bool is_modified = false;
__attribute__ ((weak)) __attribute__ ((weak))
void matrix_init_kb(void) { void matrix_init_kb(void) {
matrix_init_user(); matrix_init_user();
@ -354,11 +352,6 @@ uint8_t matrix_scan(void)
return code; return code;
} }
bool matrix_is_modified(void)
{
return is_modified;
}
inline inline
bool matrix_has_ghost(void) bool matrix_has_ghost(void)
{ {

View file

@ -38,8 +38,6 @@ static uint8_t matrix[MATRIX_ROWS];
#define ROW(code) ((code>>3)&0xF) #define ROW(code) ((code>>3)&0xF)
#define COL(code) (code&0x07) #define COL(code) (code&0x07)
static bool is_modified = false;
__attribute__ ((weak)) __attribute__ ((weak))
void matrix_init_kb(void) { void matrix_init_kb(void) {
matrix_init_user(); matrix_init_user();
@ -154,11 +152,6 @@ uint8_t matrix_scan(void)
return code; return code;
} }
bool matrix_is_modified(void)
{
return is_modified;
}
inline inline
bool matrix_has_ghost(void) bool matrix_has_ghost(void)
{ {

View file

@ -192,10 +192,6 @@ extern "C"
return 1; return 1;
} }
bool matrix_is_modified(void) {
return matrix_is_mod;
}
bool matrix_is_on(uint8_t row, uint8_t col) { bool matrix_is_on(uint8_t row, uint8_t col) {
uint8_t code = CODE(row, col); uint8_t code = CODE(row, col);

View file

@ -205,14 +205,6 @@ uint8_t matrix_scan(void)
return 1; return 1;
} }
bool matrix_is_modified(void)
{
#if (DEBOUNCE > 0)
if (debouncing) return false;
#endif
return true;
}
inline inline
bool matrix_is_on(uint8_t row, uint8_t col) bool matrix_is_on(uint8_t row, uint8_t col)
{ {

View file

@ -230,14 +230,6 @@ if (i2c_transaction(SLAVE_I2C_ADDRESS_NUMPAD, 0x1FFFF, 11)) {
return 1; return 1;
} }
bool matrix_is_modified(void)
{
#if (DEBOUNCE > 0)
if (debouncing) return false;
#endif
return true;
}
inline inline
bool matrix_is_on(uint8_t row, uint8_t col) bool matrix_is_on(uint8_t row, uint8_t col)
{ {

View file

@ -205,14 +205,6 @@ uint8_t matrix_scan(void)
return 1; return 1;
} }
bool matrix_is_modified(void)
{
#if (DEBOUNCE > 0)
if (debouncing) return false;
#endif
return true;
}
inline inline
bool matrix_is_on(uint8_t row, uint8_t col) bool matrix_is_on(uint8_t row, uint8_t col)
{ {

View file

@ -206,14 +206,6 @@ uint8_t matrix_scan(void)
return 1; return 1;
} }
bool matrix_is_modified(void)
{
#if (DEBOUNCE > 0)
if (debouncing) return false;
#endif
return true;
}
inline inline
bool matrix_is_on(uint8_t row, uint8_t col) bool matrix_is_on(uint8_t row, uint8_t col)
{ {

View file

@ -223,12 +223,6 @@ void matrix_slave_scan(void) {
} }
} }
bool matrix_is_modified(void)
{
if (debouncing) return false;
return true;
}
inline inline
bool matrix_is_on(uint8_t row, uint8_t col) bool matrix_is_on(uint8_t row, uint8_t col)
{ {

View file

@ -116,12 +116,6 @@ uint8_t matrix_scan(void)
return 1; return 1;
} }
bool matrix_is_modified(void)
{
if (debouncing) return false;
return true;
}
inline inline
bool matrix_is_on(uint8_t row, uint8_t col) bool matrix_is_on(uint8_t row, uint8_t col)
{ {

View file

@ -119,10 +119,6 @@ uint8_t matrix_scan(void) {
return 0; return 0;
} }
bool matrix_is_modified(void) {
return true;
}
inline inline
bool matrix_is_on(uint8_t row, uint8_t col) { bool matrix_is_on(uint8_t row, uint8_t col) {
return (matrix[row] & (1 << col)); return (matrix[row] & (1 << col));

View file

@ -199,11 +199,6 @@ uint8_t matrix_scan(void)
return 1; return 1;
} }
bool matrix_is_modified(void) // deprecated and evidently not called.
{
return true;
}
inline inline
bool matrix_is_on(uint8_t row, uint8_t col) bool matrix_is_on(uint8_t row, uint8_t col)
{ {

View file

@ -152,11 +152,6 @@ uint8_t matrix_scan(void) {
return 1; return 1;
} }
bool matrix_is_modified(void) // deprecated and evidently not called.
{
return true;
}
inline bool matrix_is_on(uint8_t row, uint8_t col) { return (matrix[row] & ((matrix_row_t)1 << col)); } inline bool matrix_is_on(uint8_t row, uint8_t col) { return (matrix[row] & ((matrix_row_t)1 << col)); }
inline matrix_row_t matrix_get_row(uint8_t row) { return matrix[row]; } inline matrix_row_t matrix_get_row(uint8_t row) { return matrix[row]; }

View file

@ -220,11 +220,6 @@ uint8_t matrix_scan(void)
return 1; return 1;
} }
bool matrix_is_modified(void) // deprecated and evidently not called.
{
return true;
}
inline inline
bool matrix_is_on(uint8_t row, uint8_t col) bool matrix_is_on(uint8_t row, uint8_t col)
{ {

View file

@ -273,11 +273,6 @@ uint8_t matrix_scan(void) {
return 1; return 1;
} }
bool matrix_is_modified(void) // deprecated and evidently not called.
{
return true;
}
inline bool matrix_is_on(uint8_t row, uint8_t col) { return (matrix[row] & ((matrix_row_t)1 << col)); } inline bool matrix_is_on(uint8_t row, uint8_t col) { return (matrix[row] & ((matrix_row_t)1 << col)); }
inline matrix_row_t matrix_get_row(uint8_t row) { return matrix[row]; } inline matrix_row_t matrix_get_row(uint8_t row) { return matrix[row]; }

View file

@ -281,14 +281,6 @@ uint8_t matrix_scan(void)
return 1; return 1;
} }
bool matrix_is_modified(void) // deprecated and evidently not called.
{
#if (DEBOUNCE > 0)
if (debouncing) return false;
#endif
return true;
}
inline inline
bool matrix_is_on(uint8_t row, uint8_t col) bool matrix_is_on(uint8_t row, uint8_t col)
{ {

View file

@ -174,12 +174,6 @@ uint8_t matrix_scan(void)
return 1; return 1;
} }
bool matrix_is_modified(void)
{
if (debouncing) return false;
return true;
}
inline inline
bool matrix_is_on(uint8_t row, uint8_t col) bool matrix_is_on(uint8_t row, uint8_t col)
{ {

View file

@ -239,12 +239,6 @@ void matrix_slave_scan(void) {
#endif #endif
} }
bool matrix_is_modified(void)
{
if (debouncing) return false;
return true;
}
inline inline
bool matrix_is_on(uint8_t row, uint8_t col) bool matrix_is_on(uint8_t row, uint8_t col)
{ {

View file

@ -148,14 +148,6 @@ uint8_t matrix_scan(void)
return 1; return 1;
} }
bool matrix_is_modified(void)
{
#if (DEBOUNCE > 0)
if (debouncing) return false;
#endif
return true;
}
inline inline
bool matrix_is_on(uint8_t row, uint8_t col) bool matrix_is_on(uint8_t row, uint8_t col)

View file

@ -282,14 +282,6 @@ uint8_t matrix_scan(void)
return 1; return 1;
} }
bool matrix_is_modified(void) // deprecated and evidently not called.
{
#if (DEBOUNCE > 0)
if (debouncing) return false;
#endif
return true;
}
inline inline
bool matrix_is_on(uint8_t row, uint8_t col) bool matrix_is_on(uint8_t row, uint8_t col)
{ {

View file

@ -273,12 +273,6 @@ void matrix_slave_scan(void) {
#endif #endif
} }
bool matrix_is_modified(void)
{
if (debouncing) return false;
return true;
}
inline inline
bool matrix_is_on(uint8_t row, uint8_t col) bool matrix_is_on(uint8_t row, uint8_t col)
{ {

View file

@ -239,12 +239,6 @@ void matrix_slave_scan(void) {
#endif #endif
} }
bool matrix_is_modified(void)
{
if (debouncing) return false;
return true;
}
inline inline
bool matrix_is_on(uint8_t row, uint8_t col) bool matrix_is_on(uint8_t row, uint8_t col)
{ {

View file

@ -287,12 +287,6 @@ void matrix_slave_scan(void) {
#endif #endif
} }
bool matrix_is_modified(void)
{
if (debouncing) return false;
return true;
}
inline inline
bool matrix_is_on(uint8_t row, uint8_t col) bool matrix_is_on(uint8_t row, uint8_t col)
{ {

View file

@ -163,15 +163,6 @@ uint8_t matrix_scan(void)
return 1; return 1;
} }
bool matrix_is_modified(void)
{
for (uint8_t i = 0; i < MATRIX_ROWS; i++) {
if (matrix[i] != matrix_prev[i])
return true;
}
return false;
}
inline inline
bool matrix_has_ghost(void) bool matrix_has_ghost(void)
{ {

View file

@ -164,15 +164,6 @@ uint8_t matrix_scan(void)
return 1; return 1;
} }
bool matrix_is_modified(void)
{
for (uint8_t i = 0; i < MATRIX_ROWS; i++) {
if (matrix[i] != matrix_prev[i])
return true;
}
return false;
}
inline inline
bool matrix_has_ghost(void) bool matrix_has_ghost(void)
{ {

View file

@ -218,12 +218,6 @@ uint8_t matrix_scan(void)
return 1; return 1;
} }
bool matrix_is_modified(void)
{
// NOTE: no longer used
return true;
}
inline inline
bool matrix_has_ghost(void) bool matrix_has_ghost(void)
{ {

View file

@ -136,12 +136,6 @@ uint8_t matrix_scan(void)
return 1; return 1;
} }
bool matrix_is_modified(void)
{
if (debouncing) return false;
return true;
}
inline inline
bool matrix_is_on(uint8_t row, uint8_t col) bool matrix_is_on(uint8_t row, uint8_t col)
{ {

View file

@ -161,12 +161,6 @@ uint8_t matrix_scan(void)
return ret; return ret;
} }
bool matrix_is_modified(void)
{
if (debouncing) return false;
return true;
}
inline inline
bool matrix_is_on(uint8_t row, uint8_t col) bool matrix_is_on(uint8_t row, uint8_t col)
{ {

View file

@ -205,14 +205,6 @@ uint8_t matrix_scan(void)
return 1; return 1;
} }
bool matrix_is_modified(void)
{
#if (DEBOUNCE > 0)
if (debouncing) return false;
#endif
return true;
}
inline inline
bool matrix_is_on(uint8_t row, uint8_t col) bool matrix_is_on(uint8_t row, uint8_t col)
{ {

View file

@ -94,13 +94,6 @@ uint8_t matrix_cols(void) {
return MATRIX_COLS; return MATRIX_COLS;
} }
//Deprecated.
bool matrix_is_modified(void)
{
if (debounce_active()) return false;
return true;
}
inline inline
bool matrix_is_on(uint8_t row, uint8_t col) bool matrix_is_on(uint8_t row, uint8_t col)
{ {

View file

@ -94,13 +94,6 @@ uint8_t matrix_cols(void) {
return MATRIX_COLS; return MATRIX_COLS;
} }
//Deprecated.
bool matrix_is_modified(void)
{
if (debounce_active()) return false;
return true;
}
inline inline
bool matrix_is_on(uint8_t row, uint8_t col) bool matrix_is_on(uint8_t row, uint8_t col)
{ {

View file

@ -94,13 +94,6 @@ uint8_t matrix_cols(void) {
return MATRIX_COLS; return MATRIX_COLS;
} }
//Deprecated.
bool matrix_is_modified(void)
{
if (debounce_active()) return false;
return true;
}
inline inline
bool matrix_is_on(uint8_t row, uint8_t col) bool matrix_is_on(uint8_t row, uint8_t col)
{ {

View file

@ -172,10 +172,6 @@ extern "C"
return 1; return 1;
} }
bool matrix_is_modified(void) {
return matrix_is_mod;
}
bool matrix_is_on(uint8_t row, uint8_t col) { bool matrix_is_on(uint8_t row, uint8_t col) {
uint8_t code = CODE(row, col); uint8_t code = CODE(row, col);

View file

@ -114,11 +114,6 @@ uint8_t matrix_scan(void)
return 1; return 1;
} }
bool matrix_is_modified(void)
{
return true;
}
inline inline
bool matrix_is_on(uint8_t row, uint8_t col) bool matrix_is_on(uint8_t row, uint8_t col)
{ {

View file

@ -172,14 +172,6 @@ uint8_t matrix_scan(void)
return 1; return 1;
} }
bool matrix_is_modified(void)
{
#if (DEBOUNCE > 0)
if (debouncing) return false;
#endif
return true;
}
inline inline
bool matrix_is_on(uint8_t row, uint8_t col) bool matrix_is_on(uint8_t row, uint8_t col)
{ {

View file

@ -90,13 +90,6 @@ uint8_t matrix_cols(void) {
return MATRIX_COLS; return MATRIX_COLS;
} }
//Deprecated.
bool matrix_is_modified(void)
{
if (debounce_active()) return false;
return true;
}
inline inline
bool matrix_is_on(uint8_t row, uint8_t col) bool matrix_is_on(uint8_t row, uint8_t col)
{ {

View file

@ -289,12 +289,6 @@ void matrix_slave_scan(void) {
#endif #endif
} }
bool matrix_is_modified(void)
{
if (debouncing) return false;
return true;
}
inline inline
bool matrix_is_on(uint8_t row, uint8_t col) bool matrix_is_on(uint8_t row, uint8_t col)
{ {

View file

@ -6,8 +6,6 @@
// changed is true if raw has changed since the last call // changed is true if raw has changed since the last call
void debounce(matrix_row_t raw[], matrix_row_t cooked[], uint8_t num_rows, bool changed); void debounce(matrix_row_t raw[], matrix_row_t cooked[], uint8_t num_rows, bool changed);
bool debounce_active(void);
void debounce_init(uint8_t num_rows); void debounce_init(uint8_t num_rows);
void debounce_free(void); void debounce_free(void);

View file

@ -165,7 +165,6 @@ static void transfer_matrix_values(matrix_row_t raw[], matrix_row_t cooked[], ui
} }
} }
bool debounce_active(void) { return true; }
#else #else
# include "none.c" # include "none.c"
#endif #endif

View file

@ -26,6 +26,4 @@ void debounce(matrix_row_t raw[], matrix_row_t cooked[], uint8_t num_rows, bool
} }
} }
bool debounce_active(void) { return false; }
void debounce_free(void) {} void debounce_free(void) {}

View file

@ -44,8 +44,6 @@ void debounce(matrix_row_t raw[], matrix_row_t cooked[], uint8_t num_rows, bool
} }
} }
bool debounce_active(void) { return debouncing; }
void debounce_free(void) {} void debounce_free(void) {}
#else // no debouncing. #else // no debouncing.
# include "none.c" # include "none.c"

View file

@ -134,7 +134,6 @@ static void start_debounce_counters(matrix_row_t raw[], matrix_row_t cooked[], u
} }
} }
bool debounce_active(void) { return true; }
#else #else
# include "none.c" # include "none.c"
#endif #endif

View file

@ -140,7 +140,6 @@ static void transfer_matrix_values(matrix_row_t raw[], matrix_row_t cooked[], ui
} }
} }
bool debounce_active(void) { return true; }
#else #else
# include "none.c" # include "none.c"
#endif #endif

View file

@ -132,7 +132,6 @@ static void transfer_matrix_values(matrix_row_t raw[], matrix_row_t cooked[], ui
} }
} }
bool debounce_active(void) { return true; }
#else #else
# include "none.c" # include "none.c"
#endif #endif

View file

@ -46,8 +46,6 @@ void matrix_setup(void);
void matrix_init(void); void matrix_init(void);
/* scan all key states on matrix */ /* scan all key states on matrix */
uint8_t matrix_scan(void); uint8_t matrix_scan(void);
/* whether modified from previous scan. used after matrix_scan. */
bool matrix_is_modified(void) __attribute__((deprecated));
/* whether a switch is on */ /* whether a switch is on */
bool matrix_is_on(uint8_t row, uint8_t col); bool matrix_is_on(uint8_t row, uint8_t col);
/* matrix state on row */ /* matrix state on row */

View file

@ -45,12 +45,6 @@ inline matrix_row_t matrix_get_row(uint8_t row) {
#endif #endif
} }
// Deprecated.
bool matrix_is_modified(void) {
if (debounce_active()) return false;
return true;
}
#if (MATRIX_COLS <= 8) #if (MATRIX_COLS <= 8)
# define print_matrix_header() print("\nr/c 01234567\n") # define print_matrix_header() print("\nr/c 01234567\n")
# define print_matrix_row(row) print_bin_reverse8(matrix_get_row(row)) # define print_matrix_row(row) print_bin_reverse8(matrix_get_row(row))