summaryrefslogtreecommitdiff
path: root/quantum
diff options
context:
space:
mode:
authorJoshua T <joshua@sonofone.net>2016-07-30 08:41:22 -0500
committerJoshua T <joshua@sonofone.net>2016-07-30 08:41:22 -0500
commite9a501d4477981da878294a630431ed76716c57e (patch)
tree5c6c6a381e21f3d8f2bba223438d7528da717962 /quantum
parent5607b716ba0ec7002f29244f24aa8999b9511061 (diff)
parent7775f3e4b3309f3102bf9d887a79514a67d18da6 (diff)
Merge remote-tracking branch 'upstream/master'
Diffstat (limited to 'quantum')
-rw-r--r--quantum/process_keycode/process_tap_dance.c15
-rw-r--r--quantum/process_keycode/process_tap_dance.h1
-rw-r--r--quantum/quantum.h1
3 files changed, 17 insertions, 0 deletions
diff --git a/quantum/process_keycode/process_tap_dance.c b/quantum/process_keycode/process_tap_dance.c
index d240dc2e66..5429e34383 100644
--- a/quantum/process_keycode/process_tap_dance.c
+++ b/quantum/process_keycode/process_tap_dance.c
@@ -1,6 +1,18 @@
#include "quantum.h"
static qk_tap_dance_state_t qk_tap_dance_state;
+bool td_debug_enable = false;
+
+#if CONSOLE_ENABLE
+#define td_debug(s) if (td_debug_enable) \
+ { \
+ xprintf ("D:tap_dance:%s:%s = { keycode = %d, count = %d, active = %d, pressed = %d }\n", __FUNCTION__, s, \
+ qk_tap_dance_state.keycode, qk_tap_dance_state.count, \
+ qk_tap_dance_state.active, qk_tap_dance_state.pressed); \
+ }
+#else
+#define td_debug(s)
+#endif
void qk_tap_dance_pair_finished (qk_tap_dance_state_t *state, void *user_data) {
qk_tap_dance_pair_t *pair = (qk_tap_dance_pair_t *)user_data;
@@ -33,16 +45,19 @@ static inline void _process_tap_dance_action_fn (qk_tap_dance_state_t *state,
static inline void process_tap_dance_action_on_each_tap (qk_tap_dance_action_t action)
{
+ td_debug("trigger");
_process_tap_dance_action_fn (&qk_tap_dance_state, action.user_data, action.fn.on_each_tap);
}
static inline void process_tap_dance_action_on_dance_finished (qk_tap_dance_action_t action)
{
+ td_debug("trigger");
_process_tap_dance_action_fn (&qk_tap_dance_state, action.user_data, action.fn.on_dance_finished);
}
static inline void process_tap_dance_action_on_reset (qk_tap_dance_action_t action)
{
+ td_debug("trigger")
_process_tap_dance_action_fn (&qk_tap_dance_state, action.user_data, action.fn.on_reset);
}
diff --git a/quantum/process_keycode/process_tap_dance.h b/quantum/process_keycode/process_tap_dance.h
index e2c74efe91..6a1258067e 100644
--- a/quantum/process_keycode/process_tap_dance.h
+++ b/quantum/process_keycode/process_tap_dance.h
@@ -49,6 +49,7 @@ typedef struct
}
extern const qk_tap_dance_action_t tap_dance_actions[];
+extern bool td_debug_enable;
/* To be used internally */
diff --git a/quantum/quantum.h b/quantum/quantum.h
index 7ebfb24e30..6e3fbcc792 100644
--- a/quantum/quantum.h
+++ b/quantum/quantum.h
@@ -25,6 +25,7 @@
#include "led.h"
#include "action_util.h"
#include <stdlib.h>
+#include "print.h"
extern uint32_t default_layer_state;