Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/master'
Browse files Browse the repository at this point in the history
* 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)
  ...
  • Loading branch information
barrettclark committed Apr 10, 2023
2 parents 6d29807 + fb706f4 commit ad14708
Show file tree
Hide file tree
Showing 1,001 changed files with 56,060 additions and 6,772 deletions.
74 changes: 74 additions & 0 deletions .github/workflows/ci_builds.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
name: CI Builds

permissions:
contents: read

on:
push:
branches: [master, develop]
workflow_dispatch:
inputs:
branch:
type: choice
description: 'Branch to build'
options: [master, develop]

concurrency: ci_build-${{ github.event.inputs.branch || github.ref_name }}

jobs:
ci_builds:
if: github.repository == 'qmk/qmk_firmware'
name: "CI Build"
runs-on: self-hosted
timeout-minutes: 1380

strategy:
fail-fast: false
matrix:
keymap: [default, via]

container: qmkfm/qmk_cli

steps:
- name: Disable safe.directory check
run : git config --global --add safe.directory '*'

- uses: actions/checkout@v3
with:
submodules: recursive
ref: ${{ github.event.inputs.branch || github.ref }}

- name: Install dependencies
run: pip3 install -r requirements.txt

- name: Run `qmk mass-compile` (keymap ${{ matrix.keymap }})
run: |
export NCPUS=$(nproc 2>/dev/null || sysctl -n hw.ncpu 2>/dev/null || getconf _NPROCESSORS_ONLN 2>/dev/null)
qmk mass-compile -t -j $NCPUS -km ${{ matrix.keymap }} -e DUMP_CI_METADATA=yes || touch .failed
# Generate the step summary markdown
./util/ci/generate_failure_markdown.sh > $GITHUB_STEP_SUMMARY || true
# Truncate to a maximum of 1MB to deal with GitHub workflow limit
truncate --size='<960K' $GITHUB_STEP_SUMMARY || true
# Exit with failure if the compilation stage failed
[ ! -f .failed ] || exit 1
- name: 'Upload artifacts'
uses: actions/upload-artifact@v3
if: always()
with:
name: artifacts-${{ github.event.inputs.branch || github.ref_name }}-${{ matrix.keymap }}
if-no-files-found: ignore
path: |
*.bin
*.hex
*.uf2
.build/failed.*
- name: 'CI Discord Notification'
if: always()
working-directory: util/ci/
env:
DISCORD_WEBHOOK: ${{ secrets.CI_DISCORD_WEBHOOK }}
run: |
python3 -m pip install -r requirements.txt
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 }}
2 changes: 1 addition & 1 deletion .github/workflows/format_push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ jobs:
git config user.email 'hello@qmk.fm'
- name: Create Pull Request
uses: peter-evans/create-pull-request@v4
uses: peter-evans/create-pull-request@v5
if: ${{ github.repository == 'qmk/qmk_firmware'}}
with:
token: ${{ secrets.QMK_BOT_TOKEN }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/regen_push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ jobs:
git config user.email 'hello@qmk.fm'
- name: Create Pull Request
uses: peter-evans/create-pull-request@v4
uses: peter-evans/create-pull-request@v5
if: ${{ github.repository == 'qmk/qmk_firmware'}}
with:
token: ${{ secrets.QMK_BOT_TOKEN }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/stale.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
stale:
runs-on: ubuntu-latest
steps:
- uses: actions/stale@v7
- uses: actions/stale@v8
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}

Expand Down
5 changes: 5 additions & 0 deletions builddefs/build_keyboard.mk
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,11 @@ KEYBOARD_FILESAFE := $(subst /,_,$(KEYBOARD))
TARGET ?= $(KEYBOARD_FILESAFE)_$(KEYMAP)
KEYBOARD_OUTPUT := $(BUILD_DIR)/obj_$(KEYBOARD_FILESAFE)

ifeq ($(strip $(DUMP_CI_METADATA)),yes)
$(info CI Metadata: KEYBOARD=$(KEYBOARD))
$(info CI Metadata: KEYMAP=$(KEYMAP))
endif

# Force expansion
TARGET := $(TARGET)

Expand Down
6 changes: 3 additions & 3 deletions data/constants/keycodes/keycodes_0.0.1_basic.hjson
Original file line number Diff line number Diff line change
Expand Up @@ -253,15 +253,15 @@
"0x002F": {
"group": "basic",
"key": "KC_LEFT_BRACKET",
"label": "]",
"label": "[",
"aliases": [
"KC_LBRC"
]
},
"0x0030": {
"group": "basic",
"key": "KC_RIGHT_BRACKET",
"label": "[",
"label": "]",
"aliases": [
"KC_RBRC"
]
Expand Down Expand Up @@ -1512,4 +1512,4 @@
]
}
}
}
}
43 changes: 36 additions & 7 deletions docs/cli_commands.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ qmk compile [-c] <configuratorExport.json>
qmk compile [-c] [-e <var>=<value>] [-j <num_jobs>] -kb <keyboard_name> -km <keymap_name>
```

**Usage in Keyboard Directory**:
**Usage in Keyboard Directory**:

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

```
$ cd ~/qmk_firmware/keyboards/clueboard/66/rev4
$ cd ~/qmk_firmware/keyboards/clueboard/66/rev4
$ qmk compile -km 66_iso
Ψ Compiling keymap with make clueboard/66/rev4:66_iso
...
Expand All @@ -58,7 +58,7 @@ $ qmk compile
...
```

**Usage in Layout Directory**:
**Usage in Layout Directory**:

Must be under `qmk_firmware/layouts/`, and in a keymap folder.
```
Expand Down Expand Up @@ -149,6 +149,34 @@ To exit out into the parent shell, simply type `exit`.
qmk cd
```

## `qmk find`

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.

For example, one could search for all keyboards using STM32F411:

```
qmk find -f 'processor=STM32F411'
```

...and one can further constrain the list to keyboards using STM32F411 as well as rgb_matrix support:

```
qmk find -f 'processor=STM32F411' -f 'features.rgb_matrix=true'
```

**Usage**:

```
qmk find [-h] [-km KEYMAP] [-f FILTER]
options:
-km KEYMAP, --keymap KEYMAP
The keymap name to build. Default is 'default'.
-f FILTER, --filter FILTER
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 '?'.
```

## `qmk console`

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`.
Expand Down Expand Up @@ -269,7 +297,8 @@ qmk json2c [-o OUTPUT] filename

