qmk_firmware/tmk_core/common
Simon Arlott b829a1d264
Avoid 8-bit timer overflows in debounce algorithms (#12240)
* Add fast_timer_t that is 16-bit or 32-bit based on architecture

A 16-bit timer will overflow sooner but be faster to compare on AVR.

* Avoid 8-bit timer overflows in debounce algorithms

Count down remaining elapsed time instead of trying to do 8-bit timer
comparisons.

Add a "none" implementation that is automatically used if DEBOUNCE is
0 otherwise it will break the _pk/_pr count down.

* Avoid unnecessary polling of the entire matrix in sym_eager_pk

The matrix only needs to be updated when a debounce timer expires.

* Avoid unnecessary polling of the entire matrix in sym_eager_pr

The matrix only needs to be updated when a debounce timer expires.

The use of the "needed_update" variable is trying to do what
"matrix_need_update" was added to fix but didn't work because it only
applied when all keys finished debouncing.

* Fix sym_defer_g timing inconsistency compared to other debounce algorithms

DEBOUNCE=5 should process the key after 5ms, not 6ms

* Add debounce tests
2021-06-09 17:23:21 +10:00
..
arm_atsam Avoid 8-bit timer overflows in debounce algorithms (#12240) 2021-06-09 17:23:21 +10:00
avr Avoid 8-bit timer overflows in debounce algorithms (#12240) 2021-06-09 17:23:21 +10:00
chibios Avoid 8-bit timer overflows in debounce algorithms (#12240) 2021-06-09 17:23:21 +10:00
test Move gpio wait logic to wait.h (#12067) 2021-03-10 22:47:36 +00:00
action.c run: qmk cformat --core-only 2021-05-29 13:53:10 -07:00
action.h run: qmk cformat --core-only 2021-05-29 13:53:10 -07:00
action_code.h Change include guards in tmk_core/ and drivers/ to pragma once (#11240) 2020-12-26 15:56:11 +11:00
action_layer.c Optimization for scanning less layers. (#8311) 2020-05-11 01:04:38 +01:00
action_layer.h Change include guards in tmk_core/ and drivers/ to pragma once (#11240) 2020-12-26 15:56:11 +11:00
action_macro.c clang-format changes 2019-08-30 15:01:52 -07:00
action_macro.h Change include guards in tmk_core/ and drivers/ to pragma once (#11240) 2020-12-26 15:56:11 +11:00
action_tapping.c Format code according to conventions (#12380) 2021-03-25 23:18:59 +11:00
action_tapping.h manually run formatting job (#11503) 2021-01-10 22:15:29 +00:00
action_util.c Add ability to toggle One Shot functionality (#4198) 2021-03-01 08:57:02 -08:00
action_util.h Add ability to toggle One Shot functionality (#4198) 2021-03-01 08:57:02 -08:00
atomic_util.h Split gpio and atomic to platform (#11792) 2021-02-14 11:51:06 +11:00
bootloader.h Change include guards in tmk_core/ and drivers/ to pragma once (#11240) 2020-12-26 15:56:11 +11:00
debug.c Refactor platform logic within print.h (#11863) 2021-02-14 01:44:22 +00:00
debug.h Change include guards in tmk_core/ and drivers/ to pragma once (#11240) 2020-12-26 15:56:11 +11:00
eeconfig.c Backlight: add defines for default level and breathing state (#12560) 2021-05-26 22:21:15 -07:00
eeconfig.h Backlight: add defines for default level and breathing state (#12560) 2021-05-26 22:21:15 -07:00
eeprom.h Change include guards in tmk_core/ and drivers/ to pragma once (#11240) 2020-12-26 15:56:11 +11:00
gpio.h Split gpio and atomic to platform (#11792) 2021-02-14 11:51:06 +11:00
host.c Run clang-format manually to fix recently changed files 2019-11-17 08:25:58 -08:00
host.h New and improved lock LED callbacks (#7215) 2019-11-06 00:42:16 +00:00
host_driver.h Change include guards in tmk_core/ and drivers/ to pragma once (#11240) 2020-12-26 15:56:11 +11:00
keyboard.c Fixup housekeeping from being invoked twice per loop. (#12933) 2021-05-18 17:02:28 +10:00
keyboard.h run: qmk cformat --core-only 2021-05-29 13:53:10 -07:00
keycode.h Format code according to conventions (#12244) 2021-03-15 12:21:14 +11:00
lib_printf.mk Refactor platform logic within print.h (#11863) 2021-02-14 01:44:22 +00:00
nodebug.h Change include guards in tmk_core/ and drivers/ to pragma once (#11240) 2020-12-26 15:56:11 +11:00
pin_defs.h Split gpio and atomic to platform (#11792) 2021-02-14 11:51:06 +11:00
print.h Refactor platform logic within print.h (#11863) 2021-02-14 01:44:22 +00:00
printf.c Refactor platform logic within print.h (#11863) 2021-02-14 01:44:22 +00:00
progmem.h Refactor platform logic within print.h (#11863) 2021-02-14 01:44:22 +00:00
raw_hid.h Change include guards in tmk_core/ and drivers/ to pragma once (#11240) 2020-12-26 15:56:11 +11:00
report.c format code according to conventions [skip ci] 2020-03-13 18:44:56 +00:00
report.h Add a handful of consumer/gendesk page usages (#12811) 2021-05-06 17:16:07 +01:00
sendchar.h Refactor platform logic within print.h (#11863) 2021-02-14 01:44:22 +00:00
sendchar_null.c Initial vusb console support (#8559) 2020-05-03 01:25:39 +01:00
sendchar_uart.c clang-format changes 2019-08-30 15:01:52 -07:00
sleep_led.h Change include guards in tmk_core/ and drivers/ to pragma once (#11240) 2020-12-26 15:56:11 +11:00
suspend.h Set default for USB_SUSPEND_WAKEUP_DELAY to 0/disabled (#12081) 2021-03-02 14:31:23 +00:00
sync_timer.c [Split] Sync Timer feature (#10997) 2020-12-01 10:04:42 -08:00
sync_timer.h [Split] Sync Timer feature (#10997) 2020-12-01 10:04:42 -08:00
timer.h Avoid 8-bit timer overflows in debounce algorithms (#12240) 2021-06-09 17:23:21 +10:00
usb_util.c Refactor of USB code within split_common (#11890) 2021-02-28 15:52:58 +00:00
usb_util.h Refactor of USB code within split_common (#11890) 2021-02-28 15:52:58 +00:00
virtser.h Change include guards in tmk_core/ and drivers/ to pragma once (#11240) 2020-12-26 15:56:11 +11:00
wait.h Move gpio wait logic to wait.h (#12067) 2021-03-10 22:47:36 +00:00