Merge branch 'develop'

This commit is contained in:
zvecr 2026-06-01 07:51:54 +01:00
commit f0c79ee455
218 changed files with 2389 additions and 3601 deletions

View file

@ -300,6 +300,7 @@ endef
define BUILD_TEST
TEST_PATH := $1
TEST_NAME := $$(notdir $$(TEST_PATH))
TEST_ID := $$(patsubst ./tests/%,%,$$(TEST_PATH))
TEST_FULL_NAME := $$(subst /,_,$$(patsubst $$(ROOT_DIR)tests/%,%,$$(TEST_PATH)))
MAKE_TARGET := $2
COMMAND := $1
@ -313,7 +314,7 @@ define BUILD_TEST
TEST_MSG := $$(MSG_TEST)
$$(TEST_FULL_NAME)_COMMAND := \
printf "$$(TEST_MSG)\n"; \
$$(TEST_EXECUTABLE); \
$$(TEST_EXECUTABLE) --gtest_color=$$(COLOR); \
if [ $$$$? -gt 0 ]; \
then error_occurred=1; \
fi; \

View file

@ -125,7 +125,7 @@ ifeq ($(strip $(MOUSEKEY_ENABLE)), yes)
MOUSE_ENABLE := yes
endif
VALID_POINTING_DEVICE_DRIVER_TYPES := adns5050 adns9800 analog_joystick azoteq_iqs5xx cirque_pinnacle_i2c cirque_pinnacle_spi paw3204 paw3222 pmw3320 pmw3360 pmw3389 pimoroni_trackball custom
VALID_POINTING_DEVICE_DRIVER_TYPES := adns5050 adns9800 analog_joystick azoteq_iqs5xx cirque_pinnacle_i2c cirque_pinnacle_spi paw3204 paw3222 pmw3320 pmw3325 pmw3360 pmw3389 pimoroni_trackball custom
ifeq ($(strip $(POINTING_DEVICE_ENABLE)), yes)
ifeq ($(filter $(POINTING_DEVICE_DRIVER),$(VALID_POINTING_DEVICE_DRIVER_TYPES)),)
$(call CATASTROPHIC_ERROR,Invalid POINTING_DEVICE_DRIVER,POINTING_DEVICE_DRIVER="$(POINTING_DEVICE_DRIVER)" is not a valid pointing device type)
@ -159,6 +159,8 @@ ifeq ($(strip $(POINTING_DEVICE_ENABLE)), yes)
SRC += $(QUANTUM_DIR)/pointing_device/pointing_device_gestures.c
else ifeq ($(strip $(POINTING_DEVICE_DRIVER)), paw3222)
SPI_DRIVER_REQUIRED = yes
else ifeq ($(strip $(POINTING_DEVICE_DRIVER)), pmw3325)
SPI_DRIVER_REQUIRED = yes
else ifeq ($(strip $(POINTING_DEVICE_DRIVER)), pimoroni_trackball)
I2C_DRIVER_REQUIRED = yes
else ifneq ($(filter $(strip $(POINTING_DEVICE_DRIVER)),pmw3360 pmw3389),)

View file

@ -50,10 +50,14 @@ ifeq ($(strip $(DEBUG_ENABLE)),yes)
CFLAGS += -ggdb3
CXXFLAGS += -ggdb3
ASFLAGS += -ggdb3
# Create a map file when debugging
LDFLAGS += -Wl,-Map=$(BUILD_DIR)/$(TARGET).map,--cref
endif
# Create a map file to see what was compiled and where, unless disabled
# (e.g. test builds, which use the host linker — Apple's ld does not accept
# -Map=/--cref).
ifneq ($(strip $(CREATE_MAP)), no)
LDFLAGS += -Wl,-Map=$(BUILD_DIR)/$(TARGET).map,--cref
endif
#---------------- C Compiler Options ----------------
@ -66,9 +70,9 @@ CFLAGS += $(CDEFS)
CFLAGS += -O$(OPT)
# add color
ifeq ($(COLOR),true)
ifeq ("$(shell echo "int main(){}" | $(CC) -fdiagnostics-color -x c - -o /dev/null 2>&1)", "")
CFLAGS+= -fdiagnostics-color
endif
CFLAGS+= -fdiagnostics-color=always
else
CFLAGS+= -fdiagnostics-color=never
endif
CFLAGS += -Wall
CFLAGS += -Wstrict-prototypes

View file

