From 02d44beb4410b806cb8c38e272941d212fee8a74 Mon Sep 17 00:00:00 2001 From: Drashna Jaelre Date: Fri, 14 Dec 2018 09:01:58 -0800 Subject: Fix up tap_code functionality (#4609) * Add delay in Tap Code to avoid issues I think a few people have reporting issues with it working properly, and it may be a timing issue. The 'register_code' uses this sort of delay in some of the functions, and this is probably why. Adding the 100ms delay should hopefully fix any issues with it. * Make tap_code delay configurable * Update documentation * Bring tap_code16 inline with changes * Fix type for tap_code16 Bad copy-paste job * Just use the value check for the define * Clarify timing in docs Co-Authored-By: drashna * Wordsmithing Co-Authored-By: drashna --- quantum/quantum.c | 8 ++++++++ quantum/quantum.h | 2 +- 2 files changed, 9 insertions(+), 1 deletion(-) (limited to 'quantum') diff --git a/quantum/quantum.c b/quantum/quantum.c index 69692233e..a57d4f89f 100644 --- a/quantum/quantum.c +++ b/quantum/quantum.c @@ -132,6 +132,14 @@ void unregister_code16 (uint16_t code) { } } +void tap_code16(uint16_t code) { + register_code16(code); + #if TAP_CODE_DELAY > 0 + wait_ms(TAP_CODE_DELAY); + #endif + unregister_code16(code); +} + __attribute__ ((weak)) bool process_action_kb(keyrecord_t *record) { return true; diff --git a/quantum/quantum.h b/quantum/quantum.h index 5920e4b13..0faf1af29 100644 --- a/quantum/quantum.h +++ b/quantum/quantum.h @@ -243,7 +243,7 @@ void shutdown_user(void); void register_code16(uint16_t code); void unregister_code16(uint16_t code); -inline void tap_code16(uint16_t code) { register_code16(code); unregister_code16(code); } +void tap_code16(uint16_t code); #ifdef BACKLIGHT_ENABLE void backlight_init_ports(void); -- cgit v1.2.3-24-g4f1b