Skip to content

Commit ad14708

Browse files
committed
Merge remote-tracking branch 'upstream/master'
* upstream/master: (163 commits) Run CI builds for each push, limit queued workflow depth to 1. (qmk#20362) Add numpad 0-9 to second layer, update keycodes for QMK 0.17.5, fix layout (qmk#20375) Add autocomplete to generate-compilation-database (qmk#20387) [Keyboard] Add audio support to Adafruit MacroPad RP2040 (qmk#20353) Convertors documentation: Removed duplicate table entry (qmk#20360) Avoid generating empty ENCODER_RESOLUTION (qmk#20179) Fixup CI build variables. (qmk#20357) Add Discord webhook at end of each CI run. (qmk#20355) Move a_dux to data-driven (qmk#20043) [Keyboard] Add Keychron Q11 (qmk#20125) Bump peter-evans/create-pull-request from 4 to 5 (qmk#20346) Add peterfalken userspace & keymaps (qmk#19897) Add Iron160 I160-S and I160-H PCBs support (qmk#20077) [Keyboard] Add lxxt (qmk#19935) Add Junco Keyboard (qmk#19516) [Keyboard] Add Budgy and Crowboard Keyboards (qmk#19141) Resolve keyboard names for `qmk mass-compile`. (qmk#20335) Add debounce time description (qmk#20333) Manibus keyboard, update pinout (qmk#20309) Use table for debounce algorithm description (qmk#20322) ...
2 parents 6d29807 + fb706f4 commit ad14708

File tree

1,001 files changed

+56060
-6772
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

1,001 files changed

+56060
-6772
lines changed

.github/workflows/ci_builds.yml

Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
name: CI Builds
2+
3+
permissions:
4+
contents: read
5+
6+
on:
7+
push:
8+
branches: [master, develop]
9+
workflow_dispatch:
10+
inputs:
11+
branch:
12+
type: choice
13+
description: 'Branch to build'
14+
options: [master, develop]
15+
16+
concurrency: ci_build-${{ github.event.inputs.branch || github.ref_name }}
17+
18+
jobs:
19+
ci_builds:
20+
if: github.repository == 'qmk/qmk_firmware'
21+
name: "CI Build"
22+
runs-on: self-hosted
23+
timeout-minutes: 1380
24+
25+
strategy:
26+
fail-fast: false
27+
matrix:
28+
keymap: [default, via]
29+
30+
container: qmkfm/qmk_cli
31+
32+
steps:
33+
- name: Disable safe.directory check
34+
run : git config --global --add safe.directory '*'
35+
36+
- uses: actions/checkout@v3
37+
with:
38+
submodules: recursive
39+
ref: ${{ github.event.inputs.branch || github.ref }}
40+
41+
- name: Install dependencies
42+
run: pip3 install -r requirements.txt
43+
44+
- name: Run `qmk mass-compile` (keymap ${{ matrix.keymap }})
45+
run: |
46+
export NCPUS=$(nproc 2>/dev/null || sysctl -n hw.ncpu 2>/dev/null || getconf _NPROCESSORS_ONLN 2>/dev/null)
47+
qmk mass-compile -t -j $NCPUS -km ${{ matrix.keymap }} -e DUMP_CI_METADATA=yes || touch .failed
48+
# Generate the step summary markdown
49+
./util/ci/generate_failure_markdown.sh > $GITHUB_STEP_SUMMARY || true
50+
# Truncate to a maximum of 1MB to deal with GitHub workflow limit
51+
truncate --size='<960K' $GITHUB_STEP_SUMMARY || true
52+
# Exit with failure if the compilation stage failed
53+
[ ! -f .failed ] || exit 1
54+
55+
- name: 'Upload artifacts'
56+
uses: actions/upload-artifact@v3
57+
if: always()
58+
with:
59+
name: artifacts-${{ github.event.inputs.branch || github.ref_name }}-${{ matrix.keymap }}
60+
if-no-files-found: ignore
61+
path: |
62+
*.bin
63+
*.hex
64+
*.uf2
65+
.build/failed.*
66+
67+
- name: 'CI Discord Notification'
68+
if: always()
69+
working-directory: util/ci/
70+
env:
71+
DISCORD_WEBHOOK: ${{ secrets.CI_DISCORD_WEBHOOK }}
72+
run: |
73+
python3 -m pip install -r requirements.txt
74+
python3 ./discord-results.py --branch ${{ github.event.inputs.branch || github.ref_name }} --keymap ${{ matrix.keymap }} --url ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}