@ -1,10 +1,8 @@
{
"license": "GPL-2.0-or-later",
"devDependencies": {
"vite": "^5.4.21",
"vitepress": "^1.1.0",
"vitepress-plugin-tabs": "^0.5.0",
"vue": "^3.4.24"
"vitepress": "^1.6.4",
"vitepress-plugin-tabs": "^0.8.0"
},
"scripts": {
"docs:dev": "vitepress dev --host 0.0.0.0",

File diff suppressed because it is too large Load diff

View file

@ -77,13 +77,13 @@ define GENERATE_MSG_MAKE_KB
endef
MSG_MAKE_KB = $(eval $(call GENERATE_MSG_MAKE_KB))$(MSG_MAKE_KB_ACTUAL)
define GENERATE_MSG_MAKE_TEST
MSG_MAKE_TEST_ACTUAL := Making test $(BOLD)$(TEST_NAME)$(NO_COLOR)
MSG_MAKE_TEST_ACTUAL := Making test $(BOLD)$(TEST_ID)$(NO_COLOR)
ifneq ($$(MAKE_TARGET),)
MSG_MAKE_TEST_ACTUAL += with target $(BOLD)$$(MAKE_TARGET)$(NO_COLOR)
endif
endef
MSG_MAKE_TEST = $(eval $(call GENERATE_MSG_MAKE_TEST))$(MSG_MAKE_TEST_ACTUAL)
MSG_TEST = Testing $(BOLD)$(TEST_NAME)$(NO_COLOR)
MSG_TEST = Testing $(BOLD)$(TEST_ID)$(NO_COLOR)
define GENERATE_MSG_AVAILABLE_KEYMAPS
MSG_AVAILABLE_KEYMAPS_ACTUAL := Available keymaps for $(BOLD)$$(CURRENT_KB)$(NO_COLOR):
endef

View file

@ -225,6 +225,8 @@
"RETRO_TAPPING": {"info_key": "tapping.retro", "value_type": "flag"},
"RETRO_TAPPING_PER_KEY": {"info_key": "tapping.retro_per_key", "value_type": "flag"},
"SPECULATIVE_HOLD": {"info_key": "tapping.speculative_hold", "value_type": "flag"},
"SPECULATIVE_HOLD_FLOW_TERM": {"info_key": "tapping.speculative_hold_flow_term", "value_type": "int"},
"SPECULATIVE_HOLD_ONE_KEY": {"info_key": "tapping.speculative_hold_one_key", "value_type": "flag"},
"TAP_CODE_DELAY": {"info_key": "qmk.tap_keycode_delay", "value_type": "int"},
"TAP_HOLD_CAPS_DELAY": {"info_key": "qmk.tap_capslock_delay", "value_type": "int"},
"TAPPING_TERM": {"info_key": "tapping.term", "value_type": "int"},
@ -269,9 +271,9 @@
"PRODUCT": {"info_key": "keyboard_name", "warn_duplicate": false, "value_type": "str", "deprecated": true, "replace_with": "`keyboard_name` in info.json"},
"PRODUCT_ID": {"info_key": "usb.pid", "value_type": "hex", "deprecated": true, "replace_with": "`usb.pid` in info.json"},
"VENDOR_ID": {"info_key": "usb.vid", "value_type": "hex", "deprecated": true, "replace_with": "`usb.vid` in info.json"},
"FORCE_NKRO": {"info_key": "usb.force_nkro", "value_type": "flag", "deprecated": true, "replace_with": "`host.default.nkro` in info.json"},
// Items we want flagged in lint
"FORCE_NKRO": {"info_key": "usb.force_nkro", "value_type": "flag", "invalid": true, "replace_with": "`host.default.nkro` in info.json"},
"VIAL_KEYBOARD_UID": {"info_key": "_invalid.vial_uid", "invalid": true},
"VIAL_UNLOCK_COMBO_COLS": {"info_key": "_invalid.vial_unlock_cols", "invalid": true},
"VIAL_UNLOCK_COMBO_ROWS": {"info_key": "_invalid.vial_unlock_rows", "invalid": true}

View file

@ -46,7 +46,8 @@
"manufacturer": {"$ref": "./definitions.jsonschema#/text_identifier"},
"url": {
"type": "string",
"format": "uri"
"format": "uri",
"minLength": 1
},
"development_board": {
"type": "string",
@ -992,6 +993,7 @@
"type": "object",
"properties": {
"chordal_hold": {"type": "boolean"},
"flow_tap_term": {"$ref": "./definitions.jsonschema#/unsigned_int"},
"force_hold": {"type": "boolean"},
"force_hold_per_key": {"type": "boolean"},
"ignore_mod_tap_interrupt": {"type": "boolean"},
@ -1001,6 +1003,9 @@
"permissive_hold_per_key": {"type": "boolean"},
"retro": {"type": "boolean"},
"retro_per_key": {"type": "boolean"},
"speculative_hold": {"type": "boolean"},
"speculative_hold_flow_term": {"$ref": "./definitions.jsonschema#/unsigned_int"},
"speculative_hold_one_key": {"type": "boolean"},
"term": {"$ref": "./definitions.jsonschema#/unsigned_int"},
"term_per_key": {"type": "boolean"},
"toggle": {"$ref": "./definitions.jsonschema#/unsigned_int"}

122
docs/ChangeLog/20260531.md Normal file
View file

@ -0,0 +1,122 @@
# QMK Breaking Changes - 2026 May 31 Changelog
## Notable Changes {#notable-changes}
## Deprecation Notices
In line with the [notice period](../support_deprecation_policy#how-much-advance-notice-will-be-given), deprecation notices for larger items are listed here.
### Removal of deprecated isLeftHand ([25897](https://github.com/qmk/qmk_firmware/pull/25897))
Users must migrate to `is_keyboard_left()` found in `split_util.h` instead. For example:
```diff
oled_rotation_t oled_init_user(oled_rotation_t rotation) {
- return isLeftHand ? OLED_ROTATION_180 : OLED_ROTATION_0;
+ return is_keyboard_left() ? OLED_ROTATION_180 : OLED_ROTATION_0;
}
```
### Removal of `usb.force_nkro`/`FORCE_NKRO` ([#25262](https://github.com/qmk/qmk_firmware/pull/25262))
Unpicking the assumption that only USB can do NKRO, forcing of NKRO on every boot has been deprecated. As this setting persists, it produces unnecessary user confusion when the various NKRO keycodes (for example `NK_TOGG`) do not behave as expected.
The new defaults can be configured in the following ways:
:::::tabs
==== keyboard.json
```json [keyboard.json]
{
"host": { // [!code focus]
"default": { // [!code focus]
"nkro": true // [!code focus]
} // [!code focus]
} // [!code focus]
}
```
==== keymap.json
```json [keymap.json]
{
"config": {
"host": { // [!code focus]
"default": { // [!code focus]
"nkro": true // [!code focus]
} // [!code focus]
} // [!code focus]
}
}
```
==== config.h
```c [config.h]
#pragma once
#define NKRO_DEFAULT_ON true // [!code focus]
```
:::::
## Full changelist
Core:
* Remove deprecated `isLeftHand` ([#25897](https://github.com/qmk/qmk_firmware/pull/25897))
* Either output Unicode or insert in Leader sequence ([#25940](https://github.com/qmk/qmk_firmware/pull/25940))
* Add resolution information to digitizer ([#25958](https://github.com/qmk/qmk_firmware/pull/25958))
* Always generate .map files. ([#25961](https://github.com/qmk/qmk_firmware/pull/25961))
* Add an `mcu_reset` impl for the kiibohd bootloader. ([#25963](https://github.com/qmk/qmk_firmware/pull/25963))
* VIA v13 ([#26001](https://github.com/qmk/qmk_firmware/pull/26001))
* Added PixArt PMW-3325 mouse sensor driver ([#26065](https://github.com/qmk/qmk_firmware/pull/26065))
* Update WL backing store from 16 to 32-bit for AT32 ([#26066](https://github.com/qmk/qmk_firmware/pull/26066))
* Refactor Pixel Fractal effect ([#26071](https://github.com/qmk/qmk_firmware/pull/26071))
* Minor combo code optimisation ([#26073](https://github.com/qmk/qmk_firmware/pull/26073))
* Options to constrain Speculative Hold: `SPECULATIVE_HOLD_ONE_KEY` and `SPECULATIVE_HOLD_FLOW_TERM`. ([#26099](https://github.com/qmk/qmk_firmware/pull/26099))
* Add includes for std::setw ([#26153](https://github.com/qmk/qmk_firmware/pull/26153))
* Bind gtest colour to QMKs 'COLOR' variable ([#26159](https://github.com/qmk/qmk_firmware/pull/26159))
* Print correct test names ([#26160](https://github.com/qmk/qmk_firmware/pull/26160))
* Ignore Uninteresting test warnings during test teardown ([#26161](https://github.com/qmk/qmk_firmware/pull/26161))
* Remove FORCE_NKRO ([#26206](https://github.com/qmk/qmk_firmware/pull/26206))
CLI:
* Update lint to check all keymaps within the repo ([#25970](https://github.com/qmk/qmk_firmware/pull/25970))
* Fail when a duplicate module name is detected ([#26238](https://github.com/qmk/qmk_firmware/pull/26238))
Submodule updates:
* Update ChibiOS, ChibiOS-Contrib. ([#25730](https://github.com/qmk/qmk_firmware/pull/25730))
* Revert "Update ChibiOS, ChibiOS-Contrib." ([#26074](https://github.com/qmk/qmk_firmware/pull/26074))
* ChibiOS, ChibiOS-Contrib updates (redux) ([#26079](https://github.com/qmk/qmk_firmware/pull/26079))
* Bump googletest to v1.16.0 ([#26154](https://github.com/qmk/qmk_firmware/pull/26154))
Keyboards:
* Require "url" field to not be empty ([#25152](https://github.com/qmk/qmk_firmware/pull/25152))
* Add nomis/rpi_pico_25x1 macropad ([#25346](https://github.com/qmk/qmk_firmware/pull/25346))
* Remove override of QK_{LED,RGB}_MATRIX_TOGGLE keycode ([#25672](https://github.com/qmk/qmk_firmware/pull/25672))
* Add reverse layout to SouthPad v2 ([#25707](https://github.com/qmk/qmk_firmware/pull/25707))
* Adding Handwired Bouvet Macropad ([#26040](https://github.com/qmk/qmk_firmware/pull/26040))
* Remove blockader user keymap ([#26075](https://github.com/qmk/qmk_firmware/pull/26075))
* Remove deprecated audio pin defines ([#26111](https://github.com/qmk/qmk_firmware/pull/26111))
* Remove `OLED_DISPLAY_128X32` config ([#26190](https://github.com/qmk/qmk_firmware/pull/26190))
* Migrate SPLIT_OLED_ENABLE ([#26194](https://github.com/qmk/qmk_firmware/pull/26194))
* Add API version assertion for split_data_sync module ([#26237](https://github.com/qmk/qmk_firmware/pull/26237))
Others:
* Bump vitepress to 1.6.4 ([#26067](https://github.com/qmk/qmk_firmware/pull/26067))
* Add usage clarifications to docs/features/unicode.md ([#26156](https://github.com/qmk/qmk_firmware/pull/26156))
Bugs:
* Fix `USER_PRINT` stripping out `uprintf` ([#25919](https://github.com/qmk/qmk_firmware/pull/25919))
* Fix possible repeat key infinite recursion ([#25926](https://github.com/qmk/qmk_firmware/pull/25926))
* Fix `cc-option` on arm-none-eabi-gcc ([#26114](https://github.com/qmk/qmk_firmware/pull/26114))
* Fix color diagnostics for arm-none-eabi-gcc ([#26115](https://github.com/qmk/qmk_firmware/pull/26115))
* Mask out active mods when unregistering after retro tapping ([#26127](https://github.com/qmk/qmk_firmware/pull/26127))
* fix `make test:all` failures seen on macOS Tahoe ([#26136](https://github.com/qmk/qmk_firmware/pull/26136))
* Add workaround for undefined reference to weak function under mingw ([#26167](https://github.com/qmk/qmk_firmware/pull/26167))
* fix(ws2812-pwm): allow WS2812_PWM_TICK_FREQUENCY override ([#26186](https://github.com/qmk/qmk_firmware/pull/26186))
* Clip mouse report values to the logical range from the USB descriptor. ([#26195](https://github.com/qmk/qmk_firmware/pull/26195))
* Align Mouse USB descriptor ([#26230](https://github.com/qmk/qmk_firmware/pull/26230))

View file

@ -214,7 +214,7 @@
{ "text": "My Pull Request Was Flagged", "link": "/breaking_changes_instructions" },
{
"text": "Most Recent ChangeLog",
"link": "/ChangeLog/20260222"
"link": "/ChangeLog/20260531"
},
{ "text": "Past Breaking Changes", "link": "/breaking_changes_history" },
{ "text": "Deprecation Policy", "link": "/support_deprecation_policy" }

View file

@ -10,25 +10,25 @@ Practically, this means QMK merges the `develop` branch into the `master` branch
## What has been included in past Breaking Changes?
* [2026 May 31](ChangeLog/20260531)
* [2026 Feb 22](ChangeLog/20260222)
* [2025 Nov 30](ChangeLog/20251130)
* [2025 Aug 31](ChangeLog/20250831)
* [Older Breaking Changes](breaking_changes_history)
## When is the next Breaking Change?
The next Breaking Change is scheduled for May 31, 2026.
The next Breaking Change is scheduled for Aug 30, 2026.
### Important Dates
* 2025 Feb 22 - `develop` is tagged with a new release version. Each push to `master` is subsequently merged to `develop` by GitHub actions.
* 2026 May 3 - `develop` closed to new PRs.
* 2026 May 3 - Call for testers.
* 2026 May 17 - Last day for merges -- after this point `develop` is locked for testing and accepts only bugfixes
* 2026 May 24 - `develop` is locked, only critical bugfix PRs merged.
* 2026 May 29 - `master` is locked, no PRs merged.
* 2026 May 31 - Merge `develop` to `master`.
* 2026 May 31 - `master` is unlocked. PRs can be merged again.
* 2025 May 31 - `develop` is tagged with a new release version. Each push to `master` is subsequently merged to `develop` by GitHub actions.
* 2026 Aug 2 - `develop` closed to new PRs.
* 2026 Aug 2 - Call for testers.
* 2026 Aug 16 - Last day for merges -- after this point `develop` is locked for testing and accepts only bugfixes
* 2026 Aug 23 - `develop` is locked, only critical bugfix PRs merged.
* 2026 Aug 28 - `master` is locked, no PRs merged.
* 2026 Aug 30 - Merge `develop` to `master`.
* 2026 Aug 30 - `master` is unlocked. PRs can be merged again.
## What changes will be included?

View file

@ -2,6 +2,7 @@
This page links to all previous changelogs from the QMK Breaking Changes process.
* [2026 May 31](ChangeLog/20260531) - version 0.33.0
* [2026 Feb 22](ChangeLog/20260222) - version 0.32.0
* [2025 Nov 30](ChangeLog/20251130) - version 0.31.0
* [2025 Aug 31](ChangeLog/20250831) - version 0.30.0

View file

@ -74,24 +74,6 @@ This is a C header file that is one of the first things included, and will persi
* pins mapped to rows and columns, from left to right. Defines a matrix where each switch is connected to a separate pin and ground.
* `#define AUDIO_VOICES`
* turns on the alternate audio voices (to cycle through)
* `#define C4_AUDIO`
* enables audio on pin C4
* Deprecated. Use `#define AUDIO_PIN C4`
* `#define C5_AUDIO`
* enables audio on pin C5
* Deprecated. Use `#define AUDIO_PIN C5`
* `#define C6_AUDIO`
* enables audio on pin C6
* Deprecated. Use `#define AUDIO_PIN C6`
* `#define B5_AUDIO`
* enables audio on pin B5 (duophony is enabled if one of B pins is enabled along with one of C pins)
* Deprecated. Use `#define AUDIO_PIN B5`, or use `#define AUDIO_PIN_ALT B5` if a `C` pin is enabled with `AUDIO_PIN`
* `#define B6_AUDIO`
* enables audio on pin B6 (duophony is enabled if one of B pins is enabled along with one of C pins)
* Deprecated. Use `#define AUDIO_PIN B6`, or use `#define AUDIO_PIN_ALT B6` if a `C` pin is enabled with `AUDIO_PIN`
* `#define B7_AUDIO`
* enables audio on pin B7 (duophony is enabled if one of B pins is enabled along with one of C pins)
* Deprecated. Use `#define AUDIO_PIN B7`, or use `#define AUDIO_PIN_ALT B7` if a `C` pin is enabled with `AUDIO_PIN`
* `#define BACKLIGHT_PIN B7`
* pin of the backlight
* `#define BACKLIGHT_LEVELS 3`

View file

@ -320,6 +320,23 @@ The PMW3320 sensor uses a serial type protocol for communication, and requires a
The CPI range is 500-3500, in increments of 250. Defaults to 1000 CPI.
### PMW-3325 Sensor
To use the PMW-3325 sensor, add this to your `rules.mk`:
```make
POINTING_DEVICE_DRIVER = pmw3325
```
The following pins must be defined in `config.h`:
| Setting (`config.h`) | Description | Default |
| --------------------- | ------------------------------------------------------------------ | ---------------------------- |
| `PMW3325_CS_PIN` | (Required) The pin connected to the chip select pin of the sensor. | `POINTING_DEVICE_CS_PIN` |
| `PMW3325_SPI_DIVISOR` | (Required) The SPI clock divisor. This is dependent on your MCU. | _not defined_ |
The CPI range is 100-5000, in increments of 100. Defaults to 2000 CPI.
### PMW 3360 and PMW 3389 Sensor
This drivers supports both the PMW 3360 and PMW 3389 sensor as well as multiple sensors of the same type _per_ controller, so 2 can be attached at the same side for split keyboards (or unsplit keyboards).

View file

@ -8,9 +8,9 @@ There are some limitations to this feature. Because there is no "standard" metho
## Usage {#usage}
The core Unicode API can be used purely programmatically. However, there are also additional subsystems which build on top of it and come with keycodes to make things easier. See below for more details.
The core Unicode API can be used purely programmatically. However, there are also additional subsystems which build on top of it and come with keycodes to make things easier. See [below](#input-subsystems) for more details.
Add the following to your keymap's `rules.mk`:
To start, add the following to your keymap's `rules.mk`:
```make
UNICODE_COMMON = yes
@ -18,22 +18,25 @@ UNICODE_COMMON = yes
## Basic Configuration {#basic-configuration}
Add the following to your `config.h`:
The following options can be set or overridden in your `config.h`:
|Define |Default |Description |
|------------------------|------------------|--------------------------------------------------------------------------------|
|`UNICODE_KEY_MAC` |`KC_LEFT_ALT` |The key to hold when beginning a Unicode sequence with the macOS input mode |
|`UNICODE_KEY_LNX` |`LCTL(LSFT(KC_U))`|The key to tap when beginning a Unicode sequence with the Linux input mode |
|`UNICODE_KEY_WINC` |`KC_RIGHT_ALT` |The key to hold when beginning a Unicode sequence with the WinCompose input mode|
|`UNICODE_SELECTED_MODES`|`-1` |A comma separated list of input modes for cycling through |
|`UNICODE_SELECTED_MODES`|*n/a* |A comma separated list of input modes for cycling through |
|`UNICODE_CYCLE_PERSIST` |`true` |Whether to persist the current Unicode input mode to EEPROM |
|`UNICODE_TYPE_DELAY` |`10` |The amount of time to wait, in milliseconds, between Unicode sequence keystrokes|
The default values work well for most use cases, so users usually only need to define `UNICODE_SELECTED_MODES` to set their desired input modes.
However, if you plan on switching input modes manually (see [keycodes](#keycodes) below) and don't plan on cycling through them, this definition can be omitted.
### Audio Feedback {#audio-feedback}
If you have the [Audio](audio) feature enabled on your board, you can configure it to play sounds when the input mode is changed.
Add the following to your `config.h`:
Add one or more of the following definitions to your `config.h`:
|Define |Default|Description |
|-------------------|-------|-----------------------------------------------------------|

View file

@ -91,7 +91,7 @@ Enables your LED to breath while your computer is sleeping. Timer1 is being used
`NKRO_ENABLE`
This allows the keyboard to tell the host OS that up to 248 keys are held down at once (default without NKRO is 6). NKRO is off by default, even if `NKRO_ENABLE` is set. NKRO can be forced by adding `#define FORCE_NKRO` to your config.h or by binding `MAGIC_TOGGLE_NKRO` to a key and then hitting the key.
This allows the keyboard to tell the host OS that up to 248 keys are held down at once (default without NKRO is 6). NKRO is off by default, even if `NKRO_ENABLE` is set. NKRO can be toggled by binding `NK_TOGG` to a key and then hitting the key.
`BACKLIGHT_ENABLE`

View file

@ -824,7 +824,30 @@ bool get_speculative_hold(uint16_t keycode, keyrecord_t* record) {
}
```
Some operating systems or applications assign actions to tapping a modifier key by itself, e.g., tapping GUI to open a start menu. Because Speculative Hold sends a lone modifier key press in some cases, it can falsely trigger these actions. To prevent this, set `DUMMY_MOD_NEUTRALIZER_KEYCODE` (and optionally `MODS_TO_NEUTRALIZE`) in your `config.h` in the same way as described above for [Retro Tapping](#retro-tapping).
Some operating systems or applications assign actions to tapping a modifier key by itself, e.g., tapping GUI to open a start menu. Because Speculative Hold sometimes sends a lone modifier key press, it can falsely trigger these actions (known as the "flashing mods" problem). How such an input is handled depends on the OS and application, so unfortunately, there is no universal solution.
To mitigate this issue, you can set `DUMMY_MOD_NEUTRALIZER_KEYCODE` (and optionally `MODS_TO_NEUTRALIZE`) in your `config.h`, as described above for [Retro Tapping](#retro-tapping).
You can further prevent flashing mods by restricting when Speculative Hold is allowed to trigger. There are several options for this:
* Constrain Speculative Hold to one key at a time. Add to your config.h:
```c
#define SPECULATIVE_HOLD_ONE_KEY
```
With this option, Speculative Hold does not apply when any mods are already active. Mod combinations across multiple keys can still be made after the mod-tap keys settle.
* Disable Speculative Hold during the flow of fast typing. Add to your config.h:
```c
#define SPECULATIVE_HOLD_FLOW_TERM 200
```
This value specifies a duration in milliseconds. Speculative Hold does not apply if a key is pressed within this threshold of the previous key. The effect is similar to [Flow Tap](#flow-tap); however, `SPECULATIVE_HOLD_FLOW_TERM` only restricts when speculation is allowed, without affecting how the key settles.
* Use the Flow Tap option. In the fast flow of typing, the mod-tap key is immediately settled, and therefore no speculation occurs. See [Flow Tap](#flow-tap) for details.
## Why do we include the key record for the per key functions?

173
drivers/sensors/pmw3325.c Normal file
View file

@ -0,0 +1,173 @@
// Copyright 2024 Colin Lam (Ploopy Corporation)
// Copyright 2026 HorrorTroll <https://github.com/HorrorTroll>
// SPDX-License-Identifier: GPL-2.0-or-later
#include "pmw3325.h"
#include "wait.h"
#include "gpio.h"
#include "spi_master.h"
#include "pointing_device_internal.h"
#define MSB1 0x80
#define MSB0 0x7F
const pointing_device_driver_t pmw3325_pointing_device_driver = {
.init = pmw3325_init,
.get_report = pmw3325_get_report,
.set_cpi = pmw3325_set_cpi,
.get_cpi = pmw3325_get_cpi,
};
// Convert a 16-bit twos complement binary-represented number into a
// signed 16-bit integer.
static int16_t convert_twoscomp_16(uint8_t high, uint8_t low) {
uint16_t data = (high << 8) | low;
if ((data & 0x8000) == 0x8000) {
return -32768 + (data & 0x7FFF);
} else {
return data;
}
}
void pmw3325_write(uint8_t reg_addr, uint8_t data) {
spi_start(PMW3325_CS_PIN, false, 3, PMW3325_SPI_DIVISOR);
wait_us(1); // tNCS_SCLK
spi_write(reg_addr | MSB1);
wait_us(180); // tSRAD
spi_write(data);
wait_us(1); // tSCLK_NCS
spi_stop();
wait_us(20); // tSRR
}
uint8_t pmw3325_read(uint8_t reg_addr) {
spi_start(PMW3325_CS_PIN, false, 3, PMW3325_SPI_DIVISOR);
wait_us(1); // tNCS_SCLK
spi_write(reg_addr & MSB0);
wait_us(180); // tSRAD
uint8_t data = spi_read();
wait_us(1); // tSCLK_NCS
spi_stop();
wait_us(20); // tSRR
return data;
}
bool pmw3325_init(void) {
wait_ms(50);
gpio_set_pin_output(PMW3325_CS_PIN);
// CS must be kept high at power-up stage for at least 1ms
gpio_write_pin_low(PMW3325_CS_PIN);
wait_ms(10);
gpio_write_pin_high(PMW3325_CS_PIN);
spi_init();
// reboot
pmw3325_write(0x3A, 0x5A);
wait_ms(10);
pmw3325_write(0x18, 0x39);
if (!pmw3325_check_signature()) {
return false;
}
// read a burst, then discard
pmw3325_read(0x02);
pmw3325_read(0x03);
pmw3325_read(0x04);
pmw3325_read(0x05);
pmw3325_read(0x06);
// initialize
pmw3325_write(0x78, 0x80);
pmw3325_write(0x79, 0x80);
pmw3325_write(0x14, 0x80);
pmw3325_write(0x20, 0x40);
pmw3325_write(0x1A, 0x40);
pmw3325_write(0x47, 0x00);
pmw3325_write(0x48, 0x01);
pmw3325_write(0x60, 0x01);
pmw3325_write(0x69, 0x03);
pmw3325_write(0x1D, 0x90);
pmw3325_write(0x1B, 0x2E);
pmw3325_write(0x24, 0x05);
pmw3325_write(0x56, 0x00);
pmw3325_write(0x2C, 0x8A);
pmw3325_write(0x2D, 0x58);
pmw3325_write(0x40, 0x80);
pmw3325_write(0x7F, 0x01);
pmw3325_write(0x7A, 0x32);
pmw3325_write(0x6A, 0x93);
pmw3325_write(0x6B, 0x68);
pmw3325_write(0x6C, 0x71);
pmw3325_write(0x6D, 0x50);
pmw3325_write(0x7F, 0x00);
pmw3325_write(0x7F, 0x02);
pmw3325_write(0x29, 0x1C);
pmw3325_write(0x2A, 0x1A);
pmw3325_write(0x2B, 0x90);
pmw3325_write(0x40, 0x80);
pmw3325_write(0x7F, 0x00);
return true;
}
report_pmw3325_t pmw3325_read_burst(void) {
report_pmw3325_t report = {0};
uint8_t motion = pmw3325_read(0x02);
if ((motion & MSB1) == MSB1) {
// Motion detected
uint8_t dx_l = pmw3325_read(0x03);
uint8_t dx_h = pmw3325_read(0x04);
uint8_t dy_l = pmw3325_read(0x05);
uint8_t dy_h = pmw3325_read(0x06);
report.dx = convert_twoscomp_16(dx_h, dx_l);
report.dy = convert_twoscomp_16(dy_h, dy_l);
}
return report;
}
static const uint8_t pmw3325_cpi_lut[50] = {0x02, 0x04, 0x06, 0x08, 0x0B, 0x0D, 0x0F, 0x12, 0x14, 0x16, 0x19, 0x1B, 0x1D, 0x20, 0x22, 0x24, 0x27, 0x29, 0x2B, 0x2E, 0x30, 0x32, 0x34, 0x37, 0x39, 0x3B, 0x3E, 0x40, 0x42, 0x45, 0x47, 0x49, 0x4C, 0x4E, 0x50, 0x53, 0x55, 0x57, 0x5A, 0x5C, 0x5E, 0x61, 0x63, 0x65, 0x68, 0x6A, 0x6C, 0x6F, 0x71, 0x73};
void pmw3325_set_cpi(uint16_t cpi) {
uint8_t cpival = CONSTRAIN((cpi / PMW3325_CPI_STEP), (PMW3325_CPI_MIN / PMW3325_CPI_STEP), (PMW3325_CPI_MAX / PMW3325_CPI_STEP)) - 1U;
pmw3325_write(0x1B, pmw3325_cpi_lut[cpival]);
}
uint16_t pmw3325_get_cpi(void) {
uint8_t cpival = pmw3325_read(0x1B);
for (uint8_t cpi = 0; cpi < 50; cpi++) {
if (pmw3325_cpi_lut[cpi] == cpival) {
return (cpi + 1) * PMW3325_CPI_STEP;
}
}
return 0;
}
report_mouse_t pmw3325_get_report(report_mouse_t mouse_report) {
report_pmw3325_t data = pmw3325_read_burst();
if (data.dx != 0 || data.dy != 0) {
pd_dprintf("Raw ] X: %d, Y: %d\n", data.dx, data.dy);
mouse_report.x = CONSTRAIN_HID_XY(data.dx);
mouse_report.y = CONSTRAIN_HID_XY(data.dy);
}
return mouse_report;
}
bool pmw3325_check_signature(void) {
uint8_t checkval_1 = pmw3325_read(0x00);
uint8_t checkval_2 = pmw3325_read(0x3F);
return (checkval_1 == 0x43 && checkval_2 == 0xBC);
}

44
drivers/sensors/pmw3325.h Normal file
View file

@ -0,0 +1,44 @@
// Copyright 2021 Colin Lam (Ploopy Corporation)
// Copyright 2026 HorrorTroll <https://github.com/HorrorTroll>
// SPDX-License-Identifier: GPL-2.0-or-later
#pragma once
#include <stdbool.h>
#include <stdint.h>
#include "pointing_device.h"
#ifndef PMW3325_CS_PIN
# ifdef POINTING_DEVICE_CS_PIN
# define PMW3325_CS_PIN POINTING_DEVICE_CS_PIN
# else
# error "No chip select pin defined -- missing POINTING_DEVICE_CS_PIN or PMW3325_CS_PIN define"
# endif
#endif
#ifndef PMW3325_SPI_DIVISOR
# error "No PMW3325 SPI divisor defined -- missing PMW3325_SPI_DIVISOR"
#endif
typedef struct {
int16_t dx;
int16_t dy;
} report_pmw3325_t;
extern const pointing_device_driver_t pmw3325_pointing_device_driver;
bool pmw3325_init(void);
report_pmw3325_t pmw3325_read_burst(void);
void pmw3325_set_cpi(uint16_t cpi);
uint16_t pmw3325_get_cpi(void);
report_mouse_t pmw3325_get_report(report_mouse_t mouse_report);
bool pmw3325_check_signature(void);
#if !defined(PMW3325_CPI)
# define PMW3325_CPI 2000
#endif
#define PMW3325_CPI_MIN 100
#define PMW3325_CPI_MAX 5000
#define PMW3325_CPI_STEP 100
#define CONSTRAIN(amt, low, high) ((amt) < (low) ? (low) : ((amt) > (high) ? (high) : (amt)))

View file

@ -3,7 +3,6 @@
#pragma once
#define OLED_DISPLAY_128X32
#define I2C1_SCL_PIN GP17
#define I2C1_SDA_PIN GP16
#define I2C_DRIVER I2CD0

Some files were not shown because too many files have changed in this diff Show more