summaryrefslogtreecommitdiff
path: root/quantum/debounce/sym_g.c
diff options
context:
space:
mode:
Diffstat (limited to 'quantum/debounce/sym_g.c')
-rw-r--r--quantum/debounce/sym_g.c41
1 files changed, 18 insertions, 23 deletions
diff --git a/quantum/debounce/sym_g.c b/quantum/debounce/sym_g.c
index c8ab34e1a0..3ed9055d2a 100644
--- a/quantum/debounce/sym_g.c
+++ b/quantum/debounce/sym_g.c
@@ -20,38 +20,33 @@ When no state changes have occured for DEBOUNCE milliseconds, we push the state.
#include "timer.h"
#include "quantum.h"
#ifndef DEBOUNCE
- #define DEBOUNCE 5
+# define DEBOUNCE 5
#endif
-void debounce_init(uint8_t num_rows) {}
+void debounce_init(uint8_t num_rows) {}
static bool debouncing = false;
#if DEBOUNCE > 0
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;
- debouncing_time = timer_read();
- }
+void debounce(matrix_row_t raw[], matrix_row_t cooked[], uint8_t num_rows, bool changed) {
+ if (changed) {
+ debouncing = true;
+ debouncing_time = timer_read();
+ }
- if (debouncing && timer_elapsed(debouncing_time) > DEBOUNCE) {
- for (int i = 0; i < num_rows; i++) {
- cooked[i] = raw[i];
+ if (debouncing && timer_elapsed(debouncing_time) > DEBOUNCE) {
+ for (int i = 0; i < num_rows; i++) {
+ cooked[i] = raw[i];
+ }
+ debouncing = false;
}
- debouncing = false;
- }
}
-#else //no debouncing.
-void debounce(matrix_row_t raw[], matrix_row_t cooked[], uint8_t num_rows, bool changed)
-{
- for (int i = 0; i < num_rows; i++) {
- cooked[i] = raw[i];
- }
+#else // no debouncing.
+void debounce(matrix_row_t raw[], matrix_row_t cooked[], uint8_t num_rows, bool changed) {
+ for (int i = 0; i < num_rows; i++) {
+ cooked[i] = raw[i];
+ }
}
#endif
-bool debounce_active(void) {
- return debouncing;
-}
-
+bool debounce_active(void) { return debouncing; }