]> git.donarmstrong.com Git - qmk_firmware.git/blobdiff - quantum/debounce/debounce_sym_g.c
Add SysRq, Break combos and other keys to Melody96 keymap
[qmk_firmware.git] / quantum / debounce / debounce_sym_g.c
index c206f28647a0572da169fea515058492af22f341..c8ab34e1a0cafd2a4969d1887aa308134c6ab7dd 100644 (file)
@@ -16,20 +16,19 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.
 Basic global debounce algorithm. Used in 99% of keyboards at time of implementation
 When no state changes have occured for DEBOUNCE milliseconds, we push the state.
 */
-#include "debounce.h"
 #include "matrix.h"
 #include "timer.h"
+#include "quantum.h"
 #ifndef DEBOUNCE
   #define DEBOUNCE 5
 #endif
 
+void debounce_init(uint8_t num_rows) {}
 static bool debouncing = false;
-static uint16_t debouncing_time;
-
-void debounce_init(void) {}
 
 #if DEBOUNCE > 0
-void debounce(matrix_row_t raw[], matrix_row_t cooked[], bool changed)
+static uint16_t debouncing_time;
+void debounce(matrix_row_t raw[], matrix_row_t cooked[], uint8_t num_rows, bool changed)
 {
   if (changed) {
     debouncing = true;
@@ -37,22 +36,22 @@ void debounce(matrix_row_t raw[], matrix_row_t cooked[], bool changed)
   }
 
   if (debouncing && timer_elapsed(debouncing_time) > DEBOUNCE) {
-    for (int i = 0; i < MATRIX_ROWS; i++) {
+    for (int i = 0; i < num_rows; i++) {
       cooked[i] = raw[i];
     }
     debouncing = false;
   }
 }
 #else //no debouncing.
-void debounce(matrix_row_t raw[], matrix_row_t cooked[], bool changed)
+void debounce(matrix_row_t raw[], matrix_row_t cooked[], uint8_t num_rows, bool changed)
 {
-  for (int i = 0; i < MATRIX_ROWS; i++) {
+  for (int i = 0; i < num_rows; i++) {
     cooked[i] = raw[i];
   }
 }
 #endif
 
-bool debounce_active() {
+bool debounce_active(void) {
   return debouncing;
 }