Compare commits
205 Commits
Author | SHA1 | Date | |
---|---|---|---|
df7f33582f | |||
0e81954289 | |||
b100db1e56 | |||
3f63bbc7d8 | |||
fe7ac87f18 | |||
8b824a8029 | |||
d43045e845 | |||
78c4907f34 | |||
dc52347461 | |||
88046b3ebf | |||
1d194ac60f | |||
f5e81681cd | |||
cc1565f2a3 | |||
9ecd6eb9b9 | |||
2b3f6d0ec6 | |||
0bae3b09a1 | |||
2d25b89d11 | |||
059a7fb9b0 | |||
9f0d9b4fbe | |||
2b33d2c098 | |||
3db33fba28 | |||
245f00b4d9 | |||
dfa5880144 | |||
5329f2558c | |||
3b95f97a19 | |||
4dfd744e4e | |||
10005e9f39 | |||
e1e86cb1fb | |||
b77ff4edf4 | |||
043e6e72c0 | |||
f3351c6bfb | |||
cb2a99a415 | |||
454c8c3100 | |||
cc8f2c584a | |||
dc7d2692c6 | |||
83776b44b3 | |||
be61df0827 | |||
dab9edeabb | |||
2c4fd924c0 | |||
168b69654f | |||
917c12d973 | |||
8f7b382902 | |||
adcdacf93c | |||
5b2eb4ec85 | |||
26c3e877c7 | |||
1dd15a8f22 | |||
96c1ac24ee | |||
413284a2e8 | |||
43e57ab777 | |||
94ec64f91b | |||
45b5ed5c6e | |||
bad8c67189 | |||
49128d6b85 | |||
b51b3681b7 | |||
00dc764f72 | |||
bfcbcfe3c7 | |||
14e1886405 | |||
961de3c205 | |||
51f2d27321 | |||
eb55551e2d | |||
6b8dfdfca5 | |||
c705f0f85f | |||
c71bc77da1 | |||
d6f77637c5 | |||
d050e689f5 | |||
269600f640 | |||
7b7255553c | |||
6f108642eb | |||
63c87f591e | |||
848e1ec318 | |||
f8c8005ce1 | |||
7d0c1332cc | |||
492c34f8d0 | |||
e1980726ba | |||
cad1547ee6 | |||
e021fe90b1 | |||
045170a958 | |||
357eeafd39 | |||
b521641c50 | |||
d98ec93eb8 | |||
65d0fef47a | |||
667831daba | |||
1b9de35f3a | |||
e2954cd432 | |||
7a5a99b6a5 | |||
995a0077fc | |||
6809f154c9 | |||
04b93bd2a9 | |||
fe7ee4961c | |||
a4dcf22fd7 | |||
82eb98449d | |||
ab58ae582e | |||
1bdf4cdc22 | |||
056d6aee27 | |||
431c92893f | |||
e88f0adcae | |||
7caf0b1ab8 | |||
dfa6fd4b2a | |||
2901649578 | |||
6d4d228bea | |||
244f27ac27 | |||
0dca9a1f62 | |||
fa1388a42e | |||
5ff2d93582 | |||
3072feb8ed | |||
45cc7f1e94 | |||
fe9c1d8e45 | |||
6cf4af9876 | |||
e3e0a35b58 | |||
2791ceb6aa | |||
03a671e795 | |||
3b7aeddc4d | |||
ea80141f69 | |||
ee22f34e69 | |||
b03a3d7047 | |||
b0f824755a | |||
456d6f3342 | |||
100cf3db3a | |||
41fdf32afb | |||
51620c1042 | |||
652d1d8a6d | |||
89df40d4f3 | |||
ed6679b89c | |||
2c516fab29 | |||
d8ef2ea7dd | |||
e7e08030d2 | |||
ecb4ba70b1 | |||
c6ff10a257 | |||
c56dc9c0bb | |||
3444dd5e2d | |||
4781a798ca | |||
799046fd9d | |||
1ec8ae8a49 | |||
cf88d95613 | |||
617f957e82 | |||
57c35bd817 | |||
56bad5d357 | |||
f483520ff9 | |||
3fbc3ac8ad | |||
01f31bf28e | |||
0abde386ae | |||
017398c283 | |||
624ab64750 | |||
083ac400e2 | |||
87b1b560cb | |||
fc3f2dcb43 | |||
23666150e9 | |||
6984c6d3b3 | |||
2800cd31ae | |||
b2ad047d7f | |||
110de0b512 | |||
f46379f308 | |||
16c2b528df | |||
405a32ddf4 | |||
725df1278b | |||
9e24262161 | |||
9ad75dbf47 | |||
88555d8e18 | |||
107ccc56b4 | |||
7b4dc5a7e4 | |||
ce90be0961 | |||
3f65d48539 | |||
b0dc789a1b | |||
76910eece1 | |||
6321cbaadd | |||
8a0c0f72a5 | |||
a082fcc933 | |||
f733307551 | |||
7160487ccd | |||
60cac6d938 | |||
712aa7b1cd | |||
0306bdf7fd | |||
5f1273fca6 | |||
a36c95db60 | |||
288808526b | |||
3c09db41fe | |||
bfec30a9fe | |||
39e611794d | |||
489b287e1f | |||
0c76a3c7d0 | |||
f27c70fffc | |||
5c0e87608f | |||
5d932e2612 | |||
90418b371f | |||
27671d8a43 | |||
8c793c1a43 | |||
26814ca060 | |||
101d7b5337 | |||
7adef85fa4 | |||
1ccd0c19da | |||
d4c935d8fa | |||
6104b66014 | |||
786b5d310d | |||
0faedb11cc | |||
de0d342b82 | |||
6f804f76b4 | |||
bc538e3776 | |||
a9e726501d | |||
907d7bfc54 | |||
092dd58e34 | |||
df4b01b433 | |||
6f2c173743 | |||
035e7fdb8b | |||
f3d52d8fe8 | |||
7eb71f72a7 |
36
.github/ISSUE_TEMPLATE/bug_report.md
vendored
36
.github/ISSUE_TEMPLATE/bug_report.md
vendored
@ -1,36 +0,0 @@
|
||||
---
|
||||
name: Bug report
|
||||
about: Create a report to help us improve QMK Firmware.
|
||||
title: "[Bug] "
|
||||
labels: bug, help wanted
|
||||
assignees: ''
|
||||
|
||||
---
|
||||
|
||||
<!-- Provide a general summary of the bug in the title above. -->
|
||||
|
||||
<!--- This template is entirely optional and can be removed, but is here to help both you and us. -->
|
||||
<!--- Anything on lines wrapped in comments like these will not show up in the final text. -->
|
||||
|
||||
## Describe the Bug
|
||||
|
||||
<!-- A clear and concise description of what the bug is. -->
|
||||
|
||||
## System Information
|
||||
|
||||
**Keyboard:**
|
||||
**Revision (if applicable):**
|
||||
**Operating system:**
|
||||
**`qmk doctor` output:**
|
||||
```
|
||||
(Paste output here)
|
||||
```
|
||||
|
||||
**Any keyboard related software installed?**
|
||||
- [ ] AutoHotKey (Windows)
|
||||
- [ ] Karabiner (macOS)
|
||||
- [ ] Other:
|
||||
|
||||
## Additional Context
|
||||
|
||||
<!-- Add any other relevant information about the problem here. -->
|
41
.github/ISSUE_TEMPLATE/bug_report.yml
vendored
Normal file
41
.github/ISSUE_TEMPLATE/bug_report.yml
vendored
Normal file
@ -0,0 +1,41 @@
|
||||
name: Bug report
|
||||
description: Create a report to help us improve QMK Firmware.
|
||||
title: "[Bug] "
|
||||
labels: ["bug", "help wanted"]
|
||||
body:
|
||||
- type: markdown
|
||||
attributes:
|
||||
value: |
|
||||
Provide a general summary of the bug in the title above.
|
||||
- type: textarea
|
||||
attributes:
|
||||
label: Describe the Bug
|
||||
description: A clear and concise description of what the bug is.
|
||||
- type: input
|
||||
attributes:
|
||||
label: Keyboard Used
|
||||
description: The name of the keyboard from the `make` or `qmk compile`/`qmk flash` commands, eg. `planck/rev6`.
|
||||
- type: input
|
||||
attributes:
|
||||
label: Link to product page (if applicable)
|
||||
- type: input
|
||||
attributes:
|
||||
label: Operating System
|
||||
- type: textarea
|
||||
attributes:
|
||||
label: qmk doctor Output
|
||||
description: Output from running the `qmk doctor` command.
|
||||
render: text
|
||||
- type: checkboxes
|
||||
attributes:
|
||||
label: Is AutoHotKey / Karabiner installed
|
||||
options:
|
||||
- label: AutoHotKey (Windows)
|
||||
- label: Karabiner (macOS)
|
||||
- type: input
|
||||
attributes:
|
||||
label: Other keyboard-related software installed
|
||||
- type: textarea
|
||||
attributes:
|
||||
label: Additional Context
|
||||
description: Add any other relevant information about the problem here.
|
24
.github/ISSUE_TEMPLATE/feature_request.md
vendored
24
.github/ISSUE_TEMPLATE/feature_request.md
vendored
@ -1,24 +0,0 @@
|
||||
---
|
||||
name: Feature request
|
||||
about: Suggest a new feature or changes to existing features.
|
||||
title: "[Feature Request] "
|
||||
labels: enhancement, help wanted
|
||||
assignees: ''
|
||||
|
||||
---
|
||||
|
||||
<!--- Provide a general summary of the changes you want in the title above. -->
|
||||
|
||||
<!--- This template is entirely optional and can be removed, but is here to help both you and us. -->
|
||||
<!--- Anything on lines wrapped in comments like these will not show up in the final text. -->
|
||||
|
||||
## Feature Request Type
|
||||
|
||||
- [ ] Core functionality
|
||||
- [ ] Add-on hardware support (eg. audio, RGB, OLED screen, etc.)
|
||||
- [ ] Alteration (enhancement/optimization) of existing feature(s)
|
||||
- [ ] New behavior
|
||||
|
||||
## Description
|
||||
|
||||
<!-- A few sentences describing what it is that you'd like to see in QMK. Additional information (such as links to spec sheets, licensing info, other related issues or PRs, etc) would be helpful. -->
|
21
.github/ISSUE_TEMPLATE/feature_request.yml
vendored
Normal file
21
.github/ISSUE_TEMPLATE/feature_request.yml
vendored
Normal file
@ -0,0 +1,21 @@
|
||||
name: Feature request
|
||||
description: Suggest a new feature or changes to existing features.
|
||||
title: "[Feature Request] "
|
||||
labels: ["enhancement", "help wanted"]
|
||||
body:
|
||||
- type: markdown
|
||||
attributes:
|
||||
value: |
|
||||
Provide a general summary of the changes you want in the title above.
|
||||
- type: checkboxes
|
||||
attributes:
|
||||
label: Feature Request Type
|
||||
options:
|
||||
- label: Core functionality
|
||||
- label: Add-on hardware support (eg. audio, RGB, OLED screen, etc.)
|
||||
- label: Alteration (enhancement/optimization) of existing feature(s)
|
||||
- label: New behavior
|
||||
- type: textarea
|
||||
attributes:
|
||||
label: Description
|
||||
description: A few sentences describing what it is that you'd like to see in QMK. Additional information (such as links to spec sheets, licensing info, other related issues or PRs, etc) would be helpful.
|
2
.github/workflows/auto_tag.yml
vendored
2
.github/workflows/auto_tag.yml
vendored
@ -27,7 +27,7 @@ jobs:
|
||||
fetch-depth: 0
|
||||
|
||||
- name: Bump version and push tag
|
||||
uses: anothrNick/github-tag-action@1.39.0
|
||||
uses: anothrNick/github-tag-action@1.52.0
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
DEFAULT_BUMP: 'patch'
|
||||
|
2
.github/workflows/stale.yml
vendored
2
.github/workflows/stale.yml
vendored
@ -12,7 +12,7 @@ jobs:
|
||||
stale:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/stale@v5
|
||||
- uses: actions/stale@v6
|
||||
with:
|
||||
repo-token: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
|
@ -271,7 +271,7 @@ ifneq ($(strip $(WEAR_LEVELING_DRIVER)),none)
|
||||
POST_CONFIG_H += $(DRIVER_PATH)/wear_leveling/wear_leveling_flash_spi_config.h
|
||||
else ifeq ($(strip $(WEAR_LEVELING_DRIVER)), rp2040_flash)
|
||||
SRC += wear_leveling_rp2040_flash.c
|
||||
POST_CONFIG_H += $(DRIVER_PATH)/wear_leveling/wear_leveling_rp2040_flash_config.h
|
||||
POST_CONFIG_H += $(PLATFORM_PATH)/$(PLATFORM_KEY)/$(DRIVER_PATH)/wear_leveling/wear_leveling_rp2040_flash_config.h
|
||||
else ifeq ($(strip $(WEAR_LEVELING_DRIVER)), legacy)
|
||||
COMMON_VPATH += $(PLATFORM_PATH)/$(PLATFORM_KEY)/$(DRIVER_DIR)/flash
|
||||
SRC += flash_stm32.c wear_leveling_legacy.c
|
||||
|
@ -111,9 +111,9 @@
|
||||
"NO_ACTION_MACRO": {"info_key": "_invalid.no_action_macro", "invalid": true},
|
||||
"NO_ACTION_FUNCTION": {"info_key": "_invalid.no_action_function", "invalid": true},
|
||||
"DESCRIPTION": {"info_key": "_invalid.usb_description", "invalid": true},
|
||||
"DEBOUNCING_DELAY": {"info_key": "_invalid.debouncing_delay", "invalid": true, replace_with: "DEBOUNCE"},
|
||||
"DEBOUNCING_DELAY": {"info_key": "_invalid.debouncing_delay", "invalid": true, "replace_with": "DEBOUNCE"},
|
||||
"PREVENT_STUCK_MODIFIERS": {"info_key": "_invalid.prevent_stuck_mods", "invalid": true},
|
||||
"UNUSED_PINS": {"info_key": "_invalid.unused_pins", "deprecated": true},
|
||||
"RGBLIGHT_ANIMATIONS": {"info_key": "rgblight.animations.all", "value_type": "bool", "deprecated": true},
|
||||
"QMK_KEYS_PER_SCAN": {"info_key": "qmk.keys_per_scan", "value_type": "int", "deprecated": true},
|
||||
"QMK_KEYS_PER_SCAN": {"info_key": "qmk.keys_per_scan", "value_type": "int", "deprecated": true}
|
||||
}
|
||||
|
@ -36,5 +36,5 @@
|
||||
# Items we want flagged in lint
|
||||
"CTPC": {"info_key": "_deprecated.ctpc", "deprecated": true, "replace_with": "CONVERT_TO=proton_c"},
|
||||
"CONVERT_TO_PROTON_C": {"info_key": "_deprecated.ctpc", "deprecated": true, "replace_with": "CONVERT_TO=proton_c"},
|
||||
"VIAL_ENABLE": {"info_key": "_invalid.vial", "invalid": true},
|
||||
"VIAL_ENABLE": {"info_key": "_invalid.vial", "invalid": true}
|
||||
}
|
||||
|
@ -79,6 +79,7 @@
|
||||
* [Caps Word](feature_caps_word.md)
|
||||
* [Combos](feature_combo.md)
|
||||
* [Debounce API](feature_debounce_type.md)
|
||||
* [EEPROM](feature_eeprom.md)
|
||||
* [Key Lock](feature_key_lock.md)
|
||||
* [Key Overrides](feature_key_overrides.md)
|
||||
* [Layers](feature_layers.md)
|
||||
|
@ -16,7 +16,7 @@ This service is an asynchronous API for compiling custom keymaps. You POST some
|
||||
"layers": [
|
||||
["KC_GRV","KC_1","KC_2","KC_3","KC_4","KC_5","KC_6","KC_7","KC_8","KC_9","KC_0","KC_MINS","KC_EQL","KC_GRV","KC_BSPC","KC_PGUP","KC_TAB","KC_Q","KC_W","KC_E","KC_R","KC_T","KC_Y","KC_U","KC_I","KC_O","KC_P","KC_LBRC","KC_RBRC","KC_BSLS","KC_PGDN","KC_CAPS","KC_A","KC_S","KC_D","KC_F","KC_G","KC_H","KC_J","KC_K","KC_L","KC_SCLN","KC_QUOT","KC_NUHS","KC_ENT","KC_LSFT","KC_NUBS","KC_Z","KC_X","KC_C","KC_V","KC_B","KC_N","KC_M","KC_COMM","KC_DOT","KC_SLSH","KC_RO","KC_RSFT","KC_UP","KC_LCTL","KC_LGUI","KC_LALT","KC_MHEN","KC_SPC","KC_SPC","KC_HENK","KC_RALT","KC_RCTL","MO(1)","KC_LEFT","KC_DOWN","KC_RIGHT"],
|
||||
["KC_ESC","KC_F1","KC_F2","KC_F3","KC_F4","KC_F5","KC_F6","KC_F7","KC_F8","KC_F9","KC_F10","KC_F11","KC_F12","KC_TRNS","KC_DEL","BL_STEP","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","_______","KC_TRNS","KC_PSCR","KC_SLCK","KC_PAUS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","MO(2)","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_PGUP","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","MO(1)","KC_LEFT","KC_PGDN","KC_RGHT"],
|
||||
["KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","RESET","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","MO(2)","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","MO(1)","KC_TRNS","KC_TRNS","KC_TRNS"]
|
||||
["KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","QK_BOOT","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","MO(2)","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","MO(1)","KC_TRNS","KC_TRNS","KC_TRNS"]
|
||||
]
|
||||
}
|
||||
```
|
||||
|
@ -2,7 +2,17 @@
|
||||
|
||||
QMK is nearly infinitely configurable. Wherever possible we err on the side of allowing users to customize their keyboard, even at the expense of code size. That level of flexibility makes for a daunting configuration experience, however.
|
||||
|
||||
There are two main types of configuration files in QMK- `config.h` and `rules.mk`. These files exist at various levels in QMK and all files of the same type are combined to build the final configuration. The levels, from lowest priority to highest priority, are:
|
||||
There are three main types of configuration files in QMK:
|
||||
|
||||
* `config.h`, which contains various preprocessor directives (`#define`, `#ifdef`)
|
||||
* `rules.mk`, which contains additional variables
|
||||
* `info.json`, which is utilized for [data-driven configuration](https://docs.qmk.fm/#/data_driven_config)
|
||||
|
||||
This page will only discuss the first two types, `config.h` and `rules.mk`.
|
||||
|
||||
?> While not all settings have data-driven equivalents yet, keyboard makers are encouraged to utilize the `info.json` file to set the metadata for their boards when possible. See the [`info.json` Format](https://docs.qmk.fm/#/reference_info_json) page for more details.
|
||||
|
||||
These files exist at various levels in QMK and all files of the same type are combined to build the final configuration. The levels, from lowest priority to highest priority, are:
|
||||
|
||||
* QMK Default
|
||||
* Keyboard
|
||||
|
@ -56,7 +56,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||
[1] = LAYOUT_all(
|
||||
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, RGB_TOG, RGB_MOD, RGB_HUD, RGB_HUI, RGB_SAD, RGB_SAI, RGB_VAD, RGB_VAI, BL_TOGG, BL_DEC, BL_INC,
|
||||
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_VOLU,
|
||||
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, RESET, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_MPLY, KC_MNXT, KC_VOLD,
|
||||
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, QK_BOOT, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_MPLY, KC_MNXT, KC_VOLD,
|
||||
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
|
||||
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
|
||||
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS),
|
||||
@ -84,7 +84,7 @@ The default keymap uses the `LAYOUT_all` macro, so that will be the value of the
|
||||
[
|
||||
"KC_TRNS", "KC_TRNS", "KC_TRNS", "KC_TRNS", "KC_TRNS", "RGB_TOG", "RGB_MOD", "RGB_HUD", "RGB_HUI", "RGB_SAD", "RGB_SAI", "RGB_VAD", "RGB_VAI", "BL_TOGG", "BL_DEC", "BL_INC",
|
||||
"KC_TRNS", "KC_TRNS", "KC_TRNS", "KC_TRNS", "KC_TRNS", "KC_TRNS", "KC_TRNS", "KC_TRNS", "KC_TRNS", "KC_TRNS", "KC_TRNS", "KC_TRNS", "KC_TRNS", "KC_TRNS", "KC_TRNS", "KC_TRNS", "KC_TRNS", "KC_VOLU",
|
||||
"KC_TRNS", "KC_TRNS", "KC_TRNS", "KC_TRNS", "RESET", "KC_TRNS", "KC_TRNS", "KC_TRNS", "KC_TRNS", "KC_TRNS", "KC_TRNS", "KC_TRNS", "KC_TRNS", "KC_TRNS", "KC_MPLY", "KC_MNXT", "KC_VOLD",
|
||||
"KC_TRNS", "KC_TRNS", "KC_TRNS", "KC_TRNS", "QK_BOOT", "KC_TRNS", "KC_TRNS", "KC_TRNS", "KC_TRNS", "KC_TRNS", "KC_TRNS", "KC_TRNS", "KC_TRNS", "KC_TRNS", "KC_MPLY", "KC_MNXT", "KC_VOLD",
|
||||
"KC_TRNS", "KC_TRNS", "KC_TRNS", "KC_TRNS", "KC_TRNS", "KC_TRNS", "KC_TRNS", "KC_TRNS", "KC_TRNS", "KC_TRNS", "KC_TRNS", "KC_TRNS", "KC_TRNS", "KC_TRNS",
|
||||
"KC_TRNS", "KC_TRNS", "KC_TRNS", "KC_TRNS", "KC_TRNS", "KC_TRNS", "KC_TRNS", "KC_TRNS", "KC_TRNS", "KC_TRNS", "KC_TRNS", "KC_TRNS", "KC_TRNS", "KC_TRNS", "KC_TRNS",
|
||||
"KC_TRNS", "KC_TRNS", "KC_TRNS", "KC_TRNS", "KC_TRNS", "KC_TRNS", "KC_TRNS", "KC_TRNS", "KC_TRNS", "KC_TRNS", "KC_TRNS"
|
||||
|
@ -102,11 +102,11 @@ These are the three main initialization functions, listed in the order that they
|
||||
|
||||
## Keyboard Pre Initialization code
|
||||
|
||||
This runs very early during startup, even before the USB has been started.
|
||||
This runs very early during startup, even before the USB has been started.
|
||||
|
||||
Shortly after this, the matrix is initialized.
|
||||
|
||||
For most users, this shouldn't be used, as it's primarily for hardware oriented initialization.
|
||||
For most users, this shouldn't be used, as it's primarily for hardware oriented initialization.
|
||||
|
||||
However, if you have hardware stuff that you need initialized, this is the best place for it (such as initializing LED pins).
|
||||
|
||||
@ -134,9 +134,9 @@ void keyboard_pre_init_user(void) {
|
||||
|
||||
## Matrix Initialization Code
|
||||
|
||||
This is called when the matrix is initialized, and after some of the hardware has been set up, but before many of the features have been initialized.
|
||||
This is called when the matrix is initialized, and after some of the hardware has been set up, but before many of the features have been initialized.
|
||||
|
||||
This is useful for setting up stuff that you may need elsewhere, but isn't hardware related nor is dependant on where it's started.
|
||||
This is useful for setting up stuff that you may need elsewhere, but isn't hardware related nor is dependant on where it's started.
|
||||
|
||||
|
||||
### `matrix_init_*` Function Documentation
|
||||
@ -227,185 +227,6 @@ void suspend_wakeup_init_user(void) {
|
||||
* Keyboard/Revision: `void suspend_power_down_kb(void)` and `void suspend_wakeup_init_user(void)`
|
||||
* Keymap: `void suspend_power_down_kb(void)` and `void suspend_wakeup_init_user(void)`
|
||||
|
||||
# Layer Change Code :id=layer-change-code
|
||||
|
||||
This runs code every time that the layers get changed. This can be useful for layer indication, or custom layer handling.
|
||||
|
||||
### Example `layer_state_set_*` Implementation
|
||||
|
||||
This example shows how to set the [RGB Underglow](feature_rgblight.md) lights based on the layer, using the Planck as an example.
|
||||
|
||||
```c
|
||||
layer_state_t layer_state_set_user(layer_state_t state) {
|
||||
switch (get_highest_layer(state)) {
|
||||
case _RAISE:
|
||||
rgblight_setrgb (0x00, 0x00, 0xFF);
|
||||
break;
|
||||
case _LOWER:
|
||||
rgblight_setrgb (0xFF, 0x00, 0x00);
|
||||
break;
|
||||
case _PLOVER:
|
||||
rgblight_setrgb (0x00, 0xFF, 0x00);
|
||||
break;
|
||||
case _ADJUST:
|
||||
rgblight_setrgb (0x7A, 0x00, 0xFF);
|
||||
break;
|
||||
default: // for any other layers, or the default layer
|
||||
rgblight_setrgb (0x00, 0xFF, 0xFF);
|
||||
break;
|
||||
}
|
||||
return state;
|
||||
}
|
||||
```
|
||||
|
||||
Use the `IS_LAYER_ON_STATE(state, layer)` and `IS_LAYER_OFF_STATE(state, layer)` macros to check the status of a particular layer.
|
||||
|
||||
Outside of `layer_state_set_*` functions, you can use the `IS_LAYER_ON(layer)` and `IS_LAYER_OFF(layer)` macros to check global layer state.
|
||||
|
||||
### `layer_state_set_*` Function Documentation
|
||||
|
||||
* Keyboard/Revision: `layer_state_t layer_state_set_kb(layer_state_t state)`
|
||||
* Keymap: `layer_state_t layer_state_set_user(layer_state_t state)`
|
||||
|
||||
|
||||
The `state` is the bitmask of the active layers, as explained in the [Keymap Overview](keymap.md#keymap-layer-status)
|
||||
|
||||
|
||||
# Persistent Configuration (EEPROM)
|
||||
|
||||
This allows you to configure persistent settings for your keyboard. These settings are stored in the EEPROM of your controller, and are retained even after power loss. The settings can be read with `eeconfig_read_kb` and `eeconfig_read_user`, and can be written to using `eeconfig_update_kb` and `eeconfig_update_user`. This is useful for features that you want to be able to toggle (like toggling rgb layer indication). Additionally, you can use `eeconfig_init_kb` and `eeconfig_init_user` to set the default values for the EEPROM.
|
||||
|
||||
The complicated part here, is that there are a bunch of ways that you can store and access data via EEPROM, and there is no "correct" way to do this. However, you only have a DWORD (4 bytes) for each function.
|
||||
|
||||
Keep in mind that EEPROM has a limited number of writes. While this is very high, it's not the only thing writing to the EEPROM, and if you write too often, you can potentially drastically shorten the life of your MCU.
|
||||
|
||||
* If you don't understand the example, then you may want to avoid using this feature, as it is rather complicated.
|
||||
|
||||
### Example Implementation
|
||||
|
||||
This is an example of how to add settings, and read and write it. We're using the user keymap for the example here. This is a complex function, and has a lot going on. In fact, it uses a lot of the above functions to work!
|
||||
|
||||
|
||||
In your keymap.c file, add this to the top:
|
||||
```c
|
||||
typedef union {
|
||||
uint32_t raw;
|
||||
struct {
|
||||
bool rgb_layer_change :1;
|
||||
};
|
||||
} user_config_t;
|
||||
|
||||
user_config_t user_config;
|
||||
```
|
||||
|
||||
This sets up a 32 bit structure that we can store settings with in memory, and write to the EEPROM. Using this removes the need to define variables, since they're defined in this structure. Remember that `bool` (boolean) values use 1 bit, `uint8_t` uses 8 bits, `uint16_t` uses up 16 bits. You can mix and match, but changing the order can cause issues, as it will change the values that are read and written.
|
||||
|
||||
We're using `rgb_layer_change`, for the `layer_state_set_*` function, and use `keyboard_post_init_user` and `process_record_user` to configure everything.
|
||||
|
||||
Now, using the `keyboard_post_init_user` code above, you want to add `eeconfig_read_user()` to it, to populate the structure you've just created. And you can then immediately use this structure to control functionality in your keymap. And It should look like:
|
||||
```c
|
||||
void keyboard_post_init_user(void) {
|
||||
// Call the keymap level matrix init.
|
||||
|
||||
// Read the user config from EEPROM
|
||||
user_config.raw = eeconfig_read_user();
|
||||
|
||||
// Set default layer, if enabled
|
||||
if (user_config.rgb_layer_change) {
|
||||
rgblight_enable_noeeprom();
|
||||
rgblight_sethsv_noeeprom_cyan();
|
||||
rgblight_mode_noeeprom(1);
|
||||
}
|
||||
}
|
||||
```
|
||||
The above function will use the EEPROM config immediately after reading it, to set the default layer's RGB color. The "raw" value of it is converted in a usable structure based on the "union" that you created above.
|
||||
|
||||
```c
|
||||
layer_state_t layer_state_set_user(layer_state_t state) {
|
||||
switch (get_highest_layer(state)) {
|
||||
case _RAISE:
|
||||
if (user_config.rgb_layer_change) { rgblight_sethsv_noeeprom_magenta(); rgblight_mode_noeeprom(1); }
|
||||
break;
|
||||
case _LOWER:
|
||||
if (user_config.rgb_layer_change) { rgblight_sethsv_noeeprom_red(); rgblight_mode_noeeprom(1); }
|
||||
break;
|
||||
case _PLOVER:
|
||||
if (user_config.rgb_layer_change) { rgblight_sethsv_noeeprom_green(); rgblight_mode_noeeprom(1); }
|
||||
break;
|
||||
case _ADJUST:
|
||||
if (user_config.rgb_layer_change) { rgblight_sethsv_noeeprom_white(); rgblight_mode_noeeprom(1); }
|
||||
break;
|
||||
default: // for any other layers, or the default layer
|
||||
if (user_config.rgb_layer_change) { rgblight_sethsv_noeeprom_cyan(); rgblight_mode_noeeprom(1); }
|
||||
break;
|
||||
}
|
||||
return state;
|
||||
}
|
||||
```
|
||||
This will cause the RGB underglow to be changed ONLY if the value was enabled. Now to configure this value, create a new keycode for `process_record_user` called `RGB_LYR`. Additionally, we want to make sure that if you use the normal RGB codes, that it turns off Using the example above, make it look this:
|
||||
```c
|
||||
|
||||
bool process_record_user(uint16_t keycode, keyrecord_t *record) {
|
||||
switch (keycode) {
|
||||
case FOO:
|
||||
if (record->event.pressed) {
|
||||
// Do something when pressed
|
||||
} else {
|
||||
// Do something else when release
|
||||
}
|
||||
return false; // Skip all further processing of this key
|
||||
case KC_ENTER:
|
||||
// Play a tone when enter is pressed
|
||||
if (record->event.pressed) {
|
||||
PLAY_SONG(tone_qwerty);
|
||||
}
|
||||
return true; // Let QMK send the enter press/release events
|
||||
case RGB_LYR: // This allows me to use underglow as layer indication, or as normal
|
||||
if (record->event.pressed) {
|
||||
user_config.rgb_layer_change ^= 1; // Toggles the status
|
||||
eeconfig_update_user(user_config.raw); // Writes the new status to EEPROM
|
||||
if (user_config.rgb_layer_change) { // if layer state indication is enabled,
|
||||
layer_state_set(layer_state); // then immediately update the layer color
|
||||
}
|
||||
}
|
||||
return false;
|
||||
case RGB_MODE_FORWARD ... RGB_MODE_GRADIENT: // For any of the RGB codes (see quantum_keycodes.h, L400 for reference)
|
||||
if (record->event.pressed) { //This disables layer indication, as it's assumed that if you're changing this ... you want that disabled
|
||||
if (user_config.rgb_layer_change) { // only if this is enabled
|
||||
user_config.rgb_layer_change = false; // disable it, and
|
||||
eeconfig_update_user(user_config.raw); // write the setings to EEPROM
|
||||
}
|
||||
}
|
||||
return true; break;
|
||||
default:
|
||||
return true; // Process all other keycodes normally
|
||||
}
|
||||
}
|
||||
```
|
||||
And lastly, you want to add the `eeconfig_init_user` function, so that when the EEPROM is reset, you can specify default values, and even custom actions. To force an EEPROM reset, use the `EEP_RST` keycode or [Bootmagic Lite](feature_bootmagic.md) functionallity. For example, if you want to set rgb layer indication by default, and save the default valued.
|
||||
|
||||
```c
|
||||
void eeconfig_init_user(void) { // EEPROM is getting reset!
|
||||
user_config.raw = 0;
|
||||
user_config.rgb_layer_change = true; // We want this enabled by default
|
||||
eeconfig_update_user(user_config.raw); // Write default value to EEPROM now
|
||||
|
||||
// use the non noeeprom versions, to write these values to EEPROM too
|
||||
rgblight_enable(); // Enable RGB by default
|
||||
rgblight_sethsv_cyan(); // Set it to CYAN by default
|
||||
rgblight_mode(1); // set to solid by default
|
||||
}
|
||||
```
|
||||
|
||||
And you're done. The RGB layer indication will only work if you want it to. And it will be saved, even after unplugging the board. And if you use any of the RGB codes, it will disable the layer indication, so that it stays on the mode and color that you set it to.
|
||||
|
||||
### 'EECONFIG' Function Documentation
|
||||
|
||||
* Keyboard/Revision: `void eeconfig_init_kb(void)`, `uint32_t eeconfig_read_kb(void)` and `void eeconfig_update_kb(uint32_t val)`
|
||||
* Keymap: `void eeconfig_init_user(void)`, `uint32_t eeconfig_read_user(void)` and `void eeconfig_update_user(uint32_t val)`
|
||||
|
||||
The `val` is the value of the data that you want to write to EEPROM. And the `eeconfig_read_*` function return a 32 bit (DWORD) value from the EEPROM.
|
||||
|
||||
# Deferred Execution :id=deferred-execution
|
||||
|
||||
QMK has the ability to execute a callback after a specified period of time, rather than having to manually manage timers. To enable this functionality, set `DEFERRED_EXEC_ENABLE = yes` in rules.mk.
|
||||
@ -471,3 +292,15 @@ If registrations fail, then you can increase this value in your keyboard or keym
|
||||
```c
|
||||
#define MAX_DEFERRED_EXECUTORS 16
|
||||
```
|
||||
|
||||
# Advanced topics :id=advanced-topics
|
||||
|
||||
This page used to encompass a large set of features. We have moved many sections that used to be part of this page to their own pages. Everything below this point is simply a redirect so that people following old links on the web find what they're looking for.
|
||||
|
||||
## Layer Change Code :id=layer-change-code
|
||||
|
||||
[Layer change code](feature_layers.md#layer-change-code)
|
||||
|
||||
## Persistent Configuration (EEPROM) :id=persistent-configuration-eeprom
|
||||
|
||||
[Persistent Configuration (EEPROM)](feature_eeprom.md)
|
||||
|
@ -8,7 +8,7 @@ We recommend the use of the [Zadig](https://zadig.akeo.ie/) utility. If you have
|
||||
|
||||
## Installation
|
||||
|
||||
Put your keyboard into bootloader mode, either by hitting the `RESET` keycode (which may be on a different layer), or by pressing the reset switch that's usually located on the underside of the board. If your keyboard has neither, try holding Escape or Space+`B` as you plug it in (see the [Bootmagic Lite](feature_bootmagic.md) docs for more details). Some boards use [Command](feature_command.md) instead of Bootmagic; in this case, you can enter bootloader mode by hitting Left Shift+Right Shift+`B` or Left Shift+Right Shift+Escape at any point while the keyboard is plugged in.
|
||||
Put your keyboard into bootloader mode, either by hitting the `QK_BOOT` keycode (which may be on a different layer), or by pressing the reset switch that's usually located on the underside of the board. If your keyboard has neither, try holding Escape or Space+`B` as you plug it in (see the [Bootmagic Lite](feature_bootmagic.md) docs for more details). Some boards use [Command](feature_command.md) instead of Bootmagic; in this case, you can enter bootloader mode by hitting Left Shift+Right Shift+`B` or Left Shift+Right Shift+Escape at any point while the keyboard is plugged in.
|
||||
Some keyboards may have specific instructions for entering the bootloader. For example, the [Bootmagic Lite](feature_bootmagic.md) key (default: Escape) might be on a different key, e.g. Left Control; or the magic combination for Command (default: Left Shift+Right Shift) might require you to hold something else, e.g. Left Control+Right Control. Refer to the board's README file if you are unsure.
|
||||
|
||||
To put a device in bootloader mode with USBaspLoader, tap the `RESET` button while holding down the `BOOT` button.
|
||||
|
@ -133,3 +133,4 @@ Check:
|
||||
- Set `debug_enable=true`. See [Debugging](#debugging)
|
||||
- Try using `print` function instead of debug print. See **common/print.h**.
|
||||
- Disconnect other devices with console function. See [Issue #97](https://github.com/tmk/tmk_keyboard/issues/97).
|
||||
- Ensure all strings end with a newline character (`\n`). QMK Toolbox prints console output on a per-line basis.
|
||||
|
@ -10,7 +10,7 @@ You probably don't want to "brick" your keyboard, making it impossible
|
||||
to rewrite firmware onto it. Here are some of the parameters to show
|
||||
what things are (and likely aren't) too risky.
|
||||
|
||||
- If your keyboard map does not include RESET, then, to get into DFU
|
||||
- If your keyboard map does not include QK_BOOT, then, to get into DFU
|
||||
mode, you will need to press the reset button on the PCB, which
|
||||
requires unscrewing the bottom.
|
||||
- Messing with tmk_core / common files might make the keyboard
|
||||
|
@ -161,7 +161,7 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
|
||||
};
|
||||
```
|
||||
|
||||
# Legacy Content :id=legacy-content
|
||||
# Advanced topics :id=advanced-topics
|
||||
|
||||
This page used to encompass a large set of features. We have moved many sections that used to be part of this page to their own pages. Everything below this point is simply a redirect so that people following old links on the web find what they're looking for.
|
||||
|
||||
|
@ -114,7 +114,7 @@ The audio core offers interface functions to get/set/change the tone multiplexin
|
||||
There's a couple of different sounds that will automatically be enabled without any other configuration:
|
||||
```
|
||||
STARTUP_SONG // plays when the keyboard starts up (audio.c)
|
||||
GOODBYE_SONG // plays when you press the RESET key (quantum.c)
|
||||
GOODBYE_SONG // plays when you press the QK_BOOT key (quantum.c)
|
||||
AG_NORM_SONG // plays when you press AG_NORM (quantum.c)
|
||||
AG_SWAP_SONG // plays when you press AG_SWAP (quantum.c)
|
||||
CG_NORM_SONG // plays when you press CG_NORM (quantum.c)
|
||||
@ -177,7 +177,7 @@ The available keycodes for audio are:
|
||||
|`AUDIO_INIT_DELAY` | *Not defined* |Enables delay during startup song to accomidate for USB startup issues. |
|
||||
|`AUDIO_ENABLE_TONE_MULTIPLEXING` | *Not defined* |Enables time splicing/multiplexing to create multiple tones simutaneously. |
|
||||
|`STARTUP_SONG` | `STARTUP_SOUND` |Plays when the keyboard starts up (audio.c) |
|
||||
|`GOODBYE_SONG` | `GOODBYE_SOUND` |Plays when you press the RESET key (quantum.c) |
|
||||
|`GOODBYE_SONG` | `GOODBYE_SOUND` |Plays when you press the QK_BOOT key (quantum.c) |
|
||||
|`AG_NORM_SONG` | `AG_NORM_SOUND` |Plays when you press AG_NORM (process_magic.c) |
|
||||
|`AG_SWAP_SONG` | `AG_SWAP_SOUND` |Plays when you press AG_SWAP (process_magic.c) |
|
||||
|`CG_NORM_SONG` | `AG_NORM_SOUND` |Plays when you press CG_NORM (process_magic.c) |
|
||||
|
@ -4,11 +4,14 @@ It is often useful to type a single word in all capitals, for instance
|
||||
abbreviations like "QMK", or in code, identifiers like `KC_SPC`. "Caps Word" is
|
||||
a modern alternative to Caps Lock:
|
||||
|
||||
* Letters are capitalized while active, and Caps Word automatically disables
|
||||
* While active, letters are capitalized and `-` becomes `_`. The `_` makes it easier
|
||||
to type constant names (eg 'PROGRAM\_CONSTANTS').
|
||||
|
||||
* Caps Word automatically disables
|
||||
itself at the end of the word. That is, it stops by default once a space or
|
||||
any key other than `a`--`z`, `0`--`9`, `-`, `_`, delete, or backspace is
|
||||
pressed. Caps Word also disables itself if the keyboard is idle for 5 seconds.
|
||||
This is configurable, see below.
|
||||
any key other than `KC_A`--`KC_Z`, `KC_0`--`KC_9`, `KC_MINS`, `KC_UNDS`,
|
||||
`KC_DELETE`, or `KC_BACKSPACE` is pressed. Caps Word also disables itself if
|
||||
the keyboard is idle for 5 seconds. This is configurable, see below.
|
||||
|
||||
* To avoid requiring a dedicated key for Caps Word, there is an option
|
||||
(`BOTH_SHIFTS_TURNS_ON_CAPS_WORD`) to activate Caps Word by simultaneously
|
||||
@ -16,7 +19,17 @@ a modern alternative to Caps Lock:
|
||||
|
||||
* The implementation does not use the Caps Lock (`KC_CAPS`) keycode. Caps Word
|
||||
works even if you're remapping Caps Lock at the OS level to Ctrl or something
|
||||
else, as Emacs and Vim users often do.
|
||||
else, as Emacs and Vim users often do. As a consequence, Caps Word does not
|
||||
follow the typical Caps Lock behaviour and may thus act in potentially
|
||||
unexpected ways, especially when using an *OS* keyboard layout other than US
|
||||
or UK. For example, Dvorak's <kbd>, <</kbd> key (`DV_COMM` aka `KC_W`) will
|
||||
get shifted because Caps Word interprets that keycode as the letter 'W' by
|
||||
default, the Spanish <kbd>Ñ</kbd> key (`ES_NTIL` aka `KC_SCLN`) will not get
|
||||
capitalized because Caps Word interprets it as the semicolon ';' punctuation
|
||||
character, and the US hyphen key (`KC_MINS`), while unaffected by Caps Lock,
|
||||
is shifted by Caps Word. However, this is not really a problem because you can
|
||||
[configure which keys should Caps Word
|
||||
shift](#configure-which-keys-are-word-breaking).
|
||||
|
||||
|
||||
## How do I enable Caps Word :id=how-do-i-enable-caps-word
|
||||
@ -60,7 +73,7 @@ time, since both use the Left Shift + Right Shift key combination."**
|
||||
|
||||
Many keyboards enable the [Command feature](feature_command.md), which by
|
||||
default is also activated using the Left Shift + Right Shift key combination. To
|
||||
fix this conflict, please disable Command by adding in rules.mk:
|
||||
fix this conflict, please disable Command by adding in rules.mk:
|
||||
|
||||
```make
|
||||
COMMAND_ENABLE = no
|
||||
@ -81,7 +94,7 @@ by defining `IS_COMMAND()` in config.h:
|
||||
|
||||
Caps Word turns off automatically if no keys are pressed for
|
||||
`CAPS_WORD_IDLE_TIMEOUT` milliseconds. The default is 5000 (5 seconds).
|
||||
Configure the timeout duration in config.h, for instance
|
||||
Configure the timeout duration in config.h, for instance
|
||||
|
||||
```c
|
||||
#define CAPS_WORD_IDLE_TIMEOUT 3000 // 3 seconds.
|
||||
|
134
docs/feature_eeprom.md
Normal file
134
docs/feature_eeprom.md
Normal file
@ -0,0 +1,134 @@
|
||||
# Persistent Configuration (EEPROM)
|
||||
|
||||
This allows you to configure persistent settings for your keyboard. These settings are stored in the EEPROM of your controller, and are retained even after power loss. The settings can be read with `eeconfig_read_kb` and `eeconfig_read_user`, and can be written to using `eeconfig_update_kb` and `eeconfig_update_user`. This is useful for features that you want to be able to toggle (like toggling rgb layer indication). Additionally, you can use `eeconfig_init_kb` and `eeconfig_init_user` to set the default values for the EEPROM.
|
||||
|
||||
The complicated part here, is that there are a bunch of ways that you can store and access data via EEPROM, and there is no "correct" way to do this. However, you only have a DWORD (4 bytes) for each function.
|
||||
|
||||
Keep in mind that EEPROM has a limited number of writes. While this is very high, it's not the only thing writing to the EEPROM, and if you write too often, you can potentially drastically shorten the life of your MCU.
|
||||
|
||||
* If you don't understand the example, then you may want to avoid using this feature, as it is rather complicated.
|
||||
|
||||
## Example Implementation
|
||||
|
||||
This is an example of how to add settings, and read and write it. We're using the user keymap for the example here. This is a complex function, and has a lot going on. In fact, it uses a lot of the above functions to work!
|
||||
|
||||
|
||||
In your keymap.c file, add this to the top:
|
||||
```c
|
||||
typedef union {
|
||||
uint32_t raw;
|
||||
struct {
|
||||
bool rgb_layer_change :1;
|
||||
};
|
||||
} user_config_t;
|
||||
|
||||
user_config_t user_config;
|
||||
```
|
||||
|
||||
This sets up a 32 bit structure that we can store settings with in memory, and write to the EEPROM. Using this removes the need to define variables, since they're defined in this structure. Remember that `bool` (boolean) values use 1 bit, `uint8_t` uses 8 bits, `uint16_t` uses up 16 bits. You can mix and match, but changing the order can cause issues, as it will change the values that are read and written.
|
||||
|
||||
We're using `rgb_layer_change`, for the `layer_state_set_*` function, and use `keyboard_post_init_user` and `process_record_user` to configure everything.
|
||||
|
||||
Now, using the `keyboard_post_init_user` code above, you want to add `eeconfig_read_user()` to it, to populate the structure you've just created. And you can then immediately use this structure to control functionality in your keymap. And It should look like:
|
||||
```c
|
||||
void keyboard_post_init_user(void) {
|
||||
// Call the keymap level matrix init.
|
||||
|
||||
// Read the user config from EEPROM
|
||||
user_config.raw = eeconfig_read_user();
|
||||
|
||||
// Set default layer, if enabled
|
||||
if (user_config.rgb_layer_change) {
|
||||
rgblight_enable_noeeprom();
|
||||
rgblight_sethsv_noeeprom_cyan();
|
||||
rgblight_mode_noeeprom(1);
|
||||
}
|
||||
}
|
||||
```
|
||||
The above function will use the EEPROM config immediately after reading it, to set the default layer's RGB color. The "raw" value of it is converted in a usable structure based on the "union" that you created above.
|
||||
|
||||
```c
|
||||
layer_state_t layer_state_set_user(layer_state_t state) {
|
||||
switch (get_highest_layer(state)) {
|
||||
case _RAISE:
|
||||
if (user_config.rgb_layer_change) { rgblight_sethsv_noeeprom_magenta(); rgblight_mode_noeeprom(1); }
|
||||
break;
|
||||
case _LOWER:
|
||||
if (user_config.rgb_layer_change) { rgblight_sethsv_noeeprom_red(); rgblight_mode_noeeprom(1); }
|
||||
break;
|
||||
case _PLOVER:
|
||||
if (user_config.rgb_layer_change) { rgblight_sethsv_noeeprom_green(); rgblight_mode_noeeprom(1); }
|
||||
break;
|
||||
case _ADJUST:
|
||||
if (user_config.rgb_layer_change) { rgblight_sethsv_noeeprom_white(); rgblight_mode_noeeprom(1); }
|
||||
break;
|
||||
default: // for any other layers, or the default layer
|
||||
if (user_config.rgb_layer_change) { rgblight_sethsv_noeeprom_cyan(); rgblight_mode_noeeprom(1); }
|
||||
break;
|
||||
}
|
||||
return state;
|
||||
}
|
||||
```
|
||||
This will cause the RGB underglow to be changed ONLY if the value was enabled. Now to configure this value, create a new keycode for `process_record_user` called `RGB_LYR`. Additionally, we want to make sure that if you use the normal RGB codes, that it turns off Using the example above, make it look this:
|
||||
```c
|
||||
|
||||
bool process_record_user(uint16_t keycode, keyrecord_t *record) {
|
||||
switch (keycode) {
|
||||
case FOO:
|
||||
if (record->event.pressed) {
|
||||
// Do something when pressed
|
||||
} else {
|
||||
// Do something else when release
|
||||
}
|
||||
return false; // Skip all further processing of this key
|
||||
case KC_ENTER:
|
||||
// Play a tone when enter is pressed
|
||||
if (record->event.pressed) {
|
||||
PLAY_SONG(tone_qwerty);
|
||||
}
|
||||
return true; // Let QMK send the enter press/release events
|
||||
case RGB_LYR: // This allows me to use underglow as layer indication, or as normal
|
||||
if (record->event.pressed) {
|
||||
user_config.rgb_layer_change ^= 1; // Toggles the status
|
||||
eeconfig_update_user(user_config.raw); // Writes the new status to EEPROM
|
||||
if (user_config.rgb_layer_change) { // if layer state indication is enabled,
|
||||
layer_state_set(layer_state); // then immediately update the layer color
|
||||
}
|
||||
}
|
||||
return false;
|
||||
case RGB_MODE_FORWARD ... RGB_MODE_GRADIENT: // For any of the RGB codes (see quantum_keycodes.h, L400 for reference)
|
||||
if (record->event.pressed) { //This disables layer indication, as it's assumed that if you're changing this ... you want that disabled
|
||||
if (user_config.rgb_layer_change) { // only if this is enabled
|
||||
user_config.rgb_layer_change = false; // disable it, and
|
||||
eeconfig_update_user(user_config.raw); // write the setings to EEPROM
|
||||
}
|
||||
}
|
||||
return true; break;
|
||||
default:
|
||||
return true; // Process all other keycodes normally
|
||||
}
|
||||
}
|
||||
```
|
||||
And lastly, you want to add the `eeconfig_init_user` function, so that when the EEPROM is reset, you can specify default values, and even custom actions. To force an EEPROM reset, use the `EEP_RST` keycode or [Bootmagic Lite](feature_bootmagic.md) functionallity. For example, if you want to set rgb layer indication by default, and save the default valued.
|
||||
|
||||
```c
|
||||
void eeconfig_init_user(void) { // EEPROM is getting reset!
|
||||
user_config.raw = 0;
|
||||
user_config.rgb_layer_change = true; // We want this enabled by default
|
||||
eeconfig_update_user(user_config.raw); // Write default value to EEPROM now
|
||||
|
||||
// use the non noeeprom versions, to write these values to EEPROM too
|
||||
rgblight_enable(); // Enable RGB by default
|
||||
rgblight_sethsv_cyan(); // Set it to CYAN by default
|
||||
rgblight_mode(1); // set to solid by default
|
||||
}
|
||||
```
|
||||
|
||||
And you're done. The RGB layer indication will only work if you want it to. And it will be saved, even after unplugging the board. And if you use any of the RGB codes, it will disable the layer indication, so that it stays on the mode and color that you set it to.
|
||||
|
||||
## 'EECONFIG' Function Documentation
|
||||
|
||||
* Keyboard/Revision: `void eeconfig_init_kb(void)`, `uint32_t eeconfig_read_kb(void)` and `void eeconfig_update_kb(uint32_t val)`
|
||||
* Keymap: `void eeconfig_init_user(void)`, `uint32_t eeconfig_read_user(void)` and `void eeconfig_update_user(uint32_t val)`
|
||||
|
||||
The `val` is the value of the data that you want to write to EEPROM. And the `eeconfig_read_*` function return a 32 bit (DWORD) value from the EEPROM.
|
@ -69,7 +69,7 @@ Additionally, if one side does not have an encoder, you can specify `{}` for the
|
||||
|
||||
## Encoder map :id=encoder-map
|
||||
|
||||
Encoder mapping may be added to your `keymap.c`, which replicates the normal keyswitch layer handling functionality, but with encoders. Add this to your `rules.mk`:
|
||||
Encoder mapping may be added to your `keymap.c`, which replicates the normal keyswitch layer handling functionality, but with encoders. Add this to your keymap's `rules.mk`:
|
||||
|
||||
```make
|
||||
ENCODER_MAP_ENABLE = yes
|
||||
@ -88,6 +88,8 @@ const uint16_t PROGMEM encoder_map[][NUM_ENCODERS][2] = {
|
||||
#endif
|
||||
```
|
||||
|
||||
?> This should only be enabled at the keymap level.
|
||||
|
||||
## Callbacks
|
||||
|
||||
When not using `ENCODER_MAP_ENABLE = yes`, the callback functions can be inserted into your `<keyboard>.c`:
|
||||
|
@ -1,6 +1,6 @@
|
||||
# Layers :id=layers
|
||||
|
||||
One of the most powerful and well used features of QMK Firmware is the ability to use layers. For most people, this amounts to a function key that allows for different keys, much like what you would see on a laptop or tablet keyboard.
|
||||
One of the most powerful and well used features of QMK Firmware is the ability to use layers. For most people, this amounts to a function key that allows for different keys, much like what you would see on a laptop or tablet keyboard.
|
||||
|
||||
For a detailed explanation of how the layer stack works, checkout [Keymap Overview](keymap.md#keymap-and-layers).
|
||||
|
||||
@ -9,7 +9,7 @@ For a detailed explanation of how the layer stack works, checkout [Keymap Overvi
|
||||
These functions allow you to activate layers in various ways. Note that layers are not generally independent layouts -- multiple layers can be activated at once, and it's typical for layers to use `KC_TRNS` to allow keypresses to pass through to lower layers. When using momentary layer switching with MO(), LM(), TT(), or LT(), make sure to leave the key on the above layers transparent or it may not work as intended.
|
||||
|
||||
* `DF(layer)` - switches the default layer. The default layer is the always-active base layer that other layers stack on top of. See below for more about the default layer. This might be used to switch from QWERTY to Dvorak layout. (Note that this is a temporary switch that only persists until the keyboard loses power. To modify the default layer in a persistent way requires deeper customization, such as calling the `set_single_persistent_default_layer` function inside of [process_record_user](custom_quantum_functions.md#programming-the-behavior-of-any-keycode).)
|
||||
* `MO(layer)` - momentarily activates *layer*. As soon as you let go of the key, the layer is deactivated.
|
||||
* `MO(layer)` - momentarily activates *layer*. As soon as you let go of the key, the layer is deactivated.
|
||||
* `LM(layer, mod)` - Momentarily activates *layer* (like `MO`), but with modifier(s) *mod* active. Only supports layers 0-15 and the left modifiers: `MOD_LCTL`, `MOD_LSFT`, `MOD_LALT`, `MOD_LGUI` (note the use of `MOD_` constants instead of `KC_`). These modifiers can be combined using bitwise OR, e.g. `LM(_RAISE, MOD_LCTL | MOD_LALT)`.
|
||||
* `LT(layer, kc)` - momentarily activates *layer* when held, and sends *kc* when tapped. Only supports layers 0-15.
|
||||
* `OSL(layer)` - momentarily activates *layer* until the next key is pressed. See [One Shot Keys](one_shot_keys.md) for details and additional functionality.
|
||||
@ -31,7 +31,7 @@ Care must be taken when switching layers, it's possible to lock yourself into a
|
||||
|
||||
If you are just getting started with QMK you will want to keep everything simple. Follow these guidelines when setting up your layers:
|
||||
|
||||
* Setup layer 0 as your default, "base" layer. This is your normal typing layer, and could be whatever layout you want (qwerty, dvorak, colemak, etc.). It's important to set this as the lowest layer since it will typically have most or all of the keyboard's keys defined, so would block other layers from having any effect if it were above them (i.e., had a higher layer number).
|
||||
* Setup layer 0 as your default, "base" layer. This is your normal typing layer, and could be whatever layout you want (qwerty, dvorak, colemak, etc.). It's important to set this as the lowest layer since it will typically have most or all of the keyboard's keys defined, so would block other layers from having any effect if it were above them (i.e., had a higher layer number).
|
||||
* Arrange your layers in a "tree" layout, with layer 0 as the root. Do not try to enter the same layer from more than one other layer.
|
||||
* In a layer's keymap, only reference higher-numbered layers. Because layers are processed from the highest-numbered (topmost) active layer down, modifying the state of lower layers can be tricky and error-prone.
|
||||
|
||||
@ -89,3 +89,46 @@ It is also possible to check the state of a particular layer using the following
|
||||
|---------------------------------|-------------------------------------------------------------------------------------------------|-----------------------------------------------------------------------|
|
||||
| `layer_state_is(layer)` | Checks if the specified `layer` is enabled globally. | `IS_LAYER_ON(layer)`, `IS_LAYER_OFF(layer)` |
|
||||
| `layer_state_cmp(state, layer)` | Checks `state` to see if the specified `layer` is enabled. Intended for use in layer callbacks. | `IS_LAYER_ON_STATE(state, layer)`, `IS_LAYER_OFF_STATE(state, layer)` |
|
||||
|
||||
## Layer Change Code :id=layer-change-code
|
||||
|
||||
This runs code every time that the layers get changed. This can be useful for layer indication, or custom layer handling.
|
||||
|
||||
### Example `layer_state_set_*` Implementation
|
||||
|
||||
This example shows how to set the [RGB Underglow](feature_rgblight.md) lights based on the layer, using the Planck as an example.
|
||||
|
||||
```c
|
||||
layer_state_t layer_state_set_user(layer_state_t state) {
|
||||
switch (get_highest_layer(state)) {
|
||||
case _RAISE:
|
||||
rgblight_setrgb (0x00, 0x00, 0xFF);
|
||||
break;
|
||||
case _LOWER:
|
||||
rgblight_setrgb (0xFF, 0x00, 0x00);
|
||||
break;
|
||||
case _PLOVER:
|
||||
rgblight_setrgb (0x00, 0xFF, 0x00);
|
||||
break;
|
||||
case _ADJUST:
|
||||
rgblight_setrgb (0x7A, 0x00, 0xFF);
|
||||
break;
|
||||
default: // for any other layers, or the default layer
|
||||
rgblight_setrgb (0x00, 0xFF, 0xFF);
|
||||
break;
|
||||
}
|
||||
return state;
|
||||
}
|
||||
```
|
||||
|
||||
Use the `IS_LAYER_ON_STATE(state, layer)` and `IS_LAYER_OFF_STATE(state, layer)` macros to check the status of a particular layer.
|
||||
|
||||
Outside of `layer_state_set_*` functions, you can use the `IS_LAYER_ON(layer)` and `IS_LAYER_OFF(layer)` macros to check global layer state.
|
||||
|
||||
### `layer_state_set_*` Function Documentation
|
||||
|
||||
* Keyboard/Revision: `layer_state_t layer_state_set_kb(layer_state_t state)`
|
||||
* Keymap: `layer_state_t layer_state_set_user(layer_state_t state)`
|
||||
|
||||
|
||||
The `state` is the bitmask of the active layers, as explained in the [Keymap Overview](keymap.md#keymap-layer-status)
|
||||
|
@ -42,7 +42,7 @@ For more complicated cases, like blink the LEDs, fiddle with the backlighting, a
|
||||
|
||||
Well, that's the bulk of it! You should now be able to work through the examples below, and to develop your own Tap Dance functionality. But if you want a deeper understanding of what's going on behind the scenes, then read on for the explanation of how it all works!
|
||||
|
||||
Let's go over the three functions mentioned in `ACTION_TAP_DANCE_FN_ADVANCED` in a little more detail. They all receive the same too arguments: a pointer to a structure that holds all dance related state information, and a pointer to a use case specific state variable. The three functions differ in when they are called. The first, `on_each_tap_fn()`, is called every time the tap dance key is *pressed*. Before it is called, the counter is incremented and the timer is reset. The second function, `on_dance_finished_fn()`, is called when the tap dance is interrupted or ends because `TAPPING_TERM` milliseconds have passed since the last tap. When the `finished` field of the dance state structure is set to `true`, the `on_dance_finished_fn()` is skipped. After `on_dance_finished_fn()` was called or would have been called, but no sooner than when the tap dance key is *released*, `on_dance_reset_fn()` is called. It is possible to end a tap dance immediately, skipping `on_dance_finished_fn()`, but not `on_dance_reset_fn`, by calling `reset_tap_dance(state)`.
|
||||
Let's go over the three functions mentioned in `ACTION_TAP_DANCE_FN_ADVANCED` in a little more detail. They all receive the same two arguments: a pointer to a structure that holds all dance related state information, and a pointer to a use case specific state variable. The three functions differ in when they are called. The first, `on_each_tap_fn()`, is called every time the tap dance key is *pressed*. Before it is called, the counter is incremented and the timer is reset. The second function, `on_dance_finished_fn()`, is called when the tap dance is interrupted or ends because `TAPPING_TERM` milliseconds have passed since the last tap. When the `finished` field of the dance state structure is set to `true`, the `on_dance_finished_fn()` is skipped. After `on_dance_finished_fn()` was called or would have been called, but no sooner than when the tap dance key is *released*, `on_dance_reset_fn()` is called. It is possible to end a tap dance immediately, skipping `on_dance_finished_fn()`, but not `on_dance_reset_fn`, by calling `reset_tap_dance(state)`.
|
||||
|
||||
To accomplish this logic, the tap dance mechanics use three entry points. The main entry point is `process_tap_dance()`, called from `process_record_quantum()` *after* `process_record_kb()` and `process_record_user()`. This function is responsible for calling `on_each_tap_fn()` and `on_dance_reset_fn()`. In order to handle interruptions of a tap dance, another entry point, `preprocess_tap_dance()` is run right at the beginning of `process_record_quantum()`. This function checks whether the key pressed is a tap-dance key. If it is not, and a tap-dance was in action, we handle that first, and enqueue the newly pressed key. If it is a tap-dance key, then we check if it is the same as the already active one (if there's one active, that is). If it is not, we fire off the old one first, then register the new one. Finally, `tap_dance_task()` periodically checks whether `TAPPING_TERM` has passed since the last key press and finishes a tap dance if that is the case.
|
||||
|
||||
|
@ -34,7 +34,7 @@ Compatible flashers:
|
||||
Flashing sequence:
|
||||
|
||||
1. Enter the bootloader using any of the following methods:
|
||||
* Press the `RESET` keycode
|
||||
* Press the `QK_BOOT` keycode
|
||||
* Press the `RESET` button on the PCB if available
|
||||
* Short RST to GND quickly
|
||||
2. Wait for the OS to detect the device
|
||||
@ -87,7 +87,7 @@ Compatible flashers:
|
||||
Flashing sequence:
|
||||
|
||||
1. Enter the bootloader using any of the following methods (you only have 7 seconds to flash once it enters; some variants may require you to reset twice within 750 milliseconds):
|
||||
* Press the `RESET` keycode
|
||||
* Press the `QK_BOOT` keycode
|
||||
* Press the `RESET` button on the PCB if available
|
||||
* Short RST to GND quickly
|
||||
2. Wait for the OS to detect the device
|
||||
@ -123,7 +123,7 @@ Compatible flashers:
|
||||
Flashing sequence:
|
||||
|
||||
1. Enter the bootloader using any of the following methods (you only have 7 seconds to flash once it enters):
|
||||
* Press the `RESET` keycode
|
||||
* Press the `QK_BOOT` keycode
|
||||
* Press the `RESET` button on the Teensy or PCB if available
|
||||
* short RST to GND quickly
|
||||
2. Wait for the OS to detect the device
|
||||
@ -153,7 +153,7 @@ Compatible flashers:
|
||||
Flashing sequence:
|
||||
|
||||
1. Enter the bootloader using any of the following methods:
|
||||
* Press the `RESET` keycode
|
||||
* Press the `QK_BOOT` keycode
|
||||
* Keep the `BOOT` button held while quickly tapping the `RESET` button on the PCB
|
||||
2. Wait for the OS to detect the device
|
||||
3. Flash a .hex file
|
||||
@ -182,7 +182,7 @@ Compatible flashers:
|
||||
Flashing sequence:
|
||||
|
||||
1. Enter the bootloader using any of the following methods:
|
||||
* Tap the `RESET` keycode
|
||||
* Tap the `QK_BOOT` keycode
|
||||
* Hold the salt key while plugging the keyboard in - for PS2AVRGB boards, this is usually the key connected to MCU pins A0 and B0, otherwise it will be documented in your keyboard's readme
|
||||
2. Wait for the OS to detect the device
|
||||
3. Flash a .hex file
|
||||
@ -223,7 +223,7 @@ Compatible flashers:
|
||||
Flashing sequence:
|
||||
|
||||
1. Enter the bootloader using any of the following methods:
|
||||
* Press the `RESET` keycode
|
||||
* Press the `QK_BOOT` keycode
|
||||
* Press the `RESET` button on the PCB if available
|
||||
* short RST to GND quickly
|
||||
2. Wait for the OS to detect the device
|
||||
@ -256,7 +256,7 @@ Compatible flashers:
|
||||
Flashing sequence:
|
||||
|
||||
1. Enter the bootloader using any of the following methods:
|
||||
* Tap the `RESET` keycode (may not work on STM32F042 devices)
|
||||
* Tap the `QK_BOOT` keycode (may not work on STM32F042 devices)
|
||||
* If a reset circuit is present, tap the `RESET` button on the PCB; some boards may also have a toggle switch that must be flipped
|
||||
* Otherwise, you need to bridge `BOOT0` to VCC (via `BOOT0` button or jumper), short `RESET` to GND (via `RESET` button or jumper), and then let go of the `BOOT0` bridge
|
||||
2. Wait for the OS to detect the device
|
||||
@ -292,7 +292,7 @@ Compatible flashers:
|
||||
Flashing sequence:
|
||||
|
||||
1. Enter the bootloader using any of the following methods:
|
||||
* Tap the `RESET` keycode
|
||||
* Tap the `QK_BOOT` keycode
|
||||
* If a reset circuit is present, tap the `RESET` button on the PCB
|
||||
* Otherwise, you need to bridge `BOOT0` to VCC (via `BOOT0` button or jumper), short `RESET` to GND (via `RESET` button or jumper), and then let go of the `BOOT0` bridge
|
||||
2. Wait for the OS to detect the device
|
||||
@ -316,7 +316,7 @@ Compatible flashers:
|
||||
Flashing sequence:
|
||||
|
||||
1. Enter the bootloader using any of the following methods:
|
||||
* Tap the `RESET` keycode
|
||||
* Tap the `QK_BOOT` keycode
|
||||
* Press the `RESET` button on the PCB
|
||||
2. Wait for the OS to detect the device
|
||||
3. Flash a .bin file
|
||||
@ -342,7 +342,7 @@ Compatible flashers:
|
||||
Flashing sequence:
|
||||
|
||||
1. Enter the bootloader using any of the following methods:
|
||||
* Tap the `RESET` keycode
|
||||
* Tap the `QK_BOOT` keycode
|
||||
* Double-tap the `nRST` button on the PCB.
|
||||
2. Wait for the OS to detect the device
|
||||
3. Copy the .uf2 file to the new USB disk
|
||||
@ -353,7 +353,7 @@ or
|
||||
CLI Flashing sequence:
|
||||
|
||||
1. Enter the bootloader using any of the following methods:
|
||||
* Tap the `RESET` keycode
|
||||
* Tap the `QK_BOOT` keycode
|
||||
* Double-tap the `nRST` button on the PCB.
|
||||
2. Wait for the OS to detect the device
|
||||
3. Flash via QMK CLI eg. `qmk flash --keyboard handwired/onekey/blackpill_f411_tinyuf2 --keymap default`
|
||||
@ -381,7 +381,7 @@ Compatible flashers:
|
||||
Flashing sequence:
|
||||
|
||||
1. Enter the bootloader using any of the following methods:
|
||||
* Tap the `QK_BOOTLOADER` keycode
|
||||
* Tap the `QK_BOOT` keycode
|
||||
* Hold the `BOOTSEL` button on the PCB while plugin in the usb cable.
|
||||
* Double-tap the `RESET` button on the PCB<sup>1</sup>.
|
||||
2. Wait for the OS to detect the device
|
||||
@ -393,7 +393,7 @@ or
|
||||
CLI Flashing sequence:
|
||||
|
||||
1. Enter the bootloader using any of the following methods:
|
||||
* Tap the `QK_BOOTLOADER` keycode
|
||||
* Tap the `QK_BOOT` keycode
|
||||
* Hold the `BOOTSEL` button on the PCB while plugin in the usb cable.
|
||||
* Double-tap the `RESET` button on the PCB<sup>1</sup>.
|
||||
2. Wait for the OS to detect the device
|
||||
|
@ -5,7 +5,7 @@ ps2avr(GB) boards use an ATmega32A microcontroller and a different bootloader. I
|
||||
General flashing sequence:
|
||||
|
||||
1. Enter the bootloader using any of the following methods:
|
||||
* Tap the `RESET` keycode (may not work on all devices)
|
||||
* Tap the `QK_BOOT` keycode (may not work on all devices)
|
||||
* Hold the salt key while plugging the keyboard in (usually documented within keyboard readme)
|
||||
2. Wait for the OS to detect the device
|
||||
3. Flash a .hex file
|
||||
|
@ -21,7 +21,7 @@
|
||||
"layers": [
|
||||
["KC_GRV","KC_1","KC_2","KC_3","KC_4","KC_5","KC_6","KC_7","KC_8","KC_9","KC_0","KC_MINS","KC_EQL","KC_GRV","KC_BSPC","KC_PGUP","KC_TAB","KC_Q","KC_W","KC_E","KC_R","KC_T","KC_Y","KC_U","KC_I","KC_O","KC_P","KC_LBRC","KC_RBRC","KC_BSLS","KC_PGDN","KC_CAPS","KC_A","KC_S","KC_D","KC_F","KC_G","KC_H","KC_J","KC_K","KC_L","KC_SCLN","KC_QUOT","KC_NUHS","KC_ENT","KC_LSFT","KC_NUBS","KC_Z","KC_X","KC_C","KC_V","KC_B","KC_N","KC_M","KC_COMM","KC_DOT","KC_SLSH","KC_RO","KC_RSFT","KC_UP","KC_LCTL","KC_LGUI","KC_LALT","KC_MHEN","KC_SPC","KC_SPC","KC_HENK","KC_RALT","KC_RCTL","MO(1)","KC_LEFT","KC_DOWN","KC_RIGHT"],
|
||||
["KC_ESC","KC_F1","KC_F2","KC_F3","KC_F4","KC_F5","KC_F6","KC_F7","KC_F8","KC_F9","KC_F10","KC_F11","KC_F12","KC_TRNS","KC_DEL","BL_STEP","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","_______","KC_TRNS","KC_PSCR","KC_SLCK","KC_PAUS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","MO(2)","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_PGUP","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","MO(1)","KC_LEFT","KC_PGDN","KC_RGHT"],
|
||||
["KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","RESET","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","MO(2)","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","MO(1)","KC_TRNS","KC_TRNS","KC_TRNS"]
|
||||
["KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","QK_BOOT","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","MO(2)","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","MO(1)","KC_TRNS","KC_TRNS","KC_TRNS"]
|
||||
]
|
||||
}
|
||||
```
|
||||
|
@ -13,7 +13,7 @@
|
||||
|
||||
あなたはおそらくキーボードを「文鎮化」したくないでしょう。文鎮化するとファームウェアを書き換えられないようになります。リスクがあまりに高い(そしてそうでないかもしれない)ものの一部のリストを示します。
|
||||
|
||||
- キーボードマップに RESET が含まれない場合、DFU モードに入るには、PCB のリセットボタンを押す必要があります。底部のネジを外す必要があります。
|
||||
- キーボードマップに QK_BOOT が含まれない場合、DFU モードに入るには、PCB のリセットボタンを押す必要があります。底部のネジを外す必要があります。
|
||||
- tmk_core / common にあるファイルを触るとキーボードが操作不能になるかもしれません。
|
||||
- .hex ファイルが大きすぎると問題を引き起こします; `make dfu` コマンドはブロックを削除し、サイズを検査し(おっと、間違った順序です!)、エラーを出力し、
|
||||
キーボードへの書き込みに失敗し、DFU モードのままになります。
|
||||
|
@ -23,7 +23,7 @@ Timer 3:
|
||||
|
||||
```
|
||||
STARTUP_SONG // キーボードの起動時に再生 (audio.c)
|
||||
GOODBYE_SONG // RESET キーを押すと再生 (quantum.c)
|
||||
GOODBYE_SONG // QK_BOOT キーを押すと再生 (quantum.c)
|
||||
AG_NORM_SONG // AG_NORM キーを押すと再生 (quantum.c)
|
||||
AG_SWAP_SONG // AG_SWAP キーを押すと再生 (quantum.c)
|
||||
CG_NORM_SONG // CG_NORM キーを押すと再生 (quantum.c)
|
||||
|
@ -34,7 +34,7 @@ BOOTLOADER = atmel-dfu
|
||||
|
||||
書き込み手順:
|
||||
|
||||
1. `RESET` キーコードを押すか、RESET ボタンをタップします(または RST を GND にショートします)。
|
||||
1. `QK_BOOT` キーコードを押すか、RESET ボタンをタップします(または RST を GND にショートします)。
|
||||
2. OS がデバイスを検知するのを待ちます。
|
||||
3. メモリを消去します(自動的に実行されるかもしれません)
|
||||
4. .hex ファイルを書き込みます
|
||||
@ -94,7 +94,7 @@ BOOTLOADER = caterina
|
||||
|
||||
書き込み手順:
|
||||
|
||||
1. `RESET` キーコードを押すか、RST をすばやく GND にショートします (入力後7秒で書き込みます)
|
||||
1. `QK_BOOT` キーコードを押すか、RST をすばやく GND にショートします (入力後7秒で書き込みます)
|
||||
2. OS がデバイスを検知するのを待ちます。
|
||||
3. .hex ファイルを書き込みます
|
||||
4. デバイスが自動的にリセットされるのを待ちます
|
||||
@ -141,7 +141,7 @@ BOOTLOADER = halfkay
|
||||
|
||||
書き込み手順:
|
||||
|
||||
1. `RESET` キーコードを押すか、RST をすばやく GND にショートします (入力後7秒で書き込みます)
|
||||
1. `QK_BOOT` キーコードを押すか、RST をすばやく GND にショートします (入力後7秒で書き込みます)
|
||||
2. OS がデバイスを検知するのを待ちます。
|
||||
3. .hex ファイルを書き込みます
|
||||
4. デバイスをアプリケーションモードにリセットします(自動的に実行されるかもしれません)
|
||||
@ -172,7 +172,7 @@ BOOTLOADER = USBasp
|
||||
|
||||
書き込み手順:
|
||||
|
||||
1. `RESET` キーコードを押すか、RST を GND にすばやくショートしながら、ブートピンを GND にショートしたままにします。
|
||||
1. `QK_BOOT` キーコードを押すか、RST を GND にすばやくショートしながら、ブートピンを GND にショートしたままにします。
|
||||
2. OS がデバイスを検知するのを待ちます。
|
||||
3. .hex ファイルを書き込みます
|
||||
4. デバイスをアプリケーションモードにリセットします(自動的に実行されるかもしれません)
|
||||
@ -203,7 +203,7 @@ BOOTLOADER = bootloadHID
|
||||
書き込み手順:
|
||||
|
||||
1. 以下のいずれかの方法を使ってブートローダに入ります:
|
||||
* `RESET` キーコードをタップします (全てのデバイスでは動作しないかもしれません)
|
||||
* `QK_BOOT` キーコードをタップします (全てのデバイスでは動作しないかもしれません)
|
||||
* キーボードを接続しながらソルトキーを押し続けます (通常はキーボードの readme に書かれています)
|
||||
2. OS がデバイスを検知するのを待ちます。
|
||||
3. .hex ファイルを書き込みます
|
||||
@ -227,7 +227,7 @@ BOOTLOADER = bootloadHID
|
||||
書き込み手順:
|
||||
|
||||
1. 以下のいずれかの方法を使ってブートローダに入ります:
|
||||
* `RESET` キーコードをタップします (STM32F042 デバイスでは動作しないかもしれません)
|
||||
* `QK_BOOT` キーコードをタップします (STM32F042 デバイスでは動作しないかもしれません)
|
||||
* リセット回路が存在する場合、RESET ボタンをタップします
|
||||
* それ以外の場合は、(BOOT0 ボタンあるいはブリッジ経由で)BOOT0 を VCC にブリッジし、(REEST ボタンあるいはブリッジ経由で)RESET を GND にショートし、BOOT0 ブリッジを放す必要があります。
|
||||
2. OS がデバイスを検知するのを待ちます。
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user