Commit Graph
9 Commits
Author SHA1 Message Date
Simon ArlottandGitHub 1e389c7904 rgblight: Fix rgblight_blink_layer when multiple layers are active (#16824) 2022-04-21 09:33:29 -07:00
Simon ArlottandGitHub 5841c755ae rgblight: Add functions to stop blinking one or all but one layer (#16859) 2022-04-17 00:02:32 +02:00
Simon ArlottandGitHub 1cfe49714f rgblight: Limit max repeat times in rgblight_blink_layer_repeat (#16860) 2022-04-16 10:40:48 -07:00
Simon ArlottandGitHub 84c9d6ff39 [Bug] Fix matrix scan reporting interval (#16825) 2022-04-09 11:49:20 -07:00
Simon ArlottandGitHub c93935f243 Durgod: Increase scan rate by using wait_us GPT timer (#14091)
Lower the tick rate from 10kHz to 1kHz (otherwise all the extra interrupts
reduce the achievable scan rate). Enable the WAIT_US_TIMER using GPT TIM3.

Observed scan rate on the K320 is increased from 625Hz to 2090-2120Hz.
2021-12-27 14:04:26 +11:00
0a1bf7f6aa Support using a timer for wait_us() on ChibiOS-based boards (#12211)
* Support using a timer for wait_us() on ChibiOS-based boards (#12198)

There are spare GPT timers that can be used to get a more accurate
wait_ms() time. This is required for the matrix scan unselect delay (30µs)
to be shorter than the system tick rate of 100µs.

This is limited to the maximum GPT duration of 65535 so values above that
will automatically use the previous implementation based on the system
tick.

Using a specific timer means it can't be shared by another thread at the
same time so when wait_us() is called from anything other than the main
thread it will use the system tick implementation too.

* Update tmk_core/common/chibios/wait.c

* Update tmk_core/common/chibios/wait.c

Co-authored-by: Joel Challis <git@zvecr.com>
2021-08-20 00:31:23 +01:00
Simon ArlottandGitHub a0959f1b33 Add asym_eager_defer_pk debounce type (#12689) 2021-06-16 14:00:37 +10:00
Simon ArlottandGitHub 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
Simon ArlottandGitHub e941ae3811 [Keyboard] Add YMDK NP24 (ATmega32U4 with 6 RGB LEDs) (#12120) 2021-03-16 18:39:09 -07:00