## `qmk c2json`

Creates a keymap.json from a keymap.c.
Creates a keymap.json from a keymap.c.

**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.

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

## `qmk format-text`

This command formats text files to have proper line endings.
This command formats text files to have proper line endings.

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

## `qmk format-c`

This command formats C code using clang-format.
This command formats C code using clang-format.

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>`

Expand Down Expand Up @@ -556,7 +585,7 @@ qmk kle2json [-f] <filename>
**Examples**:

```
$ qmk kle2json kle.txt
$ qmk kle2json kle.txt
☒ File info.json already exists, use -f or --force to overwrite.
```

Expand Down
58 changes: 57 additions & 1 deletion docs/custom_quantum_functions.md
Original file line number Diff line number Diff line change
Expand Up @@ -202,14 +202,70 @@ This function gets called at the end of all QMK processing, before starting the

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.

### Example `void housekeeping_task_user(void)` implementation

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.

First, add the following lines to your keymap's `config.h`:

```c
#define RGBLIGHT_SLEEP // enable rgblight_suspend() and rgblight_wakeup() in keymap.c
#define RGBLIGHT_TIMEOUT 900000 // ms to wait until rgblight time out, 900K ms is 15min.
```
Next, add the following code to your `keymap.c`:
```c
static uint32_t key_timer; // timer for last keyboard activity, use 32bit value and function to make longer idle time possible
static void refresh_rgb(void); // refreshes the activity timer and RGB, invoke whenever any activity happens
static void check_rgb_timeout(void); // checks if enough time has passed for RGB to timeout
bool is_rgb_timeout = false; // store if RGB has timed out or not in a boolean
void refresh_rgb(void) {
key_timer = timer_read32(); // store time of last refresh
if (is_rgb_timeout)
{
is_rgb_timeout = false;
rgblight_wakeup();
}
}
void check_rgb_timeout(void) {
if (!is_rgb_timeout && timer_elapsed32(key_timer) > RGBLIGHT_TIMEOUT) // check if RGB has already timeout and if enough time has passed
{
rgblight_suspend();
is_rgb_timeout = true;
}
}
/* Then, call the above functions from QMK's built in post processing functions like so */
/* Runs at the end of each scan loop, check if RGB timeout has occured or not */
void housekeeping_task_user(void) {
#ifdef RGBLIGHT_TIMEOUT
check_rgb_timeout();
#endif
}
/* Runs after each key press, check if activity occurred */
void post_process_record_user(uint16_t keycode, keyrecord_t *record) {
#ifdef RGBLIGHT_TIMEOUT
if (record->event.pressed)
refresh_rgb();
#endif
}
/* Runs after each encoder tick, check if activity occurred */
void post_encoder_update_user(uint8_t index, bool clockwise) {
#ifdef RGBLIGHT_TIMEOUT
refresh_rgb();
#endif
}
```

# Keyboard Idling/Wake Code

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.

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.


### Example suspend_power_down_user() and suspend_wakeup_init_user() Implementation
### Example `suspend_power_down_user()` and `suspend_wakeup_init_user()` Implementation


```c
Expand Down
5 changes: 5 additions & 0 deletions docs/feature_advanced_keycodes.md
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,7 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
return true;
};
```
Alternatively, this can be done with [Key Overrides](feature_key_overrides?id=simple-example).

# Advanced topics :id=advanced-topics

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

* [Tap-Hold Configuration Options](tap_hold.md)

## Key Overrides :id=key-overrides

* [Key Overrides](feature_key_overrides.md)
12 changes: 12 additions & 0 deletions docs/feature_autocorrect.md
Original file line number Diff line number Diff line change
Expand Up @@ -236,6 +236,18 @@ bool apply_autocorrect(uint8_t backspaces, const char *str) {
}
```

### Autocorrect Status

Additional user callback functions to manipulate Autocorrect:

| Function | Description |
|----------------------------|----------------------------------------------|
| `autocorrect_enable()` | Turns Autocorrect on. |
| `autocorrect_disable()` | Turns Autocorrect off. |
| `autocorrect_toggle()` | Toggles Autocorrect. |
| `autocorrect_is_enabled()` | Returns true if Autocorrect is currently on. |


## Appendix: Trie binary data format :id=appendix

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.
Expand Down
Loading

0 comments on commit ad14708

Please sign in to comment.