Compare commits
494 Commits
0.10.53
...
kle2json_h
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
69e5e15ccc | ||
|
|
543e663c68 | ||
|
|
0177fbd65b | ||
|
|
7f398eea50 | ||
|
|
df85940a47 | ||
|
|
cd1cfb7c36 | ||
|
|
2ee52e43a7 | ||
|
|
63472dfde7 | ||
|
|
2040fe3d8a | ||
|
|
88cfd3554a | ||
|
|
0f8b34771d | ||
|
|
34446b79d7 | ||
|
|
b7d4a9dc25 | ||
|
|
acec174fde | ||
|
|
1f8acb7619 | ||
|
|
070240f212 | ||
|
|
271c0cf136 | ||
|
|
f3ac792c09 | ||
|
|
e8e090aced | ||
|
|
7456e6c776 | ||
|
|
11bd98f684 | ||
|
|
b3de903a3d | ||
|
|
f27d8d9448 | ||
|
|
f12000a1b6 | ||
|
|
c07543133a | ||
|
|
266343666f | ||
|
|
2e9d091960 | ||
|
|
e190872b82 | ||
|
|
8e68003b28 | ||
|
|
13efa8290e | ||
|
|
d8a9974a41 | ||
|
|
988715910c | ||
|
|
7ecbc83e71 | ||
|
|
8da9219c16 | ||
|
|
ddfb558591 | ||
|
|
d321cb3f8b | ||
|
|
5209576828 | ||
|
|
8ed9eb9c7f | ||
|
|
f410dfa091 | ||
|
|
1d2a9a1cdb | ||
|
|
428eb5faad | ||
|
|
fcd921f3aa | ||
|
|
e45a2af683 | ||
|
|
e11d3d524d | ||
|
|
d288f2f5da | ||
|
|
c01a8b030e | ||
|
|
5fe3de3153 | ||
|
|
b5fc6f0682 | ||
|
|
39bd151472 | ||
|
|
08fdf086b7 | ||
|
|
8a2a39ed06 | ||
|
|
aab056a4a6 | ||
|
|
7b83bb188a | ||
|
|
565a038a3d | ||
|
|
e3da93e658 | ||
|
|
53e9213a22 | ||
|
|
a68d289fa5 | ||
|
|
da8423ca97 | ||
|
|
4ef4347543 | ||
|
|
42cdba8680 | ||
|
|
028d2c91dc | ||
|
|
e319d501f7 | ||
|
|
9f690c94b8 | ||
|
|
633d2cb648 | ||
|
|
6169b47e82 | ||
|
|
47b9b11009 | ||
|
|
f231f24dda | ||
|
|
10096fc42e | ||
|
|
5e5ee3f8de | ||
|
|
b51cc6d67a | ||
|
|
7071900407 | ||
|
|
d5c89c8ed5 | ||
|
|
6f6e28b4c7 | ||
|
|
f801c69c75 | ||
|
|
411b92e206 | ||
|
|
78b12dee89 | ||
|
|
1aa8a3b424 | ||
|
|
a8ac486555 | ||
|
|
0f5f6a6a75 | ||
|
|
a63db4b179 | ||
|
|
a038b712d0 | ||
|
|
09eb6381a9 | ||
|
|
ca8df55858 | ||
|
|
ade1a34cc8 | ||
|
|
fda514bbd7 | ||
|
|
c989da4cfd | ||
|
|
c9156b50d9 | ||
|
|
1b3504e329 | ||
|
|
9410b15ac9 | ||
|
|
992380a5dd | ||
|
|
163e47c29d | ||
|
|
b4ea0a70be | ||
|
|
ed94fe28bf | ||
|
|
c89930ca01 | ||
|
|
5e9b002808 | ||
|
|
a94044c15c | ||
|
|
154bf92b5b | ||
|
|
457042f179 | ||
|
|
aae0e12385 | ||
|
|
944feb2da5 | ||
|
|
e3ce3d6e30 | ||
|
|
b49c657ac1 | ||
|
|
dae6249efa | ||
|
|
ac433b218d | ||
|
|
4f2f21dc05 | ||
|
|
7dd99f2b22 | ||
|
|
8ee03f6a6b | ||
|
|
e29b9e32bb | ||
|
|
0c4663a802 | ||
|
|
5d0c0e7c12 | ||
|
|
599043e7ff | ||
|
|
bea897caf1 | ||
|
|
79265fc2c0 | ||
|
|
e85d904fe1 | ||
|
|
871d99e659 | ||
|
|
12568fb5a9 | ||
|
|
25109f79f1 | ||
|
|
824e1cd95d | ||
|
|
9634c72d7e | ||
|
|
2573ed8c6b | ||
|
|
8609fe8f46 | ||
|
|
25d9cdc88f | ||
|
|
77185961dc | ||
|
|
962b8d3814 | ||
|
|
7ee3eb50b0 | ||
|
|
122cf3ad0f | ||
|
|
525be128c9 | ||
|
|
5edfdeff50 | ||
|
|
7b7763469b | ||
|
|
221d8fd866 | ||
|
|
9748b6b847 | ||
|
|
3300164065 | ||
|
|
d1b9a7e1bd | ||
|
|
55843480ff | ||
|
|
8ea2650ab2 | ||
|
|
5fde2d730c | ||
|
|
99d6349978 | ||
|
|
1b7b72c0e9 | ||
|
|
0c5be869ff | ||
|
|
bbf0f65284 | ||
|
|
0b37c0dfa0 | ||
|
|
1d1d5da43f | ||
|
|
ffd7e44e5a | ||
|
|
48f4768d33 | ||
|
|
6c366ccf6a | ||
|
|
53eb7f0774 | ||
|
|
a4866b31d6 | ||
|
|
5544bf8524 | ||
|
|
f1a67c42a0 | ||
|
|
7ca4b61922 | ||
|
|
c6aa9c4ad7 | ||
|
|
b7f640ca76 | ||
|
|
f83eefba37 | ||
|
|
436b5394bb | ||
|
|
73dfc2b368 | ||
|
|
010271d6ea | ||
|
|
4551e57d64 | ||
|
|
cd0d2d0de5 | ||
|
|
7771e544ac | ||
|
|
6a292e11d3 | ||
|
|
5437c0af6e | ||
|
|
3e3f93c971 | ||
|
|
45bace1328 | ||
|
|
9136c122f8 | ||
|
|
a0af5eb307 | ||
|
|
cc4b93b330 | ||
|
|
363957f919 | ||
|
|
d40d1e4024 | ||
|
|
524da962d3 | ||
|
|
b2ab0af905 | ||
|
|
d6de97b116 | ||
|
|
d898d4a6fc | ||
|
|
7c95e5ef3e | ||
|
|
7c0cb18681 | ||
|
|
83d73b5407 | ||
|
|
e52b4797d3 | ||
|
|
f971934dab | ||
|
|
498d89f4b3 | ||
|
|
3656644c35 | ||
|
|
d5f3f7c126 | ||
|
|
bdc3578e29 | ||
|
|
e9ed5d7571 | ||
|
|
19fd0108d3 | ||
|
|
806aa9bc67 | ||
|
|
529dad88dd | ||
|
|
dc7081a823 | ||
|
|
b02c694992 | ||
|
|
fd177582ad | ||
|
|
dc6b0d3548 | ||
|
|
dee506c096 | ||
|
|
1c04608b0a | ||
|
|
78b2f120e5 | ||
|
|
47db2d3062 | ||
|
|
ce7d3855f4 | ||
|
|
286ab6d53f | ||
|
|
4eebefada7 | ||
|
|
3b06ab51e5 | ||
|
|
3dde354736 | ||
|
|
71b52416d8 | ||
|
|
824175e69c | ||
|
|
bf324c38e3 | ||
|
|
603d5fbeb1 | ||
|
|
f40b564683 | ||
|
|
325179eb63 | ||
|
|
2843e7f995 | ||
|
|
96a5e560d7 | ||
|
|
54e2bf3ede | ||
|
|
71fcfb3cb5 | ||
|
|
9453573080 | ||
|
|
8f867c1bef | ||
|
|
c0dcee96a8 | ||
|
|
37bb69686c | ||
|
|
4e0718a3b7 | ||
|
|
210e614d2a | ||
|
|
a380a26ad2 | ||
|
|
296a6cf4ea | ||
|
|
c8cd2caeac | ||
|
|
e3211e307e | ||
|
|
d7385676bc | ||
|
|
0239ce025a | ||
|
|
aee1798476 | ||
|
|
13bbeefc5a | ||
|
|
24e827ee1f | ||
|
|
63362a9c5e | ||
|
|
8cb52b2048 | ||
|
|
25b1367806 | ||
|
|
32f53c0671 | ||
|
|
624cafbfd2 | ||
|
|
d11116f734 | ||
|
|
5619b1d3db | ||
|
|
35e684d1ff | ||
|
|
bded5f473c | ||
|
|
45a1a3239d | ||
|
|
6890090fbb | ||
|
|
d66c14b71e | ||
|
|
03cbee8637 | ||
|
|
06f9297f94 | ||
|
|
a9f7d4dccc | ||
|
|
115b60b0e1 | ||
|
|
7797070b37 | ||
|
|
6ea4b06f9f | ||
|
|
973057cfe4 | ||
|
|
d9dcb716bf | ||
|
|
e58f69ea6a | ||
|
|
8346151fe0 | ||
|
|
1bd9570ece | ||
|
|
dc4c80eef4 | ||
|
|
398f67290c | ||
|
|
c4aae0e93b | ||
|
|
ddc27c2935 | ||
|
|
49b6c5fd83 | ||
|
|
41bf5505eb | ||
|
|
7938921f9e | ||
|
|
4352416d77 | ||
|
|
58107ebedf | ||
|
|
cb3dff5c3f | ||
|
|
d82ab56a14 | ||
|
|
4631e4ef8e | ||
|
|
14024fabeb | ||
|
|
45fa5416ab | ||
|
|
d60031b321 | ||
|
|
5e2b53541b | ||
|
|
9c205d4a29 | ||
|
|
c807695035 | ||
|
|
4f431e8a90 | ||
|
|
11669bb45b | ||
|
|
13b31938ce | ||
|
|
3295ac90ee | ||
|
|
a5dd5bfd26 | ||
|
|
0d42d7b87b | ||
|
|
2e0f2025bd | ||
|
|
9366ed7282 | ||
|
|
416dea2c54 | ||
|
|
37fb14f1b5 | ||
|
|
55f681a723 | ||
|
|
3925ff5342 | ||
|
|
c1b8b811ed | ||
|
|
0831a3181a | ||
|
|
9a04739b98 | ||
|
|
ac8cddda22 | ||
|
|
ac0ad5ad17 | ||
|
|
e6217b6aa6 | ||
|
|
6c8ed21022 | ||
|
|
795e82074d | ||
|
|
25a1cb5a15 | ||
|
|
70f40339c2 | ||
|
|
11ee2736bd | ||
|
|
10e4487ba3 | ||
|
|
d7e285a4d9 | ||
|
|
8ea7f4f45f | ||
|
|
6873c4cf91 | ||
|
|
4b03b6f7f4 | ||
|
|
1ebd243cdc | ||
|
|
a023484d64 | ||
|
|
b185816717 | ||
|
|
fdfcce57e1 | ||
|
|
501f2fdef1 | ||
|
|
ed76f4394f | ||
|
|
5b5d74a267 | ||
|
|
f77f715aa2 | ||
|
|
6c4b6531fe | ||
|
|
15373c8367 | ||
|
|
82bb47a2f1 | ||
|
|
f743ff2256 | ||
|
|
9517d90e84 | ||
|
|
b8b8a294d3 | ||
|
|
79d992d1e7 | ||
|
|
5e04ed9f53 | ||
|
|
cd67074f72 | ||
|
|
5689df7490 | ||
|
|
01c7108db5 | ||
|
|
cc14d32941 | ||
|
|
f440111b4b | ||
|
|
95c39b3727 | ||
|
|
56933b9b9f | ||
|
|
e03d72d71e | ||
|
|
563723392f | ||
|
|
2ae700c8c8 | ||
|
|
666861dd6f | ||
|
|
eb3964bd57 | ||
|
|
35f922df73 | ||
|
|
af03b92246 | ||
|
|
d354b1f0a4 | ||
|
|
95022bc366 | ||
|
|
399be2a9b3 | ||
|
|
ab2a43edb0 | ||
|
|
d17caeb8ec | ||
|
|
cf0ae2abe8 | ||
|
|
10f7f6009d | ||
|
|
7222210454 | ||
|
|
9346bd6f80 | ||
|
|
07502a28f7 | ||
|
|
a5a1f860c0 | ||
|
|
0e65e9ad51 | ||
|
|
3a69d688f2 | ||
|
|
7fba37db06 | ||
|
|
e2e6ff43ab | ||
|
|
4acfa14df1 | ||
|
|
b953a585d6 | ||
|
|
354262dfe9 | ||
|
|
dfeba3f9b6 | ||
|
|
41a76cd810 | ||
|
|
df3a81b31e | ||
|
|
b36e32a676 | ||
|
|
f1b082320e | ||
|
|
e31671ece0 | ||
|
|
8d6ad23b09 | ||
|
|
3aa2c122e1 | ||
|
|
a6a1289003 | ||
|
|
688b8df982 | ||
|
|
644dd9c388 | ||
|
|
d62e367280 | ||
|
|
3076f86dc1 | ||
|
|
63d06655e6 | ||
|
|
7043561459 | ||
|
|
6b1f96dca8 | ||
|
|
e199fb6190 | ||
|
|
c59f87a5d7 | ||
|
|
5cfbfc2c52 | ||
|
|
08bf9f9e74 | ||
|
|
2c121b3d8e | ||
|
|
cba76092eb | ||
|
|
bb79fbaccf | ||
|
|
5cf70f3993 | ||
|
|
af8697c85b | ||
|
|
54b932e844 | ||
|
|
351f258bed | ||
|
|
9971caa632 | ||
|
|
15200bd8f5 | ||
|
|
15faffacf4 | ||
|
|
f1fef16e4d | ||
|
|
684773f2d4 | ||
|
|
e3888281f4 | ||
|
|
e1ced62836 | ||
|
|
1e7661651c | ||
|
|
fac5e3b540 | ||
|
|
f05b1b54a9 | ||
|
|
64b395cb3a | ||
|
|
59832e7654 | ||
|
|
dc1eebb566 | ||
|
|
0f086df89f | ||
|
|
024b3bd0dd | ||
|
|
6ab0a6e796 | ||
|
|
7a6e7d87cc | ||
|
|
c1dc676d28 | ||
|
|
4444f3cc55 | ||
|
|
138c3e7042 | ||
|
|
7e2ba2784e | ||
|
|
a5a65fb1e2 | ||
|
|
ed2bb46658 | ||
|
|
fc85ebecd4 | ||
|
|
87291437bd | ||
|
|
777a30cb42 | ||
|
|
2989f9ce2b | ||
|
|
de44fdbaf2 | ||
|
|
bcab02b654 | ||
|
|
b5adf4d9e9 | ||
|
|
3aae5300e2 | ||
|
|
0892741b10 | ||
|
|
41347cdcec | ||
|
|
a8d0ec0749 | ||
|
|
33802ab5cd | ||
|
|
9c03a89596 | ||
|
|
eaa8c18174 | ||
|
|
3a77ef5fa3 | ||
|
|
a4da9c47c8 | ||
|
|
1124e51b11 | ||
|
|
58a5193a2b | ||
|
|
c7dab4bb25 | ||
|
|
0abf4647e3 | ||
|
|
cc08e3082e | ||
|
|
9a0a2dce41 | ||
|
|
02fb0de59b | ||
|
|
4a5388a2b6 | ||
|
|
8724a70c4c | ||
|
|
3cc7d22732 | ||
|
|
990d5189d1 | ||
|
|
485e4524f4 | ||
|
|
ce91dd4bf3 | ||
|
|
5909c243d4 | ||
|
|
67976da039 | ||
|
|
05ac139a29 | ||
|
|
81164c1663 | ||
|
|
c66df16644 | ||
|
|
15385d4113 | ||
|
|
16d55b14b7 | ||
|
|
c41c8ff780 | ||
|
|
c21d5a0973 | ||
|
|
3afe0ea9b9 | ||
|
|
1c0e8a6bb4 | ||
|
|
10d9e8ed37 | ||
|
|
d9613e6a33 | ||
|
|
9c2cfe5c27 | ||
|
|
f98e983141 | ||
|
|
feae8f2980 | ||
|
|
35b329052c | ||
|
|
e8a65baf41 | ||
|
|
d82e002737 | ||
|
|
c78ef391dc | ||
|
|
1bf657be41 | ||
|
|
8897ab9b11 | ||
|
|
50611bd814 | ||
|
|
86b0acbae0 | ||
|
|
24a741649d | ||
|
|
0a9476bc2a | ||
|
|
3fadfb565d | ||
|
|
66b5c5eff2 | ||
|
|
6e97a4c8b9 | ||
|
|
429474d1c3 | ||
|
|
6f9934c669 | ||
|
|
c84650a147 | ||
|
|
30afa1ccd3 | ||
|
|
b8443863c0 | ||
|
|
c731628946 | ||
|
|
ca9edc5fe3 | ||
|
|
a952bf2d31 | ||
|
|
44d1b2e717 | ||
|
|
8ddbb19df1 | ||
|
|
95fd2ce81a | ||
|
|
23222625c2 | ||
|
|
4368611bfd | ||
|
|
ccb15c2d29 | ||
|
|
628d4a91b9 | ||
|
|
9454f98099 | ||
|
|
64572b5c4b | ||
|
|
776d1adc76 | ||
|
|
386cff8cf5 | ||
|
|
e7497b3fba | ||
|
|
6dc2d5956f | ||
|
|
88a783a8a7 | ||
|
|
3aef2bef8f | ||
|
|
078586b21a | ||
|
|
7bdc41b025 | ||
|
|
66d52d8cd2 | ||
|
|
0f8b0d971f | ||
|
|
3270cbeb46 | ||
|
|
ad9674c5af | ||
|
|
e4aadf2c05 | ||
|
|
f00402a2f3 | ||
|
|
e1e13c53ac | ||
|
|
1512e07817 | ||
|
|
ad5cbe5982 | ||
|
|
58f2e0439e | ||
|
|
ddcb1794fa | ||
|
|
adfd34c451 | ||
|
|
3c156e130b | ||
|
|
10782789be | ||
|
|
cf3b683232 | ||
|
|
a8967778d4 | ||
|
|
503b762538 | ||
|
|
88c09aa892 | ||
|
|
69bb9b7386 | ||
|
|
f3394139de | ||
|
|
3e0789c961 |
33
.github/workflows/auto_tag.yaml
vendored
Normal file
33
.github/workflows/auto_tag.yaml
vendored
Normal file
@@ -0,0 +1,33 @@
|
|||||||
|
name: Essential files modified
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches:
|
||||||
|
- master
|
||||||
|
paths:
|
||||||
|
- quantum/**/*
|
||||||
|
- tmk_core/**/*
|
||||||
|
- drivers/**/*
|
||||||
|
- tests/**/*
|
||||||
|
- util/**/*
|
||||||
|
- platforms/**/*
|
||||||
|
- Makefile
|
||||||
|
- '*.mk'
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
tag:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
|
# protect against those who develop with their fork on master
|
||||||
|
if: github.repository == 'qmk/qmk_firmware'
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v2
|
||||||
|
with:
|
||||||
|
fetch-depth: 0
|
||||||
|
|
||||||
|
- name: Bump version and push tag
|
||||||
|
uses: anothrNick/github-tag-action@1.26.0
|
||||||
|
env:
|
||||||
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
DEFAULT_BUMP: 'patch'
|
||||||
42
.github/workflows/develop_api.yml
vendored
Normal file
42
.github/workflows/develop_api.yml
vendored
Normal file
@@ -0,0 +1,42 @@
|
|||||||
|
name: Update Develop API Data
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches:
|
||||||
|
- develop
|
||||||
|
paths:
|
||||||
|
- 'keyboards/**'
|
||||||
|
- 'layouts/community/**'
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
api_data:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
container: qmkfm/base_container
|
||||||
|
|
||||||
|
# protect against those who work in their fork on develop
|
||||||
|
if: github.repository == 'qmk/qmk_firmware'
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v2
|
||||||
|
with:
|
||||||
|
fetch-depth: 1
|
||||||
|
persist-credentials: false
|
||||||
|
|
||||||
|
- name: Generate API Data
|
||||||
|
run: qmk generate-api
|
||||||
|
|
||||||
|
- name: Install rsync
|
||||||
|
run: |
|
||||||
|
apt-get update && apt-get install -y rsync
|
||||||
|
|
||||||
|
- name: Upload API Data
|
||||||
|
uses: JamesIves/github-pages-deploy-action@3.7.1
|
||||||
|
with:
|
||||||
|
ACCESS_TOKEN: ${{ secrets.API_TOKEN_GITHUB }}
|
||||||
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
BRANCH: main
|
||||||
|
FOLDER: api_data/v1
|
||||||
|
CLEAN: true
|
||||||
|
GIT_CONFIG_EMAIL: hello@qmk.fm
|
||||||
|
REPOSITORY_NAME: qmk/qmk_keyboards_devel
|
||||||
|
TARGET_FOLDER: v1
|
||||||
37
.github/workflows/develop_update.yml
vendored
Normal file
37
.github/workflows/develop_update.yml
vendored
Normal file
@@ -0,0 +1,37 @@
|
|||||||
|
name: Update develop after master merge
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches:
|
||||||
|
- master
|
||||||
|
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
develop_update:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
|
if: github.repository == 'qmk/qmk_firmware'
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v2
|
||||||
|
with:
|
||||||
|
fetch-depth: 0
|
||||||
|
|
||||||
|
- name: Checkout develop
|
||||||
|
run: |
|
||||||
|
git fetch origin master develop
|
||||||
|
git checkout develop
|
||||||
|
|
||||||
|
- name: Check if branch locked
|
||||||
|
id: check_locked
|
||||||
|
uses: andstor/file-existence-action@v1
|
||||||
|
with:
|
||||||
|
files: ".locked"
|
||||||
|
|
||||||
|
- name: Update develop from master
|
||||||
|
if: steps.check_locked.outputs.files_exists == 'false'
|
||||||
|
run: |
|
||||||
|
git config --global user.name "QMK Bot"
|
||||||
|
git config --global user.email "hello@qmk.fm"
|
||||||
|
git merge origin/master
|
||||||
|
git push origin develop
|
||||||
37
.github/workflows/format.yaml
vendored
Normal file
37
.github/workflows/format.yaml
vendored
Normal file
@@ -0,0 +1,37 @@
|
|||||||
|
name: Format Codebase
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches:
|
||||||
|
- master
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
format:
|
||||||
|
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:
|
||||||
|
token: ${{ secrets.API_TOKEN_GITHUB }}
|
||||||
|
|
||||||
|
- name: Install dependencies
|
||||||
|
run: |
|
||||||
|
apt-get update && apt-get install -y dos2unix
|
||||||
|
|
||||||
|
- name: Format files
|
||||||
|
run: |
|
||||||
|
bin/qmk cformat -a
|
||||||
|
bin/qmk pyformat
|
||||||
|
bin/qmk fileformat
|
||||||
|
|
||||||
|
- name: Commit files
|
||||||
|
uses: stefanzweifel/git-auto-commit-action@v4
|
||||||
|
with:
|
||||||
|
commit_message: Format code according to conventions for $GITHUB_SHA
|
||||||
|
commit_user_name: QMK Bot
|
||||||
|
commit_user_email: hello@qmk.fm
|
||||||
|
commit_author: QMK Bot <hello@qmk.fm>
|
||||||
@@ -19,7 +19,6 @@ addons:
|
|||||||
- llvm-toolchain-trusty-7
|
- llvm-toolchain-trusty-7
|
||||||
packages:
|
packages:
|
||||||
- diffutils
|
- diffutils
|
||||||
- dos2unix
|
|
||||||
- clang-format-7
|
- clang-format-7
|
||||||
- libstdc++-7-dev
|
- libstdc++-7-dev
|
||||||
script:
|
script:
|
||||||
|
|||||||
135
Makefile
135
Makefile
@@ -68,71 +68,15 @@ PATH_ELEMENTS := $(subst /, ,$(STARTING_DIR))
|
|||||||
# Initialize the path elements list for further processing
|
# Initialize the path elements list for further processing
|
||||||
$(eval $(call NEXT_PATH_ELEMENT))
|
$(eval $(call NEXT_PATH_ELEMENT))
|
||||||
|
|
||||||
# This function sets the KEYBOARD; KEYMAP and SUBPROJECT to the correct
|
|
||||||
# variables depending on which directory you stand in.
|
|
||||||
# It's really a very simple if else chain, if you squint enough,
|
|
||||||
# but the makefile syntax makes it very verbose.
|
|
||||||
# If we are in a subfolder of keyboards
|
|
||||||
#
|
|
||||||
# *** No longer needed **
|
|
||||||
#
|
|
||||||
# ifeq ($(CURRENT_PATH_ELEMENT),keyboards)
|
|
||||||
# $(eval $(call NEXT_PATH_ELEMENT))
|
|
||||||
# KEYBOARD := $(CURRENT_PATH_ELEMENT)
|
|
||||||
# $(eval $(call NEXT_PATH_ELEMENT))
|
|
||||||
# # If we are in a subfolder of keymaps, or in other words in a keymap
|
|
||||||
# # folder
|
|
||||||
# ifeq ($(CURRENT_PATH_ELEMENT),keymaps)
|
|
||||||
# $(eval $(call NEXT_PATH_ELEMENT))
|
|
||||||
# KEYMAP := $(CURRENT_PATH_ELEMENT)
|
|
||||||
# # else if we are not in the keyboard folder itself
|
|
||||||
# else ifneq ($(CURRENT_PATH_ELEMENT),)
|
|
||||||
# # the we can assume it's a subproject, as no other folders
|
|
||||||
# # should have make files in them
|
|
||||||
# SUBPROJECT := $(CURRENT_PATH_ELEMENT)
|
|
||||||
# $(eval $(call NEXT_PATH_ELEMENT))
|
|
||||||
# # if we are inside a keymap folder of a subproject
|
|
||||||
# ifeq ($(CURRENT_PATH_ELEMENT),keymaps)
|
|
||||||
# $(eval $(call NEXT_PATH_ELEMENT))
|
|
||||||
# KEYMAP := $(CURRENT_PATH_ELEMENT)
|
|
||||||
# endif
|
|
||||||
# endif
|
|
||||||
# endif
|
|
||||||
|
|
||||||
define GET_KEYBOARDS
|
|
||||||
ifndef ALT_GET_KEYBOARDS
|
|
||||||
All_RULES_MK := $$(patsubst $(ROOT_DIR)/keyboards/%/rules.mk,%,$$(wildcard $(ROOT_DIR)/keyboards/*/rules.mk))
|
|
||||||
All_RULES_MK += $$(patsubst $(ROOT_DIR)/keyboards/%/rules.mk,%,$$(wildcard $(ROOT_DIR)/keyboards/*/*/rules.mk))
|
|
||||||
All_RULES_MK += $$(patsubst $(ROOT_DIR)/keyboards/%/rules.mk,%,$$(wildcard $(ROOT_DIR)/keyboards/*/*/*/rules.mk))
|
|
||||||
All_RULES_MK += $$(patsubst $(ROOT_DIR)/keyboards/%/rules.mk,%,$$(wildcard $(ROOT_DIR)/keyboards/*/*/*/*/rules.mk))
|
|
||||||
|
|
||||||
KEYMAPS_MK := $$(patsubst $(ROOT_DIR)/keyboards/%/rules.mk,%,$$(wildcard $(ROOT_DIR)/keyboards/*/keymaps/*/rules.mk))
|
|
||||||
KEYMAPS_MK += $$(patsubst $(ROOT_DIR)/keyboards/%/rules.mk,%,$$(wildcard $(ROOT_DIR)/keyboards/*/*/keymaps/*/rules.mk))
|
|
||||||
KEYMAPS_MK += $$(patsubst $(ROOT_DIR)/keyboards/%/rules.mk,%,$$(wildcard $(ROOT_DIR)/keyboards/*/*/*/keymaps/*/rules.mk))
|
|
||||||
KEYMAPS_MK += $$(patsubst $(ROOT_DIR)/keyboards/%/rules.mk,%,$$(wildcard $(ROOT_DIR)/keyboards/*/*/*/*/keymaps/*/rules.mk))
|
|
||||||
|
|
||||||
KEYBOARDS := $$(sort $$(filter-out $$(KEYMAPS_MK), $$(All_RULES_MK)))
|
|
||||||
else
|
|
||||||
KEYBOARDS := $(shell find keyboards/ -type f -iname "rules.mk" | grep -v keymaps | sed 's!keyboards/\(.*\)/rules.mk!\1!' | sort | uniq)
|
|
||||||
endif
|
|
||||||
endef
|
|
||||||
|
|
||||||
$(eval $(call GET_KEYBOARDS))
|
|
||||||
|
|
||||||
# Only consider folders with makefiles, to prevent errors in case there are extra folders
|
|
||||||
#KEYBOARDS += $(patsubst $(ROOD_DIR)/keyboards/%/rules.mk,%,$(wildcard $(ROOT_DIR)/keyboards/*/*/rules.mk))
|
|
||||||
|
|
||||||
|
# Phony targets to enable a few simple make commands outside the main processing below.
|
||||||
.PHONY: list-keyboards
|
.PHONY: list-keyboards
|
||||||
list-keyboards:
|
list-keyboards:
|
||||||
echo $(KEYBOARDS)
|
util/list_keyboards.sh | sort -u | tr '\n' ' '
|
||||||
|
|
||||||
define PRINT_KEYBOARD
|
|
||||||
$(info $(PRINTING_KEYBOARD))
|
|
||||||
endef
|
|
||||||
|
|
||||||
.PHONY: generate-keyboards-file
|
.PHONY: generate-keyboards-file
|
||||||
generate-keyboards-file:
|
generate-keyboards-file:
|
||||||
$(foreach PRINTING_KEYBOARD,$(KEYBOARDS),$(eval $(call PRINT_KEYBOARD)))
|
util/list_keyboards.sh | sort -u
|
||||||
|
|
||||||
.PHONY: clean
|
.PHONY: clean
|
||||||
clean:
|
clean:
|
||||||
@@ -158,8 +102,6 @@ endif
|
|||||||
# Uncomment these for debugging
|
# Uncomment these for debugging
|
||||||
# $(info Keyboard: $(KEYBOARD))
|
# $(info Keyboard: $(KEYBOARD))
|
||||||
# $(info Keymap: $(KEYMAP))
|
# $(info Keymap: $(KEYMAP))
|
||||||
# $(info Subproject: $(SUBPROJECT))
|
|
||||||
# $(info Keyboards: $(KEYBOARDS))
|
|
||||||
|
|
||||||
|
|
||||||
# Set the default goal depending on where we are running make from
|
# Set the default goal depending on where we are running make from
|
||||||
@@ -217,7 +159,6 @@ endef
|
|||||||
# A recursive helper function for finding the longest match
|
# A recursive helper function for finding the longest match
|
||||||
# $1 The list to be checked
|
# $1 The list to be checked
|
||||||
# It works by always removing the currently matched item from the list
|
# It works by always removing the currently matched item from the list
|
||||||
# and call itself recursively, until a match is found
|
|
||||||
define TRY_TO_MATCH_RULE_FROM_LIST_HELPER2
|
define TRY_TO_MATCH_RULE_FROM_LIST_HELPER2
|
||||||
# Stop the recursion when the list is empty
|
# Stop the recursion when the list is empty
|
||||||
ifneq ($1,)
|
ifneq ($1,)
|
||||||
@@ -272,16 +213,29 @@ endef
|
|||||||
define PARSE_RULE
|
define PARSE_RULE
|
||||||
RULE := $1
|
RULE := $1
|
||||||
COMMANDS :=
|
COMMANDS :=
|
||||||
|
REQUIRE_PLATFORM_KEY :=
|
||||||
# If the rule starts with all, then continue the parsing from
|
# If the rule starts with all, then continue the parsing from
|
||||||
# PARSE_ALL_KEYBOARDS
|
# PARSE_ALL_KEYBOARDS
|
||||||
ifeq ($$(call COMPARE_AND_REMOVE_FROM_RULE,all),true)
|
ifeq ($$(call COMPARE_AND_REMOVE_FROM_RULE,all),true)
|
||||||
KEYBOARD_RULE=all
|
KEYBOARD_RULE=all
|
||||||
$$(eval $$(call PARSE_ALL_KEYBOARDS))
|
$$(eval $$(call PARSE_ALL_KEYBOARDS))
|
||||||
|
else ifeq ($$(call COMPARE_AND_REMOVE_FROM_RULE,all-avr),true)
|
||||||
|
KEYBOARD_RULE=all
|
||||||
|
REQUIRE_PLATFORM_KEY := avr
|
||||||
|
$$(eval $$(call PARSE_ALL_KEYBOARDS))
|
||||||
|
else ifeq ($$(call COMPARE_AND_REMOVE_FROM_RULE,all-chibios),true)
|
||||||
|
KEYBOARD_RULE=all
|
||||||
|
REQUIRE_PLATFORM_KEY := chibios
|
||||||
|
$$(eval $$(call PARSE_ALL_KEYBOARDS))
|
||||||
|
else ifeq ($$(call COMPARE_AND_REMOVE_FROM_RULE,all-arm_atsam),true)
|
||||||
|
KEYBOARD_RULE=all
|
||||||
|
REQUIRE_PLATFORM_KEY := arm_atsam
|
||||||
|
$$(eval $$(call PARSE_ALL_KEYBOARDS))
|
||||||
else ifeq ($$(call COMPARE_AND_REMOVE_FROM_RULE,test),true)
|
else ifeq ($$(call COMPARE_AND_REMOVE_FROM_RULE,test),true)
|
||||||
$$(eval $$(call PARSE_TEST))
|
$$(eval $$(call PARSE_TEST))
|
||||||
# If the rule starts with the name of a known keyboard, then continue
|
# If the rule starts with the name of a known keyboard, then continue
|
||||||
# the parsing from PARSE_KEYBOARD
|
# the parsing from PARSE_KEYBOARD
|
||||||
else ifeq ($$(call TRY_TO_MATCH_RULE_FROM_LIST,$$(KEYBOARDS)),true)
|
else ifeq ($$(call TRY_TO_MATCH_RULE_FROM_LIST,$$(shell util/list_keyboards.sh | sort -u)),true)
|
||||||
KEYBOARD_RULE=$$(MATCHED_ITEM)
|
KEYBOARD_RULE=$$(MATCHED_ITEM)
|
||||||
$$(eval $$(call PARSE_KEYBOARD,$$(MATCHED_ITEM)))
|
$$(eval $$(call PARSE_KEYBOARD,$$(MATCHED_ITEM)))
|
||||||
# Otherwise use the KEYBOARD variable, which is determined either by
|
# Otherwise use the KEYBOARD variable, which is determined either by
|
||||||
@@ -398,26 +352,9 @@ endef
|
|||||||
# if we are going to compile all keyboards, match the rest of the rule
|
# if we are going to compile all keyboards, match the rest of the rule
|
||||||
# for each of them
|
# for each of them
|
||||||
define PARSE_ALL_KEYBOARDS
|
define PARSE_ALL_KEYBOARDS
|
||||||
$$(eval $$(call PARSE_ALL_IN_LIST,PARSE_KEYBOARD,$(KEYBOARDS)))
|
$$(eval $$(call PARSE_ALL_IN_LIST,PARSE_KEYBOARD,$(shell util/list_keyboards.sh noci | sort -u)))
|
||||||
endef
|
endef
|
||||||
|
|
||||||
# $1 Subproject
|
|
||||||
# When entering this, the keyboard and subproject are known, so now we need
|
|
||||||
# to determine which keymaps are going to get compiled
|
|
||||||
# define PARSE_SUBPROJECT
|
|
||||||
|
|
||||||
# endef
|
|
||||||
|
|
||||||
# If we want to parse all subprojects, but the keyboard doesn't have any,
|
|
||||||
# then use defaultsp instead
|
|
||||||
# define PARSE_ALL_SUBPROJECTS
|
|
||||||
# ifeq ($$(SUBPROJECTS),)
|
|
||||||
# $$(eval $$(call PARSE_SUBPROJECT,defaultsp))
|
|
||||||
# else
|
|
||||||
# $$(eval $$(call PARSE_ALL_IN_LIST,PARSE_SUBPROJECT,$$(SUBPROJECTS)))
|
|
||||||
# endif
|
|
||||||
# endef
|
|
||||||
|
|
||||||
# Prints a list of all known keymaps for the given keyboard
|
# Prints a list of all known keymaps for the given keyboard
|
||||||
define LIST_ALL_KEYMAPS
|
define LIST_ALL_KEYMAPS
|
||||||
COMMAND_true_LIST_KEYMAPS := \
|
COMMAND_true_LIST_KEYMAPS := \
|
||||||
@@ -447,7 +384,7 @@ define PARSE_KEYMAP
|
|||||||
# Format it in bold
|
# Format it in bold
|
||||||
KB_SP := $(BOLD)$$(KB_SP)$(NO_COLOR)
|
KB_SP := $(BOLD)$$(KB_SP)$(NO_COLOR)
|
||||||
# Specify the variables that we are passing forward to submake
|
# Specify the variables that we are passing forward to submake
|
||||||
MAKE_VARS := KEYBOARD=$$(CURRENT_KB) KEYMAP=$$(CURRENT_KM)
|
MAKE_VARS := KEYBOARD=$$(CURRENT_KB) KEYMAP=$$(CURRENT_KM) REQUIRE_PLATFORM_KEY=$$(REQUIRE_PLATFORM_KEY)
|
||||||
# And the first part of the make command
|
# And the first part of the make command
|
||||||
MAKE_CMD := $$(MAKE) -r -R -C $(ROOT_DIR) -f build_keyboard.mk $$(MAKE_TARGET)
|
MAKE_CMD := $$(MAKE) -r -R -C $(ROOT_DIR) -f build_keyboard.mk $$(MAKE_TARGET)
|
||||||
# The message to display
|
# The message to display
|
||||||
@@ -466,6 +403,8 @@ define BUILD
|
|||||||
LOG=$$$$($$(MAKE_CMD) $$(MAKE_VARS) SILENT=true 2>&1) ; \
|
LOG=$$$$($$(MAKE_CMD) $$(MAKE_VARS) SILENT=true 2>&1) ; \
|
||||||
if [ $$$$? -gt 0 ]; \
|
if [ $$$$? -gt 0 ]; \
|
||||||
then $$(PRINT_ERROR_PLAIN); \
|
then $$(PRINT_ERROR_PLAIN); \
|
||||||
|
elif [ "$$$$LOG" = "skipped" ] ; \
|
||||||
|
then $$(PRINT_SKIPPED_PLAIN); \
|
||||||
elif [ "$$$$LOG" != "" ] ; \
|
elif [ "$$$$LOG" != "" ] ; \
|
||||||
then $$(PRINT_WARNING_PLAIN); \
|
then $$(PRINT_WARNING_PLAIN); \
|
||||||
else \
|
else \
|
||||||
@@ -557,13 +496,13 @@ if [ $$error_occurred -gt 0 ]; then $(HANDLE_ERROR); fi;
|
|||||||
|
|
||||||
endef
|
endef
|
||||||
|
|
||||||
# Let's match everything, we handle all the rule parsing ourselves
|
# Catch everything and parse the command line ourselves.
|
||||||
.PHONY: %
|
.PHONY: %
|
||||||
%:
|
%:
|
||||||
# Check if we have the CMP tool installed
|
# Check if we have the CMP tool installed
|
||||||
cmp $(ROOT_DIR)/Makefile $(ROOT_DIR)/Makefile >/dev/null 2>&1; if [ $$? -gt 0 ]; then printf "$(MSG_NO_CMP)"; exit 1; fi;
|
cmp $(ROOT_DIR)/Makefile $(ROOT_DIR)/Makefile >/dev/null 2>&1; if [ $$? -gt 0 ]; then printf "$(MSG_NO_CMP)"; exit 1; fi;
|
||||||
# Ensure that bin/qmk works. This will be a failing check after the next develop merge on 2020 Aug 29.
|
# Ensure that bin/qmk works.
|
||||||
if ! bin/qmk hello 1> /dev/null 2>&1; then printf "$(MSG_PYTHON_MISSING)"; fi
|
if ! bin/qmk hello 1> /dev/null 2>&1; then printf "$(MSG_PYTHON_MISSING)"; exit 1; fi
|
||||||
# Check if the submodules are dirty, and display a warning if they are
|
# Check if the submodules are dirty, and display a warning if they are
|
||||||
ifndef SKIP_GIT
|
ifndef SKIP_GIT
|
||||||
if [ ! -e lib/chibios ]; then git submodule sync lib/chibios && git submodule update --depth 50 --init lib/chibios; fi
|
if [ ! -e lib/chibios ]; then git submodule sync lib/chibios && git submodule update --depth 50 --init lib/chibios; fi
|
||||||
@@ -593,25 +532,6 @@ endif
|
|||||||
$(foreach TEST,$(sort $(TESTS)),$(RUN_TEST))
|
$(foreach TEST,$(sort $(TESTS)),$(RUN_TEST))
|
||||||
if [ -f $(ERROR_FILE) ]; then printf "$(MSG_ERRORS)" & exit 1; fi;
|
if [ -f $(ERROR_FILE) ]; then printf "$(MSG_ERRORS)" & exit 1; fi;
|
||||||
|
|
||||||
# These no longer work because of the colon system
|
|
||||||
|
|
||||||
# All should compile everything
|
|
||||||
# .PHONY: all
|
|
||||||
# all: all-keyboards test-all
|
|
||||||
|
|
||||||
# Define some shortcuts, mostly for compatibility with the old syntax
|
|
||||||
# .PHONY: all-keyboards
|
|
||||||
# all-keyboards: all\:all\:all
|
|
||||||
|
|
||||||
# .PHONY: all-keyboards-defaults
|
|
||||||
# all-keyboards-defaults: all\:default
|
|
||||||
|
|
||||||
# .PHONY: test
|
|
||||||
# test: test-all
|
|
||||||
|
|
||||||
# .PHONY: test-clean
|
|
||||||
# test-clean: test-all-clean
|
|
||||||
|
|
||||||
lib/%:
|
lib/%:
|
||||||
git submodule sync $?
|
git submodule sync $?
|
||||||
git submodule update --init $?
|
git submodule update --init $?
|
||||||
@@ -637,12 +557,13 @@ else
|
|||||||
endif
|
endif
|
||||||
ifndef SKIP_VERSION
|
ifndef SKIP_VERSION
|
||||||
BUILD_DATE := $(shell date +"%Y-%m-%d-%H:%M:%S")
|
BUILD_DATE := $(shell date +"%Y-%m-%d-%H:%M:%S")
|
||||||
|
else
|
||||||
|
BUILD_DATE := 2020-01-01-00:00:00
|
||||||
|
endif
|
||||||
|
|
||||||
$(shell echo '#define QMK_VERSION "$(GIT_VERSION)"' > $(ROOT_DIR)/quantum/version.h)
|
$(shell echo '#define QMK_VERSION "$(GIT_VERSION)"' > $(ROOT_DIR)/quantum/version.h)
|
||||||
$(shell echo '#define QMK_BUILDDATE "$(BUILD_DATE)"' >> $(ROOT_DIR)/quantum/version.h)
|
$(shell echo '#define QMK_BUILDDATE "$(BUILD_DATE)"' >> $(ROOT_DIR)/quantum/version.h)
|
||||||
$(shell echo '#define CHIBIOS_VERSION "$(CHIBIOS_VERSION)"' >> $(ROOT_DIR)/quantum/version.h)
|
$(shell echo '#define CHIBIOS_VERSION "$(CHIBIOS_VERSION)"' >> $(ROOT_DIR)/quantum/version.h)
|
||||||
$(shell echo '#define CHIBIOS_CONTRIB_VERSION "$(CHIBIOS_CONTRIB_VERSION)"' >> $(ROOT_DIR)/quantum/version.h)
|
$(shell echo '#define CHIBIOS_CONTRIB_VERSION "$(CHIBIOS_CONTRIB_VERSION)"' >> $(ROOT_DIR)/quantum/version.h)
|
||||||
else
|
|
||||||
BUILD_DATE := NA
|
|
||||||
endif
|
|
||||||
|
|
||||||
include $(ROOT_DIR)/testlist.mk
|
include $(ROOT_DIR)/testlist.mk
|
||||||
|
|||||||
@@ -30,4 +30,4 @@ $(TEST)_SRC += $(patsubst $(ROOTDIR)/%,%,$(wildcard $(TEST_PATH)/*.cpp))
|
|||||||
|
|
||||||
$(TEST)_DEFS=$(TMK_COMMON_DEFS) $(OPT_DEFS)
|
$(TEST)_DEFS=$(TMK_COMMON_DEFS) $(OPT_DEFS)
|
||||||
$(TEST)_CONFIG=$(TEST_PATH)/config.h
|
$(TEST)_CONFIG=$(TEST_PATH)/config.h
|
||||||
VPATH+=$(TOP_DIR)/tests/test_common
|
VPATH+=$(TOP_DIR)/tests/test_common
|
||||||
|
|||||||
@@ -90,13 +90,16 @@ ifneq ("$(wildcard $(KEYBOARD_PATH_1)/rules.mk)","")
|
|||||||
include $(KEYBOARD_PATH_1)/rules.mk
|
include $(KEYBOARD_PATH_1)/rules.mk
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
|
||||||
MAIN_KEYMAP_PATH_1 := $(KEYBOARD_PATH_1)/keymaps/$(KEYMAP)
|
MAIN_KEYMAP_PATH_1 := $(KEYBOARD_PATH_1)/keymaps/$(KEYMAP)
|
||||||
MAIN_KEYMAP_PATH_2 := $(KEYBOARD_PATH_2)/keymaps/$(KEYMAP)
|
MAIN_KEYMAP_PATH_2 := $(KEYBOARD_PATH_2)/keymaps/$(KEYMAP)
|
||||||
MAIN_KEYMAP_PATH_3 := $(KEYBOARD_PATH_3)/keymaps/$(KEYMAP)
|
MAIN_KEYMAP_PATH_3 := $(KEYBOARD_PATH_3)/keymaps/$(KEYMAP)
|
||||||
MAIN_KEYMAP_PATH_4 := $(KEYBOARD_PATH_4)/keymaps/$(KEYMAP)
|
MAIN_KEYMAP_PATH_4 := $(KEYBOARD_PATH_4)/keymaps/$(KEYMAP)
|
||||||
MAIN_KEYMAP_PATH_5 := $(KEYBOARD_PATH_5)/keymaps/$(KEYMAP)
|
MAIN_KEYMAP_PATH_5 := $(KEYBOARD_PATH_5)/keymaps/$(KEYMAP)
|
||||||
|
|
||||||
|
# Pull in rules from info.json
|
||||||
|
INFO_RULES_MK = $(shell bin/qmk generate-rules-mk --quiet --keyboard $(KEYBOARD) --output $(KEYBOARD_OUTPUT)/src/rules.mk)
|
||||||
|
include $(INFO_RULES_MK)
|
||||||
|
|
||||||
# Check for keymap.json first, so we can regenerate keymap.c
|
# Check for keymap.json first, so we can regenerate keymap.c
|
||||||
include build_json.mk
|
include build_json.mk
|
||||||
|
|
||||||
@@ -136,9 +139,7 @@ ifeq ($(strip $(CTPC)), yes)
|
|||||||
endif
|
endif
|
||||||
|
|
||||||
ifeq ($(strip $(CONVERT_TO_PROTON_C)), yes)
|
ifeq ($(strip $(CONVERT_TO_PROTON_C)), yes)
|
||||||
TARGET := $(TARGET)_proton_c
|
include platforms/chibios/QMK_PROTON_C/convert_to_proton_c.mk
|
||||||
include platforms/chibios/GENERIC_STM32_F303XC/configs/proton_c.mk
|
|
||||||
OPT_DEFS += -DCONVERT_TO_PROTON_C
|
|
||||||
endif
|
endif
|
||||||
|
|
||||||
ifneq ($(FORCE_LAYOUT),)
|
ifneq ($(FORCE_LAYOUT),)
|
||||||
@@ -292,6 +293,32 @@ ifneq ("$(wildcard $(KEYMAP_PATH)/config.h)","")
|
|||||||
CONFIG_H += $(KEYMAP_PATH)/config.h
|
CONFIG_H += $(KEYMAP_PATH)/config.h
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
# Pull in stuff from info.json
|
||||||
|
INFO_JSON_FILES :=
|
||||||
|
ifneq ("$(wildcard $(KEYBOARD_PATH_1)/info.json)","")
|
||||||
|
INFO_JSON_FILES += $(KEYBOARD_PATH_1)/info.json
|
||||||
|
endif
|
||||||
|
ifneq ("$(wildcard $(KEYBOARD_PATH_2)/info.json)","")
|
||||||
|
INFO_JSON_FILES += $(KEYBOARD_PATH_2)/info.json
|
||||||
|
endif
|
||||||
|
ifneq ("$(wildcard $(KEYBOARD_PATH_3)/info.json)","")
|
||||||
|
INFO_JSON_FILES += $(KEYBOARD_PATH_3)/info.json
|
||||||
|
endif
|
||||||
|
ifneq ("$(wildcard $(KEYBOARD_PATH_4)/info.json)","")
|
||||||
|
INFO_JSON_FILES += $(KEYBOARD_PATH_4)/info.json
|
||||||
|
endif
|
||||||
|
ifneq ("$(wildcard $(KEYBOARD_PATH_5)/info.json)","")
|
||||||
|
INFO_JSON_FILES += $(KEYBOARD_PATH_5)/info.json
|
||||||
|
endif
|
||||||
|
|
||||||
|
CONFIG_H += $(KEYBOARD_OUTPUT)/src/info_config.h $(KEYBOARD_OUTPUT)/src/layouts.h
|
||||||
|
|
||||||
|
$(KEYBOARD_OUTPUT)/src/info_config.h: $(INFO_JSON_FILES)
|
||||||
|
bin/qmk generate-config-h --quiet --keyboard $(KEYBOARD) --output $(KEYBOARD_OUTPUT)/src/info_config.h
|
||||||
|
|
||||||
|
$(KEYBOARD_OUTPUT)/src/layouts.h: $(INFO_JSON_FILES)
|
||||||
|
bin/qmk generate-layouts --quiet --keyboard $(KEYBOARD) --output $(KEYBOARD_OUTPUT)/src/layouts.h
|
||||||
|
|
||||||
# project specific files
|
# project specific files
|
||||||
SRC += $(KEYBOARD_SRC) \
|
SRC += $(KEYBOARD_SRC) \
|
||||||
$(KEYMAP_C) \
|
$(KEYMAP_C) \
|
||||||
@@ -317,6 +344,13 @@ SRC += $(TMK_COMMON_SRC)
|
|||||||
OPT_DEFS += $(TMK_COMMON_DEFS)
|
OPT_DEFS += $(TMK_COMMON_DEFS)
|
||||||
EXTRALDFLAGS += $(TMK_COMMON_LDFLAGS)
|
EXTRALDFLAGS += $(TMK_COMMON_LDFLAGS)
|
||||||
|
|
||||||
|
SKIP_COMPILE := no
|
||||||
|
ifneq ($(REQUIRE_PLATFORM_KEY),)
|
||||||
|
ifneq ($(REQUIRE_PLATFORM_KEY),$(PLATFORM_KEY))
|
||||||
|
SKIP_COMPILE := yes
|
||||||
|
endif
|
||||||
|
endif
|
||||||
|
|
||||||
include $(TMK_PATH)/$(PLATFORM_KEY).mk
|
include $(TMK_PATH)/$(PLATFORM_KEY).mk
|
||||||
ifneq ($(strip $(PROTOCOL)),)
|
ifneq ($(strip $(PROTOCOL)),)
|
||||||
include $(TMK_PATH)/protocol/$(strip $(shell echo $(PROTOCOL) | tr '[:upper:]' '[:lower:]')).mk
|
include $(TMK_PATH)/protocol/$(strip $(shell echo $(PROTOCOL) | tr '[:upper:]' '[:lower:]')).mk
|
||||||
@@ -352,9 +386,16 @@ $(KEYBOARD_OUTPUT)_INC := $(PROJECT_INC) $(GFXINC)
|
|||||||
$(KEYBOARD_OUTPUT)_CONFIG := $(PROJECT_CONFIG)
|
$(KEYBOARD_OUTPUT)_CONFIG := $(PROJECT_CONFIG)
|
||||||
|
|
||||||
# Default target.
|
# Default target.
|
||||||
|
ifeq ($(SKIP_COMPILE),no)
|
||||||
all: build check-size
|
all: build check-size
|
||||||
build: elf cpfirmware
|
else
|
||||||
|
all:
|
||||||
|
echo "skipped" >&2
|
||||||
|
endif
|
||||||
|
|
||||||
|
build: $(KEYBOARD_OUTPUT)/src/info_config.h $(KEYBOARD_OUTPUT)/src/layouts.h elf cpfirmware
|
||||||
check-size: build
|
check-size: build
|
||||||
|
check-md5: build
|
||||||
objs-size: build
|
objs-size: build
|
||||||
|
|
||||||
include show_options.mk
|
include show_options.mk
|
||||||
|
|||||||
@@ -17,7 +17,7 @@ OUTPUTS := $(TEST_OBJ)/$(TEST) $(GTEST_OUTPUT)
|
|||||||
GTEST_INC := \
|
GTEST_INC := \
|
||||||
$(LIB_PATH)/googletest/googletest/include\
|
$(LIB_PATH)/googletest/googletest/include\
|
||||||
$(LIB_PATH)/googletest/googlemock/include\
|
$(LIB_PATH)/googletest/googlemock/include\
|
||||||
|
|
||||||
GTEST_INTERNAL_INC :=\
|
GTEST_INTERNAL_INC :=\
|
||||||
$(LIB_PATH)/googletest/googletest\
|
$(LIB_PATH)/googletest/googletest\
|
||||||
$(LIB_PATH)/googletest/googlemock
|
$(LIB_PATH)/googletest/googlemock
|
||||||
@@ -27,7 +27,7 @@ $(GTEST_OUTPUT)_SRC :=\
|
|||||||
googletest/src/gtest_main.cc\
|
googletest/src/gtest_main.cc\
|
||||||
googlemock/src/gmock-all.cc
|
googlemock/src/gmock-all.cc
|
||||||
|
|
||||||
$(GTEST_OUTPUT)_DEFS :=
|
$(GTEST_OUTPUT)_DEFS :=
|
||||||
$(GTEST_OUTPUT)_INC := $(GTEST_INC) $(GTEST_INTERNAL_INC)
|
$(GTEST_OUTPUT)_INC := $(GTEST_INC) $(GTEST_INTERNAL_INC)
|
||||||
|
|
||||||
LDFLAGS += -lstdc++ -lpthread -shared-libgcc
|
LDFLAGS += -lstdc++ -lpthread -shared-libgcc
|
||||||
@@ -49,6 +49,7 @@ endif
|
|||||||
|
|
||||||
include common_features.mk
|
include common_features.mk
|
||||||
include $(TMK_PATH)/common.mk
|
include $(TMK_PATH)/common.mk
|
||||||
|
include $(QUANTUM_PATH)/sequencer/tests/rules.mk
|
||||||
include $(QUANTUM_PATH)/serial_link/tests/rules.mk
|
include $(QUANTUM_PATH)/serial_link/tests/rules.mk
|
||||||
ifneq ($(filter $(FULL_TESTS),$(TEST)),)
|
ifneq ($(filter $(FULL_TESTS),$(TEST)),)
|
||||||
include build_full_test.mk
|
include build_full_test.mk
|
||||||
@@ -65,4 +66,3 @@ include $(TMK_PATH)/rules.mk
|
|||||||
|
|
||||||
$(shell mkdir -p $(BUILD_DIR)/test 2>/dev/null)
|
$(shell mkdir -p $(BUILD_DIR)/test 2>/dev/null)
|
||||||
$(shell mkdir -p $(TEST_OBJ) 2>/dev/null)
|
$(shell mkdir -p $(TEST_OBJ) 2>/dev/null)
|
||||||
|
|
||||||
|
|||||||
@@ -21,4 +21,5 @@ COMMON_VPATH += $(QUANTUM_PATH)/keymap_extras
|
|||||||
COMMON_VPATH += $(QUANTUM_PATH)/audio
|
COMMON_VPATH += $(QUANTUM_PATH)/audio
|
||||||
COMMON_VPATH += $(QUANTUM_PATH)/process_keycode
|
COMMON_VPATH += $(QUANTUM_PATH)/process_keycode
|
||||||
COMMON_VPATH += $(QUANTUM_PATH)/api
|
COMMON_VPATH += $(QUANTUM_PATH)/api
|
||||||
|
COMMON_VPATH += $(QUANTUM_PATH)/sequencer
|
||||||
COMMON_VPATH += $(DRIVER_PATH)
|
COMMON_VPATH += $(DRIVER_PATH)
|
||||||
|
|||||||
@@ -21,6 +21,11 @@ QUANTUM_SRC += \
|
|||||||
$(QUANTUM_DIR)/keymap_common.c \
|
$(QUANTUM_DIR)/keymap_common.c \
|
||||||
$(QUANTUM_DIR)/keycode_config.c
|
$(QUANTUM_DIR)/keycode_config.c
|
||||||
|
|
||||||
|
ifeq ($(strip $(DEBUG_MATRIX_SCAN_RATE_ENABLE)), yes)
|
||||||
|
OPT_DEFS += -DDEBUG_MATRIX_SCAN_RATE
|
||||||
|
CONSOLE_ENABLE = yes
|
||||||
|
endif
|
||||||
|
|
||||||
ifeq ($(strip $(API_SYSEX_ENABLE)), yes)
|
ifeq ($(strip $(API_SYSEX_ENABLE)), yes)
|
||||||
OPT_DEFS += -DAPI_SYSEX_ENABLE
|
OPT_DEFS += -DAPI_SYSEX_ENABLE
|
||||||
OPT_DEFS += -DAPI_ENABLE
|
OPT_DEFS += -DAPI_ENABLE
|
||||||
@@ -39,6 +44,13 @@ ifeq ($(strip $(AUDIO_ENABLE)), yes)
|
|||||||
SRC += $(QUANTUM_DIR)/audio/luts.c
|
SRC += $(QUANTUM_DIR)/audio/luts.c
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
ifeq ($(strip $(SEQUENCER_ENABLE)), yes)
|
||||||
|
OPT_DEFS += -DSEQUENCER_ENABLE
|
||||||
|
MUSIC_ENABLE = yes
|
||||||
|
SRC += $(QUANTUM_DIR)/sequencer/sequencer.c
|
||||||
|
SRC += $(QUANTUM_DIR)/process_keycode/process_sequencer.c
|
||||||
|
endif
|
||||||
|
|
||||||
ifeq ($(strip $(MIDI_ENABLE)), yes)
|
ifeq ($(strip $(MIDI_ENABLE)), yes)
|
||||||
OPT_DEFS += -DMIDI_ENABLE
|
OPT_DEFS += -DMIDI_ENABLE
|
||||||
MUSIC_ENABLE = yes
|
MUSIC_ENABLE = yes
|
||||||
@@ -142,26 +154,48 @@ else
|
|||||||
endif
|
endif
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
RGBLIGHT_ENABLE ?= no
|
||||||
|
VALID_RGBLIGHT_TYPES := WS2812 APA102 custom
|
||||||
|
|
||||||
|
ifeq ($(strip $(RGBLIGHT_CUSTOM_DRIVER)), yes)
|
||||||
|
RGBLIGHT_DRIVER ?= custom
|
||||||
|
endif
|
||||||
|
|
||||||
ifeq ($(strip $(RGBLIGHT_ENABLE)), yes)
|
ifeq ($(strip $(RGBLIGHT_ENABLE)), yes)
|
||||||
POST_CONFIG_H += $(QUANTUM_DIR)/rgblight_post_config.h
|
RGBLIGHT_DRIVER ?= WS2812
|
||||||
OPT_DEFS += -DRGBLIGHT_ENABLE
|
|
||||||
SRC += $(QUANTUM_DIR)/color.c
|
ifeq ($(filter $(RGBLIGHT_DRIVER),$(VALID_RGBLIGHT_TYPES)),)
|
||||||
SRC += $(QUANTUM_DIR)/rgblight.c
|
$(error RGBLIGHT_DRIVER="$(RGBLIGHT_DRIVER)" is not a valid RGB type)
|
||||||
CIE1931_CURVE := yes
|
|
||||||
RGB_KEYCODES_ENABLE := yes
|
|
||||||
ifeq ($(strip $(RGBLIGHT_CUSTOM_DRIVER)), yes)
|
|
||||||
OPT_DEFS += -DRGBLIGHT_CUSTOM_DRIVER
|
|
||||||
else
|
else
|
||||||
|
POST_CONFIG_H += $(QUANTUM_DIR)/rgblight_post_config.h
|
||||||
|
OPT_DEFS += -DRGBLIGHT_ENABLE
|
||||||
|
SRC += $(QUANTUM_DIR)/color.c
|
||||||
|
SRC += $(QUANTUM_DIR)/rgblight.c
|
||||||
|
CIE1931_CURVE := yes
|
||||||
|
RGB_KEYCODES_ENABLE := yes
|
||||||
|
endif
|
||||||
|
|
||||||
|
ifeq ($(strip $(RGBLIGHT_DRIVER)), WS2812)
|
||||||
WS2812_DRIVER_REQUIRED := yes
|
WS2812_DRIVER_REQUIRED := yes
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
ifeq ($(strip $(RGBLIGHT_DRIVER)), APA102)
|
||||||
|
APA102_DRIVER_REQUIRED := yes
|
||||||
|
endif
|
||||||
|
|
||||||
|
ifeq ($(strip $(RGBLIGHT_DRIVER)), custom)
|
||||||
|
OPT_DEFS += -DRGBLIGHT_CUSTOM_DRIVER
|
||||||
|
endif
|
||||||
endif
|
endif
|
||||||
|
|
||||||
VALID_MATRIX_TYPES := yes IS31FL3731 IS31FL3733 IS31FL3737 IS31FL3741 WS2812 custom
|
|
||||||
|
|
||||||
LED_MATRIX_ENABLE ?= no
|
LED_MATRIX_ENABLE ?= no
|
||||||
ifneq ($(strip $(LED_MATRIX_ENABLE)), no)
|
VALID_LED_MATRIX_TYPES := IS31FL3731 custom
|
||||||
ifeq ($(filter $(LED_MATRIX_ENABLE),$(VALID_MATRIX_TYPES)),)
|
# TODO: IS31FL3733 IS31FL3737 IS31FL3741
|
||||||
$(error LED_MATRIX_ENABLE="$(LED_MATRIX_ENABLE)" is not a valid matrix type)
|
|
||||||
|
ifeq ($(strip $(LED_MATRIX_ENABLE)), yes)
|
||||||
|
ifeq ($(filter $(LED_MATRIX_DRIVER),$(VALID_LED_MATRIX_TYPES)),)
|
||||||
|
$(error LED_MATRIX_DRIVER="$(LED_MATRIX_DRIVER)" is not a valid matrix type)
|
||||||
else
|
else
|
||||||
BACKLIGHT_ENABLE = yes
|
BACKLIGHT_ENABLE = yes
|
||||||
BACKLIGHT_DRIVER = custom
|
BACKLIGHT_DRIVER = custom
|
||||||
@@ -169,21 +203,22 @@ ifneq ($(strip $(LED_MATRIX_ENABLE)), no)
|
|||||||
SRC += $(QUANTUM_DIR)/led_matrix.c
|
SRC += $(QUANTUM_DIR)/led_matrix.c
|
||||||
SRC += $(QUANTUM_DIR)/led_matrix_drivers.c
|
SRC += $(QUANTUM_DIR)/led_matrix_drivers.c
|
||||||
endif
|
endif
|
||||||
endif
|
|
||||||
|
|
||||||
ifeq ($(strip $(LED_MATRIX_ENABLE)), IS31FL3731)
|
ifeq ($(strip $(LED_MATRIX_DRIVER)), IS31FL3731)
|
||||||
OPT_DEFS += -DIS31FL3731
|
OPT_DEFS += -DIS31FL3731 -DSTM32_I2C -DHAL_USE_I2C=TRUE
|
||||||
COMMON_VPATH += $(DRIVER_PATH)/issi
|
COMMON_VPATH += $(DRIVER_PATH)/issi
|
||||||
SRC += is31fl3731-simple.c
|
SRC += is31fl3731-simple.c
|
||||||
QUANTUM_LIB_SRC += i2c_master.c
|
QUANTUM_LIB_SRC += i2c_master.c
|
||||||
|
endif
|
||||||
endif
|
endif
|
||||||
|
|
||||||
RGB_MATRIX_ENABLE ?= no
|
RGB_MATRIX_ENABLE ?= no
|
||||||
|
VALID_RGB_MATRIX_TYPES := IS31FL3731 IS31FL3733 IS31FL3737 IS31FL3741 WS2812 custom
|
||||||
|
|
||||||
ifneq ($(strip $(RGB_MATRIX_ENABLE)), no)
|
ifeq ($(strip $(RGB_MATRIX_ENABLE)), yes)
|
||||||
ifeq ($(filter $(RGB_MATRIX_ENABLE),$(VALID_MATRIX_TYPES)),)
|
ifeq ($(filter $(RGB_MATRIX_DRIVER),$(VALID_RGB_MATRIX_TYPES)),)
|
||||||
$(error RGB_MATRIX_ENABLE="$(RGB_MATRIX_ENABLE)" is not a valid matrix type)
|
$(error "$(RGB_MATRIX_DRIVER)" is not a valid matrix type)
|
||||||
endif
|
endif
|
||||||
OPT_DEFS += -DRGB_MATRIX_ENABLE
|
OPT_DEFS += -DRGB_MATRIX_ENABLE
|
||||||
ifneq (,$(filter $(MCU), atmega16u2 atmega32u2))
|
ifneq (,$(filter $(MCU), atmega16u2 atmega32u2))
|
||||||
# ATmegaxxU2 does not have hardware MUL instruction - lib8tion must be told to use software multiplication routines
|
# ATmegaxxU2 does not have hardware MUL instruction - lib8tion must be told to use software multiplication routines
|
||||||
@@ -194,51 +229,52 @@ endif
|
|||||||
SRC += $(QUANTUM_DIR)/rgb_matrix_drivers.c
|
SRC += $(QUANTUM_DIR)/rgb_matrix_drivers.c
|
||||||
CIE1931_CURVE := yes
|
CIE1931_CURVE := yes
|
||||||
RGB_KEYCODES_ENABLE := yes
|
RGB_KEYCODES_ENABLE := yes
|
||||||
endif
|
|
||||||
|
|
||||||
ifeq ($(strip $(RGB_MATRIX_ENABLE)), yes)
|
ifeq ($(strip $(RGB_MATRIX_DRIVER)), IS31FL3731)
|
||||||
RGB_MATRIX_ENABLE := IS31FL3731
|
OPT_DEFS += -DIS31FL3731 -DSTM32_I2C -DHAL_USE_I2C=TRUE
|
||||||
endif
|
COMMON_VPATH += $(DRIVER_PATH)/issi
|
||||||
|
SRC += is31fl3731.c
|
||||||
|
QUANTUM_LIB_SRC += i2c_master.c
|
||||||
|
endif
|
||||||
|
|
||||||
ifeq ($(strip $(RGB_MATRIX_ENABLE)), IS31FL3731)
|
ifeq ($(strip $(RGB_MATRIX_DRIVER)), IS31FL3733)
|
||||||
OPT_DEFS += -DIS31FL3731 -DSTM32_I2C -DHAL_USE_I2C=TRUE
|
OPT_DEFS += -DIS31FL3733 -DSTM32_I2C -DHAL_USE_I2C=TRUE
|
||||||
COMMON_VPATH += $(DRIVER_PATH)/issi
|
COMMON_VPATH += $(DRIVER_PATH)/issi
|
||||||
SRC += is31fl3731.c
|
SRC += is31fl3733.c
|
||||||
QUANTUM_LIB_SRC += i2c_master.c
|
QUANTUM_LIB_SRC += i2c_master.c
|
||||||
endif
|
endif
|
||||||
|
|
||||||
ifeq ($(strip $(RGB_MATRIX_ENABLE)), IS31FL3733)
|
ifeq ($(strip $(RGB_MATRIX_DRIVER)), IS31FL3737)
|
||||||
OPT_DEFS += -DIS31FL3733 -DSTM32_I2C -DHAL_USE_I2C=TRUE
|
OPT_DEFS += -DIS31FL3737 -DSTM32_I2C -DHAL_USE_I2C=TRUE
|
||||||
COMMON_VPATH += $(DRIVER_PATH)/issi
|
COMMON_VPATH += $(DRIVER_PATH)/issi
|
||||||
SRC += is31fl3733.c
|
SRC += is31fl3737.c
|
||||||
QUANTUM_LIB_SRC += i2c_master.c
|
QUANTUM_LIB_SRC += i2c_master.c
|
||||||
endif
|
endif
|
||||||
|
|
||||||
ifeq ($(strip $(RGB_MATRIX_ENABLE)), IS31FL3737)
|
ifeq ($(strip $(RGB_MATRIX_DRIVER)), IS31FL3741)
|
||||||
OPT_DEFS += -DIS31FL3737 -DSTM32_I2C -DHAL_USE_I2C=TRUE
|
OPT_DEFS += -DIS31FL3741 -DSTM32_I2C -DHAL_USE_I2C=TRUE
|
||||||
COMMON_VPATH += $(DRIVER_PATH)/issi
|
COMMON_VPATH += $(DRIVER_PATH)/issi
|
||||||
SRC += is31fl3737.c
|
SRC += is31fl3741.c
|
||||||
QUANTUM_LIB_SRC += i2c_master.c
|
QUANTUM_LIB_SRC += i2c_master.c
|
||||||
endif
|
endif
|
||||||
|
|
||||||
ifeq ($(strip $(RGB_MATRIX_ENABLE)), IS31FL3741)
|
ifeq ($(strip $(RGB_MATRIX_DRIVER)), WS2812)
|
||||||
OPT_DEFS += -DIS31FL3741 -DSTM32_I2C -DHAL_USE_I2C=TRUE
|
OPT_DEFS += -DWS2812
|
||||||
COMMON_VPATH += $(DRIVER_PATH)/issi
|
WS2812_DRIVER_REQUIRED := yes
|
||||||
SRC += is31fl3741.c
|
endif
|
||||||
QUANTUM_LIB_SRC += i2c_master.c
|
|
||||||
endif
|
|
||||||
|
|
||||||
ifeq ($(strip $(RGB_MATRIX_ENABLE)), WS2812)
|
ifeq ($(strip $(RGB_MATRIX_DRIVER)), APA102)
|
||||||
OPT_DEFS += -DWS2812
|
OPT_DEFS += -DAPA102
|
||||||
WS2812_DRIVER_REQUIRED := yes
|
APA102_DRIVER_REQUIRED := yes
|
||||||
endif
|
endif
|
||||||
|
|
||||||
ifeq ($(strip $(RGB_MATRIX_CUSTOM_KB)), yes)
|
ifeq ($(strip $(RGB_MATRIX_CUSTOM_KB)), yes)
|
||||||
OPT_DEFS += -DRGB_MATRIX_CUSTOM_KB
|
OPT_DEFS += -DRGB_MATRIX_CUSTOM_KB
|
||||||
endif
|
endif
|
||||||
|
|
||||||
ifeq ($(strip $(RGB_MATRIX_CUSTOM_USER)), yes)
|
ifeq ($(strip $(RGB_MATRIX_CUSTOM_USER)), yes)
|
||||||
OPT_DEFS += -DRGB_MATRIX_CUSTOM_USER
|
OPT_DEFS += -DRGB_MATRIX_CUSTOM_USER
|
||||||
|
endif
|
||||||
endif
|
endif
|
||||||
|
|
||||||
ifeq ($(strip $(RGB_KEYCODES_ENABLE)), yes)
|
ifeq ($(strip $(RGB_KEYCODES_ENABLE)), yes)
|
||||||
@@ -334,6 +370,11 @@ ifeq ($(strip $(WS2812_DRIVER_REQUIRED)), yes)
|
|||||||
endif
|
endif
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
ifeq ($(strip $(APA102_DRIVER_REQUIRED)), yes)
|
||||||
|
COMMON_VPATH += $(DRIVER_PATH)/apa102
|
||||||
|
SRC += apa102.c
|
||||||
|
endif
|
||||||
|
|
||||||
ifeq ($(strip $(VISUALIZER_ENABLE)), yes)
|
ifeq ($(strip $(VISUALIZER_ENABLE)), yes)
|
||||||
CIE1931_CURVE := yes
|
CIE1931_CURVE := yes
|
||||||
endif
|
endif
|
||||||
@@ -444,11 +485,14 @@ ifeq ($(strip $(SPLIT_KEYBOARD)), yes)
|
|||||||
# Functions added via QUANTUM_LIB_SRC are only included in the final binary if they're called.
|
# Functions added via QUANTUM_LIB_SRC are only included in the final binary if they're called.
|
||||||
# Unused functions are pruned away, which is why we can add multiple drivers here without bloat.
|
# Unused functions are pruned away, which is why we can add multiple drivers here without bloat.
|
||||||
ifeq ($(PLATFORM),AVR)
|
ifeq ($(PLATFORM),AVR)
|
||||||
QUANTUM_LIB_SRC += i2c_master.c \
|
ifneq ($(NO_I2C),yes)
|
||||||
i2c_slave.c
|
QUANTUM_LIB_SRC += i2c_master.c \
|
||||||
|
i2c_slave.c
|
||||||
|
endif
|
||||||
endif
|
endif
|
||||||
|
|
||||||
SERIAL_DRIVER ?= bitbang
|
SERIAL_DRIVER ?= bitbang
|
||||||
|
OPT_DEFS += -DSERIAL_DRIVER_$(strip $(shell echo $(SERIAL_DRIVER) | tr '[:lower:]' '[:upper:]'))
|
||||||
ifeq ($(strip $(SERIAL_DRIVER)), bitbang)
|
ifeq ($(strip $(SERIAL_DRIVER)), bitbang)
|
||||||
QUANTUM_LIB_SRC += serial.c
|
QUANTUM_LIB_SRC += serial.c
|
||||||
else
|
else
|
||||||
|
|||||||
@@ -50,4 +50,3 @@ This document marks the inaugural Breaking Change merge. A list of changes follo
|
|||||||
* `KC_DELT` was a redundant, undocumented alias for `KC_DELETE`
|
* `KC_DELT` was a redundant, undocumented alias for `KC_DELETE`
|
||||||
* It has been removed and all its uses replaced with the more common `KC_DEL` alias
|
* It has been removed and all its uses replaced with the more common `KC_DEL` alias
|
||||||
* Around 90 keymaps (mostly for ErgoDox boards) have been modified as a result
|
* Around 90 keymaps (mostly for ErgoDox boards) have been modified as a result
|
||||||
|
|
||||||
|
|||||||
150
docs/ChangeLog/20201128.md
Normal file
150
docs/ChangeLog/20201128.md
Normal file
@@ -0,0 +1,150 @@
|
|||||||
|
# QMK Breaking Change - 2020 Nov 28 Changelog
|
||||||
|
|
||||||
|
Four times a year QMK runs a process for merging Breaking Changes. A Breaking Change is any change which modifies how QMK behaves in a way that is incompatible or potentially dangerous. We limit these changes to 4 times per year so that users can have confidence that updating their QMK tree will not break their keymaps.
|
||||||
|
|
||||||
|
|
||||||
|
## Changes Requiring User Action :id=changes-requiring-user-action
|
||||||
|
|
||||||
|
### Relocated Keyboards :id-relocated-keyboards
|
||||||
|
|
||||||
|
#### Reduce Helix keyboard build variation ([#8669](https://github.com/qmk/qmk_firmware/pull/8669))
|
||||||
|
|
||||||
|
The build commands for the Helix keyboard are:
|
||||||
|
|
||||||
|
```
|
||||||
|
make <helix_build_name>:<keymap_name>
|
||||||
|
```
|
||||||
|
|
||||||
|
For `<helix_build_name>`, specify the one in the rightmost column of the table below, such as `helix`,` helix/pico`.
|
||||||
|
|
||||||
|
| before Oct 17 2019 | Oct 17 2019 | Mar 10 2020 | Nov 28 2020 |
|
||||||
|
| ---------------------|-------------------------|-------------------------| ------------------------|
|
||||||
|
| helix/rev1 | helix/rev1 | helix/rev1 | helix/rev1 |
|
||||||
|
| helix/pico | helix/pico | helix/pico | helix/pico |
|
||||||
|
| | helix/pico/back | helix/pico/back | helix/pico/back |
|
||||||
|
| | helix/pico/under | helix/pico/under | helix/pico/under |
|
||||||
|
| | | helix/pico/sc | -- |
|
||||||
|
| | | helix/pico/sc/back | helix/pico/sc |
|
||||||
|
| | | helix/pico/sc/under | -- |
|
||||||
|
| helix/rev2 (=helix) | helix/rev2 (=helix) | helix/rev2 (=helix) | -- |
|
||||||
|
| | helix/rev2/back | helix/rev2/back | -- |
|
||||||
|
| | helix/rev2/back/oled | helix/rev2/back/oled | ( --> helix/rev2/back) |
|
||||||
|
| | helix/rev2/oled | helix/rev2/oled | helix/rev2 (=helix) |
|
||||||
|
| | helix/rev2/oled/back | helix/rev2/oled/back | helix/rev2/back |
|
||||||
|
| | helix/rev2/oled/under | helix/rev2/oled/under | helix/rev2/under |
|
||||||
|
| | | helix/rev2/sc | -- |
|
||||||
|
| | | helix/rev2/sc/back | -- |
|
||||||
|
| | | helix/rev2/sc/oled | -- |
|
||||||
|
| | | helix/rev2/sc/oledback | helix/rev2/sc |
|
||||||
|
| | | helix/rev2/sc/oledunder | -- |
|
||||||
|
| | | helix/rev2/sc/under | -- |
|
||||||
|
| | helix/rev2/under | helix/rev2/under | -- |
|
||||||
|
| | helix/rev2/under/oled | helix/rev2/under/oled | ( --> helix/rev2/under) |
|
||||||
|
|
||||||
|
#### Update the Speedo firmware for v3.0 ([#10657](https://github.com/qmk/qmk_firmware/pull/10657))
|
||||||
|
|
||||||
|
The Speedo keyboard has moved to `cozykeys/speedo/v2` as the designer prepares to release the Speedo v3.0.
|
||||||
|
|
||||||
|
| Previous Name | New Name |
|
||||||
|
| :------------ | :------------------------- |
|
||||||
|
| speedo | cozykeys/speedo/v2 |
|
||||||
|
| -- | cozykeys/speedo/v3 **new** |
|
||||||
|
|
||||||
|
#### Maartenwut/Maarten name change to evyd13/Evy ([#10274](https://github.com/qmk/qmk_firmware/pull/10274))
|
||||||
|
|
||||||
|
Maartenwut has rebranded as @evyd13, and all released Maartenwut boards have moved.
|
||||||
|
|
||||||
|
| Previous Name | New Name |
|
||||||
|
| :--------------------- | :----------------- |
|
||||||
|
| maartenwut/atom47/rev2 | evyd13/atom47/rev2 |
|
||||||
|
| maartenwut/atom47/rev3 | evyd13/atom47/rev3 |
|
||||||
|
| maartenwut/eon40 | evyd13/eon40 |
|
||||||
|
| maartenwut/eon65 | evyd13/eon65 |
|
||||||
|
| maartenwut/eon75 | evyd13/eon75 |
|
||||||
|
| maartenwut/eon87 | evyd13/eon87 |
|
||||||
|
| maartenwut/eon95 | evyd13/eon95 |
|
||||||
|
| maartenwut/gh80_1800 | evyd13/gh80_1800 |
|
||||||
|
| maartenwut/gh80_3700 | evyd13/gh80_3700 |
|
||||||
|
| maartenwut/minitomic | evyd13/minitomic |
|
||||||
|
| maartenwut/mx5160 | evyd13/mx5160 |
|
||||||
|
| maartenwut/nt660 | evyd13/nt660 |
|
||||||
|
| maartenwut/omrontkl | evyd13/omrontkl |
|
||||||
|
| maartenwut/plain60 | evyd13/plain60 |
|
||||||
|
| maartenwut/pockettype | evyd13/pockettype |
|
||||||
|
| maartenwut/quackfire | evyd13/quackfire |
|
||||||
|
| maartenwut/solheim68 | evyd13/solheim68 |
|
||||||
|
| maartenwut/ta65 | evyd13/ta65 |
|
||||||
|
| maartenwut/wasdat | evyd13/wasdat |
|
||||||
|
| maartenwut/wasdat_code | evyd13/wasdat_code |
|
||||||
|
| maartenwut/wonderland | evyd13/wonderland |
|
||||||
|
|
||||||
|
#### Xelus Valor and Dawn60 Refactors ([#10512](https://github.com/qmk/qmk_firmware/pull/10512), [#10584](https://github.com/qmk/qmk_firmware/pull/10584))
|
||||||
|
|
||||||
|
The Valor and Dawn60 keyboards by Xelus22 both now require their revisions to be specified when compiling.
|
||||||
|
|
||||||
|
| Previous Name | New Name |
|
||||||
|
| :------------ | :---------------- |
|
||||||
|
| xelus/dawn60 | xelus/dawn60/rev1 |
|
||||||
|
| xelus/valor | xelus/valor/rev1 |
|
||||||
|
|
||||||
|
|
||||||
|
### Updated Keyboard Codebases :id=keyboard-updates
|
||||||
|
|
||||||
|
#### AEboards EXT65 Refactor ([#10820](https://github.com/qmk/qmk_firmware/pull/10820))
|
||||||
|
|
||||||
|
The EXT65 codebase has been reworked so keymaps can be used with either revision.
|
||||||
|
|
||||||
|
|
||||||
|
## Core Changes :id=core-changes
|
||||||
|
|
||||||
|
### Fixes :id=core-fixes
|
||||||
|
|
||||||
|
* Reconnect the USB if users wake up a computer from the keyboard to restore the USB state ([#10088](https://github.com/qmk/qmk_firmware/pull/10088))
|
||||||
|
* Fix cursor position bug in oled_write_raw functions ([#10800](https://github.com/qmk/qmk_firmware/pull/10800))
|
||||||
|
|
||||||
|
### Additions and Enhancements :id=core-additions
|
||||||
|
|
||||||
|
* Allow MATRIX_ROWS to be greater than 32 ([#10183](https://github.com/qmk/qmk_firmware/pull/10183))
|
||||||
|
* Add support for soft serial to ATmega32U2 ([#10204](https://github.com/qmk/qmk_firmware/pull/10204))
|
||||||
|
* Allow direct control of MIDI velocity value ([#9940](https://github.com/qmk/qmk_firmware/pull/9940))
|
||||||
|
* Joystick 16-bit support ([#10439](https://github.com/qmk/qmk_firmware/pull/10439))
|
||||||
|
* Allow encoder resolutions to be set per encoder ([#10259](https://github.com/qmk/qmk_firmware/pull/10259))
|
||||||
|
* Share button state from mousekey to pointing_device ([#10179](https://github.com/qmk/qmk_firmware/pull/10179))
|
||||||
|
* Add advanced/efficient RGB Matrix Indicators ([#8564](https://github.com/qmk/qmk_firmware/pull/8564))
|
||||||
|
* OLED display update interval support ([#10388](https://github.com/qmk/qmk_firmware/pull/10388))
|
||||||
|
* Per-Key Retro Tapping ([#10622](https://github.com/qmk/qmk_firmware/pull/10622))
|
||||||
|
* Allow backlight duty cycle limit ([#10260](https://github.com/qmk/qmk_firmware/pull/10260))
|
||||||
|
* Add step sequencer feature ([#9703](https://github.com/qmk/qmk_firmware/pull/9703))
|
||||||
|
* Added `add_oneshot_mods` & `del_oneshot_mods` ([#10549](https://github.com/qmk/qmk_firmware/pull/10549))
|
||||||
|
* Add AT90USB support for serial.c ([#10706](https://github.com/qmk/qmk_firmware/pull/10706))
|
||||||
|
* Auto shift: support repeats and early registration (#9826)
|
||||||
|
|
||||||
|
### Clean-ups and Optimizations :id=core-optimizations
|
||||||
|
|
||||||
|
* Haptic and solenoid cleanup ([#9700](https://github.com/qmk/qmk_firmware/pull/9700))
|
||||||
|
* XD75 cleanup ([#10524](https://github.com/qmk/qmk_firmware/pull/10524))
|
||||||
|
* Minor change to behavior allowing display updates to continue between task ticks ([#10750](https://github.com/qmk/qmk_firmware/pull/10750))
|
||||||
|
* Change some GPIO manipulations in matrix.c to be atomic ([#10491](https://github.com/qmk/qmk_firmware/pull/10491))
|
||||||
|
* combine repeated lines of code for ATmega32U2, ATmega16U2, ATmega328 and ATmega328P ([#10837](https://github.com/qmk/qmk_firmware/pull/10837))
|
||||||
|
* Remove references to HD44780 ([#10735](https://github.com/qmk/qmk_firmware/pull/10735))
|
||||||
|
|
||||||
|
|
||||||
|
## QMK Infrastructure and Internals :id=qmk-internals
|
||||||
|
|
||||||
|
* Add ability to build a subset of all keyboards based on platform. ([#10420](https://github.com/qmk/qmk_firmware/pull/10420))
|
||||||
|
* Initialise EEPROM drivers at startup, instead of upon first execution ([#10438](https://github.com/qmk/qmk_firmware/pull/10438))
|
||||||
|
* Make bootloader_jump weak for ChibiOS ([#10417](https://github.com/qmk/qmk_firmware/pull/10417))
|
||||||
|
* Support for STM32 GPIOF,G,H,I,J,K ([#10206](https://github.com/qmk/qmk_firmware/pull/10206))
|
||||||
|
* Add milc as a dependency and remove the installed milc ([#10563](https://github.com/qmk/qmk_firmware/pull/10563))
|
||||||
|
* ChibiOS upgrade: early init conversions ([#10214](https://github.com/qmk/qmk_firmware/pull/10214))
|
||||||
|
* ChibiOS upgrade: configuration file migrator ([#9952](https://github.com/qmk/qmk_firmware/pull/9952))
|
||||||
|
* Add definition based on currently-selected serial driver. ([#10716](https://github.com/qmk/qmk_firmware/pull/10716))
|
||||||
|
* Allow for modification of output RGB values when using rgblight/rgb_matrix. ([#10638](https://github.com/qmk/qmk_firmware/pull/10638))
|
||||||
|
* Allow keyboards/keymaps to execute code at each main loop iteration ([#10530](https://github.com/qmk/qmk_firmware/pull/10530))
|
||||||
|
* qmk cformat ([#10767](https://github.com/qmk/qmk_firmware/pull/10767))
|
||||||
|
* Add a Make variable to easily enable DEBUG_MATRIX_SCAN_RATE on the command line ([#10824](https://github.com/qmk/qmk_firmware/pull/10824))
|
||||||
|
* update Chibios OS USB for the OTG driver ([#8893](https://github.com/qmk/qmk_firmware/pull/8893))
|
||||||
|
* Fixup version.h writing when using `SKIP_VERSION=yes` ([#10972](https://github.com/qmk/qmk_firmware/pull/10972), [#10974](https://github.com/qmk/qmk_firmware/pull/10974))
|
||||||
|
* Rename ledmatrix.h to match .c file ([#7949](https://github.com/qmk/qmk_firmware/pull/7949))
|
||||||
|
* Split RGB_MATRIX_ENABLE into _ENABLE and _DRIVER ([#10231](https://github.com/qmk/qmk_firmware/pull/10231))
|
||||||
|
* Split LED_MATRIX_ENABLE into _ENABLE and _DRIVER ([#10840](https://github.com/qmk/qmk_firmware/pull/10840))
|
||||||
@@ -24,7 +24,7 @@ Totally new to QMK? There are two ways to get started:
|
|||||||
|
|
||||||
## Make It Yours
|
## Make It Yours
|
||||||
|
|
||||||
QMK has lots of [features](features.md) to explore, and a good deal of reference documentation to dig through. Most features are taken advantage of by modifying your [keymap](keymap.md), and changing the [keycodes](keycodes.md).
|
QMK has lots of features to explore, and a good deal of reference documentation to dig through. Most features are taken advantage of by modifying your [keymap](keymap.md), and changing the [keycodes](keycodes.md).
|
||||||
|
|
||||||
## Need help?
|
## Need help?
|
||||||
|
|
||||||
|
|||||||
@@ -22,6 +22,7 @@
|
|||||||
* QMK API
|
* QMK API
|
||||||
* [Overview](api_overview.md)
|
* [Overview](api_overview.md)
|
||||||
* [API Documentation](api_docs.md)
|
* [API Documentation](api_docs.md)
|
||||||
|
* [KLE To info.json](kle2json_guide.md)
|
||||||
* [Keyboard Support](reference_configurator_support.md)
|
* [Keyboard Support](reference_configurator_support.md)
|
||||||
* [Adding Default Keymaps](configurator_default_keymaps.md)
|
* [Adding Default Keymaps](configurator_default_keymaps.md)
|
||||||
|
|
||||||
@@ -80,6 +81,7 @@
|
|||||||
* [One Shot Keys](one_shot_keys.md)
|
* [One Shot Keys](one_shot_keys.md)
|
||||||
* [Pointing Device](feature_pointing_device.md)
|
* [Pointing Device](feature_pointing_device.md)
|
||||||
* [Raw HID](feature_rawhid.md)
|
* [Raw HID](feature_rawhid.md)
|
||||||
|
* [Sequencer](feature_sequencer.md)
|
||||||
* [Swap Hands](feature_swap_hands.md)
|
* [Swap Hands](feature_swap_hands.md)
|
||||||
* [Tap Dance](feature_tap_dance.md)
|
* [Tap Dance](feature_tap_dance.md)
|
||||||
* [Tap-Hold Configuration](tap_hold.md)
|
* [Tap-Hold Configuration](tap_hold.md)
|
||||||
@@ -119,6 +121,7 @@
|
|||||||
* [Overview](breaking_changes.md)
|
* [Overview](breaking_changes.md)
|
||||||
* [My Pull Request Was Flagged](breaking_changes_instructions.md)
|
* [My Pull Request Was Flagged](breaking_changes_instructions.md)
|
||||||
* History
|
* History
|
||||||
|
* [2020 Nov 28](ChangeLog/20201128.md)
|
||||||
* [2020 Aug 29](ChangeLog/20200829.md)
|
* [2020 Aug 29](ChangeLog/20200829.md)
|
||||||
* [2020 May 30](ChangeLog/20200530.md)
|
* [2020 May 30](ChangeLog/20200530.md)
|
||||||
* [2020 Feb 29](ChangeLog/20200229.md)
|
* [2020 Feb 29](ChangeLog/20200229.md)
|
||||||
|
|||||||
@@ -6,6 +6,7 @@ The breaking change period is when we will merge PR's that change QMK in dangero
|
|||||||
|
|
||||||
## What has been included in past Breaking Changes?
|
## What has been included in past Breaking Changes?
|
||||||
|
|
||||||
|
* [2020 Nov 28](ChangeLog/20201128.md)
|
||||||
* [2020 Aug 29](ChangeLog/20200829.md)
|
* [2020 Aug 29](ChangeLog/20200829.md)
|
||||||
* [2020 May 30](ChangeLog/20200530.md)
|
* [2020 May 30](ChangeLog/20200530.md)
|
||||||
* [2020 Feb 29](ChangeLog/20200229.md)
|
* [2020 Feb 29](ChangeLog/20200229.md)
|
||||||
@@ -13,16 +14,16 @@ The breaking change period is when we will merge PR's that change QMK in dangero
|
|||||||
|
|
||||||
## When is the next Breaking Change?
|
## When is the next Breaking Change?
|
||||||
|
|
||||||
The next Breaking Change is scheduled for November 28, 2020.
|
The next Breaking Change is scheduled for February 27, 2021.
|
||||||
|
|
||||||
### Important Dates
|
### Important Dates
|
||||||
|
|
||||||
* [x] 2020 Aug 29 - `develop` is created. It will be rebased weekly.
|
* [x] 2020 Nov 28 - `develop` is created. Each push to `master` is subsequently merged to `develop`
|
||||||
* [ ] 2020 Oct 31 - `develop` closed to new PR's.
|
* [ ] 2021 Jan 30 - `develop` closed to new PR's.
|
||||||
* [ ] 2020 Oct 31 - Call for testers.
|
* [ ] 2021 Jan 30 - Call for testers.
|
||||||
* [ ] 2020 Nov 26 - `master` is locked, no PR's merged.
|
* [ ] 2021 Feb 25 - `master` is locked, no PR's merged.
|
||||||
* [ ] 2020 Nov 28 - Merge `develop` to `master`.
|
* [ ] 2021 Feb 27 - Merge `develop` to `master`.
|
||||||
* [ ] 2020 Nov 28 - `master` is unlocked. PR's can be merged again.
|
* [ ] 2021 Feb 27 - `master` is unlocked. PR's can be merged again.
|
||||||
|
|
||||||
## What changes will be included?
|
## What changes will be included?
|
||||||
|
|
||||||
@@ -39,21 +40,6 @@ Criteria for acceptance:
|
|||||||
|
|
||||||
This section documents various processes we use when running the Breaking Changes process.
|
This section documents various processes we use when running the Breaking Changes process.
|
||||||
|
|
||||||
## Rebase `develop` from `master`
|
|
||||||
|
|
||||||
This is run every Friday while `develop` is open.
|
|
||||||
|
|
||||||
Process:
|
|
||||||
|
|
||||||
```
|
|
||||||
cd qmk_firmware
|
|
||||||
git checkout master
|
|
||||||
git pull --ff-only
|
|
||||||
git checkout develop
|
|
||||||
git rebase master
|
|
||||||
git push --force
|
|
||||||
```
|
|
||||||
|
|
||||||
## Creating the `develop` branch
|
## Creating the `develop` branch
|
||||||
|
|
||||||
This happens immediately after the previous `develop` branch is merged.
|
This happens immediately after the previous `develop` branch is merged.
|
||||||
|
|||||||
@@ -175,7 +175,7 @@ Creates a keymap.json from a keymap.c.
|
|||||||
**Usage**:
|
**Usage**:
|
||||||
|
|
||||||
```
|
```
|
||||||
qmk c2json [--no-cpp] [-o OUTPUT] filename
|
qmk c2json -km KEYMAP -kb KEYBOARD [-q] [--no-cpp] [-o OUTPUT] filename
|
||||||
```
|
```
|
||||||
|
|
||||||
## `qmk lint`
|
## `qmk lint`
|
||||||
@@ -296,26 +296,44 @@ This command allows you to generate QMK documentation locally. It can be uses fo
|
|||||||
qmk generate-docs
|
qmk generate-docs
|
||||||
```
|
```
|
||||||
|
|
||||||
## `qmk kle2json`
|
## `qmk generate-rgb-breathe-table`
|
||||||
|
|
||||||
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.
|
This command generates a lookup table (LUT) header file for the [RGB Lighting](feature_rgblight.md) feature's breathing animation. Place this file in your keyboard or keymap directory as `rgblight_breathe_table.h` to override the default LUT in `quantum/`.
|
||||||
|
|
||||||
**Usage**:
|
**Usage**:
|
||||||
|
|
||||||
```
|
```
|
||||||
qmk kle2json [-f] <filename>
|
qmk generate-rgb-breathe-table [-q] [-o OUTPUT] [-m MAX] [-c CENTER]
|
||||||
|
```
|
||||||
|
|
||||||
|
## `qmk kle2json`
|
||||||
|
|
||||||
|
This command allows you to convert [Keyboard-Layout-Editor.com](http://keyboard-layout-editor.com) layouts into `info.json` layouts. It will also create a `keymap.json` file for your layout. This saves a lot of time when setting up a new keyboard.
|
||||||
|
|
||||||
|
To use this command your KLE will need to follow a specific format. See [KLE To info.json](kle2json_guide.md) for more details.
|
||||||
|
|
||||||
|
**Usage**:
|
||||||
|
|
||||||
|
```
|
||||||
|
qmk kle2json -kb <keyboard> [-km KEYMAP] [-l LAYOUT] <filename-or-kle-id>
|
||||||
```
|
```
|
||||||
|
|
||||||
**Examples**:
|
**Examples**:
|
||||||
|
|
||||||
```
|
With only a KLE id:
|
||||||
$ qmk kle2json kle.txt
|
|
||||||
☒ File info.json already exists, use -f or --force to overwrite.
|
|
||||||
```
|
|
||||||
|
|
||||||
```
|
```
|
||||||
$ qmk kle2json -f kle.txt -f
|
$ qmk kle2json -kb clueboard/new60 70aaa4bed76d0b2f67fd165641239552
|
||||||
Ψ Wrote out to info.json
|
Ψ Wrote file keyboards/clueboard/new60/info.json
|
||||||
|
Ψ Wrote file keyboards/clueboard/new60/keymaps/default/keymap.json
|
||||||
|
```
|
||||||
|
|
||||||
|
With a full URL:
|
||||||
|
|
||||||
|
```
|
||||||
|
$ qmk kle2json -kb clueboard/new60 'http://www.keyboard-layout-editor.com/#/gists/70aaa4bed76d0b2f67fd165641239552'
|
||||||
|
Ψ Wrote file keyboards/clueboard/new60/info.json
|
||||||
|
Ψ Wrote file keyboards/clueboard/new60/keymaps/default/keymap.json
|
||||||
```
|
```
|
||||||
|
|
||||||
## `qmk pyformat`
|
## `qmk pyformat`
|
||||||
|
|||||||
@@ -29,7 +29,9 @@ This level contains all of the options for that particular keymap. If you wish t
|
|||||||
|
|
||||||
This is a C header file that is one of the first things included, and will persist over the whole project (if included). Lots of variables can be set here and accessed elsewhere. The `config.h` file shouldn't be including other `config.h` files, or anything besides this:
|
This is a C header file that is one of the first things included, and will persist over the whole project (if included). Lots of variables can be set here and accessed elsewhere. The `config.h` file shouldn't be including other `config.h` files, or anything besides this:
|
||||||
|
|
||||||
#include "config_common.h"
|
```c
|
||||||
|
#include "config_common.h"
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
## Hardware Options
|
## Hardware Options
|
||||||
@@ -135,6 +137,8 @@ If you define these options you will enable the associated feature, which may in
|
|||||||
* `#define RETRO_TAPPING`
|
* `#define RETRO_TAPPING`
|
||||||
* tap anyway, even after TAPPING_TERM, if there was no other key interruption between press and release
|
* tap anyway, even after TAPPING_TERM, if there was no other key interruption between press and release
|
||||||
* See [Retro Tapping](tap_hold.md#retro-tapping) for details
|
* See [Retro Tapping](tap_hold.md#retro-tapping) for details
|
||||||
|
* `#define RETRO_TAPPING_PER_KEY`
|
||||||
|
* enables handling for per key `RETRO_TAPPING` settings
|
||||||
* `#define TAPPING_TOGGLE 2`
|
* `#define TAPPING_TOGGLE 2`
|
||||||
* how many taps before triggering the toggle
|
* how many taps before triggering the toggle
|
||||||
* `#define PERMISSIVE_HOLD`
|
* `#define PERMISSIVE_HOLD`
|
||||||
|
|||||||
@@ -185,6 +185,14 @@ This function gets called at every matrix scan, which is basically as often as t
|
|||||||
|
|
||||||
You should use this function if you need custom matrix scanning code. It can also be used for custom status output (such as LEDs or a display) or other functionality that you want to trigger regularly even when the user isn't typing.
|
You should use this function if you need custom matrix scanning code. It can also be used for custom status output (such as LEDs or a display) or other functionality that you want to trigger regularly even when the user isn't typing.
|
||||||
|
|
||||||
|
# Keyboard housekeeping
|
||||||
|
|
||||||
|
* Keyboard/Revision: `void housekeeping_task_kb(void)`
|
||||||
|
* Keymap: `void housekeeping_task_user(void)`
|
||||||
|
|
||||||
|
This function gets called at the end of all QMK processing, before starting the next iteration. You can safely assume that QMK has dealt with the last matrix scan at the time that these functions are invoked -- layer states have been updated, USB reports have been sent, LEDs have been updated, and displays have been drawn.
|
||||||
|
|
||||||
|
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.
|
||||||
|
|
||||||
# Keyboard Idling/Wake Code
|
# Keyboard Idling/Wake Code
|
||||||
|
|
||||||
|
|||||||
@@ -41,7 +41,9 @@ Bevorzugst Du es lieber auf der Befehlszeile zu debuggen? Dafür eignet sich das
|
|||||||
|
|
||||||
Manchmal ist es hilfreich Debug-Nachrichten innerhalb deines eigenen [Custom Codes](de/custom_quantum_functions.md) zu drucken. Das ist ziemlich einfach. Beginne damit `print.h` am Anfang deiner Datei zu inkludieren:
|
Manchmal ist es hilfreich Debug-Nachrichten innerhalb deines eigenen [Custom Codes](de/custom_quantum_functions.md) zu drucken. Das ist ziemlich einfach. Beginne damit `print.h` am Anfang deiner Datei zu inkludieren:
|
||||||
|
|
||||||
#include <print.h>
|
```c
|
||||||
|
#include "print.h"
|
||||||
|
```
|
||||||
|
|
||||||
Danach stehen dir verschiedene Druck-Funktionen zur Verfügung:
|
Danach stehen dir verschiedene Druck-Funktionen zur Verfügung:
|
||||||
|
|
||||||
|
|||||||
@@ -14,16 +14,11 @@ Some keyboards may have specific instructions for entering the bootloader. For e
|
|||||||
To put a device in bootloader mode with USBaspLoader, tap the `RESET` button while holding down the `BOOT` button.
|
To put a device in bootloader mode with USBaspLoader, tap the `RESET` button while holding down the `BOOT` button.
|
||||||
Alternatively, hold `BOOT` while inserting the USB cable.
|
Alternatively, hold `BOOT` while inserting the USB cable.
|
||||||
|
|
||||||
Zadig will automatically detect the bootloader device. You may sometimes need to check **Options → List All Devices**.
|
Zadig should automatically detect the bootloader device, but you may sometimes need to check **Options → List All Devices** and select the device from the dropdown instead.
|
||||||
|
|
||||||
- For keyboards with Atmel AVR MCUs, the bootloader will be named something similar to `ATm32U4DFU`, and have a Vendor ID of `03EB`.
|
|
||||||
- USBasp bootloaders will appear as `USBasp`, with a VID/PID of `16C0:05DC`.
|
|
||||||
- AVR keyboards flashed with the QMK-DFU bootloader will be named `<keyboard name> Bootloader` and will also have the VID `03EB`.
|
|
||||||
- For most ARM keyboards, it will be called `STM32 BOOTLOADER`, and have a VID/PID of `0483:DF11`.
|
|
||||||
|
|
||||||
!> If Zadig lists one or more devices with the `HidUsb` driver, your keyboard is probably not in bootloader mode. The arrow will be colored orange and you will be asked to confirm modifying a system driver. **Do not** proceed if this is the case!
|
!> If Zadig lists one or more devices with the `HidUsb` driver, your keyboard is probably not in bootloader mode. The arrow will be colored orange and you will be asked to confirm modifying a system driver. **Do not** proceed if this is the case!
|
||||||
|
|
||||||
If the arrow appears green, select the driver, and click **Install Driver**. The `libusb-win32` driver will usually work for AVR, and `WinUSB` for ARM, but if you still cannot flash the board, try installing a different driver from the list. USBAspLoader devices must use the `libusbK` driver.
|
If the arrow appears green, select the driver, and click **Install Driver**. See the [list of known bootloaders](#list-of-known-bootloaders) for the correct driver to install.
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
@@ -43,6 +38,40 @@ Right-click it and hit **Uninstall device**. Make sure to tick **Delete the driv
|
|||||||
|
|
||||||

|

|
||||||
|
|
||||||
Click **Action → Scan for hardware changes**. At this point, you should be able to type again. Double check in Zadig that the keyboard device(s) are using the `HidUsb` driver. If so, you're all done, and your board should be functional again!
|
Click **Action → Scan for hardware changes**. At this point, you should be able to type again. Double check in Zadig that the keyboard device(s) are using the `HidUsb` driver. If so, you're all done, and your board should be functional again! Otherwise, repeat the process until Zadig reports the correct driver.
|
||||||
|
|
||||||
?> A full reboot of your computer may sometimes be necessary at this point, to get Windows to pick up the new driver.
|
?> A full reboot of your computer may sometimes be necessary at this point, to get Windows to pick up the new driver.
|
||||||
|
|
||||||
|
## List of Known Bootloaders
|
||||||
|
|
||||||
|
This is a list of known bootloader devices and their USB vendor and product IDs, as well as the correct driver to assign for flashing with QMK. Note that the usbser and HidUsb drivers are built in to Windows, and cannot be assigned with Zadig - if your device has an incorrect driver, you must use the Device Manager to uninstall it as described in the previous section.
|
||||||
|
|
||||||
|
The device name here is the name that appears in Zadig, and may not be what the Device Manager or QMK Toolbox displays.
|
||||||
|
|
||||||
|
|Bootloader |Device Name |VID/PID |Driver |
|
||||||
|
|-------------|------------------------------|--------------|-------|
|
||||||
|
|`atmel-dfu` |ATmega16u2 DFU |`03EB:2FEF` |libusb0|
|
||||||
|
|`atmel-dfu` |ATmega32U2 DFU |`03EB:2FF0` |libusb0|
|
||||||
|
|`atmel-dfu` |ATm16U4 DFU V1.0.2 |`03EB:2FF3` |libusb0|
|
||||||
|
|`atmel-dfu` |ATm32U4DFU |`03EB:2FF4` |libusb0|
|
||||||
|
|`atmel-dfu` |*none* (AT90USB64) |`03EB:2FF9` |libusb0|
|
||||||
|
|`atmel-dfu` |AT90USB128 DFU |`03EB:2FFB` |libusb0|
|
||||||
|
|`qmk-dfu` |(keyboard name) Bootloader |As `atmel-dfu`|libusb0|
|
||||||
|
|`halfkay` |*none* |`16C0:0478` |HidUsb |
|
||||||
|
|`caterina` |Pro Micro 3.3V |`1B4F:9203` |usbser |
|
||||||
|
|`caterina` |Pro Micro 5V |`1B4F:9205` |usbser |
|
||||||
|
|`caterina` |LilyPadUSB |`1B4F:9207` |usbser |
|
||||||
|
|`caterina` |Pololu A-Star 32U4 Bootloader |`1FFB:0101` |usbser |
|
||||||
|
|`caterina` |Arduino Leonardo |`2341:0036` |usbser |
|
||||||
|
|`caterina` |Arduino Micro |`2341:0037` |usbser |
|
||||||
|
|`caterina` |Adafruit Feather 32u4 |`239A:000C` |usbser |
|
||||||
|
|`caterina` |Adafruit ItsyBitsy 32u4 3V |`239A:000D` |usbser |
|
||||||
|
|`caterina` |Adafruit ItsyBitsy 32u4 5V |`239A:000E` |usbser |
|
||||||
|
|`caterina` |Arduino Leonardo |`2A03:0036` |usbser |
|
||||||
|
|`caterina` |Arduino Micro |`2A03:0037` |usbser |
|
||||||
|
|`bootloadHID`|HIDBoot |`16C0:05DF` |HidUsb |
|
||||||
|
|`USBasp` |USBasp |`16C0:05DC` |libusbK|
|
||||||
|
|`apm32-dfu` |APM32 DFU ISP Mode |`314B:0106` |WinUSB |
|
||||||
|
|`stm32-dfu` |STM32 BOOTLOADER |`0483:DF11` |WinUSB |
|
||||||
|
|`kiibohd` |Kiibohd DFU Bootloader |`1C11:B007` |WinUSB |
|
||||||
|
|`stm32duino` |Maple 003 |`1EAF:0003` |WinUSB |
|
||||||
|
|||||||
@@ -40,6 +40,7 @@ Module | Equivalent `#define` | Source
|
|||||||
-----------------|---------------------------------|------------------------------------------
|
-----------------|---------------------------------|------------------------------------------
|
||||||
CAT24C512 EEPROM | `#define EEPROM_I2C_CAT24C512` | <https://www.sparkfun.com/products/14764>
|
CAT24C512 EEPROM | `#define EEPROM_I2C_CAT24C512` | <https://www.sparkfun.com/products/14764>
|
||||||
RM24C512C EEPROM | `#define EEPROM_I2C_RM24C512C` | <https://www.sparkfun.com/products/14764>
|
RM24C512C EEPROM | `#define EEPROM_I2C_RM24C512C` | <https://www.sparkfun.com/products/14764>
|
||||||
|
24LC64 EEPROM | `#define EEPROM_I2C_24LC64` | <https://www.microchip.com/wwwproducts/en/24LC64>
|
||||||
24LC128 EEPROM | `#define EEPROM_I2C_24LC128` | <https://www.microchip.com/wwwproducts/en/24LC128>
|
24LC128 EEPROM | `#define EEPROM_I2C_24LC128` | <https://www.microchip.com/wwwproducts/en/24LC128>
|
||||||
24LC256 EEPROM | `#define EEPROM_I2C_24LC256` | <https://www.sparkfun.com/products/525>
|
24LC256 EEPROM | `#define EEPROM_I2C_24LC256` | <https://www.sparkfun.com/products/525>
|
||||||
MB85RC256V FRAM | `#define EEPROM_I2C_MB85RC256V` | <https://www.adafruit.com/product/1895>
|
MB85RC256V FRAM | `#define EEPROM_I2C_MB85RC256V` | <https://www.adafruit.com/product/1895>
|
||||||
|
|||||||
@@ -33,4 +33,3 @@ Soporte para hasta 2 controladores. Cada controlador implementa 2 matrices charl
|
|||||||
## IS31FL3733
|
## IS31FL3733
|
||||||
|
|
||||||
Soporte para hasta un solo controlador con espacio para expansión. Cada controlador puede controlar 192 LEDs individuales o 64 LEDs RGB. Para obtener más información sobre cómo configurar el controlador, consulta la página de [Matriz RGB](feature_rgb_matrix.md).
|
Soporte para hasta un solo controlador con espacio para expansión. Cada controlador puede controlar 192 LEDs individuales o 64 LEDs RGB. Para obtener más información sobre cómo configurar el controlador, consulta la página de [Matriz RGB](feature_rgb_matrix.md).
|
||||||
|
|
||||||
|
|||||||
@@ -41,7 +41,9 @@ Para plataformas compatibles, [QMK Toolbox](https://github.com/qmk/qmk_toolbox)
|
|||||||
|
|
||||||
A veces, es útil imprimir mensajes de depuración desde tu [código personalizado](custom_quantum_functions.md). Hacerlo es bastante simple. Comienza incluyendo `print.h` al principio de tu fichero:
|
A veces, es útil imprimir mensajes de depuración desde tu [código personalizado](custom_quantum_functions.md). Hacerlo es bastante simple. Comienza incluyendo `print.h` al principio de tu fichero:
|
||||||
|
|
||||||
#include <print.h>
|
```c
|
||||||
|
#include "print.h"
|
||||||
|
```
|
||||||
|
|
||||||
Después de eso puedes utilzar algunas funciones print diferentes:
|
Después de eso puedes utilzar algunas funciones print diferentes:
|
||||||
|
|
||||||
|
|||||||
@@ -15,25 +15,31 @@ problem.
|
|||||||
When you tap a key, it stays depressed for a short period of time before it is
|
When you tap a key, it stays depressed for a short period of time before it is
|
||||||
then released. This depressed time is a different length for everyone. Auto Shift
|
then released. This depressed time is a different length for everyone. Auto Shift
|
||||||
defines a constant `AUTO_SHIFT_TIMEOUT` which is typically set to twice your
|
defines a constant `AUTO_SHIFT_TIMEOUT` which is typically set to twice your
|
||||||
normal pressed state time. When you press a key, a timer starts and then stops
|
normal pressed state time. When you press a key, a timer starts, and if you
|
||||||
when you release the key. If the time depressed is greater than or equal to the
|
have not released the key after the `AUTO_SHIFT_TIMEOUT` period, then a shifted
|
||||||
`AUTO_SHIFT_TIMEOUT`, then a shifted version of the key is emitted. If the time
|
version of the key is emitted. If the time is less than the `AUTO_SHIFT_TIMEOUT`
|
||||||
is less than the `AUTO_SHIFT_TIMEOUT` time, then the normal state is emitted.
|
time, or you press another key, then the normal state is emitted.
|
||||||
|
|
||||||
|
If `AUTO_SHIFT_REPEAT` is defined, there is keyrepeat support. Holding the key
|
||||||
|
down will repeat the shifted key, though this can be disabled with
|
||||||
|
`AUTO_SHIFT_NO_AUTO_REPEAT`. If you want to repeat the normal key, then tap it
|
||||||
|
once then immediately (within `TAPPING_TERM`) hold it down again (this works
|
||||||
|
with the shifted value as well if auto-repeat is disabled).
|
||||||
|
|
||||||
## Are There Limitations to Auto Shift?
|
## Are There Limitations to Auto Shift?
|
||||||
|
|
||||||
Yes, unfortunately.
|
Yes, unfortunately.
|
||||||
|
|
||||||
1. Key repeat will cease to work. For example, before if you wanted 20 'a'
|
You will have characters that are shifted when you did not intend on shifting, and
|
||||||
characters, you could press and hold the 'a' key for a second or two. This no
|
other characters you wanted shifted, but were not. This simply comes down to
|
||||||
longer works with Auto Shift because it is timing your depressed time instead
|
practice. As we get in a hurry, we think we have hit the key long enough for a
|
||||||
of emitting a depressed key state to your operating system.
|
shifted version, but we did not. On the other hand, we may think we are tapping
|
||||||
2. You will have characters that are shifted when you did not intend on shifting, and
|
the keys, but really we have held it for a little longer than anticipated.
|
||||||
other characters you wanted shifted, but were not. This simply comes down to
|
|
||||||
practice. As we get in a hurry, we think we have hit the key long enough
|
Additionally, with keyrepeat the desired shift state can get mixed up. It will
|
||||||
for a shifted version, but we did not. On the other hand, we may think we are
|
always 'belong' to the last key pressed. For example, keyrepeating a capital
|
||||||
tapping the keys, but really we have held it for a little longer than
|
and then tapping something lowercase (whether or not it's an Auto Shift key)
|
||||||
anticipated.
|
will result in the capital's *key* still being held, but shift not.
|
||||||
|
|
||||||
## How Do I Enable Auto Shift?
|
## How Do I Enable Auto Shift?
|
||||||
|
|
||||||
@@ -103,6 +109,14 @@ Do not Auto Shift numeric keys, zero through nine.
|
|||||||
|
|
||||||
Do not Auto Shift alpha characters, which include A through Z.
|
Do not Auto Shift alpha characters, which include A through Z.
|
||||||
|
|
||||||
|
### AUTO_SHIFT_REPEAT (simple define)
|
||||||
|
|
||||||
|
Enables keyrepeat.
|
||||||
|
|
||||||
|
### AUTO_SHIFT_NO_AUTO_REPEAT (simple define)
|
||||||
|
|
||||||
|
Disables automatically keyrepeating when `AUTO_SHIFT_TIMEOUT` is exceeded.
|
||||||
|
|
||||||
## Using Auto Shift Setup
|
## Using Auto Shift Setup
|
||||||
|
|
||||||
This will enable you to define three keys temporarily to increase, decrease and report your `AUTO_SHIFT_TIMEOUT`.
|
This will enable you to define three keys temporarily to increase, decrease and report your `AUTO_SHIFT_TIMEOUT`.
|
||||||
|
|||||||
@@ -62,14 +62,15 @@ Valid driver values are `pwm`, `software`, `custom` or `no`. See below for help
|
|||||||
|
|
||||||
To configure the backlighting, `#define` these in your `config.h`:
|
To configure the backlighting, `#define` these in your `config.h`:
|
||||||
|
|
||||||
|Define |Default |Description |
|
| Define | Default | Description |
|
||||||
|---------------------|-------------|-------------------------------------------------------------------------------------|
|
|------------------------|---------------|-------------------------------------------------------------------------------------------------------------------|
|
||||||
|`BACKLIGHT_PIN` |*Not defined*|The pin that controls the LED(s) |
|
| `BACKLIGHT_PIN` | *Not defined* | The pin that controls the LED(s) |
|
||||||
|`BACKLIGHT_LEVELS` |`3` |The number of brightness levels (maximum 31 excluding off) |
|
| `BACKLIGHT_LEVELS` | `3` | The number of brightness levels (maximum 31 excluding off) |
|
||||||
|`BACKLIGHT_CAPS_LOCK`|*Not defined*|Enable Caps Lock indicator using backlight (for keyboards without dedicated LED) |
|
| `BACKLIGHT_CAPS_LOCK` | *Not defined* | Enable Caps Lock indicator using backlight (for keyboards without dedicated LED) |
|
||||||
|`BACKLIGHT_BREATHING`|*Not defined*|Enable backlight breathing, if supported |
|
| `BACKLIGHT_BREATHING` | *Not defined* | Enable backlight breathing, if supported |
|
||||||
|`BREATHING_PERIOD` |`6` |The length of one backlight "breath" in seconds |
|
| `BREATHING_PERIOD` | `6` | The length of one backlight "breath" in seconds |
|
||||||
|`BACKLIGHT_ON_STATE` |`1` |The state of the backlight pin when the backlight is "on" - `1` for high, `0` for low|
|
| `BACKLIGHT_ON_STATE` | `1` | The state of the backlight pin when the backlight is "on" - `1` for high, `0` for low |
|
||||||
|
| `BACKLIGHT_LIMIT_VAL ` | `255` | The maximum duty cycle of the backlight -- `255` allows for full brightness, any lower will decrease the maximum. |
|
||||||
|
|
||||||
Unless you are designing your own keyboard, you generally should not need to change the `BACKLIGHT_PIN` or `BACKLIGHT_ON_STATE`.
|
Unless you are designing your own keyboard, you generally should not need to change the `BACKLIGHT_PIN` or `BACKLIGHT_ON_STATE`.
|
||||||
|
|
||||||
|
|||||||
@@ -148,4 +148,3 @@ The following old names for existing algorithms will continue to be supported, h
|
|||||||
* eager_pk - old name for sym_eager_pk
|
* eager_pk - old name for sym_eager_pk
|
||||||
* sym_pk - old name for sym_defer_pk
|
* sym_pk - old name for sym_defer_pk
|
||||||
* eager_pr - old name for sym_eager_pr
|
* eager_pr - old name for sym_eager_pr
|
||||||
|
|
||||||
|
|||||||
@@ -32,13 +32,20 @@ Additionally, the resolution, which defines how many pulses the encoder register
|
|||||||
#define ENCODER_RESOLUTION 4
|
#define ENCODER_RESOLUTION 4
|
||||||
```
|
```
|
||||||
|
|
||||||
|
It can also be defined per-encoder, by instead defining:
|
||||||
|
|
||||||
|
```c
|
||||||
|
#define ENCODER_RESOLUTIONS { 4, 2 }
|
||||||
|
```
|
||||||
|
|
||||||
## Split Keyboards
|
## Split Keyboards
|
||||||
|
|
||||||
If you are using different pinouts for the encoders on each half of a split keyboard, you can define the pinout for the right half like this:
|
If you are using different pinouts for the encoders on each half of a split keyboard, you can define the pinout (and optionally, resolutions) for the right half like this:
|
||||||
|
|
||||||
```c
|
```c
|
||||||
#define ENCODERS_PAD_A_RIGHT { encoder1a, encoder2a }
|
#define ENCODERS_PAD_A_RIGHT { encoder1a, encoder2a }
|
||||||
#define ENCODERS_PAD_B_RIGHT { encoder1b, encoder2b }
|
#define ENCODERS_PAD_B_RIGHT { encoder1b, encoder2b }
|
||||||
|
#define ENCODER_RESOLUTIONS_RIGHT { 2, 4 }
|
||||||
```
|
```
|
||||||
|
|
||||||
## Callbacks
|
## Callbacks
|
||||||
|
|||||||
@@ -42,14 +42,21 @@ First you will need a build a circuit to drive the solenoid through a mosfet as
|
|||||||
[Wiring diagram provided by Adafruit](https://playground.arduino.cc/uploads/Learning/solenoid_driver.pdf)
|
[Wiring diagram provided by Adafruit](https://playground.arduino.cc/uploads/Learning/solenoid_driver.pdf)
|
||||||
|
|
||||||
|
|
||||||
| Settings | Default | Description |
|
| Settings | Default | Description |
|
||||||
|--------------------------|---------------|-------------------------------------------------------|
|
|----------------------------|----------------------|-------------------------------------------------------|
|
||||||
|`SOLENOID_PIN` | *Not defined* |Configures the pin that the Solenoid is connected to. |
|
|`SOLENOID_PIN` | *Not defined* |Configures the pin that the Solenoid is connected to. |
|
||||||
|`SOLENOID_DEFAULT_DWELL` | `12` ms |Configures the default dwell time for the solenoid. |
|
|`SOLENOID_DEFAULT_DWELL` | `12` ms |Configures the default dwell time for the solenoid. |
|
||||||
|`SOLENOID_MIN_DWELL` | `4` ms |Sets the lower limit for the dwell. |
|
|`SOLENOID_MIN_DWELL` | `4` ms |Sets the lower limit for the dwell. |
|
||||||
|`SOLENOID_MAX_DWELL` | `100` ms |Sets the upper limit for the dwell. |
|
|`SOLENOID_MAX_DWELL` | `100` ms |Sets the upper limit for the dwell. |
|
||||||
|
|`SOLENOID_DWELL_STEP_SIZE` | `1` ms |The step size to use when `HPT_DWL*` keycodes are sent |
|
||||||
|
|`SOLENOID_DEFAULT_BUZZ` | `0` (disabled) |On HPT_RST buzz is set "on" if this is "1" |
|
||||||
|
|`SOLENOID_BUZZ_ACTUATED` | `SOLENOID_MIN_DWELL` |Actuated-time when the solenoid is in buzz mode |
|
||||||
|
|`SOLENOID_BUZZ_NONACTUATED` | `SOLENOID_MIN_DWELL` |Non-Actuated-time when the solenoid is in buzz mode |
|
||||||
|
|
||||||
?> Dwell time is how long the "plunger" stays activated. The dwell time changes how the solenoid sounds.
|
* If solenoid buzz is off, then dwell time is how long the "plunger" stays activated. The dwell time changes how the solenoid sounds.
|
||||||
|
* If solenoid buzz is on, then dwell time sets the length of the buzz, while `SOLENOID_BUZZ_ACTUATED` and `SOLENOID_BUZZ_NONACTUATED` set the (non-)actuation times withing the buzz period.
|
||||||
|
* With the current implementation, for any of the above time settings, the precision of these settings may be affected by how fast the keyboard is able to scan the matrix.
|
||||||
|
Therefore, if the keyboards scanning routine is slow, it may be preferable to set `SOLENOID_DWELL_STEP_SIZE` to a value slightly smaller than the time it takes to scan the keyboard.
|
||||||
|
|
||||||
Beware that some pins may be powered during bootloader (ie. A13 on the STM32F303 chip) and will result in the solenoid kept in the on state through the whole flashing process. This may overheat and damage the solenoid. If you find that the pin the solenoid is connected to is triggering the solenoid during bootloader/DFU, select another pin.
|
Beware that some pins may be powered during bootloader (ie. A13 on the STM32F303 chip) and will result in the solenoid kept in the on state through the whole flashing process. This may overheat and damage the solenoid. If you find that the pin the solenoid is connected to is triggering the solenoid during bootloader/DFU, select another pin.
|
||||||
|
|
||||||
|
|||||||
@@ -141,6 +141,12 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
|
|||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
|
### Axis Resolution
|
||||||
|
|
||||||
|
By default, the resolution of each axis is 8 bit, giving a range of -127 to +127. If you need higher precision, you can increase it by defining eg. `JOYSTICK_AXES_RESOLUTION 12` in your `config.h`. The resolution must be between 8 and 16.
|
||||||
|
|
||||||
|
Note that the supported AVR MCUs have a 10-bit ADC, and 12-bit for most STM32 MCUs.
|
||||||
|
|
||||||
### Triggering Joystick Buttons
|
### Triggering Joystick Buttons
|
||||||
|
|
||||||
Joystick buttons are normal Quantum keycodes, defined as `JS_BUTTON0` to `JS_BUTTON31`, depending on the number of buttons you have configured.
|
Joystick buttons are normal Quantum keycodes, defined as `JS_BUTTON0` to `JS_BUTTON31`, depending on the number of buttons you have configured.
|
||||||
|
|||||||
@@ -10,7 +10,8 @@ If you want to use RGB LED's you should use the [RGB Matrix Subsystem](feature_r
|
|||||||
|
|
||||||
There is basic support for addressable LED matrix lighting with the I2C IS31FL3731 RGB controller. To enable it, add this to your `rules.mk`:
|
There is basic support for addressable LED matrix lighting with the I2C IS31FL3731 RGB controller. To enable it, add this to your `rules.mk`:
|
||||||
|
|
||||||
LED_MATRIX_ENABLE = IS31FL3731
|
LED_MATRIX_ENABLE = yes
|
||||||
|
LED_MATRIX_DRIVER = IS31FL3731
|
||||||
|
|
||||||
You can use between 1 and 4 IS31FL3731 IC's. Do not specify `LED_DRIVER_ADDR_<N>` defines for IC's that are not present on your keyboard. You can define the following items in `config.h`:
|
You can use between 1 and 4 IS31FL3731 IC's. Do not specify `LED_DRIVER_ADDR_<N>` defines for IC's that are not present on your keyboard. You can define the following items in `config.h`:
|
||||||
|
|
||||||
|
|||||||
@@ -182,7 +182,9 @@ Which would send Left Control+`a` (Left Control down, `a`, Left Control up) - no
|
|||||||
|
|
||||||
By default, it assumes a US keymap with a QWERTY layout; if you want to change that (e.g. if your OS uses software Colemak), include this somewhere in your keymap:
|
By default, it assumes a US keymap with a QWERTY layout; if you want to change that (e.g. if your OS uses software Colemak), include this somewhere in your keymap:
|
||||||
|
|
||||||
#include <sendstring_colemak.h>
|
```c
|
||||||
|
#include "sendstring_colemak.h"
|
||||||
|
```
|
||||||
|
|
||||||
### Strings in Memory
|
### Strings in Memory
|
||||||
|
|
||||||
@@ -207,7 +209,7 @@ SEND_STRING(".."SS_TAP(X_END));
|
|||||||
|
|
||||||
There are some functions you may find useful in macro-writing. Keep in mind that while you can write some fairly advanced code within a macro, if your functionality gets too complex you may want to define a custom keycode instead. Macros are meant to be simple.
|
There are some functions you may find useful in macro-writing. Keep in mind that while you can write some fairly advanced code within a macro, if your functionality gets too complex you may want to define a custom keycode instead. Macros are meant to be simple.
|
||||||
|
|
||||||
?> You can also use the functions described in [Useful function](ref_functions.md) for additional functionality. For example `reset_keyboard()` allows you to reset the keyboard as part of a macro.
|
?> You can also use the functions described in [Useful functions](ref_functions.md) for additional functionality. For example `reset_keyboard()` allows you to reset the keyboard as part of a macro.
|
||||||
|
|
||||||
### `record->event.pressed`
|
### `record->event.pressed`
|
||||||
|
|
||||||
|
|||||||
@@ -42,6 +42,7 @@ In your keymap you can use the following keycodes to map key presses to mouse ac
|
|||||||
Mouse keys supports three different modes to move the cursor:
|
Mouse keys supports three different modes to move the cursor:
|
||||||
|
|
||||||
* **Accelerated (default):** Holding movement keys accelerates the cursor until it reaches its maximum speed.
|
* **Accelerated (default):** Holding movement keys accelerates the cursor until it reaches its maximum speed.
|
||||||
|
* **Kinetic:** Holding movement keys accelerates the cursor with its speed following a quadratic curve until it reaches its maximum speed.
|
||||||
* **Constant:** Holding movement keys moves the cursor at constant speeds.
|
* **Constant:** Holding movement keys moves the cursor at constant speeds.
|
||||||
* **Combined:** Holding movement keys accelerates the cursor until it reaches its maximum speed, but holding acceleration and movement keys simultaneously moves the cursor at constant speeds.
|
* **Combined:** Holding movement keys accelerates the cursor until it reaches its maximum speed, but holding acceleration and movement keys simultaneously moves the cursor at constant speeds.
|
||||||
|
|
||||||
@@ -56,7 +57,8 @@ This is the default mode. You can adjust the cursor and scrolling acceleration u
|
|||||||
|Define |Default|Description |
|
|Define |Default|Description |
|
||||||
|----------------------------|-------|---------------------------------------------------------|
|
|----------------------------|-------|---------------------------------------------------------|
|
||||||
|`MOUSEKEY_DELAY` |300 |Delay between pressing a movement key and cursor movement|
|
|`MOUSEKEY_DELAY` |300 |Delay between pressing a movement key and cursor movement|
|
||||||
|`MOUSEKEY_INTERVAL` |50 |Time between cursor movements |
|
|`MOUSEKEY_INTERVAL` |50 |Time between cursor movements in milliseconds |
|
||||||
|
|`MOUSEKEY_MOVE_DELTA` |5 |Step size |
|
||||||
|`MOUSEKEY_MAX_SPEED` |10 |Maximum cursor speed at which acceleration stops |
|
|`MOUSEKEY_MAX_SPEED` |10 |Maximum cursor speed at which acceleration stops |
|
||||||
|`MOUSEKEY_TIME_TO_MAX` |20 |Time until maximum cursor speed is reached |
|
|`MOUSEKEY_TIME_TO_MAX` |20 |Time until maximum cursor speed is reached |
|
||||||
|`MOUSEKEY_WHEEL_DELAY` |300 |Delay between pressing a wheel key and wheel movement |
|
|`MOUSEKEY_WHEEL_DELAY` |300 |Delay between pressing a wheel key and wheel movement |
|
||||||
@@ -73,6 +75,30 @@ Tips:
|
|||||||
|
|
||||||
Cursor acceleration uses the same algorithm as the X Window System MouseKeysAccel feature. You can read more about it [on Wikipedia](https://en.wikipedia.org/wiki/Mouse_keys).
|
Cursor acceleration uses the same algorithm as the X Window System MouseKeysAccel feature. You can read more about it [on Wikipedia](https://en.wikipedia.org/wiki/Mouse_keys).
|
||||||
|
|
||||||
|
### Kinetic Mode
|
||||||
|
|
||||||
|
This is an extension of the accelerated mode. The kinetic mode uses a quadratic curve on the cursor speed which allows precise movements at the beginning and allows to cover large distances by increasing cursor speed quickly thereafter. You can adjust the cursor and scrolling acceleration using the following settings in your keymap’s `config.h` file:
|
||||||
|
|
||||||
|
|Define |Default |Description |
|
||||||
|
|--------------------------------------|---------|---------------------------------------------------------------|
|
||||||
|
|`MK_KINETIC_SPEED` |undefined|Enable kinetic mode |
|
||||||
|
|`MOUSEKEY_DELAY` |8 |Delay between pressing a movement key and cursor movement |
|
||||||
|
|`MOUSEKEY_INTERVAL` |8 |Time between cursor movements in milliseconds |
|
||||||
|
|`MOUSEKEY_MOVE_DELTA` |25 |Step size for accelerating from initial to base speed |
|
||||||
|
|`MOUSEKEY_INITIAL_SPEED` |100 |Initial speed of the cursor in pixel per second |
|
||||||
|
|`MOUSEKEY_BASE_SPEED` |1000 |Maximum cursor speed at which acceleration stops |
|
||||||
|
|`MOUSEKEY_DECELERATED_SPEED` |400 |Decelerated cursor speed |
|
||||||
|
|`MOUSEKEY_ACCELERATED_SPEED` |3000 |Accelerated cursor speed |
|
||||||
|
|`MOUSEKEY_WHEEL_INITIAL_MOVEMENTS` |16 |Initial number of movements of the mouse wheel |
|
||||||
|
|`MOUSEKEY_WHEEL_BASE_MOVEMENTS` |32 |Maximum number of movements at which acceleration stops |
|
||||||
|
|`MOUSEKEY_WHEEL_ACCELERATED_MOVEMENTS`|48 |Accelerated wheel movements |
|
||||||
|
|`MOUSEKEY_WHEEL_DECELERATED_MOVEMENTS`|8 |Decelerated wheel movements |
|
||||||
|
|
||||||
|
Tips:
|
||||||
|
|
||||||
|
* The smoothness of the cursor movement depends on the `MOUSEKEY_INTERVAL` setting. The shorter the interval is set the smoother the movement will be. Setting the value too low makes the cursor unresponsive. Lower settings are possible if the micro processor is fast enough. For example: At an interval of `8` milliseconds, `125` movements per second will be initiated. With a base speed of `1000` each movement will move the cursor by `8` pixels.
|
||||||
|
* Mouse wheel movements are implemented differently from cursor movements. While it's okay for the cursor to move multiple pixels at once for the mouse wheel this would lead to jerky movements. Instead, the mouse wheel operates at step size `1`. Setting mouse wheel speed is done by adjusting the number of wheel movements per second.
|
||||||
|
|
||||||
### Constant mode
|
### Constant mode
|
||||||
|
|
||||||
In this mode you can define multiple different speeds for both the cursor and the mouse wheel. There is no acceleration. `KC_ACL0`, `KC_ACL1` and `KC_ACL2` change the cursor and scroll speed to their respective setting.
|
In this mode you can define multiple different speeds for both the cursor and the mouse wheel. There is no acceleration. `KC_ACL0`, `KC_ACL1` and `KC_ACL2` change the cursor and scroll speed to their respective setting.
|
||||||
@@ -140,3 +166,7 @@ To use constant speed mode, you must at least define `MK_COMBINED` in your keyma
|
|||||||
```c
|
```c
|
||||||
#define MK_COMBINED
|
#define MK_COMBINED
|
||||||
```
|
```
|
||||||
|
|
||||||
|
## Use with PS/2 Mouse and Pointing Device
|
||||||
|
|
||||||
|
Mouse keys button state is shared with [PS/2 mouse](feature_ps2_mouse.md) and [pointing device](feature_pointing_device.md) so mouse keys button presses can be used for clicks and drags.
|
||||||
|
|||||||
@@ -150,6 +150,7 @@ void oled_task_user(void) {
|
|||||||
|`OLED_IC` |`OLED_IC_SSD1306`|Set to `OLED_IC_SH1106` if you're using the SH1106 OLED controller. |
|
|`OLED_IC` |`OLED_IC_SSD1306`|Set to `OLED_IC_SH1106` if you're using the SH1106 OLED controller. |
|
||||||
|`OLED_COLUMN_OFFSET` |`0` |(SH1106 only.) Shift output to the right this many pixels.<br />Useful for 128x64 displays centered on a 132x64 SH1106 IC.|
|
|`OLED_COLUMN_OFFSET` |`0` |(SH1106 only.) Shift output to the right this many pixels.<br />Useful for 128x64 displays centered on a 132x64 SH1106 IC.|
|
||||||
|`OLED_BRIGHTNESS` |`255` |The default brightness level of the OLED, from 0 to 255. |
|
|`OLED_BRIGHTNESS` |`255` |The default brightness level of the OLED, from 0 to 255. |
|
||||||
|
|`OLED_UPDATE_INTERVAL` |`0` |Set the time interval for updating the OLED display in ms. This will improve the matrix scan rate. |
|
||||||
|
|
||||||
## 128x64 & Custom sized OLED Displays
|
## 128x64 & Custom sized OLED Displays
|
||||||
|
|
||||||
|
|||||||
@@ -29,7 +29,7 @@ void raw_hid_receive(uint8_t *data, uint8_t length) {
|
|||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
`raw_hid_receive` can receive variable size packets from host with maximum length `RAW_EPSIZE`. `raw_hid_send` on the other hand can send packets to host of exactly `RAW_EPSIZE` length, therefore it should be used with data of length `RAW_EPSIZE`.
|
These two functions send and receive packets of length `RAW_EPSIZE` bytes to and from the host (32 on LUFA/ChibiOS/V-USB, 64 on ATSAM).
|
||||||
|
|
||||||
Make sure to flash raw enabled firmware before proceeding with working on the host side.
|
Make sure to flash raw enabled firmware before proceeding with working on the host side.
|
||||||
|
|
||||||
|
|||||||
@@ -11,7 +11,8 @@ If you want to use single color LED's you should use the [LED Matrix Subsystem](
|
|||||||
There is basic support for addressable RGB matrix lighting with the I2C IS31FL3731 RGB controller. To enable it, add this to your `rules.mk`:
|
There is basic support for addressable RGB matrix lighting with the I2C IS31FL3731 RGB controller. To enable it, add this to your `rules.mk`:
|
||||||
|
|
||||||
```makefile
|
```makefile
|
||||||
RGB_MATRIX_ENABLE = IS31FL3731
|
RGB_MATRIX_ENABLE = yes
|
||||||
|
RGB_MATRIX_DRIVER = IS31FL3731
|
||||||
```
|
```
|
||||||
|
|
||||||
Configure the hardware via your `config.h`:
|
Configure the hardware via your `config.h`:
|
||||||
@@ -62,7 +63,8 @@ Where `Cx_y` is the location of the LED in the matrix defined by [the datasheet]
|
|||||||
There is basic support for addressable RGB matrix lighting with the I2C IS31FL3733 RGB controller. To enable it, add this to your `rules.mk`:
|
There is basic support for addressable RGB matrix lighting with the I2C IS31FL3733 RGB controller. To enable it, add this to your `rules.mk`:
|
||||||
|
|
||||||
```makefile
|
```makefile
|
||||||
RGB_MATRIX_ENABLE = IS31FL3733
|
RGB_MATRIX_ENABLE = yes
|
||||||
|
RGB_MATRIX_DRIVER = IS31FL3733
|
||||||
```
|
```
|
||||||
|
|
||||||
Configure the hardware via your `config.h`:
|
Configure the hardware via your `config.h`:
|
||||||
@@ -112,7 +114,8 @@ Where `X_Y` is the location of the LED in the matrix defined by [the datasheet](
|
|||||||
There is basic support for addressable RGB matrix lighting with a WS2811/WS2812{a,b,c} addressable LED strand. To enable it, add this to your `rules.mk`:
|
There is basic support for addressable RGB matrix lighting with a WS2811/WS2812{a,b,c} addressable LED strand. To enable it, add this to your `rules.mk`:
|
||||||
|
|
||||||
```makefile
|
```makefile
|
||||||
RGB_MATRIX_ENABLE = WS2812
|
RGB_MATRIX_ENABLE = yes
|
||||||
|
RGB_MATRIX_DRIVER = WS2812
|
||||||
```
|
```
|
||||||
|
|
||||||
Configure the hardware via your `config.h`:
|
Configure the hardware via your `config.h`:
|
||||||
@@ -126,6 +129,28 @@ Configure the hardware via your `config.h`:
|
|||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
|
### APA102 :id=apa102
|
||||||
|
|
||||||
|
There is basic support for APA102 based addressable LED strands. To enable it, add this to your `rules.mk`:
|
||||||
|
|
||||||
|
```makefile
|
||||||
|
RGB_MATRIX_ENABLE = yes
|
||||||
|
RGB_MATRIX_DRIVER = APA102
|
||||||
|
```
|
||||||
|
|
||||||
|
Configure the hardware via your `config.h`:
|
||||||
|
|
||||||
|
```c
|
||||||
|
// The pin connected to the data pin of the LEDs
|
||||||
|
#define RGB_DI_PIN D7
|
||||||
|
// The pin connected to the clock pin of the LEDs
|
||||||
|
#define RGB_CI_PIN D6
|
||||||
|
// The number of LEDs connected
|
||||||
|
#define DRIVER_LED_TOTAL 70
|
||||||
|
```
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
From this point forward the configuration is the same for all the drivers. The `led_config_t` struct provides a key electrical matrix to led index lookup table, what the physical position of each LED is on the board, and what type of key or usage the LED if the LED represents. Here is a brief example:
|
From this point forward the configuration is the same for all the drivers. The `led_config_t` struct provides a key electrical matrix to led index lookup table, what the physical position of each LED is on the board, and what type of key or usage the LED if the LED represents. Here is a brief example:
|
||||||
|
|
||||||
```c
|
```c
|
||||||
@@ -303,6 +328,12 @@ To declare new effects, create a new `rgb_matrix_user/kb.inc` that looks somethi
|
|||||||
`rgb_matrix_user.inc` should go in the root of the keymap directory.
|
`rgb_matrix_user.inc` should go in the root of the keymap directory.
|
||||||
`rgb_matrix_kb.inc` should go in the root of the keyboard directory.
|
`rgb_matrix_kb.inc` should go in the root of the keyboard directory.
|
||||||
|
|
||||||
|
To use custom effects in your code, simply prepend `RGB_MATRIX_CUSTOM_` to the effect name specified in `RGB_MATRIX_EFFECT()`. For example, an effect declared as `RGB_MATRIX_EFFECT(my_cool_effect)` would be referenced with:
|
||||||
|
|
||||||
|
```c
|
||||||
|
rgb_matrix_mode(RGB_MATRIX_CUSTOM_my_cool_effect);
|
||||||
|
```
|
||||||
|
|
||||||
```c
|
```c
|
||||||
// !!! DO NOT ADD #pragma once !!! //
|
// !!! DO NOT ADD #pragma once !!! //
|
||||||
|
|
||||||
@@ -482,6 +513,14 @@ void rgb_matrix_indicators_kb(void) {
|
|||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
|
In addition, there are the advanced indicator functions. These are aimed at those with heavily customized displays, where rendering every LED per cycle is expensive. Such as some of the "drashna" layouts. This includes a special macro to help make this easier to use: `RGB_MATRIX_INDICATOR_SET_COLOR(i, r, g, b)`.
|
||||||
|
|
||||||
|
```c
|
||||||
|
void rgb_matrix_indicators_advanced_user(uint8_t led_min, uint8_t led_max) {
|
||||||
|
RGB_MATRIX_INDICATOR_SET_COLOR(index, red, green, blue);
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
### Suspended state :id=suspended-state
|
### Suspended state :id=suspended-state
|
||||||
To use the suspend feature, make sure that `#define RGB_DISABLE_WHEN_USB_SUSPENDED true` is added to the `config.h` file.
|
To use the suspend feature, make sure that `#define RGB_DISABLE_WHEN_USB_SUSPENDED true` is added to the `config.h` file.
|
||||||
|
|
||||||
|
|||||||
@@ -10,6 +10,7 @@ Currently QMK supports the following addressable LEDs (however, the white LED in
|
|||||||
|
|
||||||
* WS2811, WS2812, WS2812B, WS2812C, etc.
|
* WS2811, WS2812, WS2812B, WS2812C, etc.
|
||||||
* SK6812, SK6812MINI, SK6805
|
* SK6812, SK6812MINI, SK6805
|
||||||
|
* APA102
|
||||||
|
|
||||||
These LEDs are called "addressable" because instead of using a wire per color, each LED contains a small microchip that understands a special protocol sent over a single wire. The chip passes on the remaining data to the next LED, allowing them to be chained together. In this way, you can easily control the color of the individual LEDs.
|
These LEDs are called "addressable" because instead of using a wire per color, each LED contains a small microchip that understands a special protocol sent over a single wire. The chip passes on the remaining data to the next LED, allowing them to be chained together. In this way, you can easily control the color of the individual LEDs.
|
||||||
|
|
||||||
@@ -21,11 +22,19 @@ On keyboards with onboard RGB LEDs, it is usually enabled by default. If it is n
|
|||||||
RGBLIGHT_ENABLE = yes
|
RGBLIGHT_ENABLE = yes
|
||||||
```
|
```
|
||||||
|
|
||||||
At minimum you must define the data pin your LED strip is connected to, and the number of LEDs in the strip, in your `config.h`. If your keyboard has onboard RGB LEDs, and you are simply creating a keymap, you usually won't need to modify these.
|
For APA102 LEDs, add the following to your `rules.mk`:
|
||||||
|
|
||||||
|
```make
|
||||||
|
RGBLIGHT_ENABLE = yes
|
||||||
|
RGBLIGHT_DRIVER = APA102
|
||||||
|
```
|
||||||
|
|
||||||
|
At minimum you must define the data pin your LED strip is connected to, and the number of LEDs in the strip, in your `config.h`. For APA102 LEDs, you must also define the clock pin. If your keyboard has onboard RGB LEDs, and you are simply creating a keymap, you usually won't need to modify these.
|
||||||
|
|
||||||
|Define |Description |
|
|Define |Description |
|
||||||
|---------------|---------------------------------------------------------------------------------------------------------|
|
|---------------|---------------------------------------------------------------------------------------------------------|
|
||||||
|`RGB_DI_PIN` |The pin connected to the data pin of the LEDs |
|
|`RGB_DI_PIN` |The pin connected to the data pin of the LEDs |
|
||||||
|
|`RGB_CI_PIN` |The pin connected to the clock pin of the LEDs (APA102 only) |
|
||||||
|`RGBLED_NUM` |The number of LEDs connected |
|
|`RGBLED_NUM` |The number of LEDs connected |
|
||||||
|`RGBLED_SPLIT` |(Optional) For split keyboards, the number of LEDs connected on each half directly wired to `RGB_DI_PIN` |
|
|`RGBLED_SPLIT` |(Optional) For split keyboards, the number of LEDs connected on each half directly wired to `RGB_DI_PIN` |
|
||||||
|
|
||||||
|
|||||||
87
docs/feature_sequencer.md
Normal file
87
docs/feature_sequencer.md
Normal file
@@ -0,0 +1,87 @@
|
|||||||
|
# Sequencer
|
||||||
|
|
||||||
|
Since QMK has experimental support for MIDI, you can now turn your keyboard into a [step sequencer](https://en.wikipedia.org/wiki/Music_sequencer#Step_sequencers)!
|
||||||
|
|
||||||
|
!> **IMPORTANT:** This feature is highly experimental, it has only been tested on a Planck EZ so far. Also, the scope will be limited to support the drum machine use-case to start with.
|
||||||
|
|
||||||
|
## Enable the step sequencer
|
||||||
|
|
||||||
|
Add the following line to your `rules.mk`:
|
||||||
|
|
||||||
|
```make
|
||||||
|
SEQUENCER_ENABLE = yes
|
||||||
|
```
|
||||||
|
|
||||||
|
By default the sequencer has 16 steps, but you can override this setting in your `config.h`:
|
||||||
|
|
||||||
|
```c
|
||||||
|
#define SEQUENCER_STEPS 32
|
||||||
|
```
|
||||||
|
|
||||||
|
## Tracks
|
||||||
|
|
||||||
|
You can program up to 8 independent tracks with the step sequencer. Select the tracks you want to edit, enable or disable some steps, and start the sequence!
|
||||||
|
|
||||||
|
## Resolutions
|
||||||
|
|
||||||
|
While the tempo defines the absolute speed at which the sequencer goes through the steps, the resolution defines the granularity of these steps (from coarser to finer).
|
||||||
|
|
||||||
|
|Resolution |Description |
|
||||||
|
|---------- |----------- |
|
||||||
|
|`SQ_RES_2` |Every other beat |
|
||||||
|
|`SQ_RES_2T` |Every 1.5 beats |
|
||||||
|
|`SQ_RES_4` |Every beat |
|
||||||
|
|`SQ_RES_4T` |Three times per 2 beats|
|
||||||
|
|`SQ_RES_8` |Twice per beat |
|
||||||
|
|`SQ_RES_8T` |Three times per beat |
|
||||||
|
|`SQ_RES_16` |Four times per beat |
|
||||||
|
|`SQ_RES_16T` |Six times per beat |
|
||||||
|
|`SQ_RES_32` |Eight times per beat |
|
||||||
|
|
||||||
|
## Keycodes
|
||||||
|
|
||||||
|
|Keycode |Description |
|
||||||
|
|------- |----------- |
|
||||||
|
|`SQ_ON` |Start the step sequencer |
|
||||||
|
|`SQ_OFF` |Stop the step sequencer |
|
||||||
|
|`SQ_TOG` |Toggle the step sequencer playback |
|
||||||
|
|`SQ_SALL`|Enable all the steps |
|
||||||
|
|`SQ_SCLR`|Disable all the steps |
|
||||||
|
|`SQ_S(n)`|Toggle the step `n` |
|
||||||
|
|`SQ_TMPD`|Decrease the tempo |
|
||||||
|
|`SQ_TMPU`|Increase the tempo |
|
||||||
|
|`SQ_R(n)`|Set the resolution to n |
|
||||||
|
|`SQ_RESD`|Change to the slower resolution |
|
||||||
|
|`SQ_RESU`|Change to the faster resolution |
|
||||||
|
|`SQ_T(n)`|Set `n` as the only active track or deactivate all |
|
||||||
|
|
||||||
|
## Functions
|
||||||
|
|
||||||
|
|Function |Description |
|
||||||
|
|-------- |----------- |
|
||||||
|
|`bool is_sequencer_on(void);` |Return whether the sequencer is playing |
|
||||||
|
|`void sequencer_toggle(void);` |Toggle the step sequencer playback |
|
||||||
|
|`void sequencer_on(void);` |Start the step sequencer |
|
||||||
|
|`void sequencer_off(void);` |Stop the step sequencer |
|
||||||
|
|`bool is_sequencer_step_on(uint8_t step);` |Return whether the step is currently enabled |
|
||||||
|
|`void sequencer_set_step(uint8_t step, bool value);` |Enable or disable the step |
|
||||||
|
|`void sequencer_set_step_on();` |Enable the step |
|
||||||
|
|`void sequencer_set_step_off();` |Disable the step |
|
||||||
|
|`void sequencer_toggle_step(uint8_t step);` |Toggle the step |
|
||||||
|
|`void sequencer_set_all_steps(bool value);` |Enable or disable all the steps |
|
||||||
|
|`void sequencer_set_all_steps_on();` |Enable all the steps |
|
||||||
|
|`void sequencer_set_all_steps_off();` |Disable all the steps |
|
||||||
|
|`uint8_t sequencer_get_tempo(void);` |Return the current tempo |
|
||||||
|
|`void sequencer_set_tempo(uint8_t tempo);` |Set the tempo to `tempo` (between 1 and 255) |
|
||||||
|
|`void sequencer_increase_tempo(void);` |Increase the tempo |
|
||||||
|
|`void sequencer_decrease_tempo(void);` |Decrease the tempo |
|
||||||
|
|`sequencer_resolution_t sequencer_get_resolution(void);` |Return the current resolution |
|
||||||
|
|`void sequencer_set_resolution(sequencer_resolution_t resolution);` |Set the resolution to `resolution` |
|
||||||
|
|`void sequencer_increase_resolution(void);` |Change to the faster resolution |
|
||||||
|
|`void sequencer_decrease_resolution(void);` |Change to the slower resolution |
|
||||||
|
|`bool is_sequencer_track_active(uint8_t track);` |Return whether the track is active |
|
||||||
|
|`void sequencer_set_track_activation(uint8_t track, bool value);` |Activate or deactivate the `track` |
|
||||||
|
|`void sequencer_toggle_track_activation(uint8_t track);` |Toggle the `track` |
|
||||||
|
|`void sequencer_activate_track(uint8_t track);` |Activate the `track` |
|
||||||
|
|`void sequencer_deactivate_track(uint8_t track);` |Deactivate the `track` |
|
||||||
|
|`void sequencer_toggle_single_active_track(uint8_t track);` |Set `track` as the only active track or deactivate all |
|
||||||
@@ -181,6 +181,16 @@ If you're having issues with serial communication, you can change this value, as
|
|||||||
* **`4`**: about 26kbps
|
* **`4`**: about 26kbps
|
||||||
* **`5`**: about 20kbps
|
* **`5`**: about 20kbps
|
||||||
|
|
||||||
|
```c
|
||||||
|
#define SPLIT_MODS_ENABLE
|
||||||
|
```
|
||||||
|
|
||||||
|
This enables transmitting modifier state (normal, weak and oneshot) to the non
|
||||||
|
primary side of the split keyboard. This adds a few bytes of data to the split
|
||||||
|
communication protocol and may impact the matrix scan speed when enabled.
|
||||||
|
The purpose of this feature is to support cosmetic use of modifer state (e.g.
|
||||||
|
displaying status on an OLED screen).
|
||||||
|
|
||||||
### Hardware Configuration Options
|
### Hardware Configuration Options
|
||||||
|
|
||||||
There are some settings that you may need to configure, based on how the hardware is set up.
|
There are some settings that you may need to configure, based on how the hardware is set up.
|
||||||
@@ -237,6 +247,26 @@ This sets the maximum timeout when detecting master/slave when using `SPLIT_USB_
|
|||||||
```
|
```
|
||||||
This sets the poll frequency when detecting master/slave when using `SPLIT_USB_DETECT`
|
This sets the poll frequency when detecting master/slave when using `SPLIT_USB_DETECT`
|
||||||
|
|
||||||
|
## Hardware Considerations and Mods
|
||||||
|
|
||||||
|
While most any Pro Micro can be used, micro controllers like the AVR Teensys and most (if not all) ARM boards require the Split USB Detect.
|
||||||
|
|
||||||
|
However, with the Teensy 2.0 and Teensy++ 2.0, there is a simple hardware mod that you can perform to add VBUS detection, so you don't need the Split USB detection option.
|
||||||
|
|
||||||
|
You'll only need a few things:
|
||||||
|
|
||||||
|
* A knife (x-acto knife, ideally)
|
||||||
|
* A solder station or hot air station
|
||||||
|
* An appropriate Schottky diode, such as the [PMEG2005EH](https://www.digikey.com/en/products/detail/nexperia-usa-inc/PMEG2005EH,115/1589924)
|
||||||
|
|
||||||
|
You'll need to cut the small trace between the 5V and center pads on the back of the Teensy.
|
||||||
|
|
||||||
|
Once you have done that, you will want to solder the diode from the 5V pad to the center pad.
|
||||||
|
|
||||||
|
You may need to use the 5V pad from the regulator block above as the pads were too small and placed too closely together to place the Schottky diode properly.
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
## Additional Resources
|
## Additional Resources
|
||||||
|
|
||||||
Nicinabox has a [very nice and detailed guide](https://github.com/nicinabox/lets-split-guide) for the Let's Split keyboard, that covers most everything you need to know, including troubleshooting information.
|
Nicinabox has a [very nice and detailed guide](https://github.com/nicinabox/lets-split-guide) for the Let's Split keyboard, that covers most everything you need to know, including troubleshooting information.
|
||||||
|
|||||||
@@ -129,4 +129,3 @@ As defined in `keymap_steno.h`.
|
|||||||
|`STN_RES1`||(GeminiPR only)|
|
|`STN_RES1`||(GeminiPR only)|
|
||||||
|`STN_RES2`||(GeminiPR only)|
|
|`STN_RES2`||(GeminiPR only)|
|
||||||
|`STN_PWR`||(GeminiPR only)|
|
|`STN_PWR`||(GeminiPR only)|
|
||||||
|
|
||||||
|
|||||||
@@ -184,7 +184,7 @@ If you wanted to consolidate macros and other functions into your userspace for
|
|||||||
|
|
||||||
First, you'd want to go through all of your `keymap.c` files and replace `process_record_user` with `process_record_keymap` instead. This way, you can still use keyboard specific codes on those boards, and use your custom "global" keycodes as well. You'll also want to replace `SAFE_RANGE` with `NEW_SAFE_RANGE` so that you wont have any overlapping keycodes
|
First, you'd want to go through all of your `keymap.c` files and replace `process_record_user` with `process_record_keymap` instead. This way, you can still use keyboard specific codes on those boards, and use your custom "global" keycodes as well. You'll also want to replace `SAFE_RANGE` with `NEW_SAFE_RANGE` so that you wont have any overlapping keycodes
|
||||||
|
|
||||||
Then add `#include <name.h>` to all of your keymap.c files. This allows you to use these new keycodes without having to redefine them in each keymap.
|
Then add `#include "<name>.h"` to all of your keymap.c files. This allows you to use these new keycodes without having to redefine them in each keymap.
|
||||||
|
|
||||||
Once you've done that, you'll want to set the keycode definitions that you need to the `<name>.h` file. For instance:
|
Once you've done that, you'll want to set the keycode definitions that you need to the `<name>.h` file. For instance:
|
||||||
```c
|
```c
|
||||||
|
|||||||
@@ -42,7 +42,9 @@ Vous préférez une solution basée sur le terminal? [hid_listen](https://www.pj
|
|||||||
|
|
||||||
Parfois, il est utile d'afficher des messages de débugage depuis votre [code custom](custom_quantum_functions.md). Le faire est assez simple. Commencez par ajouter `print.h` au début de votre fichier:
|
Parfois, il est utile d'afficher des messages de débugage depuis votre [code custom](custom_quantum_functions.md). Le faire est assez simple. Commencez par ajouter `print.h` au début de votre fichier:
|
||||||
|
|
||||||
#include <print.h>
|
```c
|
||||||
|
#include "print.h"
|
||||||
|
```
|
||||||
|
|
||||||
Une fois fait, vous pouvez utiliser les fonctions print suivantes:
|
Une fois fait, vous pouvez utiliser les fonctions print suivantes:
|
||||||
|
|
||||||
|
|||||||
@@ -47,4 +47,3 @@ This configuration is from usbasploader's Makefile.
|
|||||||
# | | +----- LB 2..1 (No memory lock features enabled)
|
# | | +----- LB 2..1 (No memory lock features enabled)
|
||||||
# | +--------- BLB0 2..1 (No restrictions for SPM or LPM accessing the Application section)
|
# | +--------- BLB0 2..1 (No restrictions for SPM or LPM accessing the Application section)
|
||||||
# +--------------- BLB1 2..1 (No restrictions for SPM or LPM accessing the Boot Loader section)
|
# +--------------- BLB1 2..1 (No restrictions for SPM or LPM accessing the Boot Loader section)
|
||||||
|
|
||||||
|
|||||||
@@ -78,7 +78,7 @@ Established materials and techniques include:
|
|||||||
| Short lengths of wire | [u/xicolinguada's ortho build](https://www.reddit.com/r/MechanicalKeyboards/comments/c39k4f/my_first_hand_wired_keyboard_its_not_perfect_but/) | Easier to strip the wire | More difficult to place | 
|
| Short lengths of wire | [u/xicolinguada's ortho build](https://www.reddit.com/r/MechanicalKeyboards/comments/c39k4f/my_first_hand_wired_keyboard_its_not_perfect_but/) | Easier to strip the wire | More difficult to place | 
|
||||||
| Magnet/Enamelled wire | [Brett Kosinski's handwired alpha](http://blog.b-ark.ca/Blog-2019-01-27) and [fknraiden's custom board](https://geekhack.org/index.php?topic=74223.0) | Can be directly soldered onto (insulation burns off with heat) | Appearance? | 
|
| Magnet/Enamelled wire | [Brett Kosinski's handwired alpha](http://blog.b-ark.ca/Blog-2019-01-27) and [fknraiden's custom board](https://geekhack.org/index.php?topic=74223.0) | Can be directly soldered onto (insulation burns off with heat) | Appearance? | 
|
||||||
| Bending the legs of the diodes for the rows | [Matt3o's Brownfox](https://deskthority.net/viewtopic.php?f=7&t=6050) | Fewer solder joints required | Uninsulated | 
|
| Bending the legs of the diodes for the rows | [Matt3o's Brownfox](https://deskthority.net/viewtopic.php?f=7&t=6050) | Fewer solder joints required | Uninsulated | 
|
||||||
| Using ridid wiring (e.g. brass tube) | [u/d_stilgar's invisible hardline](https://www.reddit.com/r/MechanicalKeyboards/comments/8aw5j2/invisible_hardline_keyboard_progress_update_april/) and [u/jonasfasler's first attempt](https://www.reddit.com/r/MechanicalKeyboards/comments/de1jyv/my_first_attempt_at_handwiring_a_keyboard/) | Very pretty | More difficult. No physical insulation | 
|
| Using rigid wiring (e.g. brass tube) | [u/d_stilgar's invisible hardline](https://www.reddit.com/r/MechanicalKeyboards/comments/8aw5j2/invisible_hardline_keyboard_progress_update_april/) and [u/jonasfasler's first attempt](https://www.reddit.com/r/MechanicalKeyboards/comments/de1jyv/my_first_attempt_at_handwiring_a_keyboard/) | Very pretty | More difficult. No physical insulation | 
|
||||||
| Bare wire with insulation added after (e.g. kapton tape) | [Matt3o's 65% on his website](https://matt3o.com/hand-wiring-a-custom-keyboard/) | Easier (no wire stripping required) | Not as attractive | 
|
| Bare wire with insulation added after (e.g. kapton tape) | [Matt3o's 65% on his website](https://matt3o.com/hand-wiring-a-custom-keyboard/) | Easier (no wire stripping required) | Not as attractive | 
|
||||||
| Copper tape | [ManuForm Dactyl](https://github.com/tshort/dactyl-keyboard) | Very easy | Only really works when your plate/case aligns with the bottom of your switches | 
|
| Copper tape | [ManuForm Dactyl](https://github.com/tshort/dactyl-keyboard) | Very easy | Only really works when your plate/case aligns with the bottom of your switches | 
|
||||||
|
|
||||||
@@ -121,7 +121,7 @@ Letting the diode rest, grab your solder, and touch both it and the soldering ir
|
|||||||
|
|
||||||
The smoke that the rosin releases is harmful, so be careful not to breath it or get it in your eyes/face.
|
The smoke that the rosin releases is harmful, so be careful not to breath it or get it in your eyes/face.
|
||||||
|
|
||||||
After soldering things in place, it may be helpful to blow on the joint to push the smoke away from your face, and cool the solder quicker. You should see the solder develop a matte (not shiny) surface as it solidifies. Keep in mind that it will still be very hot afterwards, and will take a couple minutes to be cool to touch. Blow on it will accelerate this process.
|
After soldering things in place, it may be helpful to blow on the joint to push the smoke away from your face, and cool the solder quicker. You should see the solder develop a matte (not shiny) surface as it solidifies. Keep in mind that it will still be very hot afterwards, and will take a couple minutes to be cool to touch. Blowing on it will accelerate this process.
|
||||||
|
|
||||||
When the first diode is complete, the next one will need to be soldered to both the keyswitch, and the previous diode at the new elbow. That will look something like this:
|
When the first diode is complete, the next one will need to be soldered to both the keyswitch, and the previous diode at the new elbow. That will look something like this:
|
||||||
|
|
||||||
|
|||||||
@@ -64,4 +64,4 @@
|
|||||||
```
|
```
|
||||||
|
|
||||||
מקמו את התיעוד שלכם בתוך `docs/feature_<my_cool_feature>.md`, והוסיפו קישור לקובץ זה במקום המתאים ב `docs/_sidebar.md`. אם הוספתם קודי מקשים נוספים, תקפידו להוסיף אותם ל- `docs/keycodes.md` עם לינק לעמוד היכולת שלכם.
|
מקמו את התיעוד שלכם בתוך `docs/feature_<my_cool_feature>.md`, והוסיפו קישור לקובץ זה במקום המתאים ב `docs/_sidebar.md`. אם הוספתם קודי מקשים נוספים, תקפידו להוסיף אותם ל- `docs/keycodes.md` עם לינק לעמוד היכולת שלכם.
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -5,4 +5,4 @@
|
|||||||
* [בנייה או קומפילציה של QMK](faq_build.md)
|
* [בנייה או קומפילציה של QMK](faq_build.md)
|
||||||
* [דיבאגינג ופתרון בעיות של QMK](faq_debug.md)
|
* [דיבאגינג ופתרון בעיות של QMK](faq_debug.md)
|
||||||
* [מיפוי מקשים](faq_keymap.md)
|
* [מיפוי מקשים](faq_keymap.md)
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -14,4 +14,4 @@ TMK עוצב ומומש במקור ע״י [Jun Wako](https://github.com/tmk). QM
|
|||||||
מנק׳ מבט של הפרוייקט וניהול הקהילה, TMK מנהל את כל המקלדות הנתמכות בעצמו, עם מעט תמיכה מהקהילה. כל אחד יכול לעשות פורק מהפרוייקט עבור מקלדות אחרות. רק מס׳ מיפויי מקשים נמצאים בברירת המחדל כך שאנשים בד״כ לא משתפים מיפויי מקשים זה עם זה. QMK מעודד את השיתוף של המקלדות וקודי המקשים דרך רפוזיטורי בניהול מרכזי, אשר מקבל את כל בקשות ה- Pull Requests שעומדות בסטנדרט האיכות. רובם מנוהלות ע״י הקהילה, אבל הצוות של QMK עוזר כשנדרש.
|
מנק׳ מבט של הפרוייקט וניהול הקהילה, TMK מנהל את כל המקלדות הנתמכות בעצמו, עם מעט תמיכה מהקהילה. כל אחד יכול לעשות פורק מהפרוייקט עבור מקלדות אחרות. רק מס׳ מיפויי מקשים נמצאים בברירת המחדל כך שאנשים בד״כ לא משתפים מיפויי מקשים זה עם זה. QMK מעודד את השיתוף של המקלדות וקודי המקשים דרך רפוזיטורי בניהול מרכזי, אשר מקבל את כל בקשות ה- Pull Requests שעומדות בסטנדרט האיכות. רובם מנוהלות ע״י הקהילה, אבל הצוות של QMK עוזר כשנדרש.
|
||||||
|
|
||||||
לשתי הגישות יש יתרונות וחסרונות וקוד עובר בחופשיות בין TMK ל- QMK כשצריך.
|
לשתי הגישות יש יתרונות וחסרונות וקוד עובר בחופשיות בין TMK ל- QMK כשצריך.
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -14,4 +14,4 @@
|
|||||||
## סוגיות GitHub
|
## סוגיות GitHub
|
||||||
|
|
||||||
ניתן לפתוח [סוגייה ב-GitHub](https://github.com/qmk/qmk_firmware/issues). הדבר שימושי במיוחד כאשר הסוגיה דורשת דיון עמוק וארוך או דיבאגינג.
|
ניתן לפתוח [סוגייה ב-GitHub](https://github.com/qmk/qmk_firmware/issues). הדבר שימושי במיוחד כאשר הסוגיה דורשת דיון עמוק וארוך או דיבאגינג.
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -7,4 +7,4 @@ QMK רצה על מגוון של חומרות. אם המעבד שלך יכול ל
|
|||||||
* [מעבדי AVR](hardware_avr.md)
|
* [מעבדי AVR](hardware_avr.md)
|
||||||
* מעבדי ARM (TBD)
|
* מעבדי ARM (TBD)
|
||||||
* [מנהלי התקנים](hardware_drivers.md)
|
* [מנהלי התקנים](hardware_drivers.md)
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -13,4 +13,4 @@
|
|||||||
מקורות לפקודות שורה (Command Line):
|
מקורות לפקודות שורה (Command Line):
|
||||||
|
|
||||||
* [מדריך טוב על Command Line](https://www.codecademy.com/learn/learn-the-command-line)
|
* [מדריך טוב על Command Line](https://www.codecademy.com/learn/learn-the-command-line)
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -126,6 +126,10 @@
|
|||||||
headings: 'h1, h2',
|
headings: 'h1, h2',
|
||||||
title: 'Table of Contents',
|
title: 'Table of Contents',
|
||||||
},
|
},
|
||||||
|
tabs: {
|
||||||
|
persist : false,
|
||||||
|
tabComments: false,
|
||||||
|
},
|
||||||
plugins: [
|
plugins: [
|
||||||
function (hook, vm) {
|
function (hook, vm) {
|
||||||
hook.beforeEach(function (html) {
|
hook.beforeEach(function (html) {
|
||||||
@@ -148,6 +152,7 @@
|
|||||||
<script src="//unpkg.com/docsify/lib/docsify.min.js"></script>
|
<script src="//unpkg.com/docsify/lib/docsify.min.js"></script>
|
||||||
<script src="//unpkg.com/docsify/lib/plugins/search.min.js"></script>
|
<script src="//unpkg.com/docsify/lib/plugins/search.min.js"></script>
|
||||||
<script src="//unpkg.com/docsify/lib/plugins/emoji.min.js"></script>
|
<script src="//unpkg.com/docsify/lib/plugins/emoji.min.js"></script>
|
||||||
|
<script src="//unpkg.com/docsify-tabs@1"></script>
|
||||||
<script src="//unpkg.com/docsify-copy-code@2"></script>
|
<script src="//unpkg.com/docsify-copy-code@2"></script>
|
||||||
<script src="//unpkg.com/docsify-toc@1.0.0/dist/toc.js"></script>
|
<script src="//unpkg.com/docsify-toc@1.0.0/dist/toc.js"></script>
|
||||||
<script src="//unpkg.com/prismjs/components/prism-bash.min.js"></script>
|
<script src="//unpkg.com/prismjs/components/prism-bash.min.js"></script>
|
||||||
|
|||||||
@@ -21,3 +21,22 @@ The following functions can provide basic control of GPIOs and are found in `qua
|
|||||||
## Advanced Settings :id=advanced-settings
|
## Advanced Settings :id=advanced-settings
|
||||||
|
|
||||||
Each microcontroller can have multiple advanced settings regarding its GPIO. This abstraction layer does not limit the use of architecture-specific functions. Advanced users should consult the datasheet of their desired device and include any needed libraries. For AVR, the standard avr/io.h library is used; for STM32, the ChibiOS [PAL library](http://chibios.sourceforge.net/docs3/hal/group___p_a_l.html) is used.
|
Each microcontroller can have multiple advanced settings regarding its GPIO. This abstraction layer does not limit the use of architecture-specific functions. Advanced users should consult the datasheet of their desired device and include any needed libraries. For AVR, the standard avr/io.h library is used; for STM32, the ChibiOS [PAL library](http://chibios.sourceforge.net/docs3/hal/group___p_a_l.html) is used.
|
||||||
|
|
||||||
|
## Atomic Operation
|
||||||
|
|
||||||
|
The above functions are not always guaranteed to work atomically. Therefore, if you want to prevent interruptions in the middle of operations when using multiple combinations of the above functions, use the following `ATOMIC_BLOCK_FORCEON` macro.
|
||||||
|
|
||||||
|
eg.
|
||||||
|
```c
|
||||||
|
void some_function() {
|
||||||
|
// some process
|
||||||
|
ATOMIC_BLOCK_FORCEON {
|
||||||
|
// Atomic Processing
|
||||||
|
}
|
||||||
|
// some process
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
`ATOMIC_BLOCK_FORCEON` forces interrupts to be disabled before the block is executed, without regard to whether they are enabled or disabled. Then, after the block is executed, the interrupt is enabled.
|
||||||
|
|
||||||
|
Note that `ATOMIC_BLOCK_FORCEON` can therefore be used if you know that interrupts are enabled before the execution of the block, or if you know that it is OK to enable interrupts at the completion of the block.
|
||||||
|
|||||||
@@ -34,7 +34,9 @@ QMK での全ての利用可能な設定にはデフォルトがあります。
|
|||||||
|
|
||||||
これは最初に include されるものの 1 つである C ヘッダファイルで、プロジェクト全体(もし含まれる場合)にわたって持続します。多くの変数をここで設定し、他の場所からアクセスすることができます。`config.h` ファイルでは、以下のもの以外の、他の `config.h` ファイルやその他のファイルの include をしないでください:
|
これは最初に include されるものの 1 つである C ヘッダファイルで、プロジェクト全体(もし含まれる場合)にわたって持続します。多くの変数をここで設定し、他の場所からアクセスすることができます。`config.h` ファイルでは、以下のもの以外の、他の `config.h` ファイルやその他のファイルの include をしないでください:
|
||||||
|
|
||||||
#include "config_common.h"
|
```c
|
||||||
|
#include "config_common.h"
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
## ハードウェアオプション
|
## ハードウェアオプション
|
||||||
|
|||||||
@@ -43,5 +43,3 @@ endif
|
|||||||
* eager_pk - キーごとにデバウンスします。状態が変化すると、応答は即座に行われ、その後そのキーは ```DEBOUNCE``` ミリ秒の間入力されません。
|
* eager_pk - キーごとにデバウンスします。状態が変化すると、応答は即座に行われ、その後そのキーは ```DEBOUNCE``` ミリ秒の間入力されません。
|
||||||
* sym_g - キーボードごとにデバウンスします。状態が変化すると、グローバルタイマが設定されます。```DEBOUNCE``` ミリ秒の間何も変化がなければ、全ての入力の変更がプッシュされます。
|
* sym_g - キーボードごとにデバウンスします。状態が変化すると、グローバルタイマが設定されます。```DEBOUNCE``` ミリ秒の間何も変化がなければ、全ての入力の変更がプッシュされます。
|
||||||
* sym_pk - キーごとにデバウンスします。状態が変化すると、キーごとのタイマーが設定されます。```DEBOUNCE``` ミリ秒の間そのキーに変化がなければ、キーの状態の変更がプッシュされます。
|
* sym_pk - キーごとにデバウンスします。状態が変化すると、キーごとのタイマーが設定されます。```DEBOUNCE``` ミリ秒の間そのキーに変化がなければ、キーの状態の変更がプッシュされます。
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -15,7 +15,8 @@ RGB LED を使いたい場合は、代わりに [RGB マトリックスサブシ
|
|||||||
|
|
||||||
I2C IS31FL3731 RGB コントローラを使ったアドレス指定可能な LED マトリックスライトのための基本的なサポートがあります:有効にするには、`rules.mk` に以下を追加します:
|
I2C IS31FL3731 RGB コントローラを使ったアドレス指定可能な LED マトリックスライトのための基本的なサポートがあります:有効にするには、`rules.mk` に以下を追加します:
|
||||||
|
|
||||||
LED_MATRIX_ENABLE = IS31FL3731
|
LED_MATRIX_ENABLE = yes
|
||||||
|
LED_MATRIX_DRIVER = IS31FL3731
|
||||||
|
|
||||||
1から4個の IS31FL3731 IC を使うことができます。キーボード上に存在しない IC の `LED_DRIVER_ADDR_<N>` 定義を指定しないでください。`config.h` に以下の項目を定義することができます:
|
1から4個の IS31FL3731 IC を使うことができます。キーボード上に存在しない IC の `LED_DRIVER_ADDR_<N>` 定義を指定しないでください。`config.h` に以下の項目を定義することができます:
|
||||||
|
|
||||||
|
|||||||
@@ -187,7 +187,9 @@ void post_process_record_user(uint16_t keycode, keyrecord_t *record) {
|
|||||||
|
|
||||||
デフォルトでは、QWERTY レイアウトの US キーマップを想定しています; それを変更したい場合(例えば OS がソフトウェア Colemak を使う場合)、キーマップのどこかに以下を含めます:
|
デフォルトでは、QWERTY レイアウトの US キーマップを想定しています; それを変更したい場合(例えば OS がソフトウェア Colemak を使う場合)、キーマップのどこかに以下を含めます:
|
||||||
|
|
||||||
#include <sendstring_colemak.h>
|
```c
|
||||||
|
#include "sendstring_colemak.h"
|
||||||
|
```
|
||||||
|
|
||||||
### メモリ内の文字列
|
### メモリ内の文字列
|
||||||
|
|
||||||
|
|||||||
@@ -189,7 +189,7 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
|
|||||||
|
|
||||||
最初に、全ての `keymap.c` ファイルを調べ、代わりに `process_record_user` を `process_record_keymap` に置き換えます。この方法では、これらのキーボードでキーボード固有のコードを使用でき、カスタムの "global" キーコードも使うことができます。また、`SAFE_RANGE` を `NEW_SAFE_RANGE` に置き換えて、キーコードが重複しないようにすることもできます。
|
最初に、全ての `keymap.c` ファイルを調べ、代わりに `process_record_user` を `process_record_keymap` に置き換えます。この方法では、これらのキーボードでキーボード固有のコードを使用でき、カスタムの "global" キーコードも使うことができます。また、`SAFE_RANGE` を `NEW_SAFE_RANGE` に置き換えて、キーコードが重複しないようにすることもできます。
|
||||||
|
|
||||||
次に、全ての keymap.c ファイルに `#include <name.h>` を追加します。これにより、各キーマップでそれらを再定義することなく新しいキーコードを使うことができます。
|
次に、全ての keymap.c ファイルに `#include "<name>.h"` を追加します。これにより、各キーマップでそれらを再定義することなく新しいキーコードを使うことができます。
|
||||||
|
|
||||||
それが完了したら、必要なキーコードの定義を `<name>.h` ファイルに設定します。例えば:
|
それが完了したら、必要なキーコードの定義を `<name>.h` ファイルに設定します。例えば:
|
||||||
```c
|
```c
|
||||||
|
|||||||
@@ -171,4 +171,3 @@
|
|||||||
* `device` 関連するデバイス
|
* `device` 関連するデバイス
|
||||||
|
|
||||||
* `func` 登録するコールバック関数
|
* `func` 登録するコールバック関数
|
||||||
|
|
||||||
|
|||||||
@@ -45,7 +45,9 @@ void keyboard_post_init_user(void) {
|
|||||||
|
|
||||||
[custom code](ja/custom_quantum_functions.md)内からデバッグメッセージを出力すると便利な場合があります。それはとても簡単です。ファイルの先頭に`print.h`のインクルードを追加します:
|
[custom code](ja/custom_quantum_functions.md)内からデバッグメッセージを出力すると便利な場合があります。それはとても簡単です。ファイルの先頭に`print.h`のインクルードを追加します:
|
||||||
|
|
||||||
#include <print.h>
|
```c
|
||||||
|
#include "print.h"
|
||||||
|
```
|
||||||
|
|
||||||
そのあとは、いくつかの異なった print 関数を使用することが出来ます。
|
そのあとは、いくつかの異なった print 関数を使用することが出来ます。
|
||||||
|
|
||||||
|
|||||||
@@ -51,6 +51,7 @@ Proton C には1つのオンボード LED(C13)しかなく、デフォルトで
|
|||||||
|
|
||||||
```
|
```
|
||||||
MCU = STM32F303
|
MCU = STM32F303
|
||||||
|
BOARD = QMK_PROTON_C
|
||||||
```
|
```
|
||||||
|
|
||||||
次の変数が存在する場合は削除します。
|
次の変数が存在する場合は削除します。
|
||||||
|
|||||||
@@ -51,6 +51,7 @@ HID Keyboard/Keypad usage ページでは 256 未満の usage が定義されて
|
|||||||
| Norwegian | `keymap_norwegian.h` |
|
| Norwegian | `keymap_norwegian.h` |
|
||||||
| Polish | `keymap_polish.h` |
|
| Polish | `keymap_polish.h` |
|
||||||
| Portuguese | `keymap_portuguese.h` |
|
| Portuguese | `keymap_portuguese.h` |
|
||||||
|
| Portuguese (macOS, ISO) | `keymap_portuguese_osx_iso.h` |
|
||||||
| Portuguese (Brazil) | `keymap_br_abnt2.h` |
|
| Portuguese (Brazil) | `keymap_br_abnt2.h` |
|
||||||
| Romanian | `keymap_romanian.h` |
|
| Romanian | `keymap_romanian.h` |
|
||||||
| Russian* | `keymap_russian.h` |
|
| Russian* | `keymap_russian.h` |
|
||||||
|
|||||||
@@ -124,17 +124,17 @@ See also: [Basic Keycodes](keycodes_basic.md)
|
|||||||
|`KC_F22` | |F22 |✔ | |✔ |
|
|`KC_F22` | |F22 |✔ | |✔ |
|
||||||
|`KC_F23` | |F23 |✔ | |✔ |
|
|`KC_F23` | |F23 |✔ | |✔ |
|
||||||
|`KC_F24` | |F24 |✔ | |✔ |
|
|`KC_F24` | |F24 |✔ | |✔ |
|
||||||
|`KC_EXECUTE` |`KC_EXEC` |Execute | | |✔ |
|
|`KC_EXECUTE` |`KC_EXEC` |Execute | | |✔ |
|
||||||
|`KC_HELP` | |Help | | |✔ |
|
|`KC_HELP` | |Help | | |✔ |
|
||||||
|`KC_MENU` | |Menu | | |✔ |
|
|`KC_MENU` | |Menu | | |✔ |
|
||||||
|`KC_SELECT` |`KC_SLCT` |Select | | |✔ |
|
|`KC_SELECT` |`KC_SLCT` |Select | | |✔ |
|
||||||
|`KC_STOP` | |Stop | | |✔ |
|
|`KC_STOP` | |Stop | | |✔ |
|
||||||
|`KC_AGAIN` |`KC_AGIN` |Again | | |✔ |
|
|`KC_AGAIN` |`KC_AGIN` |Again | | |✔ |
|
||||||
|`KC_UNDO` | |Undo | | |✔ |
|
|`KC_UNDO` | |Undo | | |✔ |
|
||||||
|`KC_CUT` | |Cut | | |✔ |
|
|`KC_CUT` | |Cut | | |✔ |
|
||||||
|`KC_COPY` | |Copy | | |✔ |
|
|`KC_COPY` | |Copy | | |✔ |
|
||||||
|`KC_PASTE` |`KC_PSTE` |Paste | | |✔ |
|
|`KC_PASTE` |`KC_PSTE` |Paste | | |✔ |
|
||||||
|`KC_FIND` | |Find | | |✔ |
|
|`KC_FIND` | |Find | | |✔ |
|
||||||
|`KC__MUTE` | |Mute | |✔ |✔ |
|
|`KC__MUTE` | |Mute | |✔ |✔ |
|
||||||
|`KC__VOLUP` | |Volume Up | |✔ |✔ |
|
|`KC__VOLUP` | |Volume Up | |✔ |✔ |
|
||||||
|`KC__VOLDOWN` | |Volume Down | |✔ |✔ |
|
|`KC__VOLDOWN` | |Volume Down | |✔ |✔ |
|
||||||
|
|||||||
@@ -144,48 +144,48 @@ The basic set of keycodes are based on the [HID Keyboard/Keypad Usage Page (0x07
|
|||||||
|
|
||||||
## Commands
|
## Commands
|
||||||
|
|
||||||
|Key |Aliases |Description |
|
|Key |Aliases |Description |
|
||||||
|------------------|------------------------------|------------------------------|
|
|------------------|------------------------------|--------------------------------------|
|
||||||
|`KC_PSCREEN` |`KC_PSCR` |Print Screen |
|
|`KC_PSCREEN` |`KC_PSCR` |Print Screen |
|
||||||
|`KC_PAUSE` |`KC_PAUS`, `KC_BRK`, `KC_BRMU`|Pause, Brightness Up (macOS) |
|
|`KC_PAUSE` |`KC_PAUS`, `KC_BRK`, `KC_BRMU`|Pause, Brightness Up (macOS) |
|
||||||
|`KC_INSERT` |`KC_INS` |Insert |
|
|`KC_INSERT` |`KC_INS` |Insert |
|
||||||
|`KC_HOME` | |Home |
|
|`KC_HOME` | |Home |
|
||||||
|`KC_PGUP` | |Page Up |
|
|`KC_PGUP` | |Page Up |
|
||||||
|`KC_DELETE` |`KC_DEL` |Forward Delete |
|
|`KC_DELETE` |`KC_DEL` |Forward Delete |
|
||||||
|`KC_END` | |End |
|
|`KC_END` | |End |
|
||||||
|`KC_PGDOWN` |`KC_PGDN` |Page Down |
|
|`KC_PGDOWN` |`KC_PGDN` |Page Down |
|
||||||
|`KC_RIGHT` |`KC_RGHT` |Right Arrow |
|
|`KC_RIGHT` |`KC_RGHT` |Right Arrow |
|
||||||
|`KC_LEFT` | |Left Arrow |
|
|`KC_LEFT` | |Left Arrow |
|
||||||
|`KC_DOWN` | |Down Arrow |
|
|`KC_DOWN` | |Down Arrow |
|
||||||
|`KC_UP` | |Up Arrow |
|
|`KC_UP` | |Up Arrow |
|
||||||
|`KC_APPLICATION` |`KC_APP` |Application (Windows Menu Key)|
|
|`KC_APPLICATION` |`KC_APP` |Application (Windows Context Menu Key)|
|
||||||
|`KC_POWER` | |System Power (macOS/Linux) |
|
|`KC_POWER` | |System Power |
|
||||||
|`KC_EXECUTE` |`KC_EXEC` |Execute |
|
|`KC_EXECUTE` |`KC_EXEC` |Execute |
|
||||||
|`KC_HELP` | |Help |
|
|`KC_HELP` | |Help |
|
||||||
|`KC_MENU` | |Menu |
|
|`KC_MENU` | |Menu |
|
||||||
|`KC_SELECT` |`KC_SLCT` |Select |
|
|`KC_SELECT` |`KC_SLCT` |Select |
|
||||||
|`KC_STOP` | |Stop |
|
|`KC_STOP` | |Stop |
|
||||||
|`KC_AGAIN` |`KC_AGIN` |Again |
|
|`KC_AGAIN` |`KC_AGIN` |Again |
|
||||||
|`KC_UNDO` | |Undo |
|
|`KC_UNDO` | |Undo |
|
||||||
|`KC_CUT` | |Cut |
|
|`KC_CUT` | |Cut |
|
||||||
|`KC_COPY` | |Copy |
|
|`KC_COPY` | |Copy |
|
||||||
|`KC_PASTE` |`KC_PSTE` |Paste |
|
|`KC_PASTE` |`KC_PSTE` |Paste |
|
||||||
|`KC_FIND` | |Find |
|
|`KC_FIND` | |Find |
|
||||||
|`KC__MUTE` | |Mute (macOS) |
|
|`KC__MUTE` | |Mute |
|
||||||
|`KC__VOLUP` | |Volume Up (macOS) |
|
|`KC__VOLUP` | |Volume Up |
|
||||||
|`KC__VOLDOWN` | |Volume Down (macOS) |
|
|`KC__VOLDOWN` | |Volume Down |
|
||||||
|`KC_ALT_ERASE` |`KC_ERAS` |Alternate Erase |
|
|`KC_ALT_ERASE` |`KC_ERAS` |Alternate Erase |
|
||||||
|`KC_SYSREQ` | |SysReq/Attention |
|
|`KC_SYSREQ` | |SysReq/Attention |
|
||||||
|`KC_CANCEL` | |Cancel |
|
|`KC_CANCEL` | |Cancel |
|
||||||
|`KC_CLEAR` |`KC_CLR` |Clear |
|
|`KC_CLEAR` |`KC_CLR` |Clear |
|
||||||
|`KC_PRIOR` | |Prior |
|
|`KC_PRIOR` | |Prior |
|
||||||
|`KC_RETURN` | |Return |
|
|`KC_RETURN` | |Return |
|
||||||
|`KC_SEPARATOR` | |Separator |
|
|`KC_SEPARATOR` | |Separator |
|
||||||
|`KC_OUT` | |Out |
|
|`KC_OUT` | |Out |
|
||||||
|`KC_OPER` | |Oper |
|
|`KC_OPER` | |Oper |
|
||||||
|`KC_CLEAR_AGAIN` | |Clear/Again |
|
|`KC_CLEAR_AGAIN` | |Clear/Again |
|
||||||
|`KC_CRSEL` | |CrSel/Props |
|
|`KC_CRSEL` | |CrSel/Props |
|
||||||
|`KC_EXSEL` | |ExSel |
|
|`KC_EXSEL` | |ExSel |
|
||||||
|
|
||||||
## Media Keys
|
## Media Keys
|
||||||
|
|
||||||
@@ -193,34 +193,34 @@ These keycodes are not part of the Keyboard/Keypad usage page. The `SYSTEM_` key
|
|||||||
|
|
||||||
?> Some of these keycodes may behave differently depending on the OS. For example, on macOS, the keycodes `KC_MEDIA_FAST_FORWARD`, `KC_MEDIA_REWIND`, `KC_MEDIA_NEXT_TRACK` and `KC_MEDIA_PREV_TRACK` skip within the current track when held, but skip the entire track when tapped.
|
?> Some of these keycodes may behave differently depending on the OS. For example, on macOS, the keycodes `KC_MEDIA_FAST_FORWARD`, `KC_MEDIA_REWIND`, `KC_MEDIA_NEXT_TRACK` and `KC_MEDIA_PREV_TRACK` skip within the current track when held, but skip the entire track when tapped.
|
||||||
|
|
||||||
|Key |Aliases |Description |
|
|Key |Aliases |Description |
|
||||||
|-----------------------|---------|-----------------------------|
|
|-----------------------|---------|-------------------|
|
||||||
|`KC_SYSTEM_POWER` |`KC_PWR` |System Power Down |
|
|`KC_SYSTEM_POWER` |`KC_PWR` |System Power Down |
|
||||||
|`KC_SYSTEM_SLEEP` |`KC_SLEP`|System Sleep |
|
|`KC_SYSTEM_SLEEP` |`KC_SLEP`|System Sleep |
|
||||||
|`KC_SYSTEM_WAKE` |`KC_WAKE`|System Wake |
|
|`KC_SYSTEM_WAKE` |`KC_WAKE`|System Wake |
|
||||||
|`KC_AUDIO_MUTE` |`KC_MUTE`|Mute |
|
|`KC_AUDIO_MUTE` |`KC_MUTE`|Mute |
|
||||||
|`KC_AUDIO_VOL_UP` |`KC_VOLU`|Volume Up |
|
|`KC_AUDIO_VOL_UP` |`KC_VOLU`|Volume Up |
|
||||||
|`KC_AUDIO_VOL_DOWN` |`KC_VOLD`|Volume Down |
|
|`KC_AUDIO_VOL_DOWN` |`KC_VOLD`|Volume Down |
|
||||||
|`KC_MEDIA_NEXT_TRACK` |`KC_MNXT`|Next Track |
|
|`KC_MEDIA_NEXT_TRACK` |`KC_MNXT`|Next Track |
|
||||||
|`KC_MEDIA_PREV_TRACK` |`KC_MPRV`|Previous Track |
|
|`KC_MEDIA_PREV_TRACK` |`KC_MPRV`|Previous Track |
|
||||||
|`KC_MEDIA_STOP` |`KC_MSTP`|Stop Track (Windows) |
|
|`KC_MEDIA_STOP` |`KC_MSTP`|Stop Track |
|
||||||
|`KC_MEDIA_PLAY_PAUSE` |`KC_MPLY`|Play/Pause Track |
|
|`KC_MEDIA_PLAY_PAUSE` |`KC_MPLY`|Play/Pause Track |
|
||||||
|`KC_MEDIA_SELECT` |`KC_MSEL`|Launch Media Player (Windows)|
|
|`KC_MEDIA_SELECT` |`KC_MSEL`|Launch Media Player|
|
||||||
|`KC_MEDIA_EJECT` |`KC_EJCT`|Eject (macOS) |
|
|`KC_MEDIA_EJECT` |`KC_EJCT`|Eject |
|
||||||
|`KC_MAIL` | |Launch Mail (Windows) |
|
|`KC_MAIL` | |Launch Mail |
|
||||||
|`KC_CALCULATOR` |`KC_CALC`|Launch Calculator (Windows) |
|
|`KC_CALCULATOR` |`KC_CALC`|Launch Calculator |
|
||||||
|`KC_MY_COMPUTER` |`KC_MYCM`|Launch My Computer (Windows) |
|
|`KC_MY_COMPUTER` |`KC_MYCM`|Launch My Computer |
|
||||||
|`KC_WWW_SEARCH` |`KC_WSCH`|Browser Search (Windows) |
|
|`KC_WWW_SEARCH` |`KC_WSCH`|Browser Search |
|
||||||
|`KC_WWW_HOME` |`KC_WHOM`|Browser Home (Windows) |
|
|`KC_WWW_HOME` |`KC_WHOM`|Browser Home |
|
||||||
|`KC_WWW_BACK` |`KC_WBAK`|Browser Back (Windows) |
|
|`KC_WWW_BACK` |`KC_WBAK`|Browser Back |
|
||||||
|`KC_WWW_FORWARD` |`KC_WFWD`|Browser Forward (Windows) |
|
|`KC_WWW_FORWARD` |`KC_WFWD`|Browser Forward |
|
||||||
|`KC_WWW_STOP` |`KC_WSTP`|Browser Stop (Windows) |
|
|`KC_WWW_STOP` |`KC_WSTP`|Browser Stop |
|
||||||
|`KC_WWW_REFRESH` |`KC_WREF`|Browser Refresh (Windows) |
|
|`KC_WWW_REFRESH` |`KC_WREF`|Browser Refresh |
|
||||||
|`KC_WWW_FAVORITES` |`KC_WFAV`|Browser Favorites (Windows) |
|
|`KC_WWW_FAVORITES` |`KC_WFAV`|Browser Favorites |
|
||||||
|`KC_MEDIA_FAST_FORWARD`|`KC_MFFD`|Next Track (macOS) |
|
|`KC_MEDIA_FAST_FORWARD`|`KC_MFFD`|Next Track |
|
||||||
|`KC_MEDIA_REWIND` |`KC_MRWD`|Previous Track (macOS) |
|
|`KC_MEDIA_REWIND` |`KC_MRWD`|Previous Track |
|
||||||
|`KC_BRIGHTNESS_UP` |`KC_BRIU`|Brightness Up |
|
|`KC_BRIGHTNESS_UP` |`KC_BRIU`|Brightness Up |
|
||||||
|`KC_BRIGHTNESS_DOWN` |`KC_BRID`|Brightness Down |
|
|`KC_BRIGHTNESS_DOWN` |`KC_BRID`|Brightness Down |
|
||||||
|
|
||||||
## Number Pad
|
## Number Pad
|
||||||
|
|
||||||
@@ -248,7 +248,7 @@ These keycodes are not part of the Keyboard/Keypad usage page. The `SYSTEM_` key
|
|||||||
|
|
||||||
## Special Keys
|
## Special Keys
|
||||||
|
|
||||||
In addition to these, keycodes in the range of `0xA5-DF` are reserved for internal use by TMK.
|
In addition to these, keycodes in the range of `0xA5-DF` are reserved for internal use.
|
||||||
|
|
||||||
|Key |Aliases |Description |
|
|Key |Aliases |Description |
|
||||||
|----------------|--------------------|---------------------------------------|
|
|----------------|--------------------|---------------------------------------|
|
||||||
|
|||||||
62
docs/kle2json_guide.md
Normal file
62
docs/kle2json_guide.md
Normal file
@@ -0,0 +1,62 @@
|
|||||||
|
# KLE To info.json
|
||||||
|
|
||||||
|
This page describes how to create a [Keyboard Layout Editor](http://keyboard-layout-editor.com) layout that works with `qmk kle2json`. You will also be able to use the same KLE layout to create VIA support for your keyboard.
|
||||||
|
|
||||||
|
## Overview
|
||||||
|
|
||||||
|
QMK uses `info.json` to store metadata about the keyboard including the matrix pins, row and column configuration, and keyboard layout. You can encode some of this data into a KLE layout and then convert that to `info.json`, which saves you time and headaches creating files from scratch.
|
||||||
|
|
||||||
|
Our reference layout is here: <http://www.keyboard-layout-editor.com/#/gists/70aaa4bed76d0b2f67fd165641239552>
|
||||||
|
|
||||||
|
Keep that open in a separate window so that you can refer to it while reading this document.
|
||||||
|
|
||||||
|
## Layout Structure
|
||||||
|
|
||||||
|
The first thing you should notice is that the main layout for the keyboard is in the middle. This is the default layout. Around the sides you'll find layout options. These are groups of keys that can replace specific keys in the default layout. More on that later.
|
||||||
|
|
||||||
|
## Anatomy of a Key
|
||||||
|
|
||||||
|
Every key in KLE has 12 labels- top left, top center, top right, center left, center, center right, bottom left, bottom center, bottom right, front left, front center, front right. We do not use all 12 labels, but we do some of them.
|
||||||
|
|
||||||
|
The labels we use are below:
|
||||||
|
|
||||||
|
| | | |
|
||||||
|
|-|-|-|
|
||||||
|
| **Matrix** | (unused) | (unused) |
|
||||||
|
| **Keycode** | (unused) | (unused) |
|
||||||
|
| (unused) | (unused) | **Option Group** |
|
||||||
|
| **Option Name** | (unused) | (unused) |
|
||||||
|
|
||||||
|
### Matrix
|
||||||
|
|
||||||
|
This is the location of the key in the keyboard matrix. It should be two whole numbers separated by a comma representing row and column. For example, the top left location of the keyboard is usually `0,0`, to the right of that key is `0,1`, below that key is `1,0`, and so on.
|
||||||
|
|
||||||
|
### Keycode
|
||||||
|
|
||||||
|
This is the default keycode for layer 0. You should supply this now even if you won't use the generated keymap because QMK will make greater use of it in the future.
|
||||||
|
|
||||||
|
### Option Group
|
||||||
|
|
||||||
|
This identifies what Layout Options (if any) this key is part of. If this value is empty the key is not part of any Layout Options.
|
||||||
|
|
||||||
|
The value is two whole numbers separated by a comma. The first number is the Layout Option Group Number, which identifies the specific Layout Option this key is associated with. The second number is the specific Layout Option Choice this key is associated with.
|
||||||
|
|
||||||
|
### Option Name
|
||||||
|
|
||||||
|
This identifies the name for each Option Group Choice. This will be used in the future to automatically build layouts from each option. All keys with the same Option Group identifier should have the same Option Name.
|
||||||
|
|
||||||
|
## Running qmk kle2json
|
||||||
|
|
||||||
|
Once you have built your KLE layout you are ready to convert it to `info.json`. Start by clicking `Sign In with GitHub` on Keyboard Layout Editor. Once you have signed in you can click `Save` to save your KLE. Once it's saved grab the URL from the bar, it should end end in `/#/gists/<long_number>`.
|
||||||
|
|
||||||
|
To use the reference layout as an example, I could update the keyboard `clueboard/60` from that KLE using this command:
|
||||||
|
|
||||||
|
```shell
|
||||||
|
qmk kle2json -kb clueboard/60 -l LAYOUT_60_ansi 'http://www.keyboard-layout-editor.com/#/gists/70aaa4bed76d0b2f67fd165641239552'
|
||||||
|
```
|
||||||
|
|
||||||
|
It will fetch the KLE, generate a new `LAYOUT_60_ansi`, and either add a new layout or change the existing layout to match.
|
||||||
|
|
||||||
|
## Adding more layouts
|
||||||
|
|
||||||
|
At the current time QMK only supports the base layout. Layout Options are allowed for VIA compatibility purposes and will be implemented in QMK at a later date. For now we recommend you create a KLE for each layout you want to support in QMK and call `qmk kle2json` once per layout to set up the info.json.
|
||||||
@@ -37,56 +37,119 @@ We've tried to make QMK as easy to set up as possible. You only have to prepare
|
|||||||
[Must Know Linux Commands](https://www.guru99.com/must-know-linux-commands.html)<br>
|
[Must Know Linux Commands](https://www.guru99.com/must-know-linux-commands.html)<br>
|
||||||
[Some Basic Unix Commands](https://www.tjhsst.edu/~dhyatt/superap/unixcmd.html)
|
[Some Basic Unix Commands](https://www.tjhsst.edu/~dhyatt/superap/unixcmd.html)
|
||||||
|
|
||||||
### Windows
|
<!-- tabs:start -->
|
||||||
|
|
||||||
You will need to install MSYS2, Git, and the QMK CLI.
|
### ** Windows **
|
||||||
|
|
||||||
Follow the installation instructions on the [MSYS2 homepage](http://www.msys2.org). Close any open MSYS terminals and open a new MinGW 64-bit terminal. **NOTE: This is *not* the same as the MSYS terminal that opens when installation is completed.**
|
#### Prerequisites
|
||||||
|
|
||||||
Then, run the following:
|
You will need to install MSYS2, Git and Python. Follow the installation instructions on https://www.msys2.org.
|
||||||
|
|
||||||
|
Once MSYS2 is installed, close any open MSYS terminals and open a new MinGW 64-bit terminal.
|
||||||
|
|
||||||
|
!> **NOTE:** The MinGW 64-bit terminal is *not* the same as the MSYS terminal that opens when installation is completed. Your prompt should say "MINGW64" in purple text, rather than "MSYS". See [this page](https://www.msys2.org/wiki/MSYS2-introduction/#subsystems) for more information on the differences.
|
||||||
|
|
||||||
|
Then run the following command:
|
||||||
|
|
||||||
pacman --needed --noconfirm --disable-download-timeout -S git mingw-w64-x86_64-toolchain mingw-w64-x86_64-python3-pip
|
pacman --needed --noconfirm --disable-download-timeout -S git mingw-w64-x86_64-toolchain mingw-w64-x86_64-python3-pip
|
||||||
|
|
||||||
|
#### Installation
|
||||||
|
|
||||||
|
Install the QMK CLI by running:
|
||||||
|
|
||||||
python3 -m pip install qmk
|
python3 -m pip install qmk
|
||||||
|
|
||||||
### macOS
|
### ** macOS **
|
||||||
|
|
||||||
You will need to install Homebrew. Follow the instructions on the [Homebrew homepage](https://brew.sh).
|
QMK maintains a Homebrew tap and formula which will automatically install the CLI and all necessary dependencies.
|
||||||
|
|
||||||
After Homebrew is installed run this command:
|
#### Prerequisites
|
||||||
|
|
||||||
|
You will need to install Homebrew. Follow the instructions on https://brew.sh.
|
||||||
|
|
||||||
|
#### Installation
|
||||||
|
|
||||||
|
Install the QMK CLI by running:
|
||||||
|
|
||||||
brew install qmk/qmk/qmk
|
brew install qmk/qmk/qmk
|
||||||
|
|
||||||
### Linux
|
### ** Linux/WSL **
|
||||||
|
|
||||||
|
#### Prerequisites
|
||||||
|
|
||||||
You will need to install Git and Python. It's very likely that you already have both, but if not, one of the following commands should install them:
|
You will need to install Git and Python. It's very likely that you already have both, but if not, one of the following commands should install them:
|
||||||
|
|
||||||
* Debian / Ubuntu / Devuan: `sudo apt install git python3 python3-pip`
|
* Debian / Ubuntu / Devuan: `sudo apt install -y git python3-pip`
|
||||||
* Fedora / Red Hat / CentOS: `sudo yum install git python3 python3-pip`
|
* Fedora / Red Hat / CentOS: `sudo yum -y install git python3-pip`
|
||||||
* Arch / Manjaro: `sudo pacman -S git python python-pip python-setuptools libffi`
|
* Arch / Manjaro: `sudo pacman --needed --noconfirm -S git python-pip libffi`
|
||||||
|
* Void: `sudo xbps-install -y git python3-pip`
|
||||||
|
* Solus: `sudo eopkg -y install git python3`
|
||||||
|
* Sabayon: `sudo equo install dev-vcs/git dev-python/pip`
|
||||||
|
* Gentoo: `sudo emerge dev-vcs/git dev-python/pip`
|
||||||
|
|
||||||
Install the global CLI to bootstrap your system:
|
#### Installation
|
||||||
|
|
||||||
`python3 -m pip install --user qmk` (on Arch-based distros you can also try the `qmk` package from AUR (**note**: it's maintained by a community member): `yay -S qmk`)
|
Install the QMK CLI by running:
|
||||||
|
|
||||||
### FreeBSD
|
python3 -m pip install --user qmk
|
||||||
|
|
||||||
|
#### Community Packages
|
||||||
|
|
||||||
|
These packages are maintained by community members, so may not be up to date or completely functional. If you encounter problems, please report them to their respective maintainers.
|
||||||
|
|
||||||
|
On Arch-based distros you can install the CLI from the official repositories (NOTE: at the time of writing this package marks some dependencies as optional that should not be):
|
||||||
|
|
||||||
|
sudo pacman -S qmk
|
||||||
|
|
||||||
|
You can also try the `qmk` package from AUR:
|
||||||
|
|
||||||
|
yay -S qmk
|
||||||
|
|
||||||
|
### ** FreeBSD **
|
||||||
|
|
||||||
|
#### Prerequisites
|
||||||
|
|
||||||
You will need to install Git and Python. It's possible that you already have both, but if not, run the following commands to install them:
|
You will need to install Git and Python. It's possible that you already have both, but if not, run the following commands to install them:
|
||||||
|
|
||||||
pkg install git python3
|
pkg install git python3
|
||||||
|
|
||||||
Make sure that `$HOME/.local/bin` is added to your `$PATH` so that locally install Python packages are available.
|
Make sure that `$HOME/.local/bin` is added to your `$PATH` so that locally installed Python packages are available.
|
||||||
|
|
||||||
Once installed, you can install QMK CLI:
|
#### Installation
|
||||||
|
|
||||||
|
Install the QMK CLI by running:
|
||||||
|
|
||||||
python3 -m pip install --user qmk
|
python3 -m pip install --user qmk
|
||||||
|
|
||||||
|
<!-- tabs:end -->
|
||||||
|
|
||||||
## 3. Run QMK Setup :id=set-up-qmk
|
## 3. Run QMK Setup :id=set-up-qmk
|
||||||
|
|
||||||
|
<!-- tabs:start -->
|
||||||
|
|
||||||
|
### ** Windows **
|
||||||
|
|
||||||
After installing QMK you can set it up with this command:
|
After installing QMK you can set it up with this command:
|
||||||
|
|
||||||
qmk setup
|
qmk setup
|
||||||
|
|
||||||
In most situations you will want to answer Yes to all of the prompts.
|
In most situations you will want to answer `y` to all of the prompts.
|
||||||
|
|
||||||
|
### ** macOS **
|
||||||
|
|
||||||
|
After installing QMK you can set it up with this command:
|
||||||
|
|
||||||
|
qmk setup
|
||||||
|
|
||||||
|
In most situations you will want to answer `y` to all of the prompts.
|
||||||
|
|
||||||
|
### ** Linux/WSL **
|
||||||
|
|
||||||
|
After installing QMK you can set it up with this command:
|
||||||
|
|
||||||
|
qmk setup
|
||||||
|
|
||||||
|
In most situations you will want to answer `y` to all of the prompts.
|
||||||
|
|
||||||
?>**Note on Debian, Ubuntu and their derivatives**:
|
?>**Note on Debian, Ubuntu and their derivatives**:
|
||||||
It's possible, that you will get an error saying something like: `bash: qmk: command not found`.
|
It's possible, that you will get an error saying something like: `bash: qmk: command not found`.
|
||||||
@@ -94,12 +157,22 @@ This is due to a [bug](https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=839155)
|
|||||||
Sadly, Ubuntu reitroduced this bug and is [yet to fix it](https://bugs.launchpad.net/ubuntu/+source/bash/+bug/1588562).
|
Sadly, Ubuntu reitroduced this bug and is [yet to fix it](https://bugs.launchpad.net/ubuntu/+source/bash/+bug/1588562).
|
||||||
Luckily, the fix is easy. Run this as your user: `echo 'PATH="$HOME/.local/bin:$PATH"' >> $HOME/.bashrc && source $HOME/.bashrc`
|
Luckily, the fix is easy. Run this as your user: `echo 'PATH="$HOME/.local/bin:$PATH"' >> $HOME/.bashrc && source $HOME/.bashrc`
|
||||||
|
|
||||||
|
### ** FreeBSD **
|
||||||
|
|
||||||
|
After installing QMK you can set it up with this command:
|
||||||
|
|
||||||
|
qmk setup
|
||||||
|
|
||||||
|
In most situations you will want to answer `y` to all of the prompts.
|
||||||
|
|
||||||
?>**Note on FreeBSD**:
|
?>**Note on FreeBSD**:
|
||||||
It is suggested to run `qmk setup` as a non-`root` user to start with, but this will likely identify packages that need to be installed to your
|
It is suggested to run `qmk setup` as a non-`root` user to start with, but this will likely identify packages that need to be installed to your
|
||||||
base system using `pkg`. However the installation will probably fail when run as an unprivileged user.
|
base system using `pkg`. However the installation will probably fail when run as an unprivileged user.
|
||||||
To manually install the base dependencies, run `./util/qmk_install.sh` either as `root`, or with `sudo`.
|
To manually install the base dependencies, run `./util/qmk_install.sh` either as `root`, or with `sudo`.
|
||||||
Once that completes, re-run `qmk setup` to complete the setup and checks.
|
Once that completes, re-run `qmk setup` to complete the setup and checks.
|
||||||
|
|
||||||
|
<!-- tabs:end -->
|
||||||
|
|
||||||
?> If you already know [how to use GitHub](getting_started_github.md), we recommend that you create your own fork and use `qmk setup <github_username>/qmk_firmware` to clone your personal fork. If you don't know what that means you can safely ignore this message.
|
?> If you already know [how to use GitHub](getting_started_github.md), we recommend that you create your own fork and use `qmk setup <github_username>/qmk_firmware` to clone your personal fork. If you don't know what that means you can safely ignore this message.
|
||||||
|
|
||||||
## 4. Test Your Build Environment
|
## 4. Test Your Build Environment
|
||||||
|
|||||||
@@ -36,7 +36,9 @@ Prefer a terminal based solution? [hid_listen](https://www.pjrc.com/teensy/hid_l
|
|||||||
|
|
||||||
Sometimes it's useful to print debug messages from within your [custom code](custom_quantum_functions.md). Doing so is pretty simple. Start by including `print.h` at the top of your file:
|
Sometimes it's useful to print debug messages from within your [custom code](custom_quantum_functions.md). Doing so is pretty simple. Start by including `print.h` at the top of your file:
|
||||||
|
|
||||||
#include <print.h>
|
```c
|
||||||
|
#include "print.h"
|
||||||
|
```
|
||||||
|
|
||||||
After that you can use a few different print functions:
|
After that you can use a few different print functions:
|
||||||
|
|
||||||
|
|||||||
@@ -22,7 +22,7 @@ Sometimes, you want to activate a one-shot key as part of a macro or tap dance r
|
|||||||
|
|
||||||
For one shot layers, you need to call `set_oneshot_layer(LAYER, ONESHOT_START)` on key down, and `clear_oneshot_layer_state(ONESHOT_OTHER_KEY_PRESSED)` on key up. If you want to cancel the oneshot, call `reset_oneshot_layer()`.
|
For one shot layers, you need to call `set_oneshot_layer(LAYER, ONESHOT_START)` on key down, and `clear_oneshot_layer_state(ONESHOT_OTHER_KEY_PRESSED)` on key up. If you want to cancel the oneshot, call `reset_oneshot_layer()`.
|
||||||
|
|
||||||
For one shot mods, you need to call `set_oneshot_mods(MOD)` to set it, or `clear_oneshot_mods()` to cancel it.
|
For one shot mods, you need to call `set_oneshot_mods(MOD_BIT(KC_*))` to set it, or `clear_oneshot_mods()` to cancel it.
|
||||||
|
|
||||||
!> If you're having issues with OSM translating over Remote Desktop Connection, this can be fixed by opening the settings, going to the "Local Resources" tap, and in the keyboard section, change the drop down to "On this Computer". This will fix the issue and allow OSM to function properly over Remote Desktop.
|
!> If you're having issues with OSM translating over Remote Desktop Connection, this can be fixed by opening the settings, going to the "Local Resources" tap, and in the keyboard section, change the drop down to "On this Computer". This will fix the issue and allow OSM to function properly over Remote Desktop.
|
||||||
|
|
||||||
|
|||||||
@@ -61,4 +61,4 @@ To implement your own version of this function, in your keyboard's source files:
|
|||||||
void board_init(void) {
|
void board_init(void) {
|
||||||
// initialize anything that requires ChibiOS
|
// initialize anything that requires ChibiOS
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|||||||
@@ -44,6 +44,7 @@ To use the Proton C natively, without having to specify `CTPC=yes`, you need to
|
|||||||
|
|
||||||
```
|
```
|
||||||
MCU = STM32F303
|
MCU = STM32F303
|
||||||
|
BOARD = QMK_PROTON_C
|
||||||
```
|
```
|
||||||
|
|
||||||
Remove these variables if they exist:
|
Remove these variables if they exist:
|
||||||
|
|||||||
@@ -27,3 +27,20 @@
|
|||||||
.markdown-section hr, .search {
|
.markdown-section hr, .search {
|
||||||
border-bottom: 1px solid #777 !important;
|
border-bottom: 1px solid #777 !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
:root {
|
||||||
|
--docsifytabs-border-color: #555;
|
||||||
|
--docsifytabs-tab-highlight-color: var(--theme-color,#ea6f5a);
|
||||||
|
|
||||||
|
--docsifytabs-tab-background: #444;
|
||||||
|
--docsifytabs-tab-background-active: #3f3f3f;
|
||||||
|
}
|
||||||
|
|
||||||
|
.docsify-tabs__tab:focus {
|
||||||
|
outline: none !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.docsify-tabs__content .anchor {
|
||||||
|
transition: none;
|
||||||
|
}
|
||||||
|
|||||||
@@ -28,3 +28,20 @@
|
|||||||
.markdown-section pre {
|
.markdown-section pre {
|
||||||
padding: 0;
|
padding: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
:root {
|
||||||
|
--docsifytabs-border-color: #ddd;
|
||||||
|
--docsifytabs-tab-highlight-color: var(--theme-color, #0074d9);
|
||||||
|
|
||||||
|
--docsifytabs-tab-background: #f8f8f8;
|
||||||
|
--docsifytabs-tab-background-active: transparent;
|
||||||
|
}
|
||||||
|
|
||||||
|
.docsify-tabs__tab:focus {
|
||||||
|
outline: none !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.docsify-tabs__content .anchor {
|
||||||
|
transition: none;
|
||||||
|
}
|
||||||
|
|||||||
@@ -19,8 +19,20 @@ The `info.json` file is a JSON formatted dictionary with the following keys avai
|
|||||||
* Width of the board in Key Units
|
* Width of the board in Key Units
|
||||||
* `height`
|
* `height`
|
||||||
* Height of the board in Key Units
|
* Height of the board in Key Units
|
||||||
|
* `debounce`
|
||||||
|
* How many milliseconds (ms) to wait for debounce to happen. (Default: 5)
|
||||||
|
* `diode_direction`
|
||||||
|
* The direction diodes face. See [`DIRECT_PINS` in the hardware configuration](https://docs.qmk.fm/#/config_options?id=hardware-options) for more details.
|
||||||
|
* `layout_aliases`
|
||||||
|
* A dictionary containing layout aliases. The key is the alias and the value is a layout in `layouts` it maps to.
|
||||||
* `layouts`
|
* `layouts`
|
||||||
* Physical Layout representations. See the next section for more detail.
|
* Physical Layout representations. See the [Layout Format](#layout_format) section for more detail.
|
||||||
|
* `matrix_pins`
|
||||||
|
* Configure the pins corresponding to columns and rows, or direct pins. See [Matrix Pins](#matrix_pins) for more detail.
|
||||||
|
* `rgblight`
|
||||||
|
* Configure the [RGB Lighting feature](feature_rgblight.md). See the [RGB Lighting](#rgb_lighting) section for more detail.
|
||||||
|
* `usb`
|
||||||
|
* Configure USB VID, PID, and other parameters. See [USB](#USB) for more detail.
|
||||||
|
|
||||||
### Layout Format
|
### Layout Format
|
||||||
|
|
||||||
@@ -49,25 +61,128 @@ All key positions and rotations are specified in relation to the top-left corner
|
|||||||
* The width of the key, in Key Units. Ignored if `ks` is provided. Default: `1`
|
* The width of the key, in Key Units. Ignored if `ks` is provided. Default: `1`
|
||||||
* `h`
|
* `h`
|
||||||
* The height of the key, in Key Units. Ignored if `ks` is provided. Default: `1`
|
* The height of the key, in Key Units. Ignored if `ks` is provided. Default: `1`
|
||||||
* `r`
|
|
||||||
* How many degrees clockwise to rotate the key.
|
|
||||||
* `rx`
|
|
||||||
* The absolute position of the point to rotate the key around in the horizontal axis. Default: `x`
|
|
||||||
* `ry`
|
|
||||||
* The absolute position of the point to rotate the key around in the vertical axis. Default: `y`
|
|
||||||
* `ks`
|
|
||||||
* Key Shape: define a polygon by providing a list of points, in Key Units.
|
|
||||||
* **Important**: These are relative to the top-left of the key, not absolute.
|
|
||||||
* Example ISO Enter: `[ [0,0], [1.5,0], [1.5,2], [0.25,2], [0.25,1], [0,1], [0,0] ]`
|
|
||||||
* `label`
|
* `label`
|
||||||
* What to name this position in the matrix.
|
* What to name this position in the matrix.
|
||||||
* This should usually be the same name as what is silkscreened on the PCB at this location.
|
* This should usually correspond to the keycode for the first layer of the default keymap.
|
||||||
|
* `matrix`
|
||||||
|
* A 2 item list describing the row and column location for this key.
|
||||||
|
|
||||||
## How is the Metadata Exposed?
|
### Matrix Pins
|
||||||
|
|
||||||
This metadata is primarily used in two ways:
|
Currently QMK supports connecting switches either directly to GPIO pins or via a switch matrix. At this time you can not combine these, they are mutually exclusive.
|
||||||
|
|
||||||
* To allow web-based configurators to dynamically generate UI
|
#### Switch Matrix
|
||||||
* To support the new `make keyboard:keymap:qmk` target, which bundles this metadata up with the firmware to allow QMK Toolbox to be smarter.
|
|
||||||
|
|
||||||
Configurator authors can see the [QMK Compiler](https://docs.api.qmk.fm/using-the-api) docs for more information on using the JSON API.
|
Most keyboards use a switch matrix to connect keyswitches to the MCU. You can define your pin columns and rows to configure your switch matrix. When defining switch matrices you should also define your `diode_direction`.
|
||||||
|
|
||||||
|
Example:
|
||||||
|
|
||||||
|
```json
|
||||||
|
{
|
||||||
|
"diode_direction": "COL2ROW",
|
||||||
|
"matrix_pins": {
|
||||||
|
"cols": ["F4", "E6", "B1", "D2"],
|
||||||
|
"rows": ["B0", "D3", "D5", "D4", "D6"]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
#### Direct Pins
|
||||||
|
|
||||||
|
Direct pins are when you connect one side of the switch to GND and the other side to a GPIO pin on your MCU. No diode is required, but there is a 1:1 mapping between switches and pins.
|
||||||
|
|
||||||
|
When specifying direct pins you need to arrange them in nested arrays. The outer array consists of rows, while the inner array is a text string corresponding to a pin. You can use `null` to indicate an empty spot in the matrix.
|
||||||
|
|
||||||
|
Example:
|
||||||
|
|
||||||
|
```json
|
||||||
|
{
|
||||||
|
"matrix_pins": {
|
||||||
|
"direct": [
|
||||||
|
["A10", "A9"],
|
||||||
|
["A0", "B8"],
|
||||||
|
[null, "B11"],
|
||||||
|
["B9", "A8"],
|
||||||
|
["A7", "B1"],
|
||||||
|
[null, "B2"]
|
||||||
|
]
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
### RGB Lighting
|
||||||
|
|
||||||
|
This section controls the legacy WS2812 support in QMK. This should not be confused with the RGB Matrix feature, which can be used to control both WS2812 and ISSI RGB LEDs.
|
||||||
|
|
||||||
|
The following items can be set. Not every value is required.
|
||||||
|
|
||||||
|
* `led_count`
|
||||||
|
* The number of LEDs in your strip
|
||||||
|
* `pin`
|
||||||
|
* The GPIO pin that your LED strip is connected to
|
||||||
|
* `animations`
|
||||||
|
* A dictionary that lists enabled and disabled animations. See [RGB Light Animations](#rgb_light_animations) below.
|
||||||
|
* `sleep`
|
||||||
|
* Set to `true` to enable lighting during host sleep
|
||||||
|
* `split`
|
||||||
|
* Set to `true` to enable synchronization functionality between split halves
|
||||||
|
* `split_count`
|
||||||
|
* For split keyboards, the number of LEDs on each side
|
||||||
|
* `max_brightness`
|
||||||
|
* (0-255) What the maxmimum brightness (value) level is
|
||||||
|
* `hue_steps`
|
||||||
|
* How many steps of adjustment to have for hue
|
||||||
|
* `saturation_steps`
|
||||||
|
* How many steps of adjustment to have for saturation
|
||||||
|
* `brightness_steps`
|
||||||
|
* How many steps of adjustment to have for brightness (value)
|
||||||
|
|
||||||
|
Example:
|
||||||
|
|
||||||
|
```json
|
||||||
|
{
|
||||||
|
"rgblight": {
|
||||||
|
"led_count": 4,
|
||||||
|
"pin": "F6",
|
||||||
|
"hue_steps": 10,
|
||||||
|
"saturation_steps": 17,
|
||||||
|
"brightness_steps": 17,
|
||||||
|
"animations": {
|
||||||
|
"all": true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
#### RGB Light Animations
|
||||||
|
|
||||||
|
The following animations can be enabled:
|
||||||
|
|
||||||
|
| Key | Description |
|
||||||
|
|-----|-------------|
|
||||||
|
| `all` | Enable all additional animation modes. |
|
||||||
|
| `alternating` | Enable alternating animation mode. |
|
||||||
|
| `breathing` | Enable breathing animation mode. |
|
||||||
|
| `christmas` | Enable christmas animation mode. |
|
||||||
|
| `knight` | Enable knight animation mode. |
|
||||||
|
| `rainbow_mood` | Enable rainbow mood animation mode. |
|
||||||
|
| `rainbow_swirl` | Enable rainbow swirl animation mode. |
|
||||||
|
| `rgb_test` | Enable RGB test animation mode. |
|
||||||
|
| `snake` | Enable snake animation mode. |
|
||||||
|
| `static_gradient` | Enable static gradient mode. |
|
||||||
|
| `twinkle` | Enable twinkle animation mode. |
|
||||||
|
|
||||||
|
### USB
|
||||||
|
|
||||||
|
Every USB keyboard needs to have its USB parmaters defined. At a minimum you need to set vid, pid, and device version.
|
||||||
|
|
||||||
|
Example:
|
||||||
|
|
||||||
|
```json
|
||||||
|
{
|
||||||
|
"usb": {
|
||||||
|
"vid": "0xC1ED",
|
||||||
|
"pid": "0x23B0",
|
||||||
|
"device_ver": "0x0001"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|||||||
@@ -18,7 +18,9 @@ To use these, simply `#include` the corresponding [header file](https://github.c
|
|||||||
|Dutch (Belgium) |`keymap_belgian.h` |
|
|Dutch (Belgium) |`keymap_belgian.h` |
|
||||||
|English (Ireland) |`keymap_irish.h` |
|
|English (Ireland) |`keymap_irish.h` |
|
||||||
|English (UK) |`keymap_uk.h` |
|
|English (UK) |`keymap_uk.h` |
|
||||||
|
|English (US Extended) |`keymap_us_extended.h` |
|
||||||
|English (US International) |`keymap_us_international.h` |
|
|English (US International) |`keymap_us_international.h` |
|
||||||
|
|English (US International, Linux)|`keymap_us_international_linux.h`|
|
||||||
|Estonian |`keymap_estonian.h` |
|
|Estonian |`keymap_estonian.h` |
|
||||||
|Finnish |`keymap_finnish.h` |
|
|Finnish |`keymap_finnish.h` |
|
||||||
|French |`keymap_french.h` |
|
|French |`keymap_french.h` |
|
||||||
@@ -46,6 +48,7 @@ To use these, simply `#include` the corresponding [header file](https://github.c
|
|||||||
|Norwegian |`keymap_norwegian.h` |
|
|Norwegian |`keymap_norwegian.h` |
|
||||||
|Polish |`keymap_polish.h` |
|
|Polish |`keymap_polish.h` |
|
||||||
|Portuguese |`keymap_portuguese.h` |
|
|Portuguese |`keymap_portuguese.h` |
|
||||||
|
|Portuguese (macOS, ISO) |`keymap_portuguese_osx_iso.h` |
|
||||||
|Portuguese (Brazil) |`keymap_br_abnt2.h` |
|
|Portuguese (Brazil) |`keymap_br_abnt2.h` |
|
||||||
|Romanian |`keymap_romanian.h` |
|
|Romanian |`keymap_romanian.h` |
|
||||||
|Russian* |`keymap_russian.h` |
|
|Russian* |`keymap_russian.h` |
|
||||||
|
|||||||
@@ -60,6 +60,7 @@ Configure the hardware via your config.h:
|
|||||||
// 5: about 19200 baud
|
// 5: about 19200 baud
|
||||||
#define SERIAL_USART_DRIVER SD1 // USART driver of TX pin. default: SD1
|
#define SERIAL_USART_DRIVER SD1 // USART driver of TX pin. default: SD1
|
||||||
#define SERIAL_USART_TX_PAL_MODE 7 // Pin "alternate function", see the respective datasheet for the appropriate values for your MCU. default: 7
|
#define SERIAL_USART_TX_PAL_MODE 7 // Pin "alternate function", see the respective datasheet for the appropriate values for your MCU. default: 7
|
||||||
|
#define SERIAL_USART_TIMEOUT 100 // USART driver timeout. default 100
|
||||||
```
|
```
|
||||||
|
|
||||||
You must also enable the ChibiOS `SERIAL` feature:
|
You must also enable the ChibiOS `SERIAL` feature:
|
||||||
|
|||||||
@@ -179,6 +179,25 @@ Holding and releasing a dual function key without pressing another key will resu
|
|||||||
|
|
||||||
For instance, holding and releasing `LT(2, KC_SPACE)` without hitting another key will result in nothing happening. With this enabled, it will send `KC_SPACE` instead.
|
For instance, holding and releasing `LT(2, KC_SPACE)` without hitting another key will result in nothing happening. With this enabled, it will send `KC_SPACE` instead.
|
||||||
|
|
||||||
|
For more granular control of this feature, you can add the following to your `config.h`:
|
||||||
|
|
||||||
|
```c
|
||||||
|
#define RETRO_TAPPING_PER_KEY
|
||||||
|
```
|
||||||
|
|
||||||
|
You can then add the following function to your keymap:
|
||||||
|
|
||||||
|
```c
|
||||||
|
bool get_retro_tapping(uint16_t keycode, keyrecord_t *record) {
|
||||||
|
switch (keycode) {
|
||||||
|
case LT(2, KC_SPACE):
|
||||||
|
return true;
|
||||||
|
default:
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
## Why do we include the key record for the per key functions?
|
## Why do we include the key record for the per key functions?
|
||||||
|
|
||||||
One thing that you may notice is that we include the key record for all of the "per key" functions, and may be wondering why we do that.
|
One thing that you may notice is that we include the key record for all of the "per key" functions, and may be wondering why we do that.
|
||||||
|
|||||||
@@ -28,6 +28,17 @@ The default setting is 280 µs, which should work for most cases, but this can b
|
|||||||
#define WS2812_TRST_US 80
|
#define WS2812_TRST_US 80
|
||||||
```
|
```
|
||||||
|
|
||||||
|
#### Byte Order
|
||||||
|
|
||||||
|
Some variants of the WS2812 may have their color components in a different physical or logical order. For example, the WS2812B-2020 has physically swapped red and green LEDs, which causes the wrong color to be displayed, because the default order of the bytes sent over the wire is defined as GRB.
|
||||||
|
In this case, you can change the byte order by defining `WS2812_BYTE_ORDER` as one of the following values:
|
||||||
|
|
||||||
|
| Byte order | Known devices |
|
||||||
|
|-----------------------------------|-------------------------------|
|
||||||
|
| `WS2812_BYTE_ORDER_GRB` (default) | Most WS2812's, SK6812, SK6805 |
|
||||||
|
| `WS2812_BYTE_ORDER_RGB` | WS2812B-2020 |
|
||||||
|
|
||||||
|
|
||||||
### Bitbang
|
### Bitbang
|
||||||
Default driver, the absence of configuration assumes this driver. To configure it, add this to your rules.mk:
|
Default driver, the absence of configuration assumes this driver. To configure it, add this to your rules.mk:
|
||||||
|
|
||||||
|
|||||||
@@ -34,7 +34,9 @@ void keyboard_post_init_user(void) {
|
|||||||
|
|
||||||
有时用[custom code](custom_quantum_functions.md)发送自定义调试信息很有用. 这么做很简单. 首先在你文件头部包含`print.h`:
|
有时用[custom code](custom_quantum_functions.md)发送自定义调试信息很有用. 这么做很简单. 首先在你文件头部包含`print.h`:
|
||||||
|
|
||||||
#include <print.h>
|
```c
|
||||||
|
#include "print.h"
|
||||||
|
```
|
||||||
|
|
||||||
之后,您可以使用一些不同的打印功能:
|
之后,您可以使用一些不同的打印功能:
|
||||||
|
|
||||||
|
|||||||
151
drivers/apa102/apa102.c
Normal file
151
drivers/apa102/apa102.c
Normal file
@@ -0,0 +1,151 @@
|
|||||||
|
/* Copyright 2020 Aldehir Rojas
|
||||||
|
* Copyright 2017 Mikkel (Duckle29)
|
||||||
|
*
|
||||||
|
* This program is free software: you can redistribute it and/or modify
|
||||||
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
* the Free Software Foundation, either version 2 of the License, or
|
||||||
|
* (at your option) any later version.
|
||||||
|
*
|
||||||
|
* This program is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
* GNU General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License
|
||||||
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include "apa102.h"
|
||||||
|
#include "quantum.h"
|
||||||
|
|
||||||
|
#ifndef APA102_NOPS
|
||||||
|
# if defined(__AVR__)
|
||||||
|
# define APA102_NOPS 0 // AVR at 16 MHz already spends 62.5 ns per clock, so no extra delay is needed
|
||||||
|
# elif defined(PROTOCOL_CHIBIOS)
|
||||||
|
|
||||||
|
# include "hal.h"
|
||||||
|
# if defined(STM32F0XX) || defined(STM32F1XX) || defined(STM32F3XX) || defined(STM32F4XX) || defined(STM32L0XX)
|
||||||
|
# define APA102_NOPS (100 / (1000000000L / (STM32_SYSCLK / 4))) // This calculates how many loops of 4 nops to run to delay 100 ns
|
||||||
|
# else
|
||||||
|
# error("APA102_NOPS configuration required")
|
||||||
|
# define APA102_NOPS 0 // this just pleases the compile so the above error is easier to spot
|
||||||
|
# endif
|
||||||
|
# endif
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#define io_wait \
|
||||||
|
do { \
|
||||||
|
for (int i = 0; i < APA102_NOPS; i++) { \
|
||||||
|
__asm__ volatile("nop\n\t" \
|
||||||
|
"nop\n\t" \
|
||||||
|
"nop\n\t" \
|
||||||
|
"nop\n\t"); \
|
||||||
|
} \
|
||||||
|
} while (0)
|
||||||
|
|
||||||
|
#define APA102_SEND_BIT(byte, bit) \
|
||||||
|
do { \
|
||||||
|
writePin(RGB_DI_PIN, (byte >> bit) & 1); \
|
||||||
|
io_wait; \
|
||||||
|
writePinHigh(RGB_CI_PIN); \
|
||||||
|
io_wait; \
|
||||||
|
writePinLow(RGB_CI_PIN); \
|
||||||
|
io_wait; \
|
||||||
|
} while (0)
|
||||||
|
|
||||||
|
uint8_t apa102_led_brightness = APA102_DEFAULT_BRIGHTNESS;
|
||||||
|
|
||||||
|
void static apa102_start_frame(void);
|
||||||
|
void static apa102_end_frame(uint16_t num_leds);
|
||||||
|
|
||||||
|
void static apa102_send_frame(uint8_t red, uint8_t green, uint8_t blue, uint8_t brightness);
|
||||||
|
void static apa102_send_byte(uint8_t byte);
|
||||||
|
|
||||||
|
void apa102_setleds(LED_TYPE *start_led, uint16_t num_leds) {
|
||||||
|
LED_TYPE *end = start_led + num_leds;
|
||||||
|
|
||||||
|
apa102_start_frame();
|
||||||
|
for (LED_TYPE *led = start_led; led < end; led++) {
|
||||||
|
apa102_send_frame(led->r, led->g, led->b, apa102_led_brightness);
|
||||||
|
}
|
||||||
|
apa102_end_frame(num_leds);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Overwrite the default rgblight_call_driver to use apa102 driver
|
||||||
|
void rgblight_call_driver(LED_TYPE *start_led, uint8_t num_leds) { apa102_setleds(start_led, num_leds); }
|
||||||
|
|
||||||
|
void static apa102_init(void) {
|
||||||
|
setPinOutput(RGB_DI_PIN);
|
||||||
|
setPinOutput(RGB_CI_PIN);
|
||||||
|
|
||||||
|
writePinLow(RGB_DI_PIN);
|
||||||
|
writePinLow(RGB_CI_PIN);
|
||||||
|
}
|
||||||
|
|
||||||
|
void apa102_set_brightness(uint8_t brightness) {
|
||||||
|
if (brightness > APA102_MAX_BRIGHTNESS) {
|
||||||
|
apa102_led_brightness = APA102_MAX_BRIGHTNESS;
|
||||||
|
} else if (brightness < 0) {
|
||||||
|
apa102_led_brightness = 0;
|
||||||
|
} else {
|
||||||
|
apa102_led_brightness = brightness;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void static apa102_send_frame(uint8_t red, uint8_t green, uint8_t blue, uint8_t brightness) {
|
||||||
|
apa102_send_byte(0b11100000 | brightness);
|
||||||
|
apa102_send_byte(blue);
|
||||||
|
apa102_send_byte(green);
|
||||||
|
apa102_send_byte(red);
|
||||||
|
}
|
||||||
|
|
||||||
|
void static apa102_start_frame(void) {
|
||||||
|
apa102_init();
|
||||||
|
for (uint16_t i = 0; i < 4; i++) {
|
||||||
|
apa102_send_byte(0);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void static apa102_end_frame(uint16_t num_leds) {
|
||||||
|
// This function has been taken from: https://github.com/pololu/apa102-arduino/blob/master/APA102.h
|
||||||
|
// and adapted. The code is MIT licensed. I think thats compatible?
|
||||||
|
//
|
||||||
|
// The data stream seen by the last LED in the chain will be delayed by
|
||||||
|
// (count - 1) clock edges, because each LED before it inverts the clock
|
||||||
|
// line and delays the data by one clock edge. Therefore, to make sure
|
||||||
|
// the last LED actually receives the data we wrote, the number of extra
|
||||||
|
// edges we send at the end of the frame must be at least (count - 1).
|
||||||
|
//
|
||||||
|
// Assuming we only want to send these edges in groups of size K, the
|
||||||
|
// C/C++ expression for the minimum number of groups to send is:
|
||||||
|
//
|
||||||
|
// ((count - 1) + (K - 1)) / K
|
||||||
|
//
|
||||||
|
// The C/C++ expression above is just (count - 1) divided by K,
|
||||||
|
// rounded up to the nearest whole number if there is a remainder.
|
||||||
|
//
|
||||||
|
// We set K to 16 and use the formula above as the number of frame-end
|
||||||
|
// bytes to transfer. Each byte has 16 clock edges.
|
||||||
|
//
|
||||||
|
// We are ignoring the specification for the end frame in the APA102
|
||||||
|
// datasheet, which says to send 0xFF four times, because it does not work
|
||||||
|
// when you have 66 LEDs or more, and also it results in unwanted white
|
||||||
|
// pixels if you try to update fewer LEDs than are on your LED strip.
|
||||||
|
uint16_t iterations = (num_leds + 14) / 16;
|
||||||
|
for (uint16_t i = 0; i < iterations; i++) {
|
||||||
|
apa102_send_byte(0);
|
||||||
|
}
|
||||||
|
|
||||||
|
apa102_init();
|
||||||
|
}
|
||||||
|
|
||||||
|
void static apa102_send_byte(uint8_t byte) {
|
||||||
|
APA102_SEND_BIT(byte, 7);
|
||||||
|
APA102_SEND_BIT(byte, 6);
|
||||||
|
APA102_SEND_BIT(byte, 5);
|
||||||
|
APA102_SEND_BIT(byte, 4);
|
||||||
|
APA102_SEND_BIT(byte, 3);
|
||||||
|
APA102_SEND_BIT(byte, 2);
|
||||||
|
APA102_SEND_BIT(byte, 1);
|
||||||
|
APA102_SEND_BIT(byte, 0);
|
||||||
|
}
|
||||||
@@ -1,10 +1,5 @@
|
|||||||
/*
|
/* Copyright 2020 Aldehir Rojas
|
||||||
* light weight WS2812 lib include
|
* Copyright 2017 Mikkel (Duckle29)
|
||||||
*
|
|
||||||
* Version 2.3 - Nev 29th 2015
|
|
||||||
* Author: Tim (cpldcpu@gmail.com)
|
|
||||||
*
|
|
||||||
* Please do not change this file! All configuration is handled in "ws2812_config.h"
|
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* This program is free software: you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
@@ -22,24 +17,25 @@
|
|||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include <avr/io.h>
|
|
||||||
#include <avr/interrupt.h>
|
|
||||||
|
|
||||||
#include "color.h"
|
#include "color.h"
|
||||||
|
|
||||||
|
#ifndef APA102_DEFAULT_BRIGHTNESS
|
||||||
|
# define APA102_DEFAULT_BRIGHTNESS 31
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#define APA102_MAX_BRIGHTNESS 31
|
||||||
|
|
||||||
|
extern uint8_t apa102_led_brightness;
|
||||||
|
|
||||||
/* User Interface
|
/* User Interface
|
||||||
*
|
*
|
||||||
* Input:
|
* Input:
|
||||||
* ledarray: An array of GRB data describing the LED colors
|
* start_led: An array of GRB data describing the LED colors
|
||||||
* number_of_leds: The number of LEDs to write
|
* num_leds: The number of LEDs to write
|
||||||
* pinmask (optional): Bitmask describing the output bin. e.g. _BV(PB0)
|
|
||||||
*
|
*
|
||||||
* The functions will perform the following actions:
|
* The functions will perform the following actions:
|
||||||
* - Set the data-out pin as output
|
* - Set the data-out pin as output
|
||||||
* - Send out the LED data
|
* - Send out the LED data
|
||||||
* - Wait 50<EFBFBD>s to reset the LEDs
|
|
||||||
*/
|
*/
|
||||||
|
void apa102_setleds(LED_TYPE *start_led, uint16_t num_leds);
|
||||||
void apa102_setleds(LED_TYPE *ledarray, uint16_t number_of_leds);
|
void apa102_set_brightness(uint8_t brightness);
|
||||||
void apa102_setleds_pin(LED_TYPE *ledarray, uint16_t number_of_leds, uint8_t pinmask);
|
|
||||||
void apa102_setleds_rgbw(LED_TYPE *ledarray, uint16_t number_of_leds);
|
|
||||||
@@ -1,96 +0,0 @@
|
|||||||
/*
|
|
||||||
* APA102 lib V1.0a
|
|
||||||
*
|
|
||||||
* Controls APA102 RGB-LEDs
|
|
||||||
* Author: Mikkel (Duckle29 on GitHub)
|
|
||||||
*
|
|
||||||
* Dec 22th, 2017 v1.0a Initial Version
|
|
||||||
*
|
|
||||||
* This program is free software: you can redistribute it and/or modify
|
|
||||||
* it under the terms of the GNU General Public License as published by
|
|
||||||
* the Free Software Foundation, either version 2 of the License, or
|
|
||||||
* (at your option) any later version.
|
|
||||||
*
|
|
||||||
* This program is distributed in the hope that it will be useful,
|
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
* GNU General Public License for more details.
|
|
||||||
*
|
|
||||||
* You should have received a copy of the GNU General Public License
|
|
||||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#include "apa102.h"
|
|
||||||
#include <avr/interrupt.h>
|
|
||||||
#include <avr/io.h>
|
|
||||||
#include <util/delay.h>
|
|
||||||
#include "debug.h"
|
|
||||||
|
|
||||||
// Setleds for standard RGB
|
|
||||||
void inline apa102_setleds(LED_TYPE *ledarray, uint16_t leds) { apa102_setleds_pin(ledarray, leds, _BV(RGB_DI_PIN & 0xF), _BV(RGB_CLK_PIN & 0xF)); }
|
|
||||||
|
|
||||||
void static inline apa102_setleds_pin(LED_TYPE *ledarray, uint16_t leds, uint8_t pinmask_DI, uint8_t pinmask_CLK) {
|
|
||||||
setPinOutput(RGB_DI_PIN);
|
|
||||||
setPinOutput(RGB_CLK_PIN);
|
|
||||||
|
|
||||||
apa102_send_array((uint8_t *)ledarray, leds)
|
|
||||||
}
|
|
||||||
|
|
||||||
void apa102_send_array(uint8_t *data, uint16_t leds) { // Data is struct of 3 bytes. RGB - leds is number of leds in data
|
|
||||||
apa102_start_frame();
|
|
||||||
while (leds--) {
|
|
||||||
apa102_send_frame(0xFF000000 | (data->b << 16) | (data->g << 8) | data->r);
|
|
||||||
data++;
|
|
||||||
}
|
|
||||||
apa102_end_frame(leds);
|
|
||||||
}
|
|
||||||
|
|
||||||
void apa102_send_frame(uint32_t frame) {
|
|
||||||
for (uint32_t i = 0xFF; i > 0;) {
|
|
||||||
apa102_send_byte(frame & i);
|
|
||||||
i = i << 8;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void apa102_start_frame() { apa102_send_frame(0); }
|
|
||||||
|
|
||||||
void apa102_end_frame(uint16_t leds) {
|
|
||||||
// This function has been taken from: https://github.com/pololu/apa102-arduino/blob/master/APA102.h
|
|
||||||
// and adapted. The code is MIT licensed. I think thats compatible?
|
|
||||||
|
|
||||||
// We need to send some more bytes to ensure that all the LEDs in the
|
|
||||||
// chain see their new color and start displaying it.
|
|
||||||
//
|
|
||||||
// The data stream seen by the last LED in the chain will be delayed by
|
|
||||||
// (count - 1) clock edges, because each LED before it inverts the clock
|
|
||||||
// line and delays the data by one clock edge. Therefore, to make sure
|
|
||||||
// the last LED actually receives the data we wrote, the number of extra
|
|
||||||
// edges we send at the end of the frame must be at least (count - 1).
|
|
||||||
// For the APA102C, that is sufficient.
|
|
||||||
//
|
|
||||||
// The SK9822 only updates after it sees 32 zero bits followed by one more
|
|
||||||
// rising edge. To avoid having the update time depend on the color of
|
|
||||||
// the last LED, we send a dummy 0xFF byte. (Unfortunately, this means
|
|
||||||
// that partial updates of the beginning of an LED strip are not possible;
|
|
||||||
// the LED after the last one you are trying to update will be black.)
|
|
||||||
// After that, to ensure that the last LED in the chain sees 32 zero bits
|
|
||||||
// and a rising edge, we need to send at least 65 + (count - 1) edges. It
|
|
||||||
// is sufficent and simpler to just send (5 + count/16) bytes of zeros.
|
|
||||||
//
|
|
||||||
// We are ignoring the specification for the end frame in the APA102/SK9822
|
|
||||||
// datasheets because it does not actually ensure that all the LEDs will
|
|
||||||
// start displaying their new colors right away.
|
|
||||||
|
|
||||||
apa102_send_byte(0xFF);
|
|
||||||
for (uint16_t i = 0; i < 5 + leds / 16; i++) {
|
|
||||||
apa102_send_byte(0);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void apa102_send_byte(uint8_t byte) {
|
|
||||||
uint8_t i;
|
|
||||||
for (i = 0; i < 8; i++) {
|
|
||||||
writePin(RGB_DI_PIN, !!(byte & (1 << (7 - i))));
|
|
||||||
writePinHigh(RGB_CLK_PIN);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,5 +1,3 @@
|
|||||||
#ifndef LCD_H
|
|
||||||
#define LCD_H
|
|
||||||
/*************************************************************************
|
/*************************************************************************
|
||||||
Title : C include file for the HD44780U LCD library (lcd.c)
|
Title : C include file for the HD44780U LCD library (lcd.c)
|
||||||
Author: Peter Fleury <pfleury@gmx.ch> http://tinyurl.com/peterfleury
|
Author: Peter Fleury <pfleury@gmx.ch> http://tinyurl.com/peterfleury
|
||||||
@@ -43,6 +41,8 @@
|
|||||||
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#pragma once
|
||||||
|
|
||||||
#include <inttypes.h>
|
#include <inttypes.h>
|
||||||
#include <avr/pgmspace.h>
|
#include <avr/pgmspace.h>
|
||||||
|
|
||||||
@@ -346,5 +346,3 @@ extern void lcd_data(uint8_t data);
|
|||||||
#define lcd_puts_P(__s) lcd_puts_p(PSTR(__s))
|
#define lcd_puts_P(__s) lcd_puts_p(PSTR(__s))
|
||||||
|
|
||||||
/**@}*/
|
/**@}*/
|
||||||
|
|
||||||
#endif // LCD_H
|
|
||||||
|
|||||||
@@ -17,8 +17,7 @@
|
|||||||
* GitHub repository: https://github.com/g4lvanix/I2C-master-lib
|
* GitHub repository: https://github.com/g4lvanix/I2C-master-lib
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef I2C_MASTER_H
|
#pragma once
|
||||||
#define I2C_MASTER_H
|
|
||||||
|
|
||||||
#define I2C_READ 0x01
|
#define I2C_READ 0x01
|
||||||
#define I2C_WRITE 0x00
|
#define I2C_WRITE 0x00
|
||||||
@@ -42,5 +41,3 @@ i2c_status_t i2c_receive(uint8_t address, uint8_t* data, uint16_t length, uint16
|
|||||||
i2c_status_t i2c_writeReg(uint8_t devaddr, uint8_t regaddr, const uint8_t* data, uint16_t length, uint16_t timeout);
|
i2c_status_t i2c_writeReg(uint8_t devaddr, uint8_t regaddr, const uint8_t* data, uint16_t length, uint16_t timeout);
|
||||||
i2c_status_t i2c_readReg(uint8_t devaddr, uint8_t regaddr, uint8_t* data, uint16_t length, uint16_t timeout);
|
i2c_status_t i2c_readReg(uint8_t devaddr, uint8_t regaddr, uint8_t* data, uint16_t length, uint16_t timeout);
|
||||||
void i2c_stop(void);
|
void i2c_stop(void);
|
||||||
|
|
||||||
#endif // I2C_MASTER_H
|
|
||||||
|
|||||||
@@ -20,8 +20,7 @@
|
|||||||
Read or write to the necessary buffer according to the opperation.
|
Read or write to the necessary buffer according to the opperation.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef I2C_SLAVE_H
|
#pragma once
|
||||||
#define I2C_SLAVE_H
|
|
||||||
|
|
||||||
#define I2C_SLAVE_REG_COUNT 30
|
#define I2C_SLAVE_REG_COUNT 30
|
||||||
|
|
||||||
@@ -29,5 +28,3 @@ extern volatile uint8_t i2c_slave_reg[I2C_SLAVE_REG_COUNT];
|
|||||||
|
|
||||||
void i2c_slave_init(uint8_t address);
|
void i2c_slave_init(uint8_t address);
|
||||||
void i2c_slave_stop(void);
|
void i2c_slave_stop(void);
|
||||||
|
|
||||||
#endif // I2C_SLAVE_H
|
|
||||||
|
|||||||
@@ -20,50 +20,111 @@
|
|||||||
|
|
||||||
#ifdef SOFT_SERIAL_PIN
|
#ifdef SOFT_SERIAL_PIN
|
||||||
|
|
||||||
# ifdef __AVR_ATmega32U4__
|
# if !(defined(__AVR_AT90USB646__) || defined(__AVR_AT90USB647__) || defined(__AVR_AT90USB1286__) || defined(__AVR_AT90USB1287__) || defined(__AVR_ATmega16U2__) || defined(__AVR_ATmega32U2__) || defined(__AVR_ATmega16U4__) || defined(__AVR_ATmega32U4__))
|
||||||
// if using ATmega32U4 I2C, can not use PD0 and PD1 in soft serial.
|
# error serial.c is not supported for the currently selected MCU
|
||||||
# ifdef USE_AVR_I2C
|
# endif
|
||||||
# if SOFT_SERIAL_PIN == D0 || SOFT_SERIAL_PIN == D1
|
// if using ATmega32U4/2, AT90USBxxx I2C, can not use PD0 and PD1 in soft serial.
|
||||||
# error Using ATmega32U4 I2C, so can not use PD0, PD1
|
# if defined(__AVR_ATmega16U4__) || defined(__AVR_ATmega32U4__) || defined(__AVR_AT90USB646__) || defined(__AVR_AT90USB647__) || defined(__AVR_AT90USB1286__) || defined(__AVR_AT90USB1287__)
|
||||||
# endif
|
# if defined(USE_AVR_I2C) && (SOFT_SERIAL_PIN == D0 || SOFT_SERIAL_PIN == D1)
|
||||||
|
# error Using I2C, so can not use PD0, PD1
|
||||||
# endif
|
# endif
|
||||||
|
# endif
|
||||||
|
// PD0..PD3, common config
|
||||||
|
# if SOFT_SERIAL_PIN == D0
|
||||||
|
# define EIMSK_BIT _BV(INT0)
|
||||||
|
# define EICRx_BIT (~(_BV(ISC00) | _BV(ISC01)))
|
||||||
|
# define SERIAL_PIN_INTERRUPT INT0_vect
|
||||||
|
# define EICRx EICRA
|
||||||
|
# elif SOFT_SERIAL_PIN == D1
|
||||||
|
# define EIMSK_BIT _BV(INT1)
|
||||||
|
# define EICRx_BIT (~(_BV(ISC10) | _BV(ISC11)))
|
||||||
|
# define SERIAL_PIN_INTERRUPT INT1_vect
|
||||||
|
# define EICRx EICRA
|
||||||
|
# elif SOFT_SERIAL_PIN == D2
|
||||||
|
# define EIMSK_BIT _BV(INT2)
|
||||||
|
# define EICRx_BIT (~(_BV(ISC20) | _BV(ISC21)))
|
||||||
|
# define SERIAL_PIN_INTERRUPT INT2_vect
|
||||||
|
# define EICRx EICRA
|
||||||
|
# elif SOFT_SERIAL_PIN == D3
|
||||||
|
# define EIMSK_BIT _BV(INT3)
|
||||||
|
# define EICRx_BIT (~(_BV(ISC30) | _BV(ISC31)))
|
||||||
|
# define SERIAL_PIN_INTERRUPT INT3_vect
|
||||||
|
# define EICRx EICRA
|
||||||
|
# endif
|
||||||
|
|
||||||
# define setPinInputHigh(pin) (DDRx_ADDRESS(pin) &= ~_BV((pin)&0xF), PORTx_ADDRESS(pin) |= _BV((pin)&0xF))
|
// ATmegaxxU2 specific config
|
||||||
# define setPinOutput(pin) (DDRx_ADDRESS(pin) |= _BV((pin)&0xF))
|
# if defined(__AVR_ATmega16U2__) || defined(__AVR_ATmega32U2__)
|
||||||
# define writePinHigh(pin) (PORTx_ADDRESS(pin) |= _BV((pin)&0xF))
|
// PD4(INT5), PD6(INT6), PD7(INT7), PC7(INT4)
|
||||||
# define writePinLow(pin) (PORTx_ADDRESS(pin) &= ~_BV((pin)&0xF))
|
# if SOFT_SERIAL_PIN == D4
|
||||||
# define readPin(pin) ((bool)(PINx_ADDRESS(pin) & _BV((pin)&0xF)))
|
# define EIMSK_BIT _BV(INT5)
|
||||||
|
# define EICRx_BIT (~(_BV(ISC50) | _BV(ISC51)))
|
||||||
|
# define SERIAL_PIN_INTERRUPT INT5_vect
|
||||||
|
# define EICRx EICRB
|
||||||
|
# elif SOFT_SERIAL_PIN == D6
|
||||||
|
# define EIMSK_BIT _BV(INT6)
|
||||||
|
# define EICRx_BIT (~(_BV(ISC60) | _BV(ISC61)))
|
||||||
|
# define SERIAL_PIN_INTERRUPT INT6_vect
|
||||||
|
# define EICRx EICRB
|
||||||
|
# elif SOFT_SERIAL_PIN == D7
|
||||||
|
# define EIMSK_BIT _BV(INT7)
|
||||||
|
# define EICRx_BIT (~(_BV(ISC70) | _BV(ISC71)))
|
||||||
|
# define SERIAL_PIN_INTERRUPT INT7_vect
|
||||||
|
# define EICRx EICRB
|
||||||
|
# elif SOFT_SERIAL_PIN == C7
|
||||||
|
# define EIMSK_BIT _BV(INT4)
|
||||||
|
# define EICRx_BIT (~(_BV(ISC40) | _BV(ISC41)))
|
||||||
|
# define SERIAL_PIN_INTERRUPT INT4_vect
|
||||||
|
# define EICRx EICRB
|
||||||
|
# endif
|
||||||
|
# endif
|
||||||
|
|
||||||
# if SOFT_SERIAL_PIN >= D0 && SOFT_SERIAL_PIN <= D3
|
// ATmegaxxU4 specific config
|
||||||
# if SOFT_SERIAL_PIN == D0
|
# if defined(__AVR_ATmega16U4__) || defined(__AVR_ATmega32U4__)
|
||||||
# define EIMSK_BIT _BV(INT0)
|
// PE6(INT6)
|
||||||
# define EICRx_BIT (~(_BV(ISC00) | _BV(ISC01)))
|
# if SOFT_SERIAL_PIN == E6
|
||||||
# define SERIAL_PIN_INTERRUPT INT0_vect
|
# define EIMSK_BIT _BV(INT6)
|
||||||
# elif SOFT_SERIAL_PIN == D1
|
# define EICRx_BIT (~(_BV(ISC60) | _BV(ISC61)))
|
||||||
# define EIMSK_BIT _BV(INT1)
|
# define SERIAL_PIN_INTERRUPT INT6_vect
|
||||||
# define EICRx_BIT (~(_BV(ISC10) | _BV(ISC11)))
|
# define EICRx EICRB
|
||||||
# define SERIAL_PIN_INTERRUPT INT1_vect
|
# endif
|
||||||
# elif SOFT_SERIAL_PIN == D2
|
# endif
|
||||||
# define EIMSK_BIT _BV(INT2)
|
|
||||||
# define EICRx_BIT (~(_BV(ISC20) | _BV(ISC21)))
|
// AT90USBxxx specific config
|
||||||
# define SERIAL_PIN_INTERRUPT INT2_vect
|
# if defined(__AVR_AT90USB646__) || defined(__AVR_AT90USB647__) || defined(__AVR_AT90USB1286__) || defined(__AVR_AT90USB1287__)
|
||||||
# elif SOFT_SERIAL_PIN == D3
|
// PE4..PE7(INT4..INT7)
|
||||||
# define EIMSK_BIT _BV(INT3)
|
# if SOFT_SERIAL_PIN == E4
|
||||||
# define EICRx_BIT (~(_BV(ISC30) | _BV(ISC31)))
|
# define EIMSK_BIT _BV(INT4)
|
||||||
# define SERIAL_PIN_INTERRUPT INT3_vect
|
# define EICRx_BIT (~(_BV(ISC40) | _BV(ISC41)))
|
||||||
# endif
|
# define SERIAL_PIN_INTERRUPT INT4_vect
|
||||||
|
# define EICRx EICRB
|
||||||
|
# elif SOFT_SERIAL_PIN == E5
|
||||||
|
# define EIMSK_BIT _BV(INT5)
|
||||||
|
# define EICRx_BIT (~(_BV(ISC50) | _BV(ISC51)))
|
||||||
|
# define SERIAL_PIN_INTERRUPT INT5_vect
|
||||||
|
# define EICRx EICRB
|
||||||
# elif SOFT_SERIAL_PIN == E6
|
# elif SOFT_SERIAL_PIN == E6
|
||||||
# define EIMSK_BIT _BV(INT6)
|
# define EIMSK_BIT _BV(INT6)
|
||||||
# define EICRx_BIT (~(_BV(ISC60) | _BV(ISC61)))
|
# define EICRx_BIT (~(_BV(ISC60) | _BV(ISC61)))
|
||||||
# define SERIAL_PIN_INTERRUPT INT6_vect
|
# define SERIAL_PIN_INTERRUPT INT6_vect
|
||||||
# else
|
# define EICRx EICRB
|
||||||
# error invalid SOFT_SERIAL_PIN value
|
# elif SOFT_SERIAL_PIN == E7
|
||||||
|
# define EIMSK_BIT _BV(INT7)
|
||||||
|
# define EICRx_BIT (~(_BV(ISC70) | _BV(ISC71)))
|
||||||
|
# define SERIAL_PIN_INTERRUPT INT7_vect
|
||||||
|
# define EICRx EICRB
|
||||||
# endif
|
# endif
|
||||||
|
|
||||||
# else
|
|
||||||
# error serial.c now support ATmega32U4 only
|
|
||||||
# endif
|
# endif
|
||||||
|
|
||||||
|
# ifndef SERIAL_PIN_INTERRUPT
|
||||||
|
# error invalid SOFT_SERIAL_PIN value
|
||||||
|
# endif
|
||||||
|
|
||||||
|
# define setPinInputHigh(pin) (DDRx_ADDRESS(pin) &= ~_BV((pin)&0xF), PORTx_ADDRESS(pin) |= _BV((pin)&0xF))
|
||||||
|
# define setPinOutput(pin) (DDRx_ADDRESS(pin) |= _BV((pin)&0xF))
|
||||||
|
# define writePinHigh(pin) (PORTx_ADDRESS(pin) |= _BV((pin)&0xF))
|
||||||
|
# define writePinLow(pin) (PORTx_ADDRESS(pin) &= ~_BV((pin)&0xF))
|
||||||
|
# define readPin(pin) ((bool)(PINx_ADDRESS(pin) & _BV((pin)&0xF)))
|
||||||
|
|
||||||
# define ALWAYS_INLINE __attribute__((always_inline))
|
# define ALWAYS_INLINE __attribute__((always_inline))
|
||||||
# define NO_INLINE __attribute__((noinline))
|
# define NO_INLINE __attribute__((noinline))
|
||||||
# define _delay_sub_us(x) __builtin_avr_delay_cycles(x)
|
# define _delay_sub_us(x) __builtin_avr_delay_cycles(x)
|
||||||
@@ -210,15 +271,9 @@ void soft_serial_target_init(SSTD_t *sstd_table, int sstd_table_size) {
|
|||||||
Transaction_table_size = (uint8_t)sstd_table_size;
|
Transaction_table_size = (uint8_t)sstd_table_size;
|
||||||
serial_input_with_pullup();
|
serial_input_with_pullup();
|
||||||
|
|
||||||
// Enable INT0-INT3,INT6
|
// Enable INT0-INT7
|
||||||
EIMSK |= EIMSK_BIT;
|
EIMSK |= EIMSK_BIT;
|
||||||
# if SOFT_SERIAL_PIN == E6
|
EICRx &= EICRx_BIT;
|
||||||
// Trigger on falling edge of INT6
|
|
||||||
EICRB &= EICRx_BIT;
|
|
||||||
# else
|
|
||||||
// Trigger on falling edge of INT0-INT3
|
|
||||||
EICRA &= EICRx_BIT;
|
|
||||||
# endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Used by the sender to synchronize timing with the reciver.
|
// Used by the sender to synchronize timing with the reciver.
|
||||||
|
|||||||
@@ -140,27 +140,33 @@ spi_status_t spi_read() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
spi_status_t spi_transmit(const uint8_t *data, uint16_t length) {
|
spi_status_t spi_transmit(const uint8_t *data, uint16_t length) {
|
||||||
spi_status_t status = SPI_STATUS_ERROR;
|
spi_status_t status;
|
||||||
|
|
||||||
for (uint16_t i = 0; i < length; i++) {
|
for (uint16_t i = 0; i < length; i++) {
|
||||||
status = spi_write(data[i]);
|
status = spi_write(data[i]);
|
||||||
|
|
||||||
|
if (status < 0) {
|
||||||
|
return status;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return status;
|
return SPI_STATUS_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
spi_status_t spi_receive(uint8_t *data, uint16_t length) {
|
spi_status_t spi_receive(uint8_t *data, uint16_t length) {
|
||||||
spi_status_t status = SPI_STATUS_ERROR;
|
spi_status_t status;
|
||||||
|
|
||||||
for (uint16_t i = 0; i < length; i++) {
|
for (uint16_t i = 0; i < length; i++) {
|
||||||
status = spi_read();
|
status = spi_read();
|
||||||
|
|
||||||
if (status > 0) {
|
if (status >= 0) {
|
||||||
data[i] = status;
|
data[i] = status;
|
||||||
|
} else {
|
||||||
|
return status;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return (status < 0) ? status : SPI_STATUS_SUCCESS;
|
return SPI_STATUS_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
void spi_stop(void) {
|
void spi_stop(void) {
|
||||||
|
|||||||
@@ -1,5 +1,4 @@
|
|||||||
#ifndef SSD1306_H
|
#pragma once
|
||||||
#define SSD1306_H
|
|
||||||
|
|
||||||
#include <stdbool.h>
|
#include <stdbool.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
@@ -86,5 +85,3 @@ void matrix_write_char(struct CharacterMatrix *matrix, uint8_t c);
|
|||||||
void matrix_write(struct CharacterMatrix *matrix, const char *data);
|
void matrix_write(struct CharacterMatrix *matrix, const char *data);
|
||||||
void matrix_write_P(struct CharacterMatrix *matrix, const char *data);
|
void matrix_write_P(struct CharacterMatrix *matrix, const char *data);
|
||||||
void matrix_render(struct CharacterMatrix *matrix);
|
void matrix_render(struct CharacterMatrix *matrix);
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|||||||
@@ -16,7 +16,7 @@
|
|||||||
|
|
||||||
#include "quantum.h"
|
#include "quantum.h"
|
||||||
#include "analog.h"
|
#include "analog.h"
|
||||||
#include "ch.h"
|
#include <ch.h>
|
||||||
#include <hal.h>
|
#include <hal.h>
|
||||||
|
|
||||||
#if !HAL_USE_ADC
|
#if !HAL_USE_ADC
|
||||||
|
|||||||
@@ -58,18 +58,23 @@ static i2c_status_t chibios_to_qmk(const msg_t* status) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
__attribute__((weak)) void i2c_init(void) {
|
__attribute__((weak)) void i2c_init(void) {
|
||||||
// Try releasing special pins for a short time
|
static bool is_initialised = false;
|
||||||
palSetPadMode(I2C1_SCL_BANK, I2C1_SCL, PAL_MODE_INPUT);
|
if (!is_initialised) {
|
||||||
palSetPadMode(I2C1_SDA_BANK, I2C1_SDA, PAL_MODE_INPUT);
|
is_initialised = true;
|
||||||
|
|
||||||
chThdSleepMilliseconds(10);
|
// Try releasing special pins for a short time
|
||||||
|
palSetPadMode(I2C1_SCL_BANK, I2C1_SCL, PAL_MODE_INPUT);
|
||||||
|
palSetPadMode(I2C1_SDA_BANK, I2C1_SDA, PAL_MODE_INPUT);
|
||||||
|
|
||||||
|
chThdSleepMilliseconds(10);
|
||||||
#if defined(USE_GPIOV1)
|
#if defined(USE_GPIOV1)
|
||||||
palSetPadMode(I2C1_SCL_BANK, I2C1_SCL, I2C1_SCL_PAL_MODE);
|
palSetPadMode(I2C1_SCL_BANK, I2C1_SCL, I2C1_SCL_PAL_MODE);
|
||||||
palSetPadMode(I2C1_SDA_BANK, I2C1_SDA, I2C1_SDA_PAL_MODE);
|
palSetPadMode(I2C1_SDA_BANK, I2C1_SDA, I2C1_SDA_PAL_MODE);
|
||||||
#else
|
#else
|
||||||
palSetPadMode(I2C1_SCL_BANK, I2C1_SCL, PAL_MODE_ALTERNATE(I2C1_SCL_PAL_MODE) | PAL_STM32_OTYPE_OPENDRAIN);
|
palSetPadMode(I2C1_SCL_BANK, I2C1_SCL, PAL_MODE_ALTERNATE(I2C1_SCL_PAL_MODE) | PAL_STM32_OTYPE_OPENDRAIN);
|
||||||
palSetPadMode(I2C1_SDA_BANK, I2C1_SDA, PAL_MODE_ALTERNATE(I2C1_SDA_PAL_MODE) | PAL_STM32_OTYPE_OPENDRAIN);
|
palSetPadMode(I2C1_SDA_BANK, I2C1_SDA, PAL_MODE_ALTERNATE(I2C1_SDA_PAL_MODE) | PAL_STM32_OTYPE_OPENDRAIN);
|
||||||
#endif
|
#endif
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
i2c_status_t i2c_start(uint8_t address) {
|
i2c_status_t i2c_start(uint8_t address) {
|
||||||
|
|||||||
@@ -24,7 +24,7 @@
|
|||||||
*/
|
*/
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include "ch.h"
|
#include <ch.h>
|
||||||
#include <hal.h>
|
#include <hal.h>
|
||||||
|
|
||||||
#ifdef I2C1_BANK
|
#ifdef I2C1_BANK
|
||||||
|
|||||||
@@ -6,7 +6,7 @@
|
|||||||
#include "serial.h"
|
#include "serial.h"
|
||||||
#include "wait.h"
|
#include "wait.h"
|
||||||
|
|
||||||
#include "hal.h"
|
#include <hal.h>
|
||||||
|
|
||||||
// TODO: resolve/remove build warnings
|
// TODO: resolve/remove build warnings
|
||||||
#if defined(RGBLIGHT_ENABLE) && defined(RGBLED_SPLIT) && defined(PROTOCOL_CHIBIOS) && defined(WS2812_DRIVER_BITBANG)
|
#if defined(RGBLIGHT_ENABLE) && defined(RGBLED_SPLIT) && defined(PROTOCOL_CHIBIOS) && defined(WS2812_DRIVER_BITBANG)
|
||||||
|
|||||||
@@ -1,9 +1,9 @@
|
|||||||
#include "quantum.h"
|
#include "quantum.h"
|
||||||
#include "serial.h"
|
#include "serial.h"
|
||||||
#include "printf.h"
|
#include "print.h"
|
||||||
|
|
||||||
#include "ch.h"
|
#include <ch.h>
|
||||||
#include "hal.h"
|
#include <hal.h>
|
||||||
|
|
||||||
#ifndef USART_CR1_M0
|
#ifndef USART_CR1_M0
|
||||||
# define USART_CR1_M0 USART_CR1_M // some platforms (f1xx) dont have this so
|
# define USART_CR1_M0 USART_CR1_M // some platforms (f1xx) dont have this so
|
||||||
@@ -58,7 +58,10 @@
|
|||||||
# error invalid SELECT_SOFT_SERIAL_SPEED value
|
# error invalid SELECT_SOFT_SERIAL_SPEED value
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#define TIMEOUT 100
|
#ifndef SERIAL_USART_TIMEOUT
|
||||||
|
# define SERIAL_USART_TIMEOUT 100
|
||||||
|
#endif
|
||||||
|
|
||||||
#define HANDSHAKE_MAGIC 7
|
#define HANDSHAKE_MAGIC 7
|
||||||
|
|
||||||
static inline msg_t sdWriteHalfDuplex(SerialDriver* driver, uint8_t* data, uint8_t size) {
|
static inline msg_t sdWriteHalfDuplex(SerialDriver* driver, uint8_t* data, uint8_t size) {
|
||||||
@@ -201,21 +204,21 @@ int soft_serial_transaction(int index) {
|
|||||||
sdClear(&SERIAL_USART_DRIVER);
|
sdClear(&SERIAL_USART_DRIVER);
|
||||||
|
|
||||||
// First chunk is always transaction id
|
// First chunk is always transaction id
|
||||||
sdWriteTimeout(&SERIAL_USART_DRIVER, &sstd_index, sizeof(sstd_index), TIME_MS2I(TIMEOUT));
|
sdWriteTimeout(&SERIAL_USART_DRIVER, &sstd_index, sizeof(sstd_index), TIME_MS2I(SERIAL_USART_TIMEOUT));
|
||||||
|
|
||||||
uint8_t sstd_index_shake = 0xFF;
|
uint8_t sstd_index_shake = 0xFF;
|
||||||
|
|
||||||
// Which we always read back first so that we can error out correctly
|
// Which we always read back first so that we can error out correctly
|
||||||
// - due to the half duplex limitations on return codes, we always have to read *something*
|
// - due to the half duplex limitations on return codes, we always have to read *something*
|
||||||
// - without the read, write only transactions *always* succeed, even during the boot process where the slave is not ready
|
// - without the read, write only transactions *always* succeed, even during the boot process where the slave is not ready
|
||||||
res = sdReadTimeout(&SERIAL_USART_DRIVER, &sstd_index_shake, sizeof(sstd_index_shake), TIME_MS2I(TIMEOUT));
|
res = sdReadTimeout(&SERIAL_USART_DRIVER, &sstd_index_shake, sizeof(sstd_index_shake), TIME_MS2I(SERIAL_USART_TIMEOUT));
|
||||||
if (res < 0 || (sstd_index_shake != (sstd_index ^ HANDSHAKE_MAGIC))) {
|
if (res < 0 || (sstd_index_shake != (sstd_index ^ HANDSHAKE_MAGIC))) {
|
||||||
dprintf("serial::usart_shake NO_RESPONSE\n");
|
dprintf("serial::usart_shake NO_RESPONSE\n");
|
||||||
return TRANSACTION_NO_RESPONSE;
|
return TRANSACTION_NO_RESPONSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (trans->initiator2target_buffer_size) {
|
if (trans->initiator2target_buffer_size) {
|
||||||
res = sdWriteTimeout(&SERIAL_USART_DRIVER, trans->initiator2target_buffer, trans->initiator2target_buffer_size, TIME_MS2I(TIMEOUT));
|
res = sdWriteTimeout(&SERIAL_USART_DRIVER, trans->initiator2target_buffer, trans->initiator2target_buffer_size, TIME_MS2I(SERIAL_USART_TIMEOUT));
|
||||||
if (res < 0) {
|
if (res < 0) {
|
||||||
dprintf("serial::usart_transmit NO_RESPONSE\n");
|
dprintf("serial::usart_transmit NO_RESPONSE\n");
|
||||||
return TRANSACTION_NO_RESPONSE;
|
return TRANSACTION_NO_RESPONSE;
|
||||||
@@ -223,7 +226,7 @@ int soft_serial_transaction(int index) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (trans->target2initiator_buffer_size) {
|
if (trans->target2initiator_buffer_size) {
|
||||||
res = sdReadTimeout(&SERIAL_USART_DRIVER, trans->target2initiator_buffer, trans->target2initiator_buffer_size, TIME_MS2I(TIMEOUT));
|
res = sdReadTimeout(&SERIAL_USART_DRIVER, trans->target2initiator_buffer, trans->target2initiator_buffer_size, TIME_MS2I(SERIAL_USART_TIMEOUT));
|
||||||
if (res < 0) {
|
if (res < 0) {
|
||||||
dprintf("serial::usart_receive NO_RESPONSE\n");
|
dprintf("serial::usart_receive NO_RESPONSE\n");
|
||||||
return TRANSACTION_NO_RESPONSE;
|
return TRANSACTION_NO_RESPONSE;
|
||||||
|
|||||||
@@ -22,21 +22,26 @@ static pin_t currentSlavePin = NO_PIN;
|
|||||||
static SPIConfig spiConfig = {false, NULL, 0, 0, 0, 0};
|
static SPIConfig spiConfig = {false, NULL, 0, 0, 0, 0};
|
||||||
|
|
||||||
__attribute__((weak)) void spi_init(void) {
|
__attribute__((weak)) void spi_init(void) {
|
||||||
// Try releasing special pins for a short time
|
static bool is_initialised = false;
|
||||||
palSetPadMode(PAL_PORT(SPI_SCK_PIN), PAL_PAD(SPI_SCK_PIN), PAL_MODE_INPUT);
|
if (!is_initialised) {
|
||||||
palSetPadMode(PAL_PORT(SPI_MOSI_PIN), PAL_PAD(SPI_MOSI_PIN), PAL_MODE_INPUT);
|
is_initialised = true;
|
||||||
palSetPadMode(PAL_PORT(SPI_MISO_PIN), PAL_PAD(SPI_MISO_PIN), PAL_MODE_INPUT);
|
|
||||||
|
|
||||||
chThdSleepMilliseconds(10);
|
// Try releasing special pins for a short time
|
||||||
|
palSetPadMode(PAL_PORT(SPI_SCK_PIN), PAL_PAD(SPI_SCK_PIN), PAL_MODE_INPUT);
|
||||||
|
palSetPadMode(PAL_PORT(SPI_MOSI_PIN), PAL_PAD(SPI_MOSI_PIN), PAL_MODE_INPUT);
|
||||||
|
palSetPadMode(PAL_PORT(SPI_MISO_PIN), PAL_PAD(SPI_MISO_PIN), PAL_MODE_INPUT);
|
||||||
|
|
||||||
|
chThdSleepMilliseconds(10);
|
||||||
#if defined(USE_GPIOV1)
|
#if defined(USE_GPIOV1)
|
||||||
palSetPadMode(PAL_PORT(SPI_SCK_PIN), PAL_PAD(SPI_SCK_PIN), PAL_MODE_STM32_ALTERNATE_PUSHPULL);
|
palSetPadMode(PAL_PORT(SPI_SCK_PIN), PAL_PAD(SPI_SCK_PIN), PAL_MODE_STM32_ALTERNATE_PUSHPULL);
|
||||||
palSetPadMode(PAL_PORT(SPI_MOSI_PIN), PAL_PAD(SPI_MOSI_PIN), PAL_MODE_STM32_ALTERNATE_PUSHPULL);
|
palSetPadMode(PAL_PORT(SPI_MOSI_PIN), PAL_PAD(SPI_MOSI_PIN), PAL_MODE_STM32_ALTERNATE_PUSHPULL);
|
||||||
palSetPadMode(PAL_PORT(SPI_MISO_PIN), PAL_PAD(SPI_MISO_PIN), PAL_MODE_STM32_ALTERNATE_PUSHPULL);
|
palSetPadMode(PAL_PORT(SPI_MISO_PIN), PAL_PAD(SPI_MISO_PIN), PAL_MODE_STM32_ALTERNATE_PUSHPULL);
|
||||||
#else
|
#else
|
||||||
palSetPadMode(PAL_PORT(SPI_SCK_PIN), PAL_PAD(SPI_SCK_PIN), PAL_MODE_ALTERNATE(SPI_SCK_PAL_MODE) | PAL_STM32_OTYPE_PUSHPULL | PAL_STM32_OSPEED_HIGHEST);
|
palSetPadMode(PAL_PORT(SPI_SCK_PIN), PAL_PAD(SPI_SCK_PIN), PAL_MODE_ALTERNATE(SPI_SCK_PAL_MODE) | PAL_STM32_OTYPE_PUSHPULL | PAL_STM32_OSPEED_HIGHEST);
|
||||||
palSetPadMode(PAL_PORT(SPI_MOSI_PIN), PAL_PAD(SPI_MOSI_PIN), PAL_MODE_ALTERNATE(SPI_MOSI_PAL_MODE) | PAL_STM32_OTYPE_PUSHPULL | PAL_STM32_OSPEED_HIGHEST);
|
palSetPadMode(PAL_PORT(SPI_MOSI_PIN), PAL_PAD(SPI_MOSI_PIN), PAL_MODE_ALTERNATE(SPI_MOSI_PAL_MODE) | PAL_STM32_OTYPE_PUSHPULL | PAL_STM32_OSPEED_HIGHEST);
|
||||||
palSetPadMode(PAL_PORT(SPI_MISO_PIN), PAL_PAD(SPI_MISO_PIN), PAL_MODE_ALTERNATE(SPI_MISO_PAL_MODE) | PAL_STM32_OTYPE_PUSHPULL | PAL_STM32_OSPEED_HIGHEST);
|
palSetPadMode(PAL_PORT(SPI_MISO_PIN), PAL_PAD(SPI_MISO_PIN), PAL_MODE_ALTERNATE(SPI_MISO_PAL_MODE) | PAL_STM32_OTYPE_PUSHPULL | PAL_STM32_OSPEED_HIGHEST);
|
||||||
#endif
|
#endif
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
bool spi_start(pin_t slavePin, bool lsbFirst, uint8_t mode, uint16_t divisor) {
|
bool spi_start(pin_t slavePin, bool lsbFirst, uint8_t mode, uint16_t divisor) {
|
||||||
@@ -110,11 +115,17 @@ bool spi_start(pin_t slavePin, bool lsbFirst, uint8_t mode, uint16_t divisor) {
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
spi_status_t spi_write(uint8_t data) { return spi_transmit(&data, 1); }
|
spi_status_t spi_write(uint8_t data) {
|
||||||
|
uint8_t rxData;
|
||||||
|
spiExchange(&SPI_DRIVER, 1, &data, &rxData);
|
||||||
|
|
||||||
|
return rxData;
|
||||||
|
}
|
||||||
|
|
||||||
spi_status_t spi_read(void) {
|
spi_status_t spi_read(void) {
|
||||||
uint8_t data = 0;
|
uint8_t data = 0;
|
||||||
spi_receive(&data, 1);
|
spiReceive(&SPI_DRIVER, 1, &data);
|
||||||
|
|
||||||
return data;
|
return data;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -18,7 +18,7 @@
|
|||||||
|
|
||||||
#include <ch.h>
|
#include <ch.h>
|
||||||
#include <hal.h>
|
#include <hal.h>
|
||||||
#include <quantum.h>
|
#include "quantum.h"
|
||||||
|
|
||||||
#ifndef SPI_DRIVER
|
#ifndef SPI_DRIVER
|
||||||
# define SPI_DRIVER SPID2
|
# define SPI_DRIVER SPID2
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
#include "quantum.h"
|
#include "quantum.h"
|
||||||
#include "ws2812.h"
|
#include "ws2812.h"
|
||||||
#include "ch.h"
|
#include <ch.h>
|
||||||
#include "hal.h"
|
#include <hal.h>
|
||||||
|
|
||||||
/* Adapted from https://github.com/bigjosh/SimpleNeoPixelDemo/ */
|
/* Adapted from https://github.com/bigjosh/SimpleNeoPixelDemo/ */
|
||||||
|
|
||||||
@@ -89,9 +89,16 @@ void ws2812_setleds(LED_TYPE *ledarray, uint16_t leds) {
|
|||||||
|
|
||||||
for (uint8_t i = 0; i < leds; i++) {
|
for (uint8_t i = 0; i < leds; i++) {
|
||||||
// WS2812 protocol dictates grb order
|
// WS2812 protocol dictates grb order
|
||||||
|
#if (WS2812_BYTE_ORDER == WS2812_BYTE_ORDER_GRB)
|
||||||
sendByte(ledarray[i].g);
|
sendByte(ledarray[i].g);
|
||||||
sendByte(ledarray[i].r);
|
sendByte(ledarray[i].r);
|
||||||
sendByte(ledarray[i].b);
|
sendByte(ledarray[i].b);
|
||||||
|
#elif (WS2812_BYTE_ORDER == WS2812_BYTE_ORDER_RGB)
|
||||||
|
sendByte(ledarray[i].r);
|
||||||
|
sendByte(ledarray[i].g);
|
||||||
|
sendByte(ledarray[i].b);
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifdef RGBW
|
#ifdef RGBW
|
||||||
sendByte(ledarray[i].w);
|
sendByte(ledarray[i].w);
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
#include "ws2812.h"
|
#include "ws2812.h"
|
||||||
#include "quantum.h"
|
#include "quantum.h"
|
||||||
#include "hal.h"
|
#include <hal.h>
|
||||||
|
|
||||||
/* Adapted from https://github.com/joewa/WS2812-LED-Driver_ChibiOS/ */
|
/* Adapted from https://github.com/joewa/WS2812-LED-Driver_ChibiOS/ */
|
||||||
|
|
||||||
@@ -107,6 +107,7 @@
|
|||||||
*/
|
*/
|
||||||
#define WS2812_BIT(led, byte, bit) (24 * (led) + 8 * (byte) + (7 - (bit)))
|
#define WS2812_BIT(led, byte, bit) (24 * (led) + 8 * (byte) + (7 - (bit)))
|
||||||
|
|
||||||
|
#if (WS2812_BYTE_ORDER == WS2812_BYTE_ORDER_GRB)
|
||||||
/**
|
/**
|
||||||
* @brief Determine the index in @ref ws2812_frame_buffer "the frame buffer" of a given red bit
|
* @brief Determine the index in @ref ws2812_frame_buffer "the frame buffer" of a given red bit
|
||||||
*
|
*
|
||||||
@@ -117,7 +118,7 @@
|
|||||||
*
|
*
|
||||||
* @return The bit index
|
* @return The bit index
|
||||||
*/
|
*/
|
||||||
#define WS2812_RED_BIT(led, bit) WS2812_BIT((led), 1, (bit))
|
# define WS2812_RED_BIT(led, bit) WS2812_BIT((led), 1, (bit))
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Determine the index in @ref ws2812_frame_buffer "the frame buffer" of a given green bit
|
* @brief Determine the index in @ref ws2812_frame_buffer "the frame buffer" of a given green bit
|
||||||
@@ -129,7 +130,7 @@
|
|||||||
*
|
*
|
||||||
* @return The bit index
|
* @return The bit index
|
||||||
*/
|
*/
|
||||||
#define WS2812_GREEN_BIT(led, bit) WS2812_BIT((led), 0, (bit))
|
# define WS2812_GREEN_BIT(led, bit) WS2812_BIT((led), 0, (bit))
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Determine the index in @ref ws2812_frame_buffer "the frame buffer" of a given blue bit
|
* @brief Determine the index in @ref ws2812_frame_buffer "the frame buffer" of a given blue bit
|
||||||
@@ -141,7 +142,45 @@
|
|||||||
*
|
*
|
||||||
* @return The bit index
|
* @return The bit index
|
||||||
*/
|
*/
|
||||||
#define WS2812_BLUE_BIT(led, bit) WS2812_BIT((led), 2, (bit))
|
# define WS2812_BLUE_BIT(led, bit) WS2812_BIT((led), 2, (bit))
|
||||||
|
|
||||||
|
#elif (WS2812_BYTE_ORDER == WS2812_BYTE_ORDER_RGB)
|
||||||
|
/**
|
||||||
|
* @brief Determine the index in @ref ws2812_frame_buffer "the frame buffer" of a given red bit
|
||||||
|
*
|
||||||
|
* @note The red byte is the middle byte in the color packet
|
||||||
|
*
|
||||||
|
* @param[in] led: The led index [0, @ref RGBLED_NUM)
|
||||||
|
* @param[in] bit: The bit number [0, 7]
|
||||||
|
*
|
||||||
|
* @return The bit index
|
||||||
|
*/
|
||||||
|
# define WS2812_RED_BIT(led, bit) WS2812_BIT((led), 0, (bit))
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Determine the index in @ref ws2812_frame_buffer "the frame buffer" of a given green bit
|
||||||
|
*
|
||||||
|
* @note The red byte is the first byte in the color packet
|
||||||
|
*
|
||||||
|
* @param[in] led: The led index [0, @ref RGBLED_NUM)
|
||||||
|
* @param[in] bit: The bit number [0, 7]
|
||||||
|
*
|
||||||
|
* @return The bit index
|
||||||
|
*/
|
||||||
|
# define WS2812_GREEN_BIT(led, bit) WS2812_BIT((led), 1, (bit))
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Determine the index in @ref ws2812_frame_buffer "the frame buffer" of a given blue bit
|
||||||
|
*
|
||||||
|
* @note The red byte is the last byte in the color packet
|
||||||
|
*
|
||||||
|
* @param[in] led: The led index [0, @ref RGBLED_NUM)
|
||||||
|
* @param[in] bit: The bit index [0, 7]
|
||||||
|
*
|
||||||
|
* @return The bit index
|
||||||
|
*/
|
||||||
|
# define WS2812_BLUE_BIT(led, bit) WS2812_BIT((led), 2, (bit))
|
||||||
|
#endif
|
||||||
|
|
||||||
/* --- PRIVATE VARIABLES ---------------------------------------------------- */
|
/* --- PRIVATE VARIABLES ---------------------------------------------------- */
|
||||||
|
|
||||||
|
|||||||
@@ -62,9 +62,15 @@ static uint8_t get_protocol_eq(uint8_t data, int pos) {
|
|||||||
static void set_led_color_rgb(LED_TYPE color, int pos) {
|
static void set_led_color_rgb(LED_TYPE color, int pos) {
|
||||||
uint8_t* tx_start = &txbuf[PREAMBLE_SIZE];
|
uint8_t* tx_start = &txbuf[PREAMBLE_SIZE];
|
||||||
|
|
||||||
|
#if (WS2812_BYTE_ORDER == WS2812_BYTE_ORDER_GRB)
|
||||||
for (int j = 0; j < 4; j++) tx_start[BYTES_FOR_LED * pos + j] = get_protocol_eq(color.g, j);
|
for (int j = 0; j < 4; j++) tx_start[BYTES_FOR_LED * pos + j] = get_protocol_eq(color.g, j);
|
||||||
for (int j = 0; j < 4; j++) tx_start[BYTES_FOR_LED * pos + BYTES_FOR_LED_BYTE + j] = get_protocol_eq(color.r, j);
|
for (int j = 0; j < 4; j++) tx_start[BYTES_FOR_LED * pos + BYTES_FOR_LED_BYTE + j] = get_protocol_eq(color.r, j);
|
||||||
for (int j = 0; j < 4; j++) tx_start[BYTES_FOR_LED * pos + BYTES_FOR_LED_BYTE * 2 + j] = get_protocol_eq(color.b, j);
|
for (int j = 0; j < 4; j++) tx_start[BYTES_FOR_LED * pos + BYTES_FOR_LED_BYTE * 2 + j] = get_protocol_eq(color.b, j);
|
||||||
|
#elif (WS2812_BYTE_ORDER == WS2812_BYTE_ORDER_RGB)
|
||||||
|
for (int j = 0; j < 4; j++) tx_start[BYTES_FOR_LED * pos + j] = get_protocol_eq(color.r, j);
|
||||||
|
for (int j = 0; j < 4; j++) tx_start[BYTES_FOR_LED * pos + BYTES_FOR_LED_BYTE + j] = get_protocol_eq(color.g, j);
|
||||||
|
for (int j = 0; j < 4; j++) tx_start[BYTES_FOR_LED * pos + BYTES_FOR_LED_BYTE * 2 + j] = get_protocol_eq(color.b, j);
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
void ws2812_init(void) {
|
void ws2812_init(void) {
|
||||||
|
|||||||
@@ -42,14 +42,6 @@
|
|||||||
# include "debug.h"
|
# include "debug.h"
|
||||||
#endif // DEBUG_EEPROM_OUTPUT
|
#endif // DEBUG_EEPROM_OUTPUT
|
||||||
|
|
||||||
static inline void init_i2c_if_required(void) {
|
|
||||||
static int done = 0;
|
|
||||||
if (!done) {
|
|
||||||
i2c_init();
|
|
||||||
done = 1;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
static inline void fill_target_address(uint8_t *buffer, const void *addr) {
|
static inline void fill_target_address(uint8_t *buffer, const void *addr) {
|
||||||
uintptr_t p = (uintptr_t)addr;
|
uintptr_t p = (uintptr_t)addr;
|
||||||
for (int i = 0; i < EXTERNAL_EEPROM_ADDRESS_SIZE; ++i) {
|
for (int i = 0; i < EXTERNAL_EEPROM_ADDRESS_SIZE; ++i) {
|
||||||
@@ -58,7 +50,7 @@ static inline void fill_target_address(uint8_t *buffer, const void *addr) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void eeprom_driver_init(void) {}
|
void eeprom_driver_init(void) { i2c_init(); }
|
||||||
|
|
||||||
void eeprom_driver_erase(void) {
|
void eeprom_driver_erase(void) {
|
||||||
#if defined(CONSOLE_ENABLE) && defined(DEBUG_EEPROM_OUTPUT)
|
#if defined(CONSOLE_ENABLE) && defined(DEBUG_EEPROM_OUTPUT)
|
||||||
@@ -80,7 +72,6 @@ void eeprom_read_block(void *buf, const void *addr, size_t len) {
|
|||||||
uint8_t complete_packet[EXTERNAL_EEPROM_ADDRESS_SIZE];
|
uint8_t complete_packet[EXTERNAL_EEPROM_ADDRESS_SIZE];
|
||||||
fill_target_address(complete_packet, addr);
|
fill_target_address(complete_packet, addr);
|
||||||
|
|
||||||
init_i2c_if_required();
|
|
||||||
i2c_transmit(EXTERNAL_EEPROM_I2C_ADDRESS((uintptr_t)addr), complete_packet, EXTERNAL_EEPROM_ADDRESS_SIZE, 100);
|
i2c_transmit(EXTERNAL_EEPROM_I2C_ADDRESS((uintptr_t)addr), complete_packet, EXTERNAL_EEPROM_ADDRESS_SIZE, 100);
|
||||||
i2c_receive(EXTERNAL_EEPROM_I2C_ADDRESS((uintptr_t)addr), buf, len, 100);
|
i2c_receive(EXTERNAL_EEPROM_I2C_ADDRESS((uintptr_t)addr), buf, len, 100);
|
||||||
|
|
||||||
@@ -98,7 +89,6 @@ void eeprom_write_block(const void *buf, void *addr, size_t len) {
|
|||||||
uint8_t * read_buf = (uint8_t *)buf;
|
uint8_t * read_buf = (uint8_t *)buf;
|
||||||
uintptr_t target_addr = (uintptr_t)addr;
|
uintptr_t target_addr = (uintptr_t)addr;
|
||||||
|
|
||||||
init_i2c_if_required();
|
|
||||||
while (len > 0) {
|
while (len > 0) {
|
||||||
uintptr_t page_offset = target_addr % EXTERNAL_EEPROM_PAGE_SIZE;
|
uintptr_t page_offset = target_addr % EXTERNAL_EEPROM_PAGE_SIZE;
|
||||||
int write_length = EXTERNAL_EEPROM_PAGE_SIZE - page_offset;
|
int write_length = EXTERNAL_EEPROM_PAGE_SIZE - page_offset;
|
||||||
|
|||||||
@@ -49,6 +49,11 @@
|
|||||||
# define EXTERNAL_EEPROM_PAGE_SIZE 64
|
# define EXTERNAL_EEPROM_PAGE_SIZE 64
|
||||||
# define EXTERNAL_EEPROM_ADDRESS_SIZE 2
|
# define EXTERNAL_EEPROM_ADDRESS_SIZE 2
|
||||||
# define EXTERNAL_EEPROM_WRITE_TIME 5
|
# define EXTERNAL_EEPROM_WRITE_TIME 5
|
||||||
|
#elif defined(EEPROM_I2C_24LC64)
|
||||||
|
# define EXTERNAL_EEPROM_BYTE_COUNT 8192
|
||||||
|
# define EXTERNAL_EEPROM_PAGE_SIZE 32
|
||||||
|
# define EXTERNAL_EEPROM_ADDRESS_SIZE 2
|
||||||
|
# define EXTERNAL_EEPROM_WRITE_TIME 5
|
||||||
#elif defined(EEPROM_I2C_MB85RC256V)
|
#elif defined(EEPROM_I2C_MB85RC256V)
|
||||||
# define EXTERNAL_EEPROM_BYTE_COUNT 32768
|
# define EXTERNAL_EEPROM_BYTE_COUNT 32768
|
||||||
# define EXTERNAL_EEPROM_PAGE_SIZE 128
|
# define EXTERNAL_EEPROM_PAGE_SIZE 128
|
||||||
|
|||||||
@@ -55,14 +55,6 @@
|
|||||||
# include "debug.h"
|
# include "debug.h"
|
||||||
#endif // CONSOLE_ENABLE
|
#endif // CONSOLE_ENABLE
|
||||||
|
|
||||||
static void init_spi_if_required(void) {
|
|
||||||
static int done = 0;
|
|
||||||
if (!done) {
|
|
||||||
spi_init();
|
|
||||||
done = 1;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
static bool spi_eeprom_start(void) { return spi_start(EXTERNAL_EEPROM_SPI_SLAVE_SELECT_PIN, EXTERNAL_EEPROM_SPI_LSBFIRST, EXTERNAL_EEPROM_SPI_MODE, EXTERNAL_EEPROM_SPI_CLOCK_DIVISOR); }
|
static bool spi_eeprom_start(void) { return spi_start(EXTERNAL_EEPROM_SPI_SLAVE_SELECT_PIN, EXTERNAL_EEPROM_SPI_LSBFIRST, EXTERNAL_EEPROM_SPI_MODE, EXTERNAL_EEPROM_SPI_CLOCK_DIVISOR); }
|
||||||
|
|
||||||
static spi_status_t spi_eeprom_wait_while_busy(int timeout) {
|
static spi_status_t spi_eeprom_wait_while_busy(int timeout) {
|
||||||
@@ -91,7 +83,7 @@ static void spi_eeprom_transmit_address(uintptr_t addr) {
|
|||||||
|
|
||||||
//----------------------------------------------------------------------------------------------------------------------
|
//----------------------------------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
void eeprom_driver_init(void) {}
|
void eeprom_driver_init(void) { spi_init(); }
|
||||||
|
|
||||||
void eeprom_driver_erase(void) {
|
void eeprom_driver_erase(void) {
|
||||||
#if defined(CONSOLE_ENABLE) && defined(DEBUG_EEPROM_OUTPUT)
|
#if defined(CONSOLE_ENABLE) && defined(DEBUG_EEPROM_OUTPUT)
|
||||||
@@ -110,8 +102,6 @@ void eeprom_driver_erase(void) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void eeprom_read_block(void *buf, const void *addr, size_t len) {
|
void eeprom_read_block(void *buf, const void *addr, size_t len) {
|
||||||
init_spi_if_required();
|
|
||||||
|
|
||||||
//-------------------------------------------------
|
//-------------------------------------------------
|
||||||
// Wait for the write-in-progress bit to be cleared
|
// Wait for the write-in-progress bit to be cleared
|
||||||
bool res = spi_eeprom_start();
|
bool res = spi_eeprom_start();
|
||||||
@@ -154,8 +144,6 @@ void eeprom_read_block(void *buf, const void *addr, size_t len) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void eeprom_write_block(const void *buf, void *addr, size_t len) {
|
void eeprom_write_block(const void *buf, void *addr, size_t len) {
|
||||||
init_spi_if_required();
|
|
||||||
|
|
||||||
bool res;
|
bool res;
|
||||||
uint8_t * read_buf = (uint8_t *)buf;
|
uint8_t * read_buf = (uint8_t *)buf;
|
||||||
uintptr_t target_addr = (uintptr_t)addr;
|
uintptr_t target_addr = (uintptr_t)addr;
|
||||||
|
|||||||
@@ -17,7 +17,7 @@
|
|||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
|
||||||
#include "hal.h"
|
#include <hal.h>
|
||||||
#include "eeprom_driver.h"
|
#include "eeprom_driver.h"
|
||||||
#include "eeprom_stm32_L0_L1.h"
|
#include "eeprom_stm32_L0_L1.h"
|
||||||
|
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user