Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merge from master repo #12

Merged
merged 70 commits into from
Nov 19, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
70 commits
Select commit Hold shift + click to select a range
f2eb080
Add support for 4 IS31FL3731 devices (#10860)
XBowsTech Nov 5, 2020
5f2c434
E85 backlight & LED indicator updates (#10678)
kaylanm Nov 6, 2020
d7c90d8
add dp60 indicator mode (#8801)
yulei Nov 6, 2020
b5ebdf1
[Keymap] bcat keymaps and userspace (#10705)
bcat Nov 6, 2020
7ce5402
Updates to Talljoe's Keymaps (#10115)
Talljoe Nov 7, 2020
4d33d72
New command: qmk lint (#10761)
skullydazed Nov 7, 2020
bd1c048
Add qmk info -l to show the layouts too (#10882)
skullydazed Nov 7, 2020
db829c9
Add big spacebar defaults to Underscore33 (#10731)
tominabox1 Nov 8, 2020
ff7f703
[Keyboard] Fix unused variables in mschwingen modelm (#10811)
drashna Nov 8, 2020
9cd3ffa
add missing physical layout options and VIA support for Sesame (#10471)
str-dst Nov 8, 2020
1ff5ee2
Indicator LEDs as config (#10816)
zvecr Nov 8, 2020
95bbd79
[Keyboard] Keebwerk MEGA Initial commit (#10777)
yiancar Nov 9, 2020
cb80b59
Adding few Korean translated files (#5895)
SeungheonOh Nov 9, 2020
84ca67f
[Keymap] idobo:egstad (#10783)
egstad Nov 9, 2020
16fe4b8
Update massdrop/alt and arm_atsam/led_matrix to fix #10813 (#10818)
Nov 9, 2020
f38a3b7
[Keymap] little foot (#7305)
yanfali Nov 9, 2020
ed8d1d1
Add VIA Keymap for Worldspawn Gothic70. (#10617)
stein3 Nov 10, 2020
489bee0
[Docs] redirect from /tutorial to /newbs (#10718)
Duckle29 Nov 10, 2020
2ef68a8
Added color wheel that have QMK HSV values. (#8997)
elijahblake81 Nov 10, 2020
53f1166
[Keyboard] kingly_keys/ave (#10042)
The-Royal Nov 10, 2020
a9f65b7
userspace and keymap changes for rupa (#10489)
Nov 10, 2020
8af767c
[Keyboard] Crazy Keyboard 68 (#10693)
z-ww447 Nov 10, 2020
7595f53
refactor SPLIT_KEYBOARD, OLED_DRIVER_ENABLE (#10405)
yfuku Nov 10, 2020
aa90cf1
XD68: add 65_ansi_split_bs layout (#10835)
owestend Nov 10, 2020
abf1902
[Keyboard] RGBKB Pan (#9587)
Legonut Nov 10, 2020
aae3b35
CI: Add docs build and deploy workflow (#7448)
zvecr Nov 10, 2020
683ba8b
Improve the QMK Lint workflow (#10909)
skullydazed Nov 10, 2020
a422309
Bring up Qvex Lynepad (#10826)
mcrosson Nov 11, 2020
0dee334
handwired/onekey/blackpill_f401: Fix I2C pin config mismatch (#10322)
sigprof Nov 12, 2020
d7c1b89
[Keyboard] Southpaw66 by rpiguy9907 (#10782)
gooberpsycho Nov 14, 2020
a7afaa3
[Keyboard] Time 80 TKL by Fox Lab (#10851)
lukelex Nov 14, 2020
45e16fd
[Keyboard] h660s by hineybush (#10221)
hineybush Nov 15, 2020
91b4401
ZTBoards Updated keymap and updated info.json (#10926)
phlopsuh Nov 15, 2020
5edce6b
[Keyboard] Add Lily58 via keymap (#10178)
kata0510 Nov 15, 2020
bb9fbd6
[Keymap] Add nfriend's ErgoDox EZ keymap (#10545)
nfriend Nov 15, 2020
81a17f4
[Keyboard] add Symmetric70 keyboard prototype (#10780)
mtei Nov 15, 2020
e423627
[Keyboard] added Pill60 to handwired/pill60 (#10798)
IktaS Nov 15, 2020
cfc9a35
[Keyboard] Add "Uno" (#10579)
jvbroek Nov 16, 2020
94e94ff
Recommend use of LED Indicator config (#10895)
zvecr Nov 16, 2020
b337ba7
CLI: Udev related fixes and improvements (#10736)
Erovia Nov 16, 2020
aaea5e2
[Keyboard] YMDK NP21: correct numpad layout matrix (#10874)
cole-h Nov 16, 2020
e6a13e0
[Keymap] clean up helix:five_rows keymap (#10866)
mtei Nov 16, 2020
2ffac90
Fix typo causing `redefined error` in keymap_french_osx (#10962)
gbotin Nov 16, 2020
3e0789c
BDN9: Fix encoder direction, add 3rd encoder for Rev. 1.3 support (#1…
nooges Nov 17, 2020
f339413
[Keyboard] Add Beatervan keyboard (#10939)
ojthetiny Nov 17, 2020
69bb9b7
Fox Lab Time80: add Configurator layout data (#10950)
noroadsleft Nov 17, 2020
88c09aa
[Keyboard] Add Titan 60 (#10886)
mechmerlin Nov 17, 2020
503b762
Refactor the crkbd/via keymap and fix OLED bugs (#10354)
foostan Nov 17, 2020
a896777
[Keymap] Add user keymaps to qmk master (#10870)
bghull Nov 17, 2020
cf3b683
[Keyboard] bm16s - Added Via Support (#10863)
Relocks Nov 17, 2020
1078278
[Keymap] Update for jisplit89 (#10859)
Salicylic-acid3 Nov 17, 2020
3c156e1
[Keymap] ANAVI Macro Pad 8 fix kodi and default (#10727)
leon-anavi Nov 17, 2020
adfd34c
Refactor to use led config - Part 2 (#10906)
zvecr Nov 17, 2020
ddcb179
Refactor to use led config - Part 1 (#10905)
zvecr Nov 17, 2020
58f2e04
Add VIA Keymap for boardsource/microdox (#10932)
waffle87 Nov 17, 2020
ad5cbe5
Added new keyboard - nack (#10940)
farfalleflickan Nov 18, 2020
1512e07
Add support for keyboard 'DimplePlus' (#10881)
jackytrabbit Nov 18, 2020
e1e13c5
Add support for LAYOUT_alice to sneakbox pcb (#10914)
stanrc85 Nov 18, 2020
f00402a
Refactor to use led config - Part 3 (#10966)
zvecr Nov 18, 2020
e4aadf2
[Keyboard] Add wilba.tech WT65-G (#10877)
wilba Nov 18, 2020
ad9674c
[Keyboard] Add wilba.tech WT80-G (#10878)
wilba Nov 18, 2020
3270cbe
[Keymap]Add and Update keymap for reviung34 (#10915)
gtips Nov 18, 2020
0f8b0d9
VIA Support: E6V2 BMC editions (#10969)
mechmerlin Nov 18, 2020
66d52d8
Update the melody96:zunger keymap (#10888)
yonatanzunger Nov 18, 2020
7bdc41b
Changed personal keymap punk75:dsanchezseco (#10928)
dsanchezseco Nov 18, 2020
078586b
Update one_shot_keys.md (#10917)
j-zero Nov 18, 2020
3aef2be
Add basic OLED keymap for nullbitsco/nibble (#10912)
Nov 18, 2020
88a783a
[Keyboard] PloopyCo update and fixes (#10936)
drashna Nov 18, 2020
6dc2d59
[Keymap] add massdrop/alt:pregame (#8953)
elijahblake81 Nov 18, 2020
e7497b3
Add references for is_keyboard_left() (#10850)
drashna Nov 19, 2020
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
43 changes: 43 additions & 0 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: Generate Docs

on:
push:
branches:
- master
paths:
- 'tmk_core/**'
- 'quantum/**'
- 'platforms/**'
- 'docs/**'
- '.github/workflows/docs.yml'

jobs:
generate:
runs-on: ubuntu-latest
container: qmkfm/base_container

# protect against those who develop with their fork on master
if: github.repository == 'qmk/qmk_firmware'

steps:
- uses: actions/checkout@v2
with:
fetch-depth: 1

- name: Install dependencies
run: |
apt-get update && apt-get install -y rsync nodejs npm doxygen
npm install -g moxygen

- name: Build docs
run: |
qmk --verbose generate-docs

- name: Deploy
uses: JamesIves/github-pages-deploy-action@3.7.1
with:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
BASE_BRANCH: master
BRANCH: gh-pages
FOLDER: .build/docs
GIT_CONFIG_EMAIL: hello@qmk.fm
13 changes: 7 additions & 6 deletions .github/workflows/info.yml → .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ on:
- 'keyboards/**'

jobs:
info:
lint:
runs-on: ubuntu-latest

container: qmkfm/base_container
Expand All @@ -27,7 +27,7 @@ jobs:
echo ${{ github.event.pull_request.base.sha }}
echo '${{ steps.file_changes.outputs.files}}'

- name: Run qmk info
- name: Run qmk lint
shell: 'bash {0}'
run: |
QMK_CHANGES=$(echo -e '${{ steps.file_changes.outputs.files}}')
Expand All @@ -45,10 +45,11 @@ jobs:
if [[ $KEYMAP_ONLY -gt 0 ]]; then
echo "linting ${KB}"

# TODO: info info always returns 0 - right now the only way to know failure is to inspect log lines
qmk info -l -kb ${KB} 2>&1 | tee /tmp/$$
!(grep -cq ☒ /tmp/$$)
: $((exit_code = $exit_code + $?))
qmk lint --keyboard ${KB} && qmk info -l --keyboard ${KB}
exit_code=$(($exit_code + $?))
fi
done
if [[ $exit_code -gt 255 ]]; then
exit 255
fi
exit $exit_code
5 changes: 0 additions & 5 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,21 +18,16 @@ addons:
- ubuntu-toolchain-r-test
- llvm-toolchain-trusty-7
packages:
- pandoc
- diffutils
- dos2unix
- doxygen
- clang-format-7
- libstdc++-7-dev
install:
- npm install -g moxygen
script:
- git fetch --depth=50 origin $TRAVIS_BRANCH:$TRAVIS_BRANCH
- git rev-parse --short HEAD
- git diff --name-only HEAD $TRAVIS_BRANCH
- bash util/travis_test.sh
- bash util/travis_build.sh
- bash util/travis_docs.sh
after_script:
bash util/travis_compiled_push.sh
notifications:
Expand Down
1 change: 1 addition & 0 deletions common_features.mk
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ SERIAL_PATH := $(QUANTUM_PATH)/serial_link

QUANTUM_SRC += \
$(QUANTUM_DIR)/quantum.c \
$(QUANTUM_DIR)/led.c \
$(QUANTUM_DIR)/keymap_common.c \
$(QUANTUM_DIR)/keycode_config.c

Expand Down
1 change: 1 addition & 0 deletions docs/_summary.md
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,7 @@
* [Encoders](feature_encoders.md)
* [Haptic Feedback](feature_haptic_feedback.md)
* [Joystick](feature_joystick.md)
* [LED Indicators](feature_led_indicators.md)
* [Proton C Conversion](proton_c_conversion.md)
* [PS/2 Mouse](feature_ps2_mouse.md)
* [Split Keyboard](feature_split_keyboard.md)
Expand Down
29 changes: 28 additions & 1 deletion docs/cli_commands.md
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,24 @@ Creates a keymap.json from a keymap.c.
qmk c2json [--no-cpp] [-o OUTPUT] filename
```

## `qmk lint`

Checks over a keyboard and/or keymap and highlights common errors, problems, and anti-patterns.

**Usage**:

```
qmk lint [-km KEYMAP] [-kb KEYBOARD] [--strict]
```

This command is directory aware. It will automatically fill in KEYBOARD and/or KEYMAP if you are in a keyboard or keymap directory.

**Examples**:

Do a basic lint check:

qmk lint -kb rominronin/katana60/rev2

## `qmk list-keyboards`

This command lists all the keyboards currently defined in `qmk_firmware`
Expand Down Expand Up @@ -268,6 +286,16 @@ This command starts a local HTTP server which you can use for browsing or improv
qmk docs [-p PORT]
```

## `qmk generate-docs`

This command allows you to generate QMK documentation locally. It can be uses for general browsing or improving the docs. External tools such as [serve](https://www.npmjs.com/package/serve) can be used to browse the generated files.

**Usage**:

```
qmk generate-docs
```

## `qmk kle2json`

This command allows you to convert from raw KLE data to QMK Configurator JSON. It accepts either an absolute file path, or a file name in the current directory. By default it will not overwrite `info.json` if it is already present. Use the `-f` or `--force` flag to overwrite.
Expand Down Expand Up @@ -309,4 +337,3 @@ This command runs the python test suite. If you make changes to python code you
```
qmk pytest
```

102 changes: 0 additions & 102 deletions docs/custom_quantum_functions.md
Original file line number Diff line number Diff line change
Expand Up @@ -88,108 +88,6 @@ keyrecord_t record {
}
```

# LED Control

QMK provides methods to read 5 of the LEDs defined in the HID spec:

* Num Lock
* Caps Lock
* Scroll Lock
* Compose
* Kana

There are two ways to get the lock LED state:

* by implementing `bool led_update_kb(led_t led_state)` or `_user(led_t led_state)`; or
* by calling `led_t host_keyboard_led_state()`

!> `host_keyboard_led_state()` may already reflect a new value before `led_update_user()` is called.

Two more deprecated functions exist that provide the LED state as a `uint8_t`:

* `uint8_t led_set_kb(uint8_t usb_led)` and `_user(uint8_t usb_led)`
* `uint8_t host_keyboard_leds()`

## `led_update_user()`

This function will be called when the state of one of those 5 LEDs changes. It receives the LED state as a struct parameter.

By convention, return `true` from `led_update_user()` to get the `led_update_kb()` hook to run its code, and
return `false` when you would prefer not to run the code in `led_update_kb()`.

Some examples include:

- overriding the LEDs to use them for something else like layer indication
- return `false` because you do not want the `_kb()` function to run, as it would override your layer behavior.
- play a sound when an LED turns on or off.
- return `true` because you want the `_kb` function to run, and this is in addition to the default LED behavior.

?> Because the `led_set_*` functions return `void` instead of `bool`, they do not allow for overriding the keyboard LED control, and thus it's recommended to use `led_update_*` instead.

### Example `led_update_kb()` Implementation

```c
bool led_update_kb(led_t led_state) {
bool res = led_update_user(led_state);
if(res) {
// writePin sets the pin high for 1 and low for 0.
// In this example the pins are inverted, setting
// it low/0 turns it on, and high/1 turns the LED off.
// This behavior depends on whether the LED is between the pin
// and VCC or the pin and GND.
writePin(B0, !led_state.num_lock);
writePin(B1, !led_state.caps_lock);
writePin(B2, !led_state.scroll_lock);
writePin(B3, !led_state.compose);
writePin(B4, !led_state.kana);
}
return res;
}
```

### Example `led_update_user()` Implementation

This incomplete example would play a sound if Caps Lock is turned on or off. It returns `true`, because you also want the LEDs to maintain their state.

```c
#ifdef AUDIO_ENABLE
float caps_on[][2] = SONG(CAPS_LOCK_ON_SOUND);
float caps_off[][2] = SONG(CAPS_LOCK_OFF_SOUND);
#endif

bool led_update_user(led_t led_state) {
#ifdef AUDIO_ENABLE
static uint8_t caps_state = 0;
if (caps_state != led_state.caps_lock) {
led_state.caps_lock ? PLAY_SONG(caps_on) : PLAY_SONG(caps_off);
caps_state = led_state.caps_lock;
}
#endif
return true;
}
```

### `led_update_*` Function Documentation

* Keyboard/Revision: `bool led_update_kb(led_t led_state)`
* Keymap: `bool led_update_user(led_t led_state)`

## `host_keyboard_led_state()`

Call this function to get the last received LED state as a `led_t`. This is useful for reading the LED state outside `led_update_*`, e.g. in [`matrix_scan_user()`](#matrix-scanning-code).

## Setting Physical LED State

Some keyboard implementations provide convenience methods for setting the state of the physical LEDs.

### Ergodox Boards

The Ergodox implementations provide `ergodox_right_led_1`/`2`/`3_on`/`off()` to turn individual LEDs on or off, as well as `ergodox_right_led_on`/`off(uint8_t led)` to turn them on or off by their index.

In addition, it is possible to specify the brightness level of all LEDs with `ergodox_led_all_set(uint8_t n)`; of individual LEDs with `ergodox_right_led_1`/`2`/`3_set(uint8_t n)`; or by index with `ergodox_right_led_set(uint8_t led, uint8_t n)`.

Ergodox boards also define `LED_BRIGHTNESS_LO` for the lowest brightness and `LED_BRIGHTNESS_HI` for the highest brightness (which is the default).

# Keyboard Initialization Code

There are several steps in the keyboard initialization process. Depending on what you want to do, it will influence which function you should use.
Expand Down
116 changes: 116 additions & 0 deletions docs/feature_led_indicators.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,116 @@
# LED Indicators

QMK provides methods to read 5 of the LEDs defined in the HID spec:

* Num Lock
* Caps Lock
* Scroll Lock
* Compose
* Kana

There are three ways to get the lock LED state:
* by specifying configuration options within `config.h`
* by implementing `bool led_update_kb(led_t led_state)` or `_user(led_t led_state)`; or
* by calling `led_t host_keyboard_led_state()`

!> `host_keyboard_led_state()` may already reflect a new value before `led_update_user()` is called.

Two more deprecated functions exist that provide the LED state as a `uint8_t`:

* `uint8_t led_set_kb(uint8_t usb_led)` and `_user(uint8_t usb_led)`
* `uint8_t host_keyboard_leds()`

## Configuration Options

To configure the indicators, `#define` these in your `config.h`:

|Define |Default |Description |
|---------------------|-------------|-------------------------------------------|
|`LED_NUM_LOCK_PIN` |*Not defined*|The pin that controls the `Num Lock` LED |
|`LED_CAPS_LOCK_PIN` |*Not defined*|The pin that controls the `Caps Lock` LED |
|`LED_SCROLL_LOCK_PIN`|*Not defined*|The pin that controls the `Scroll Lock` LED|
|`LED_COMPOSE_PIN` |*Not defined*|The pin that controls the `Compose` LED |
|`LED_KANA_PIN` |*Not defined*|The pin that controls the `Kana` LED |
|`LED_PIN_ON_STATE` |`1` |The state of the indicator pins when the LED is "on" - `1` for high, `0` for low|

Unless you are designing your own keyboard, you generally should not need to change the above config options.

## `led_update_*()`

When the configuration options do not provide enough flexibility, the API hooks provided allow custom control of the LED behavior. These functions will be called when the state of one of those 5 LEDs changes. It receives the LED state as a struct parameter.

By convention, return `true` from `led_update_user()` to get the `led_update_kb()` hook to run its code, and
return `false` when you would prefer not to run the code in `led_update_kb()`.

Some examples include:

- overriding the LEDs to use them for something else like layer indication
- return `false` because you do not want the `_kb()` function to run, as it would override your layer behavior.
- play a sound when an LED turns on or off.
- return `true` because you want the `_kb` function to run, and this is in addition to the default LED behavior.

?> Because the `led_set_*` functions return `void` instead of `bool`, they do not allow for overriding the keyboard LED control, and thus it's recommended to use `led_update_*` instead.

### Example `led_update_kb()` Implementation

```c
bool led_update_kb(led_t led_state) {
bool res = led_update_user(led_state);
if(res) {
// writePin sets the pin high for 1 and low for 0.
// In this example the pins are inverted, setting
// it low/0 turns it on, and high/1 turns the LED off.
// This behavior depends on whether the LED is between the pin
// and VCC or the pin and GND.
writePin(B0, !led_state.num_lock);
writePin(B1, !led_state.caps_lock);
writePin(B2, !led_state.scroll_lock);
writePin(B3, !led_state.compose);
writePin(B4, !led_state.kana);
}
return res;
}
```

### Example `led_update_user()` Implementation

This incomplete example would play a sound if Caps Lock is turned on or off. It returns `true`, because you also want the LEDs to maintain their state.

```c
#ifdef AUDIO_ENABLE
float caps_on[][2] = SONG(CAPS_LOCK_ON_SOUND);
float caps_off[][2] = SONG(CAPS_LOCK_OFF_SOUND);
#endif

bool led_update_user(led_t led_state) {
#ifdef AUDIO_ENABLE
static uint8_t caps_state = 0;
if (caps_state != led_state.caps_lock) {
led_state.caps_lock ? PLAY_SONG(caps_on) : PLAY_SONG(caps_off);
caps_state = led_state.caps_lock;
}
#endif
return true;
}
```

### `led_update_*` Function Documentation

* Keyboard/Revision: `bool led_update_kb(led_t led_state)`
* Keymap: `bool led_update_user(led_t led_state)`

## `host_keyboard_led_state()`

Call this function to get the last received LED state as a `led_t`. This is useful for reading the LED state outside `led_update_*`, e.g. in [`matrix_scan_user()`](#matrix-scanning-code).

## Setting Physical LED State

Some keyboard implementations provide convenience methods for setting the state of the physical LEDs.

### Ergodox Boards

The Ergodox implementations provide `ergodox_right_led_1`/`2`/`3_on`/`off()` to turn individual LEDs on or off, as well as `ergodox_right_led_on`/`off(uint8_t led)` to turn them on or off by their index.

In addition, it is possible to specify the brightness level of all LEDs with `ergodox_led_all_set(uint8_t n)`; of individual LEDs with `ergodox_right_led_1`/`2`/`3_set(uint8_t n)`; or by index with `ergodox_right_led_set(uint8_t led, uint8_t n)`.

Ergodox boards also define `LED_BRIGHTNESS_LO` for the lowest brightness and `LED_BRIGHTNESS_HI` for the highest brightness (which is the default).
2 changes: 2 additions & 0 deletions docs/feature_rgblight.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,8 @@ Changing the **Hue** cycles around the circle.<br>
Changing the **Saturation** moves between the inner and outer sections of the wheel, affecting the intensity of the color.<br>
Changing the **Value** sets the overall brightness.<br>

![QMK Color Wheel with HSV Values](https://i.imgur.com/vkYVo66.jpg)

## Keycodes

|Key |Aliases |Description |
Expand Down
Loading