diff options
Diffstat (limited to 'docs')
| -rw-r--r-- | docs/ChangeLog/20251130/PR25515.md | 3 | ||||
| -rw-r--r-- | docs/ChangeLog/20251130/PR25632.md | 4 | ||||
| -rw-r--r-- | docs/custom_matrix.md | 4 | ||||
| -rw-r--r-- | docs/features/haptic_feedback.md | 2 | ||||
| -rw-r--r-- | docs/features/led_matrix.md | 59 | ||||
| -rw-r--r-- | docs/features/rgb_matrix.md | 59 | ||||
| -rw-r--r-- | docs/isp_flashing_guide.md | 16 | ||||
| -rw-r--r-- | docs/keycodes.md | 4 | ||||
| -rw-r--r-- | docs/quantum_painter.md | 2 | ||||
| -rw-r--r-- | docs/reference_info_json.md | 12 |
10 files changed, 156 insertions, 9 deletions
diff --git a/docs/ChangeLog/20251130/PR25515.md b/docs/ChangeLog/20251130/PR25515.md new file mode 100644 index 0000000000..ccc88e0c64 --- /dev/null +++ b/docs/ChangeLog/20251130/PR25515.md @@ -0,0 +1,3 @@ +# Refactor debounce algorithm with static allocation [#25515](https://github.com/qmk/qmk_firmware/pull/25515) + +Removed dynamic memory allocation (malloc, free) from all debounce implementations for improved efficiency on embedded systems and to avoid runtime allocation overhead. Refactored state arrays to use direct indexing, simplifying code and eliminating pointer arithmetic. Standardized usage of MATRIX_ROWS_PER_HAND throughout the codebase to ensure consistent support for split keyboards. diff --git a/docs/ChangeLog/20251130/PR25632.md b/docs/ChangeLog/20251130/PR25632.md new file mode 100644 index 0000000000..39136067b9 --- /dev/null +++ b/docs/ChangeLog/20251130/PR25632.md @@ -0,0 +1,4 @@ +# Changes Requiring User Action +## Debounce: Deprecate init and remove num_rows parameter [#25632](https://github.com/qmk/qmk_firmware/pull/25632) + +With dynamic memory allocation removed from all debounce implementations ([#25515](https://github.com/qmk/qmk_firmware/pull/25515)), the `num_rows` parameter has been removed from the `debounce_init()` and `debounce()` functions. The `MATRIX_ROWS_PER_HAND` is now used by default in every implementation. diff --git a/docs/custom_matrix.md b/docs/custom_matrix.md index ef206944e1..294b88bb0b 100644 --- a/docs/custom_matrix.md +++ b/docs/custom_matrix.md @@ -74,7 +74,7 @@ void matrix_init(void) { // TODO: initialize hardware and global matrix state here // Unless hardware debouncing - Init the configured debounce routine - debounce_init(MATRIX_ROWS); + debounce_init(); // This *must* be called for correct keyboard behavior matrix_init_kb(); @@ -86,7 +86,7 @@ uint8_t matrix_scan(void) { // TODO: add matrix scanning routine here // Unless hardware debouncing - use the configured debounce routine - changed = debounce(raw_matrix, matrix, MATRIX_ROWS, changed); + changed = debounce(raw_matrix, matrix, changed); // This *must* be called for correct keyboard behavior matrix_scan_kb(); diff --git a/docs/features/haptic_feedback.md b/docs/features/haptic_feedback.md index 08e66ea8e1..d380b1b999 100644 --- a/docs/features/haptic_feedback.md +++ b/docs/features/haptic_feedback.md @@ -121,7 +121,7 @@ Linear resonant actuators (LRA, also know as a linear vibrator) works different #### DRV2605L waveform library -DRV2605L comes with preloaded library of various waveform sequences that can be called and played. If writing a macro, these waveforms can be played using `DRV_pulse(*sequence name or number*)` +DRV2605L comes with preloaded library of various waveform sequences that can be called and played. If writing a macro, these waveforms can be played using `drv2605l_pulse(*sequence name or number*)` after adding `#include "drv2605l.h"`. List of waveform sequences from the datasheet: diff --git a/docs/features/led_matrix.md b/docs/features/led_matrix.md index 28d24bc400..f14fb47d62 100644 --- a/docs/features/led_matrix.md +++ b/docs/features/led_matrix.md @@ -88,6 +88,8 @@ As mentioned earlier, the center of the keyboard by default is expected to be `{ |`QK_LED_MATRIX_BRIGHTNESS_DOWN`|`LM_BRID`|Decrease the brightness level | |`QK_LED_MATRIX_SPEED_UP` |`LM_SPDU`|Increase the animation speed | |`QK_LED_MATRIX_SPEED_DOWN` |`LM_SPDD`|Decrease the animation speed | +|`QK_LED_MATRIX_FLAG_NEXT` |`LM_FLGN`|Cycle through flags | +|`QK_LED_MATRIX_FLAG_PREVIOUS` |`LM_FLGP`|Cycle through flags in reverse | ## LED Matrix Effects {#led-matrix-effects} @@ -253,6 +255,7 @@ const char* effect_name = led_matrix_get_mode_name(led_matrix_get_mode()); #define LED_MATRIX_DEFAULT_FLAGS LED_FLAG_ALL // Sets the default LED flags, if none has been set #define LED_MATRIX_SPLIT { X, Y } // (Optional) For split keyboards, the number of LEDs connected on each half. X = left, Y = Right. // If reactive effects are enabled, you also will want to enable SPLIT_TRANSPORT_MIRROR +#define LED_MATRIX_FLAG_STEPS { LED_FLAG_ALL, LED_FLAG_KEYLIGHT | LED_FLAG_MODIFIER, LED_FLAG_NONE } // Sets the flags which can be cycled through. ``` ## EEPROM storage {#eeprom-storage} @@ -505,6 +508,62 @@ The current effect speed, from 0 to 255. --- +### `void led_matrix_set_flags(led_flags_t flags)` {#api-led-matrix-set-flags} + +Set the global effect flags. + +#### Arguments {#api-led-matrix-set-flags-arguments} + + - `led_flags_t flags` + The [flags](#flags) value to set. + +--- + +### `void led_matrix_set_flags_noeeprom(led_flags_t flags)` {#api-led-matrix-set-flags-noeeprom} + +Set the global effect flags. New state is not written to EEPROM. + +#### Arguments {#api-led-matrix-set-flags-noeeprom-arguments} + + - `led_flags_t flags` + The [flags](#flags) value to set. + +--- + +### `void led_matrix_flags_step(void)` {#api-led-matrix-flags-step} + +Move to the next flag combination. + +--- + +### `void led_matrix_flags_step_noeeprom(void)` {#api-led-matrix-flags-step-noeeprom} + +Move to the next flag combination. New state is not written to EEPROM. + +--- + +### `void led_matrix_flags_step_reverse(void)` {#api-led-matrix-flags-step-reverse} + +Move to the previous flag combination. + +--- + +### `void led_matrix_flags_step_reverse_noeeprom(void)` {#api-led-matrix-flags-step-reverse-noeeprom} + +Move to the previous flag combination. New state is not written to EEPROM. + +--- + +### `uint8_t led_matrix_get_flags(void)` {#api-led-matrix-get-flags} + +Get the current global effect flags. + +#### Return Value {#api-led-matrix-get-flags-return} + +The current effect [flags](#flags). + +--- + ### `void led_matrix_reload_from_eeprom(void)` {#api-led-matrix-reload-from-eeprom} Reload the effect configuration (enabled, mode and brightness) from EEPROM. diff --git a/docs/features/rgb_matrix.md b/docs/features/rgb_matrix.md index 95ee4c4896..36680f24a2 100644 --- a/docs/features/rgb_matrix.md +++ b/docs/features/rgb_matrix.md @@ -96,6 +96,8 @@ As mentioned earlier, the center of the keyboard by default is expected to be `{ |`QK_RGB_MATRIX_VALUE_DOWN` |`RM_VALD`|Decrease the brightness level | |`QK_RGB_MATRIX_SPEED_UP` |`RM_SPDU`|Increase the animation speed | |`QK_RGB_MATRIX_SPEED_DOWN` |`RM_SPDD`|Decrease the animation speed | +|`QK_RGB_MATRIX_FLAG_NEXT` |`RM_FLGN`|Cycle through flags | +|`QK_RGB_MATRIX_FLAG_PREVIOUS` |`RM_FLGP`|Cycle through flags in reverse | ## RGB Matrix Effects {#rgb-matrix-effects} @@ -409,6 +411,7 @@ const char* effect_name = rgb_matrix_get_mode_name(rgb_matrix_get_mode()); #define RGB_MATRIX_SPLIT { X, Y } // (Optional) For split keyboards, the number of LEDs connected on each half. X = left, Y = Right. // If reactive effects are enabled, you also will want to enable SPLIT_TRANSPORT_MIRROR #define RGB_TRIGGER_ON_KEYDOWN // Triggers RGB keypress events on key down. This makes RGB control feel more responsive. This may cause RGB to not function properly on some boards +#define RGB_MATRIX_FLAG_STEPS { LED_FLAG_ALL, LED_FLAG_KEYLIGHT | LED_FLAG_MODIFIER, LED_FLAG_UNDERGLOW, LED_FLAG_NONE } // Sets the flags which can be cycled through. ``` ## EEPROM storage {#eeprom-storage} @@ -852,6 +855,62 @@ The current effect speed, from 0 to 255. --- +### `void rgb_matrix_set_flags(led_flags_t flags)` {#api-rgb-matrix-set-flags} + +Set the global effect flags. + +#### Arguments {#api-rgb-matrix-set-flags-arguments} + + - `led_flags_t flags` + The [flags](#flags) value to set. + +--- + +### `void rgb_matrix_set_flags_noeeprom(led_flags_t flags)` {#api-rgb-matrix-set-flags-noeeprom} + +Set the global effect flags. New state is not written to EEPROM. + +#### Arguments {#api-rgb-matrix-set-flags-noeeprom-arguments} + + - `led_flags_t flags` + The [flags](#flags) value to set. + +--- + +### `void rgb_matrix_flags_step(void)` {#api-rgb-matrix-flags-step} + +Move to the next flag combination. + +--- + +### `void rgb_matrix_flags_step_noeeprom(void)` {#api-rgb-matrix-flags-step-noeeprom} + +Move to the next flag combination. New state is not written to EEPROM. + +--- + +### `void rgb_matrix_flags_step_reverse(void)` {#api-rgb-matrix-flags-step-reverse} + +Move to the previous flag combination. + +--- + +### `void rgb_matrix_flags_step_reverse_noeeprom(void)` {#api-rgb-matrix-flags-step-reverse-noeeprom} + +Move to the previous flag combination. New state is not written to EEPROM. + +--- + +### `uint8_t rgb_matrix_get_flags(void)` {#api-rgb-matrix-get-flags} + +Get the current global effect flags. + +#### Return Value {#api-rgb-matrix-get-flags-return} + +The current effect [flags](#flags). + +--- + ### `void rgb_matrix_sethsv(uint8_t h, uint8_t s, uint8_t v)` {#api-rgb-matrix-sethsv} Set the global effect hue, saturation, and value (brightness). diff --git a/docs/isp_flashing_guide.md b/docs/isp_flashing_guide.md index 6f3f0a8f7d..1eaec3b59d 100644 --- a/docs/isp_flashing_guide.md +++ b/docs/isp_flashing_guide.md @@ -220,14 +220,18 @@ This bootloader is primarily for keyboards originally designed for the PS2AVRGB USBaspLoader is a bootloader based on V-USB that emulates a hardware USBasp device. It runs on ATmega32A and ATmega328P MCUs. -Precompiled `.hex` files are generally not available, but you can compile it yourself by setting up the QMK environment and following Coseyfannitutti's guide for the appropriate MCU: +Precompiled `.hex` files are generally not available, but you can compile it yourself by setting up the QMK environment and cloning the appropriate branch of Coseyfannitutti's USBaspLoader fork: -|MCU |Low |High |Extended|USB ID | -|-------------------------------------------------------------------------------------|------|------|--------|-----------| -|[ATmega32A](https://github.com/coseyfannitutti/discipline/tree/master/doc/bootloader)|`0x1F`|`0xC0`|*n/a* |`16C0:05DC`| -|[ATmega328P](https://github.com/coseyfannitutti/discipad/tree/master/doc/bootloader) |`0xD7`|`0xD0`|`0x04` |`16C0:05DC`| +|MCU |Low |High |Extended|USB ID | +|-----------------------------------------------------------------------------|------|------|--------|-----------| +|[ATmega32A](https://github.com/coseyfannitutti/USBaspLoader/tree/atmega32a) |`0x1F`|`0xC0`|*n/a* |`16C0:05DC`| +|[ATmega328P](https://github.com/coseyfannitutti/USBaspLoader/tree/atmega328p)|`0xD7`|`0xD0`|`0x04` |`16C0:05DC`| -Note that some boards may have their own specialized build of this bootloader in a separate repository. This will usually be linked to in the board's readme. +From there, simply `cd` to the `firmware/` directory and run `make`, which should produce a file called `main.hex`. + +:::tip +Some boards may have their own specialized build of this bootloader in a separate repository. This will usually be linked to in the board's readme. +::: ## Flashing the Bootloader diff --git a/docs/keycodes.md b/docs/keycodes.md index c540a7ce7f..9c918b7676 100644 --- a/docs/keycodes.md +++ b/docs/keycodes.md @@ -433,6 +433,8 @@ See also: [LED Matrix](features/led_matrix) |`QK_LED_MATRIX_BRIGHTNESS_DOWN`|`LM_BRID`|Decrease the brightness level | |`QK_LED_MATRIX_SPEED_UP` |`LM_SPDU`|Increase the animation speed | |`QK_LED_MATRIX_SPEED_DOWN` |`LM_SPDD`|Decrease the animation speed | +|`QK_LED_MATRIX_FLAG_NEXT` |`LM_FLGN`|Cycle through flags | +|`QK_LED_MATRIX_FLAG_PREVIOUS` |`LM_FLGP`|Cycle through flags in reverse | ## Magic Keycodes {#magic-keycodes} @@ -783,6 +785,8 @@ See also: [RGB Matrix](features/rgb_matrix) |`QK_RGB_MATRIX_VALUE_DOWN` |`RM_VALD`|Decrease the brightness level | |`QK_RGB_MATRIX_SPEED_UP` |`RM_SPDU`|Increase the animation speed | |`QK_RGB_MATRIX_SPEED_DOWN` |`RM_SPDD`|Decrease the animation speed | +|`QK_RGB_MATRIX_FLAG_NEXT` |`RM_FLGN`|Cycle through flags | +|`QK_RGB_MATRIX_FLAG_PREVIOUS` |`RM_FLGP`|Cycle through flags in reverse | ## US ANSI Shifted Symbols {#us-ansi-shifted-symbols} diff --git a/docs/quantum_painter.md b/docs/quantum_painter.md index bbe8944516..fbc72cb053 100644 --- a/docs/quantum_painter.md +++ b/docs/quantum_painter.md @@ -534,6 +534,8 @@ QUANTUM_PAINTER_DRIVERS += surface Creating a surface in firmware can then be done with the following APIs: ```c +// 24bpp RGB888 surface: +painter_device_t qp_make_rgb888_surface(uint16_t panel_width, uint16_t panel_height, void *buffer); // 16bpp RGB565 surface: painter_device_t qp_make_rgb565_surface(uint16_t panel_width, uint16_t panel_height, void *buffer); // 1bpp monochrome surface: diff --git a/docs/reference_info_json.md b/docs/reference_info_json.md index 84377ef36c..91ab7f4577 100644 --- a/docs/reference_info_json.md +++ b/docs/reference_info_json.md @@ -415,6 +415,9 @@ Configures the [LED Matrix](features/led_matrix) feature. * `center_point` <Badge type="info">Array: Number</Badge> * The centroid (geometric center) of the LEDs. Used for certain effects. * Default: `[112, 32]` + * `flag_steps` <Badge type="info">Array: Number</Badge> + * A list of flag bitfields that can be cycled through. + * Default: `[255, 5, 0]` * `default` * `animation` <Badge type="info">String</Badge> * The default effect. Must be one of `led_matrix.animations` @@ -428,6 +431,9 @@ Configures the [LED Matrix](features/led_matrix) feature. * `speed` <Badge type="info">Number</Badge> * The default animation speed. * Default: `128` + * `flags` <Badge type="info">Number</Badge> + * The default LED flags. + * Default: `255` * `driver` <Badge type="info">String</Badge> <Badge>Required</Badge> * The driver to use. Must be one of `custom`, `is31fl3218`, `is31fl3731`, `is31fl3733`, `is31fl3736`, `is31fl3737`, `is31fl3741`, `is31fl3742a`, `is31fl3743a`, `is31fl3745`, `is31fl3746a`, `snled27351`. * `layout` <Badge type="info">Array: Object</Badge> <Badge>Required</Badge> @@ -660,6 +666,9 @@ Configures the [RGB Matrix](features/rgb_matrix) feature. * `center_point` <Badge type="info">Array: Number</Badge> * The centroid (geometric center) of the LEDs. Used for certain effects. * Default: `[112, 32]` + * `flag_steps` <Badge type="info">Array: Number</Badge> + * A list of flag bitfields that can be cycled through. + * Default: `[255, 5, 2, 0]` * `default` * `animation` <Badge type="info">String</Badge> * The default effect. Must be one of `rgb_matrix.animations` @@ -679,6 +688,9 @@ Configures the [RGB Matrix](features/rgb_matrix) feature. * `speed` <Badge type="info">Number</Badge> * The default animation speed. * Default: `128` + * `flags` <Badge type="info">Number</Badge> + * The default LED flags. + * Default: `255` * `driver` <Badge type="info">String</Badge> <Badge>Required</Badge> * The driver to use. Must be one of `aw20216s`, `custom`, `is31fl3218`, `is31fl3236`, `is31fl3729`, `is31fl3731`, `is31fl3733`, `is31fl3736`, `is31fl3737`, `is31fl3741`, `is31fl3742a`, `is31fl3743a`, `is31fl3745`, `is31fl3746a`, `snled27351`, `ws2812`. * `hue_steps` <Badge type="info">Number</Badge> |