]> git.donarmstrong.com Git - qmk_firmware.git/blobdiff - keyboards/kmini/matrix.c
Remove more commented out MCUs
[qmk_firmware.git] / keyboards / kmini / matrix.c
index f0733340cef89411faf53b4c3ace759358a3280f..9888f1a76597d3dda67986ded263c037f1e01cb0 100755 (executable)
@@ -27,8 +27,8 @@
 
 
 /* Set 0 if debouncing isn't needed */
-#ifndef DEBOUNCING_DELAY
-#   define DEBOUNCING_DELAY 5
+#ifndef DEBOUNCE
+#   define DEBOUNCE 5
 #endif
 
 #define COL_SHIFTER ((uint32_t)1)
@@ -48,6 +48,22 @@ static bool read_rows_on_col(matrix_row_t current_matrix[], uint8_t current_col)
 static void unselect_cols(void);
 static void select_col(uint8_t col);
 
+__attribute__ ((weak))
+void matrix_init_user(void) {}
+
+__attribute__ ((weak))
+void matrix_scan_user(void) {}
+
+__attribute__ ((weak))
+void matrix_init_kb(void) {
+  matrix_init_user();
+}
+
+__attribute__ ((weak))
+void matrix_scan_kb(void) {
+  matrix_scan_user();
+}
+
 inline
 uint8_t matrix_rows(void) {
     return MATRIX_ROWS;
@@ -82,7 +98,7 @@ uint8_t matrix_scan(void)
         }
     }
 
-    if (debouncing && (timer_elapsed(debouncing_time) > DEBOUNCING_DELAY)) {
+    if (debouncing && (timer_elapsed(debouncing_time) > DEBOUNCE)) {
         for (uint8_t i = 0; i < MATRIX_ROWS; i++) {
             matrix[i] = matrix_debouncing[i];
         }
@@ -96,7 +112,7 @@ uint8_t matrix_scan(void)
 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));
 }
 
 inline
@@ -219,16 +235,16 @@ static void init_rows(void) {
 static void unselect_cols(void) {
     DDRB  |= (1<<5) | (1<<6) | (1<<0) | (1<<7) | (1<<4); // OUT
     PORTB &= ~((1<<5) | (1<<6) | (1<<0) |  (1<<7) | (1<<4)); // LO
-       
+
     DDRD  |= (1<<4) | (1<<6) | (1<<7); // OUT
     PORTD &= ~((1<<4) | (1<<6) | (1<<7)); // LO
-       
+
     DDRE  |= (1<<6); // OUT
     PORTE &= ~((1<<6)); // LO
-       
+
     DDRF  |= (1<<0) | (1<<1); // OUT
     PORTF &= ~((1<<0) | (1<<1)); // LO
-       
+
     DDRC  |= (1<<7) | (1<<6); // OUT
     PORTC &= ~((1<<7) | (1<<6)); // LO
 }