.github/workflows/format_push.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ jobs:
4747
git config user.email '[email protected]'
4848
4949
- name: Create Pull Request
50-
uses: peter-evans/create-pull-request@v4
50+
uses: peter-evans/create-pull-request@v5
5151
if: ${{ github.repository == 'qmk/qmk_firmware'}}
5252
with:
5353
token: ${{ secrets.QMK_BOT_TOKEN }}

.github/workflows/regen_push.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ jobs:
3434
git config user.email '[email protected]'
3535
3636
- name: Create Pull Request
37-
uses: peter-evans/create-pull-request@v4
37+
uses: peter-evans/create-pull-request@v5
3838
if: ${{ github.repository == 'qmk/qmk_firmware'}}
3939
with:
4040
token: ${{ secrets.QMK_BOT_TOKEN }}

.github/workflows/stale.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ jobs:
1313
stale:
1414
runs-on: ubuntu-latest
1515
steps:
16-
- uses: actions/stale@v7
16+
- uses: actions/stale@v8
1717
with:
1818
repo-token: ${{ secrets.GITHUB_TOKEN }}
1919

builddefs/build_keyboard.mk

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,11 @@ KEYBOARD_FILESAFE := $(subst /,_,$(KEYBOARD))
2929
TARGET ?= $(KEYBOARD_FILESAFE)_$(KEYMAP)
3030
KEYBOARD_OUTPUT := $(BUILD_DIR)/obj_$(KEYBOARD_FILESAFE)
3131

32+
ifeq ($(strip $(DUMP_CI_METADATA)),yes)
33+
$(info CI Metadata: KEYBOARD=$(KEYBOARD))
34+
$(info CI Metadata: KEYMAP=$(KEYMAP))
35+
endif
36+
3237
# Force expansion
3338
TARGET := $(TARGET)
3439

data/constants/keycodes/keycodes_0.0.1_basic.hjson

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -253,15 +253,15 @@
253253
"0x002F": {
254254
"group": "basic",
255255
"key": "KC_LEFT_BRACKET",
256-
"label": "]",
256+
"label": "[",
257257
"aliases": [
258258
"KC_LBRC"
259259
]
260260
},
261261
"0x0030": {
262262
"group": "basic",
263263
"key": "KC_RIGHT_BRACKET",
264-
"label": "[",
264+
"label": "]",
265265
"aliases": [
266266
"KC_RBRC"
267267
]
@@ -1512,4 +1512,4 @@
15121512
]
15131513
}
15141514
}
1515-
}
1515+
}

docs/cli_commands.md

Lines changed: 36 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ qmk compile [-c] <configuratorExport.json>
2020
qmk compile [-c] [-e <var>=<value>] [-j <num_jobs>] -kb <keyboard_name> -km <keymap_name>
2121
```
2222

23-
**Usage in Keyboard Directory**:
23+
**Usage in Keyboard Directory**:
2424

2525
Must be in keyboard directory with a default keymap, or in keymap directory for keyboard, or supply one with `--keymap <keymap_name>`
2626
```
@@ -44,7 +44,7 @@ $ qmk compile
4444
or with optional keymap argument
4545

4646
```
47-
$ cd ~/qmk_firmware/keyboards/clueboard/66/rev4
47+
$ cd ~/qmk_firmware/keyboards/clueboard/66/rev4
4848
$ qmk compile -km 66_iso
4949
Ψ Compiling keymap with make clueboard/66/rev4:66_iso
5050
...
@@ -58,7 +58,7 @@ $ qmk compile
5858
...
5959
```
6060

61-
**Usage in Layout Directory**:
61+
**Usage in Layout Directory**:
6262

6363
Must be under `qmk_firmware/layouts/`, and in a keymap folder.
6464
```
@@ -149,6 +149,34 @@ To exit out into the parent shell, simply type `exit`.
149149
qmk cd
150150
```
151151

