summaryrefslogtreecommitdiff
path: root/quantum/debounce/sym_g.c
diff options
context:
space:
mode:
authorskullY <skullydazed@gmail.com>2019-08-30 11:19:03 -0700
committerFlorian Didron <fdidron@users.noreply.github.com>2019-09-17 11:39:43 +0900
commitf8fe33acfac01064112fd2b5da680abfb5190b97 (patch)
treefcf75ef930800a948e5a3ba015d6759889f2284d /quantum/debounce/sym_g.c
parentc339d670684674165b422a0168bfd2016ff2e6ef (diff)
clang-format changes
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; }