* Use less tap dance memory.
Use dynamically allocated sparse array for tap dance state, dynamically allocate tap dance state when needed and free it when the tap dance is done.
* new approach
* Use null, check for null
* Reformat with docker
* Use uint8 with idx rather than uint16 with keycode in state
* fix accidental change
* reformat
* Add null check
* add documentation tip suggested by tzarc
* Only allow tap dance state allocation on key down, not on key up
Co-authored-by: Sergey Vlasov <sigprof@gmail.com>
* Only allow tap dance allocation on key down, not on key up
Co-authored-by: Sergey Vlasov <sigprof@gmail.com>
* add user action required section
---------
Co-authored-by: Sergey Vlasov <sigprof@gmail.com>
* suspend: suppress wake up keypress
Waking the host from suspend is done by pressing any key on the
keyboard, the regular key codes assigned to the keys are not important
and must not be sent - otherwise they usually end up in password prompts
as ghost characters that have to be deleted again. This commit adds
suppression for all keys pressed at the time of wake up. Once a key is
released it functions as a regular key again.
Signed-off-by: Stefan Kerkmann <karlk90@pm.me>
* suspend: update wake up matrix after wake up delay
If USB_SUSPEND_WAKEUP_DELAY is set, the keyboard sleeps during wake up -
which can be up to multiple seconds. To handle key presses and releases
in that time frame we have to handle the following cases:
1. Key not pressed before suspend, and not pressed after wakeup → do
nothing (normal case).
2. Key not pressed before suspend, but pressed after wakeup → set the
wakeup_matrix bit to 1 (so that the press and release events would be
suppressed).
3. Key pressed before suspend, but not pressed after wakeup → do nothing
(the release event will be generated on the first matrix_task() call
after the wakeup).
4. Key pressed before suspend, and still pressed after wakeup → do
nothing (the release event will be generated some time later).
Signed-off-by: Stefan Kerkmann <karlk90@pm.me>
Co-authored-by: Sergey Vlasov <sigprof@gmail.com>
* keyboards: anavi: macropad8: disable snake and rgb_test effects
...to shrink the binary size.
* Only perform key and mod remapping in keycode_config() and mod_config() when MAGIC_ENABLE is defined.
* If not set, these functions now return the original keycode or modifier unchanged.
* Reduces firmware size, and unnecessary code when MAGIC_ENABLE is not enabled.
* Removed space saving suggestion with magic functions from squeezing AVR documentation
* Refactor debounce counters with direct indexing
* Refactor code to use array indexing for debounce_counters
* Use global MATRIX_ROW_SHIFTER macro
* Refactor debounce algorithm with static allocation
* Converted arrays to static allocation
* Standardised use of MATRIX_ROWS_PER_HAND for array sizing
* Added Doxygen comments for primary debounce functions
* Removed debounce_free()
* Rewrite sym_defer_pr
* Modernise code using sym_defer_pk as template
* Format consistency with other current algorithms
* Use shorter SPDX-License-Identifier
* Remove ChibiOS core memory manager guard
* Keep type definition within DEBOUNCE guard
* Add change log
* Minor optimisation refactor
* Pre-calculate row_offset in per-key matrix loops
* Add inline compiler hints
* Improve readability with blank lines
* Limit elapsed time to the maximum debounce value
* Apply suggestions from code review
Declare counters with "DEBOUNCE_ELAPSED"
Co-authored-by: Joel Challis <git@zvecr.com>
* Update change log to new breaking change date
---------
Co-authored-by: Joel Challis <git@zvecr.com>