152+
## `qmk find`
153+
154+
This command allows for searching through keyboard/keymap targets, filtering by specific criteria. `info.json` and `rules.mk` files contribute to the search data, as well as keymap configurations, and the results can be filtered using "dotty" syntax matching the overall `info.json` file format.
155+
156+
For example, one could search for all keyboards using STM32F411:
157+
158+
```
159+
qmk find -f 'processor=STM32F411'
160+
```
161+
162+
...and one can further constrain the list to keyboards using STM32F411 as well as rgb_matrix support:
163+
164+
```
165+
qmk find -f 'processor=STM32F411' -f 'features.rgb_matrix=true'
166+
```
167+
168+
**Usage**:
169+
170+
```
171+
qmk find [-h] [-km KEYMAP] [-f FILTER]
172+
173+
options:
174+
-km KEYMAP, --keymap KEYMAP
175+
The keymap name to build. Default is 'default'.
176+
-f FILTER, --filter FILTER
177+
Filter the list of keyboards based on the supplied value in rules.mk. Matches info.json structure, and accepts the formats 'features.rgblight=true' or 'exists(matrix_pins.direct)'. May be passed multiple times, all filters need to match. Value may include wildcards such as '*' and '?'.
178+
```
179+
152180
## `qmk console`
153181

154182
This command lets you connect to keyboard consoles to get debugging messages. It only works if your keyboard firmware has been compiled with `CONSOLE_ENABLE=yes`.
@@ -269,7 +297,8 @@ qmk json2c [-o OUTPUT] filename
269297

270298
## `qmk c2json`
271299

272-
Creates a keymap.json from a keymap.c.
300+
Creates a keymap.json from a keymap.c.
301+
273302
**Note:** Parsing C source files is not easy, therefore this subcommand may not work with your keymap. In some cases not using the C pre-processor helps.
274303

275304
**Usage**:
@@ -442,7 +471,7 @@ $ qmk import-kbfirmware ~/Downloads/gh62.json
442471

443472
## `qmk format-text`
444473

445-
This command formats text files to have proper line endings.
474+
This command formats text files to have proper line endings.
446475

447476
Every text file in the repository needs to have Unix (LF) line ending.
448477
If you are working on **Windows**, you must ensure that line endings are corrected in order to get your PRs merged.
@@ -453,7 +482,7 @@ qmk format-text
453482

454483
## `qmk format-c`
455484

456-
This command formats C code using clang-format.
485+
This command formats C code using clang-format.
457486

458487
Run it with no arguments to format all core code that has been changed. Default checks `origin/master` with `git diff`, branch can be changed using `-b <branch_name>`
459488

@@ -556,7 +585,7 @@ qmk kle2json [-f] <filename>
556585
**Examples**:
557586

558587
```
559-
$ qmk kle2json kle.txt
588+
$ qmk kle2json kle.txt
560589
☒ File info.json already exists, use -f or --force to overwrite.
561590
```
562591

docs/custom_quantum_functions.md

Lines changed: 57 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -202,14 +202,70 @@ This function gets called at the end of all QMK processing, before starting the
202202

203203
Similar to `matrix_scan_*`, these are called as often as the MCU can handle. To keep your board responsive, it's suggested to do as little as possible during these function calls, potentially throtting their behaviour if you do indeed require implementing something special.
204204

