summaryrefslogtreecommitdiff
path: root/quantum/debounce/sym_g.c
diff options
context:
space:
mode:
authorskullY <skullydazed@gmail.com>2019-08-30 11:19:03 -0700
committerskullydazed <skullydazed@users.noreply.github.com>2019-08-30 15:01:52 -0700
commitb624f32f944acdc59dcb130674c09090c5c404cb (patch)
treebc13adbba137d122d9a2c2fb2fafcbb08ac10e25 /quantum/debounce/sym_g.c
parent61af76a10d00aba185b8338604171de490a13e3b (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; }