summaryrefslogtreecommitdiff
path: root/tmk_core/common/matrix.h
diff options
context:
space:
mode:
Diffstat (limited to 'tmk_core/common/matrix.h')
-rw-r--r--tmk_core/common/matrix.h27
1 files changed, 12 insertions, 15 deletions
diff --git a/tmk_core/common/matrix.h b/tmk_core/common/matrix.h
index e5665bf40a..7624d51376 100644
--- a/tmk_core/common/matrix.h
+++ b/tmk_core/common/matrix.h
@@ -20,29 +20,27 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#include <stdint.h>
#include <stdbool.h>
-
#if (MATRIX_COLS <= 8)
-typedef uint8_t matrix_row_t;
+typedef uint8_t matrix_row_t;
#elif (MATRIX_COLS <= 16)
-typedef uint16_t matrix_row_t;
+typedef uint16_t matrix_row_t;
#elif (MATRIX_COLS <= 32)
-typedef uint32_t matrix_row_t;
+typedef uint32_t matrix_row_t;
#else
-#error "MATRIX_COLS: invalid value"
+# error "MATRIX_COLS: invalid value"
#endif
#if (MATRIX_ROWS <= 8)
-typedef uint8_t matrix_col_t;
+typedef uint8_t matrix_col_t;
#elif (MATRIX_ROWS <= 16)
-typedef uint16_t matrix_col_t;
+typedef uint16_t matrix_col_t;
#elif (MATRIX_ROWS <= 32)
-typedef uint32_t matrix_col_t;
+typedef uint32_t matrix_col_t;
#else
-#error "MATRIX_ROWS: invalid value"
+# error "MATRIX_ROWS: invalid value"
#endif
-#define MATRIX_IS_ON(row, col) (matrix_get_row(row) && (1<<col))
-
+#define MATRIX_IS_ON(row, col) (matrix_get_row(row) && (1 << col))
#ifdef __cplusplus
extern "C" {
@@ -59,7 +57,7 @@ void matrix_init(void);
/* scan all key states on matrix */
uint8_t matrix_scan(void);
/* whether modified from previous scan. used after matrix_scan. */
-bool matrix_is_modified(void) __attribute__ ((deprecated));
+bool matrix_is_modified(void) __attribute__((deprecated));
/* whether a switch is on */
bool matrix_is_on(uint8_t row, uint8_t col);
/* matrix state on row */
@@ -67,7 +65,6 @@ matrix_row_t matrix_get_row(uint8_t row);
/* print matrix for debug */
void matrix_print(void);
-
/* power control */
void matrix_power_up(void);
void matrix_power_down(void);
@@ -83,8 +80,8 @@ void matrix_init_user(void);
void matrix_scan_user(void);
#ifdef I2C_SPLIT
- void slave_matrix_init(void);
- uint8_t slave_matrix_scan(void);
+void slave_matrix_init(void);
+uint8_t slave_matrix_scan(void);
#endif
#ifdef __cplusplus