205+
### Example `void housekeeping_task_user(void)` implementation
206+
207+
This example will show you how to use `void housekeeping_task_user(void)` to turn off [RGB Light](feature_rgblight.md). For RGB Matrix, the [builtin](https://docs.qmk.fm/#/feature_rgb_matrix?id=additional-configh-options) `RGB_MATRIX_TIMEOUT` should be used.
208+
209+
First, add the following lines to your keymap's `config.h`:
210+
211+
```c
212+
#define RGBLIGHT_SLEEP // enable rgblight_suspend() and rgblight_wakeup() in keymap.c
213+
#define RGBLIGHT_TIMEOUT 900000 // ms to wait until rgblight time out, 900K ms is 15min.
214+
```
215+
216+
Next, add the following code to your `keymap.c`:
217+
218+
```c
219+
static uint32_t key_timer; // timer for last keyboard activity, use 32bit value and function to make longer idle time possible
220+
static void refresh_rgb(void); // refreshes the activity timer and RGB, invoke whenever any activity happens
221+
static void check_rgb_timeout(void); // checks if enough time has passed for RGB to timeout
222+
bool is_rgb_timeout = false; // store if RGB has timed out or not in a boolean
223+
224+
void refresh_rgb(void) {
225+
key_timer = timer_read32(); // store time of last refresh
226+
if (is_rgb_timeout)
227+
{
228+
is_rgb_timeout = false;
229+
rgblight_wakeup();
230+
}
231+
}
232+
void check_rgb_timeout(void) {
233+
if (!is_rgb_timeout && timer_elapsed32(key_timer) > RGBLIGHT_TIMEOUT) // check if RGB has already timeout and if enough time has passed
234+
{
235+
rgblight_suspend();
236+
is_rgb_timeout = true;
237+
}
238+
}
239+
/* Then, call the above functions from QMK's built in post processing functions like so */
240+
/* Runs at the end of each scan loop, check if RGB timeout has occured or not */
241+
void housekeeping_task_user(void) {
242+
#ifdef RGBLIGHT_TIMEOUT
243+
check_rgb_timeout();
244+
#endif
245+
}
246+
/* Runs after each key press, check if activity occurred */
247+
void post_process_record_user(uint16_t keycode, keyrecord_t *record) {
248+
#ifdef RGBLIGHT_TIMEOUT
249+
if (record->event.pressed)
250+
refresh_rgb();
251+
#endif
252+
}
253+
/* Runs after each encoder tick, check if activity occurred */
254+
void post_encoder_update_user(uint8_t index, bool clockwise) {
255+
#ifdef RGBLIGHT_TIMEOUT
256+
refresh_rgb();
257+
#endif
258+
}
259+
```
260+
205261
# Keyboard Idling/Wake Code
206262

207263
If the board supports it, it can be "idled", by stopping a number of functions. A good example of this is RGB lights or backlights. This can save on power consumption, or may be better behavior for your keyboard.
208264

209265
This is controlled by two functions: `suspend_power_down_*` and `suspend_wakeup_init_*`, which are called when the system board is idled and when it wakes up, respectively.
210266

211267

212-
### Example suspend_power_down_user() and suspend_wakeup_init_user() Implementation
268+
### Example `suspend_power_down_user()` and `suspend_wakeup_init_user()` Implementation
213269

214270

215271
```c

docs/feature_advanced_keycodes.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -160,6 +160,7 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
160160
return true;
161161
};
162162
```
163+
Alternatively, this can be done with [Key Overrides](feature_key_overrides?id=simple-example).
163164

164165
# Advanced topics :id=advanced-topics
165166

@@ -180,3 +181,7 @@ This page used to encompass a large set of features. We have moved many sections
180181
## Tap-Hold Configuration Options :id=tap-hold-configuration-options
181182

182183
* [Tap-Hold Configuration Options](tap_hold.md)
184+
185+
## Key Overrides :id=key-overrides
186+
187+
* [Key Overrides](feature_key_overrides.md)

docs/feature_autocorrect.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -236,6 +236,18 @@ bool apply_autocorrect(uint8_t backspaces, const char *str) {
236236
}
237237
```
238238

239+
### Autocorrect Status
240+
241+
Additional user callback functions to manipulate Autocorrect:
242+
243+
| Function | Description |
244+
|----------------------------|----------------------------------------------|
245+
| `autocorrect_enable()` | Turns Autocorrect on. |
246+
| `autocorrect_disable()` | Turns Autocorrect off. |
247+
| `autocorrect_toggle()` | Toggles Autocorrect. |
248+
| `autocorrect_is_enabled()` | Returns true if Autocorrect is currently on. |
249+
250+
239251
## Appendix: Trie binary data format :id=appendix
240252

241253
This section details how the trie is serialized to byte data in autocorrect_data. You don’t need to care about this to use this autocorrection implementation. But it is documented for the record in case anyone is interested in modifying the implementation, or just curious how it works.

0 commit comments

Comments
 (0)