Compare commits

..

8 Commits

Author SHA1 Message Date
Zach White e293bf243d refactor doctor.py into a directory 2021-06-21 22:48:20 -07:00
Zach White 286acfe7fd move all our file formatters to the format dir 2021-06-21 22:24:34 -07:00
Zach White 6d20b28354 make our schema validation more compact and flexible 2021-06-21 12:30:26 -07:00
Zach White 846da06380 cleanup 2021-06-21 09:58:11 -07:00
Zach White 243fc17e41 make flake8 happy 2021-06-20 12:27:51 -07:00
Zach White f394f23ac6 fix formatting after vscode broke it 2021-06-20 11:57:37 -07:00
Zach White 0ca53fa307 optimize our jsonschema using refs 2021-06-20 11:52:57 -07:00
Zach White 8c361d6c41 fix some broken info.json files 2021-06-20 11:52:57 -07:00
19936 changed files with 262294 additions and 587132 deletions
-4
View File
@@ -5,9 +5,6 @@ AlignConsecutiveAssignments: 'true'
AlignConsecutiveDeclarations: 'true' AlignConsecutiveDeclarations: 'true'
AlignOperands: 'true' AlignOperands: 'true'
AllowAllParametersOfDeclarationOnNextLine: 'false' AllowAllParametersOfDeclarationOnNextLine: 'false'
AllowShortCaseLabelsOnASingleLine: 'false'
AllowShortFunctionsOnASingleLine: Empty
AllowShortLoopsOnASingleLine: 'false'
AlwaysBreakAfterDefinitionReturnType: None AlwaysBreakAfterDefinitionReturnType: None
AlwaysBreakAfterReturnType: None AlwaysBreakAfterReturnType: None
AlwaysBreakBeforeMultilineStrings: 'false' AlwaysBreakBeforeMultilineStrings: 'false'
@@ -23,7 +20,6 @@ SortIncludes: 'false'
SpaceBeforeAssignmentOperators: 'true' SpaceBeforeAssignmentOperators: 'true'
SpaceBeforeParens: ControlStatements SpaceBeforeParens: ControlStatements
SpaceInEmptyParentheses: 'false' SpaceInEmptyParentheses: 'false'
SpacesBeforeTrailingComments: 1
TabWidth: '4' TabWidth: '4'
UseTab: Never UseTab: Never
+56 -57
View File
@@ -2,70 +2,69 @@
* text=auto * text=auto
# sources # sources
*.c text eol=lf *.c text
*.cc text eol=lf *.cc text
*.cxx text eol=lf *.cxx text
*.cpp text eol=lf *.cpp text
*.c++ text eol=lf *.c++ text
*.hpp text eol=lf *.hpp text
*.h text eol=lf *.h text
*.h++ text eol=lf *.h++ text
*.hh text eol=lf *.hh text
*.bat text eol=crlf *.bat text
*.cmd text eol=crlf *.coffee text
*.coffee text eol=lf *.css text
*.css text eol=lf *.htm text
*.htm text eol=lf *.html text
*.html text eol=lf *.inc text
*.inc text eol=lf *.ini text
*.ini text eol=crlf *.js text
*.js text eol=lf *.jsx text
*.jsx text eol=lf *.json text
*.json text eol=lf *.less text
*.less text eol=lf *.php text
*.php text eol=lf *.pl text
*.pl text eol=lf *.py text
*.py text eol=lf *.rb text
*.rb text eol=lf *.sass text
*.sass text eol=lf *.scm text
*.scm text eol=lf *.scss text
*.scss text eol=lf *.sh text
*.sh text eol=lf *.sql text
*.sql text eol=lf *.styl text
*.styl text eol=lf *.ts text
*.ts text eol=lf *.xml text
*.xml text eol=lf *.xhtml text
*.xhtml text eol=lf
# make files (need to always use lf for compatibility with Windows 10 bash) # make files (need to always use lf for compatibility with Windows 10 bash)
Makefile eol=lf Makefile eol=lf
*.mk eol=lf *.mk eol=lf
# make files (need to always use lf for compatibility with Windows 10 bash) # make files (need to always use lf for compatibility with Windows 10 bash)
*.sh eol=lf *.sh eol=lf
# documentation # documentation
*.markdown text eol=lf *.markdown text
*.md text eol=lf *.md text
*.mdwn text eol=lf *.mdwn text
*.mdown text eol=lf *.mdown text
*.mkd text eol=lf *.mkd text
*.mkdn text eol=lf *.mkdn text
*.mdtxt text eol=lf *.mdtxt text
*.mdtext text eol=lf *.mdtext text
*.txt text eol=lf *.txt text
AUTHORS text eol=lf AUTHORS text
CHANGELOG text eol=lf CHANGELOG text
CHANGES text eol=lf CHANGES text
CONTRIBUTING text eol=lf CONTRIBUTING text
COPYING text eol=lf COPYING text
INSTALL text eol=lf INSTALL text
license text eol=lf license text
LICENSE text eol=lf LICENSE text
NEWS text eol=lf NEWS text
readme text eol=lf readme text
*README* text eol=lf *README* text
TODO text eol=lf TODO text
GRAPHICS GRAPHICS
*.ai binary *.ai binary
@@ -83,7 +82,7 @@ GRAPHICS
*.png binary *.png binary
*.psb binary *.psb binary
*.psd binary *.psd binary
*.svg text eol=lf *.svg text
*.svgz binary *.svgz binary
*.tif binary *.tif binary
*.tiff binary *.tiff binary
+1
View File
@@ -22,6 +22,7 @@ keymap:
via: via:
- keyboards/**/keymaps/via/* - keyboards/**/keymaps/via/*
cli: cli:
- bin/qmk
- requirements.txt - requirements.txt
- lib/python/**/* - lib/python/**/*
python: python:
+1 -2
View File
@@ -7,12 +7,11 @@ on:
paths: paths:
- 'keyboards/**' - 'keyboards/**'
- 'layouts/community/**' - 'layouts/community/**'
workflow_dispatch:
jobs: jobs:
api_data: api_data:
runs-on: ubuntu-latest runs-on: ubuntu-latest
container: qmkfm/qmk_cli container: qmkfm/base_container
# protect against those who develop with their fork on master # protect against those who develop with their fork on master
if: github.repository == 'qmk/qmk_firmware' if: github.repository == 'qmk/qmk_firmware'
+4 -3
View File
@@ -4,10 +4,11 @@ on:
push: push:
branches: branches:
- master - master
- develop - future
pull_request: pull_request:
paths: paths:
- 'lib/python/**' - 'lib/python/**'
- 'bin/qmk'
- 'requirements.txt' - 'requirements.txt'
- '.github/workflows/cli.yml' - '.github/workflows/cli.yml'
@@ -15,7 +16,7 @@ jobs:
test: test:
runs-on: ubuntu-latest runs-on: ubuntu-latest
container: qmkfm/qmk_cli container: qmkfm/base_container
steps: steps:
- uses: actions/checkout@v2 - uses: actions/checkout@v2
@@ -24,4 +25,4 @@ jobs:
- name: Install dependencies - name: Install dependencies
run: pip3 install -r requirements-dev.txt run: pip3 install -r requirements-dev.txt
- name: Run tests - name: Run tests
run: qmk pytest run: bin/qmk pytest
+1 -2
View File
@@ -7,12 +7,11 @@ on:
paths: paths:
- 'keyboards/**' - 'keyboards/**'
- 'layouts/community/**' - 'layouts/community/**'
workflow_dispatch:
jobs: jobs:
api_data: api_data:
runs-on: ubuntu-latest runs-on: ubuntu-latest
container: qmkfm/qmk_cli container: qmkfm/base_container
# protect against those who work in their fork on develop # protect against those who work in their fork on develop
if: github.repository == 'qmk/qmk_firmware' if: github.repository == 'qmk/qmk_firmware'
+1 -1
View File
@@ -14,7 +14,7 @@ on:
jobs: jobs:
generate: generate:
runs-on: ubuntu-latest runs-on: ubuntu-latest
container: qmkfm/qmk_cli container: qmkfm/base_container
# protect against those who develop with their fork on master # protect against those who develop with their fork on master
if: github.repository == 'qmk/qmk_firmware' if: github.repository == 'qmk/qmk_firmware'
+9 -18
View File
@@ -16,36 +16,27 @@ jobs:
lint: lint:
runs-on: ubuntu-latest runs-on: ubuntu-latest
container: qmkfm/qmk_cli container: qmkfm/base_container
steps: steps:
- uses: rlespinasse/github-slug-action@v3.x
- uses: actions/checkout@v2 - uses: actions/checkout@v2
with: with:
fetch-depth: 0 fetch-depth: 0
- name: Install dependencies
run: |
pip3 install -r requirements-dev.txt
- uses: trilom/file-changes-action@v1.2.4 - uses: trilom/file-changes-action@v1.2.4
id: file_changes id: file_changes
with: with:
output: ' ' output: ' '
fileOutput: ' ' fileOutput: ' '
- name: Run qmk formatters - name: Run qmk cformat and qmk pyformat
shell: 'bash {0}' shell: 'bash {0}'
run: | run: |
cat ~/files_added.txt ~/files_modified.txt > ~/files_changed.txt qmk cformat --core-only -n $(< ~/files.txt)
qmk format-c --core-only $(< ~/files_changed.txt) || true cformat_exit=$?
qmk format-python $(< ~/files_changed.txt) || true qmk pyformat -n
qmk format-text $(< ~/files_changed.txt) || true pyformat_exit=$?
- name: Fail when formatting required exit $((cformat_exit + pyformat_exit))
run: |
git diff
for file in $(git diff --name-only); do
echo "File '${file}' Requires Formatting"
echo "::error file=${file}::Requires Formatting"
done
test -z "$(git diff --name-only)"
-49
View File
@@ -1,49 +0,0 @@
name: Lint Format
on:
push:
branches:
- master
- develop
jobs:
lint:
runs-on: ubuntu-latest
container: qmkfm/qmk_cli
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Install dependencies
run: |
pip3 install -r requirements-dev.txt
- name: Run qmk formatters
shell: 'bash {0}'
run: |
qmk format-c -a
qmk format-python -a
qmk format-text -a
git diff
- uses: rlespinasse/github-slug-action@v3.x
- name: Become QMK Bot
run: |
git config user.name 'QMK Bot'
git config user.email 'hello@qmk.fm'
- name: Create Pull Request
uses: peter-evans/create-pull-request@v3
if: ${{ github.repository == 'qmk/qmk_firmware'}}
with:
token: ${{ secrets.QMK_BOT_TOKEN }}
delete-branch: true
branch: bugfix/format_${{ env.GITHUB_REF_SLUG }}
author: QMK Bot <hello@qmk.fm>
committer: QMK Bot <hello@qmk.fm>
commit-message: Format code according to conventions
title: '[CI] Format code according to conventions'
+1 -1
View File
@@ -9,7 +9,7 @@ jobs:
lint: lint:
runs-on: ubuntu-latest runs-on: ubuntu-latest
container: qmkfm/qmk_cli container: qmkfm/base_container
steps: steps:
- uses: actions/checkout@v2 - uses: actions/checkout@v2
-30
View File
@@ -1,30 +0,0 @@
name: Unit Tests
on:
push:
branches:
- master
- develop
pull_request:
paths:
- 'builddefs/**'
- 'quantum/**'
- 'platforms/**'
- 'tmk_core/**'
- 'tests/**'
- '*.mk'
- 'Makefile'
- '.github/workflows/unit_test.yml'
jobs:
test:
runs-on: ubuntu-latest
container: qmkfm/base_container
steps:
- uses: actions/checkout@v2
with:
submodules: recursive
- name: Run tests
run: make test:all
+40 -51
View File
@@ -1,32 +1,36 @@
# Junk files .history/
*.bak .dep
*.swp *.o
*~ *.bin
.DS_Store *.eep
._*
# Build artifacts
.clang_complete
.build/
*.elf *.elf
*.hex
*.uf2
*.qmk
!util/bootloader.hex
!quantum/tools/eeprom_reset.hex
*.log *.log
*.lss *.lss
*.lst *.lst
*.map *.map
*.o
*.stackdump
*.sym *.sym
*.swp
# QMK-specific tags
*~
api_data/v1 api_data/v1
build/
.build/
*.bak
.vagrant/
quantum/version.h quantum/version.h
*.bin .idea/
*.eep CMakeLists.txt
*.hex cmake-build-debug
*.qmk .clang_complete
*.uf2 doxygen/
.DS_Store
# Old-style QMK Makefiles /util/wsl_downloaded
/util/win_downloaded
/keyboards/*/Makefile /keyboards/*/Makefile
/keyboards/*/*/Makefile /keyboards/*/*/Makefile
/keyboards/*/*/*/Makefile /keyboards/*/*/*/Makefile
@@ -39,55 +43,40 @@ quantum/version.h
/keyboards/*/*/*/*/*/keymaps/Makefile /keyboards/*/*/*/*/*/keymaps/Makefile
# Eclipse/PyCharm/Other IDE Settings # Eclipse/PyCharm/Other IDE Settings
*.iml
.browse.VC.db*
.cproject .cproject
.idea
.idea/
.project .project
.settings/ .settings/
.vagrant/ .idea
*.iml
# ? .browse.VC.db*
.dep *.stackdump
.history/
build/
cmake-build-debug
CMakeLists.txt
# Let these ones be user specific, since we have so many different configurations # Let these ones be user specific, since we have so many different configurations
*.code-workspace *.code-workspace
.stfolder
.tags
.vscode/c_cpp_properties.json .vscode/c_cpp_properties.json
.vscode/ipch/
.vscode/last.sql
.vscode/launch.json .vscode/launch.json
.vscode/tasks.json .vscode/tasks.json
.vscode/last.sql
.vscode/temp.sql .vscode/temp.sql
tags .vscode/ipch/
.stfolder
.tags
# Ignore image files # ignore image files
*.png
*.gif *.gif
*.jpg *.jpg
*.png
# Things Travis sees # things travis sees
/.vs
id_rsa_*
secrets.tar secrets.tar
id_rsa_*
/.vs
# Python things # python things
__pycache__ __pycache__
.python-version .python-version
# Prerequisites for updating ChibiOS # prerequisites for updating ChibiOS
/util/fmpp* /util/fmpp*
# Allow to exist but don't include it in the repo # Allow to exist but don't include it in the repo
user_song_list.h user_song_list.h
# clangd
compile_commands.json
.clangd/
.cache/
+4
View File
@@ -6,6 +6,10 @@
path = lib/chibios-contrib path = lib/chibios-contrib
url = https://github.com/qmk/ChibiOS-Contrib url = https://github.com/qmk/ChibiOS-Contrib
branch = master branch = master
[submodule "lib/ugfx"]
path = lib/ugfx
url = https://github.com/qmk/uGFX
branch = master
[submodule "lib/googletest"] [submodule "lib/googletest"]
path = lib/googletest path = lib/googletest
url = https://github.com/qmk/googletest url = https://github.com/qmk/googletest
+38
View File
@@ -0,0 +1,38 @@
os: linux
dist: trusty
group: edge
language: c
branches:
except:
- /^.*-automated-build$/
- /^[0-9]+\.[0-9]+\.[0-9]+/
env:
global:
- secure: vBTSL34BDPxDilKUuTXqU4CJ26Pv5hogD2nghatkxSQkI1/jbdnLj/DQdPUrMJFDIY6TK3AltsBx72MaMsLQ1JO/Ou24IeHINHXzUC1FlS9yQa48cpxnhX5kzXNyGs3oa0qaFbvnr7RgYRWtmD52n4bIZuSuW+xpBv05x2OCizdT2ZonH33nATaHGFasxROm4qYZ241VfzcUv766V6RVHgL4x9V08warugs+RENVkfzxxwhk3NmkrISabze0gSVJLHBPHxroZC6EUcf/ocobcuDrCwFqtEt90i7pNIAFUE7gZsN2uE75LmpzAWin21G7lLPcPL2k4FJVd8an1HiP2WmscJU6U89fOfMb2viObnKcCzebozBCmKGtHEuXZo9FcReOx49AnQSpmESJGs+q2dL/FApkTjQiyT4J6O5dJpoww0/r57Wx0cmmqjETKBb5rSgXM51Etk3wO09mvcPHsEwrT7qH8r9XWdyCDoEn7FCLX3/LYnf/D4SmZ633YPl5gv3v9XEwxR5+04akjgnvWDSNIaDbWBdxHNb7l4pMc+WR1bwCyMyA7KXj0RrftEGOrm9ZRLe6BkbT4cycA+j77nbPOMcyZChliV9pPQos+4TOJoTzcK2L8yWVoY409aDNVuAjdP6Yum0R2maBGl/etLmIMpJC35C5/lZ+dUNjJAM=
- MAKEFLAGS="-j3 --output-sync"
services:
- docker
addons:
apt:
sources:
- ubuntu-toolchain-r-test
- llvm-toolchain-trusty-7
packages:
- diffutils
- clang-format-7
- libstdc++-7-dev
script:
- git fetch --depth=50 origin $TRAVIS_BRANCH:$TRAVIS_BRANCH
- git rev-parse --short HEAD
- git diff --name-only HEAD $TRAVIS_BRANCH
- bash util/travis_test.sh
- bash util/travis_build.sh
after_script:
bash util/travis_compiled_push.sh
notifications:
webhooks:
urls:
- https://webhooks.gitter.im/e/afce403d65f143dfac09
on_success: always # options: [always|never|change] default: always
on_failure: always # options: [always|never|change] default: always
on_start: never # options: [always|never|change] default: always
+2 -1
View File
@@ -5,6 +5,7 @@
"xaver.clang-format", "xaver.clang-format",
"ms-vscode.cpptools", "ms-vscode.cpptools",
"bierner.github-markdown-preview", "bierner.github-markdown-preview",
"donjayamanne.git-extension-pack" "donjayamanne.git-extension-pack",
"CoenraadS.bracket-pair-colorizer-2"
] ]
} }
+1 -4
View File
@@ -23,8 +23,5 @@
"editor.trimAutoWhitespace": false, "editor.trimAutoWhitespace": false,
"files.trimTrailingWhitespace": false "files.trimTrailingWhitespace": false
}, },
"python.formatting.provider": "yapf", "python.formatting.provider": "yapf"
"[json]": {
"editor.formatOnSave": false
}
} }
+24
View File
@@ -0,0 +1,24 @@
# Code Of Conduct
QMK strives to be an inclusive, tolerant, and welcoming community. We encourage participation from anyone regardless of age, disability, ethnicity, gender identity and expression, level of experience, nationality, personal appearance, political belief, race, religion, or sexual identity and orientation.
> “A gentle word turns away wrath, but a harsh word stirs up anger."
Our users, contributors, and collaborators are expected to treat each other with kindness and respect, to assume good intentions, and to gently correct, where possible, rather than react with escalation. While our goal is to be as accurate as possible, kindness and understanding are more valuable than correctness. Some examples of behavior we will not tolerate include, but is not limited to:
* The use of sexualized language or imagery
* Unwelcome advances, sexual or otherwise
* Deliberate intimidation, stalking, or following
* Insults or derogatory comments, or personal or political attacks
* Publishing others private information without explicit permission
* Sustained disruption of talks or other events
* Other conduct which could reasonably be considered inappropriate in a professional setting
* Advocating for, or encouraging, any of the above behaviour
# Reporting
If someone is violating this Code of Conduct, please email hello@qmk.fm or reach out to one of the Collaborators to bring it to our attention. All complaints will be reviewed and investigated.
QMK will seek to use the least punitive means available to resolve an issue. If the circumstances require asking an offender to leave, we will do that.
Reports will be taken and kept in strict confidence. You will not be required to confront an offender directly.
+3 -2
View File
@@ -1,6 +1,7 @@
FROM qmkfm/qmk_cli FROM qmkfm/base_container
VOLUME /qmk_firmware VOLUME /qmk_firmware
WORKDIR /qmk_firmware WORKDIR /qmk_firmware
COPY . .
CMD qmk compile -kb all -km default CMD make all:default
+3 -3
View File
@@ -21,7 +21,7 @@ DOXYFILE_ENCODING = UTF-8
PROJECT_NAME = "QMK Firmware" PROJECT_NAME = "QMK Firmware"
PROJECT_NUMBER = https://github.com/qmk/qmk_firmware PROJECT_NUMBER = https://github.com/qmk/qmk_firmware
PROJECT_BRIEF = "Keyboard controller firmware for Atmel AVR and ARM USB families" PROJECT_BRIEF = "Keyboard controller firmware for Atmel AVR and ARM USB families"
OUTPUT_DIRECTORY = .build/doxygen OUTPUT_DIRECTORY = doxygen
ALLOW_UNICODE_NAMES = NO ALLOW_UNICODE_NAMES = NO
OUTPUT_LANGUAGE = English OUTPUT_LANGUAGE = English
BRIEF_MEMBER_DESC = YES BRIEF_MEMBER_DESC = YES
@@ -145,7 +145,7 @@ FILE_PATTERNS = *.c \
RECURSIVE = YES RECURSIVE = YES
EXCLUDE = EXCLUDE =
EXCLUDE_SYMLINKS = NO EXCLUDE_SYMLINKS = NO
EXCLUDE_PATTERNS = */protocol/arm_atsam/* EXCLUDE_PATTERNS =
EXCLUDE_SYMBOLS = EXCLUDE_SYMBOLS =
EXAMPLE_PATH = EXAMPLE_PATH =
EXAMPLE_PATTERNS = * EXAMPLE_PATTERNS = *
@@ -209,7 +209,7 @@ EXPAND_ONLY_PREDEF = NO
SEARCH_INCLUDES = YES SEARCH_INCLUDES = YES
INCLUDE_PATH = INCLUDE_PATH =
INCLUDE_FILE_PATTERNS = INCLUDE_FILE_PATTERNS =
PREDEFINED = __DOXYGEN__ PROGMEM PREDEFINED =
EXPAND_AS_DEFINED = EXPAND_AS_DEFINED =
SKIP_FUNCTION_MACROS = YES SKIP_FUNCTION_MACROS = YES
+182 -58
View File
File diff suppressed because it is too large Load Diff
Vendored
+2 -2
View File
@@ -68,13 +68,13 @@ Vagrant.configure(2) do |config|
["virtualbox", "vmware_workstation", "vmware_fusion"].each do |type| ["virtualbox", "vmware_workstation", "vmware_fusion"].each do |type|
config.vm.provider type do |virt, override| config.vm.provider type do |virt, override|
override.vm.provision "docker" do |d| override.vm.provision "docker" do |d|
d.run "qmkfm/qmk_cli", d.run "qmkfm/base_container",
cmd: "tail -f /dev/null", cmd: "tail -f /dev/null",
args: "--privileged -v /dev:/dev -v '/vagrant:/vagrant'" args: "--privileged -v /dev:/dev -v '/vagrant:/vagrant'"
end end
override.vm.provision "shell", inline: <<-SHELL override.vm.provision "shell", inline: <<-SHELL
echo 'docker restart qmkfm-qmk_cli && exec docker exec -it qmkfm-qmk_cli /bin/bash -l' >> ~vagrant/.bashrc echo 'docker restart qmkfm-base_container && exec docker exec -it qmkfm-base_container /bin/bash -l' >> ~vagrant/.bashrc
SHELL SHELL
end end
end end
Executable
+58
View File
@@ -0,0 +1,58 @@
#!/usr/bin/env python3
"""CLI wrapper for running QMK commands.
"""
import os
import sys
from pathlib import Path
# Add the QMK python libs to our path
script_dir = Path(os.path.realpath(__file__)).parent
qmk_dir = script_dir.parent
python_lib_dir = Path(qmk_dir / 'lib' / 'python').resolve()
sys.path.append(str(python_lib_dir))
# Setup the CLI
import milc # noqa
milc.EMOJI_LOGLEVELS['INFO'] = '{fg_blue}Ψ{style_reset_all}'
@milc.cli.entrypoint('QMK Helper Script')
def qmk_main(cli):
"""The function that gets run when no subcommand is provided.
"""
cli.print_help()
def main():
"""Setup our environment and then call the CLI entrypoint.
"""
# Change to the root of our checkout
os.environ['ORIG_CWD'] = os.getcwd()
os.environ['DEPRECATED_BIN_QMK'] = '1'
os.chdir(qmk_dir)
print('Warning: The bin/qmk script is being deprecated. Please install the QMK CLI: python3 -m pip install qmk', file=sys.stderr)
# Import the subcommands
import milc.subcommand.config # noqa
import qmk.cli # noqa
# Execute
return_code = milc.cli()
if return_code is False:
exit(1)
elif return_code is not True and isinstance(return_code, int):
if return_code < 0 or return_code > 255:
milc.cli.log.error('Invalid return_code: %d', return_code)
exit(255)
exit(return_code)
exit(0)
if __name__ == '__main__':
main()
+46
View File
@@ -0,0 +1,46 @@
{
"structure": {
"summary": "_summary.md"
},
"plugins" : [
"edit-link",
"forkmegithub",
"hints",
"page-toc",
"terminal",
"toolbar",
"bulk-redirect"
],
"pluginsConfig": {
"edit-link": {
"base": "https://github.com/qmk/qmk_firmware/edit/master/docs",
"label": "Suggest an edit"
},
"forkmegithub": {
"color": "red",
"url": "https://github.com/qmk/qmk_firmware"
},
"page-toc": {
"selector": ".markdown-section h1, .markdown-section h2"
},
"terminal": {
"copyButtons": true,
"fade": false,
"style": "flat"
},
"toolbar": {
"buttons": [
{
"label": "QMK Firmware",
"icon": "fa fa-github",
"url": "https://github.com/qmk/qmk_firmware"
}
]
},
"bulk-redirect": {
"basepath": "/",
"redirectsFile": "docs/redirects.json"
}
},
"root": "./docs/"
}
+148
View File
@@ -0,0 +1,148 @@
# Copyright 2017 Jack Humbert
#
# 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/>.
# If it's possible that multiple bootloaders can be used for one project,
# you can leave this unset, and the correct size will be selected
# automatically.
#
# Sets the bootloader defined in the keyboard's/keymap's rules.mk
# Current options:
#
# AVR:
# halfkay PJRC Teensy
# caterina Pro Micro (Sparkfun/generic)
# atmel-dfu Atmel factory DFU
# lufa-dfu LUFA DFU
# qmk-dfu QMK DFU (LUFA + blinkenlight)
# bootloadHID HIDBootFlash compatible (ATmega32A)
# USBasp USBaspLoader (ATmega328P)
# ARM:
# kiibohd Input:Club Kiibohd bootloader (only used on their boards)
# stm32duino STM32Duino (STM32F103x8)
# stm32-dfu STM32 USB DFU in ROM
# apm32-dfu APM32 USB DFU in ROM
#
# BOOTLOADER_SIZE can still be defined manually, but it's recommended
# you add any possible configuration to this list
ifeq ($(strip $(BOOTLOADER)), atmel-dfu)
OPT_DEFS += -DBOOTLOADER_ATMEL_DFU
OPT_DEFS += -DBOOTLOADER_DFU
ifneq (,$(filter $(MCU), at90usb162 atmega16u2 atmega32u2 atmega16u4 atmega32u4 at90usb646 at90usb647))
BOOTLOADER_SIZE = 4096
endif
ifneq (,$(filter $(MCU), at90usb1286 at90usb1287))
BOOTLOADER_SIZE = 8192
endif
endif
ifeq ($(strip $(BOOTLOADER)), lufa-dfu)
OPT_DEFS += -DBOOTLOADER_LUFA_DFU
OPT_DEFS += -DBOOTLOADER_DFU
ifneq (,$(filter $(MCU), at90usb162 atmega16u2 atmega32u2 atmega16u4 atmega32u4 at90usb646 at90usb647))
BOOTLOADER_SIZE = 4096
endif
ifneq (,$(filter $(MCU), at90usb1286 at90usb1287))
BOOTLOADER_SIZE = 8192
endif
endif
ifeq ($(strip $(BOOTLOADER)), qmk-dfu)
OPT_DEFS += -DBOOTLOADER_QMK_DFU
OPT_DEFS += -DBOOTLOADER_DFU
ifneq (,$(filter $(MCU), at90usb162 atmega16u2 atmega32u2 atmega16u4 atmega32u4 at90usb646 at90usb647))
BOOTLOADER_SIZE = 4096
endif
ifneq (,$(filter $(MCU), at90usb1286 at90usb1287))
BOOTLOADER_SIZE = 8192
endif
endif
ifeq ($(strip $(BOOTLOADER)), halfkay)
OPT_DEFS += -DBOOTLOADER_HALFKAY
ifeq ($(strip $(MCU)), atmega32u4)
BOOTLOADER_SIZE = 512
endif
ifeq ($(strip $(MCU)), at90usb1286)
BOOTLOADER_SIZE = 1024
endif
endif
ifeq ($(strip $(BOOTLOADER)), caterina)
OPT_DEFS += -DBOOTLOADER_CATERINA
BOOTLOADER_SIZE = 4096
endif
ifeq ($(strip $(BOOTLOADER)), bootloadHID)
OPT_DEFS += -DBOOTLOADER_BOOTLOADHID
BOOTLOADER_SIZE = 4096
endif
ifeq ($(strip $(BOOTLOADER)), USBasp)
OPT_DEFS += -DBOOTLOADER_USBASP
BOOTLOADER_SIZE = 4096
endif
ifeq ($(strip $(BOOTLOADER)), lufa-ms)
OPT_DEFS += -DBOOTLOADER_MS
BOOTLOADER_SIZE ?= 8192
FIRMWARE_FORMAT = bin
cpfirmware: lufa_warning
.INTERMEDIATE: lufa_warning
lufa_warning: $(FIRMWARE_FORMAT)
$(info @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@)
$(info LUFA MASS STORAGE Bootloader selected)
$(info DO NOT USE THIS BOOTLOADER IN NEW PROJECTS!)
$(info It is extremely prone to bricking, and is only included to support existing boards.)
$(info @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@)
endif
ifdef BOOTLOADER_SIZE
OPT_DEFS += -DBOOTLOADER_SIZE=$(strip $(BOOTLOADER_SIZE))
endif
ifeq ($(strip $(BOOTLOADER)), stm32-dfu)
OPT_DEFS += -DBOOTLOADER_STM32_DFU
# Options to pass to dfu-util when flashing
DFU_ARGS ?= -d 0483:DF11 -a 0 -s 0x08000000:leave
DFU_SUFFIX_ARGS ?= -v 0483 -p DF11
endif
ifeq ($(strip $(BOOTLOADER)), apm32-dfu)
OPT_DEFS += -DBOOTLOADER_APM32_DFU
# Options to pass to dfu-util when flashing
DFU_ARGS ?= -d 314B:0106 -a 0 -s 0x08000000:leave
DFU_SUFFIX_ARGS ?= -v 314B -p 0106
endif
ifeq ($(strip $(BOOTLOADER)), kiibohd)
OPT_DEFS += -DBOOTLOADER_KIIBOHD
ifeq ($(strip $(MCU_ORIG)), MK20DX128)
MCU_LDSCRIPT = MK20DX128BLDR4
endif
ifeq ($(strip $(MCU_ORIG)), MK20DX256)
MCU_LDSCRIPT = MK20DX256BLDR8
endif
# Options to pass to dfu-util when flashing
DFU_ARGS = -d 1C11:B007
DFU_SUFFIX_ARGS = -v 1C11 -p B007
endif
ifeq ($(strip $(BOOTLOADER)), stm32duino)
OPT_DEFS += -DBOOTLOADER_STM32DUINO
MCU_LDSCRIPT = STM32F103x8_stm32duino_bootloader
BOARD = STM32_F103_STM32DUINO
# STM32F103 does NOT have an USB bootloader in ROM (only serial), so setting anything here does not make much sense
STM32_BOOTLOADER_ADDRESS = 0x80000000
# Options to pass to dfu-util when flashing
DFU_ARGS = -d 1EAF:0003 -a 2 -R
DFU_SUFFIX_ARGS = -v 1EAF -p 0003
endif
ifeq ($(strip $(BOOTLOADER)), tinyuf2)
OPT_DEFS += -DBOOTLOADER_TINYUF2
endif
+33
View File
@@ -0,0 +1,33 @@
# Copyright 2017 Fred Sundvik
#
# 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 $(TMK_PATH)/protocol.mk
TEST_PATH=tests/$(TEST)
$(TEST)_SRC= \
$(TEST_PATH)/keymap.c \
$(TMK_COMMON_SRC) \
$(QUANTUM_SRC) \
$(SRC) \
tests/test_common/matrix.c \
tests/test_common/test_driver.cpp \
tests/test_common/keyboard_report_util.cpp \
tests/test_common/test_fixture.cpp
$(TEST)_SRC += $(patsubst $(ROOTDIR)/%,%,$(wildcard $(TEST_PATH)/*.cpp))
$(TEST)_DEFS=$(TMK_COMMON_DEFS) $(OPT_DEFS)
$(TEST)_CONFIG=$(TEST_PATH)/config.h
VPATH+=$(TOP_DIR)/tests/test_common
+31
View File
@@ -0,0 +1,31 @@
# Look for a json keymap file
ifneq ("$(wildcard $(MAIN_KEYMAP_PATH_5)/keymap.json)","")
KEYMAP_C := $(KEYMAP_OUTPUT)/keymap.c
KEYMAP_JSON := $(MAIN_KEYMAP_PATH_5)/keymap.json
KEYMAP_PATH := $(MAIN_KEYMAP_PATH_5)
else ifneq ("$(wildcard $(MAIN_KEYMAP_PATH_4)/keymap.json)","")
KEYMAP_C := $(KEYMAP_OUTPUT)/keymap.c
KEYMAP_JSON := $(MAIN_KEYMAP_PATH_4)/keymap.json
KEYMAP_PATH := $(MAIN_KEYMAP_PATH_4)
else ifneq ("$(wildcard $(MAIN_KEYMAP_PATH_3)/keymap.json)","")
KEYMAP_C := $(KEYMAP_OUTPUT)/keymap.c
KEYMAP_JSON := $(MAIN_KEYMAP_PATH_3)/keymap.json
KEYMAP_PATH := $(MAIN_KEYMAP_PATH_3)
else ifneq ("$(wildcard $(MAIN_KEYMAP_PATH_2)/keymap.json)","")
KEYMAP_C := $(KEYMAP_OUTPUT)/keymap.c
KEYMAP_JSON := $(MAIN_KEYMAP_PATH_2)/keymap.json
KEYMAP_PATH := $(MAIN_KEYMAP_PATH_2)
else ifneq ("$(wildcard $(MAIN_KEYMAP_PATH_1)/keymap.json)","")
KEYMAP_C := $(KEYMAP_OUTPUT)/keymap.c
KEYMAP_JSON := $(MAIN_KEYMAP_PATH_1)/keymap.json
KEYMAP_PATH := $(MAIN_KEYMAP_PATH_1)
endif
# Load the keymap-level rules.mk if exists
ifneq ("$(wildcard $(KEYMAP_PATH))", "")
-include $(KEYMAP_PATH)/rules.mk
endif
# Generate the keymap.c
$(KEYMAP_C): $(KEYMAP_JSON)
$(QMK_BIN) json2c --quiet --output $(KEYMAP_C) $(KEYMAP_JSON)
@@ -10,8 +10,7 @@ endif
.DEFAULT_GOAL := all .DEFAULT_GOAL := all
include paths.mk include common.mk
include $(BUILDDEFS_PATH)/message.mk
# Set the qmk cli to use # Set the qmk cli to use
QMK_BIN ?= qmk QMK_BIN ?= qmk
@@ -24,30 +23,24 @@ KEYBOARD_OUTPUT := $(BUILD_DIR)/obj_$(KEYBOARD_FILESAFE)
# Force expansion # Force expansion
TARGET := $(TARGET) TARGET := $(TARGET)
ifneq ($(FORCE_LAYOUT),) # For split boards we need to set a master half.
TARGET := $(TARGET)_$(FORCE_LAYOUT) MASTER ?= left
ifdef master
MASTER = $(master)
endif endif
# Object files and generated keymap directory ifeq ($(MASTER),right)
# To put object files in current directory, use a dot (.), do NOT make OPT_DEFS += -DMASTER_IS_ON_RIGHT
# this an empty or blank macro! else
KEYMAP_OUTPUT := $(BUILD_DIR)/obj_$(TARGET) ifneq ($(MASTER),left)
$(error MASTER does not have a valid value(left/right))
endif
endif
ifdef SKIP_VERSION ifdef SKIP_VERSION
OPT_DEFS += -DSKIP_VERSION OPT_DEFS += -DSKIP_VERSION
endif endif
# Generate the version.h file
ifdef SKIP_VERSION
VERSION_H_FLAGS := --skip-all
endif
ifdef SKIP_GIT
VERSION_H_FLAGS := --skip-git
endif
# Generate the board's version.h file.
$(shell $(QMK_BIN) generate-version-h $(VERSION_H_FLAGS) -q -o $(KEYMAP_OUTPUT)/src/version.h)
# Determine which subfolders exist. # Determine which subfolders exist.
KEYBOARD_FOLDER_PATH_1 := $(KEYBOARD) KEYBOARD_FOLDER_PATH_1 := $(KEYBOARD)
KEYBOARD_FOLDER_PATH_2 := $(patsubst %/,%,$(dir $(KEYBOARD_FOLDER_PATH_1))) KEYBOARD_FOLDER_PATH_2 := $(patsubst %/,%,$(dir $(KEYBOARD_FOLDER_PATH_1)))
@@ -107,13 +100,21 @@ 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 # Pull in rules from info.json
INFO_RULES_MK = $(shell $(QMK_BIN) generate-rules-mk --quiet --escape --keyboard $(KEYBOARD) --output $(KEYBOARD_OUTPUT)/src/info_rules.mk) INFO_RULES_MK = $(shell $(QMK_BIN) generate-rules-mk --quiet --escape --keyboard $(KEYBOARD) --output $(KEYBOARD_OUTPUT)/src/rules.mk)
include $(INFO_RULES_MK) include $(INFO_RULES_MK)
# Check for keymap.json first, so we can regenerate keymap.c ifneq ($(FORCE_LAYOUT),)
include $(BUILDDEFS_PATH)/build_json.mk TARGET := $(TARGET)_$(FORCE_LAYOUT)
endif
# Object files and generated keymap directory
# To put object files in current directory, use a dot (.), do NOT make
# this an empty or blank macro!
KEYMAP_OUTPUT := $(BUILD_DIR)/obj_$(TARGET)
# Check for keymap.json first, so we can regenerate keymap.c
include build_json.mk
# Pull in keymap level rules.mk
ifeq ("$(wildcard $(KEYMAP_PATH))", "") ifeq ("$(wildcard $(KEYMAP_PATH))", "")
# Look through the possible keymap folders until we find a matching keymap.c # Look through the possible keymap folders until we find a matching keymap.c
ifneq ("$(wildcard $(MAIN_KEYMAP_PATH_5)/keymap.c)","") ifneq ("$(wildcard $(MAIN_KEYMAP_PATH_5)/keymap.c)","")
@@ -138,45 +139,22 @@ ifeq ("$(wildcard $(KEYMAP_PATH))", "")
KEYMAP_PATH := $(MAIN_KEYMAP_PATH_1) KEYMAP_PATH := $(MAIN_KEYMAP_PATH_1)
else ifneq ($(LAYOUTS),) else ifneq ($(LAYOUTS),)
# If we haven't found a keymap yet fall back to community layouts # If we haven't found a keymap yet fall back to community layouts
include $(BUILDDEFS_PATH)/build_layout.mk include build_layout.mk
else else
$(call CATASTROPHIC_ERROR,Invalid keymap,Could not find keymap) $(error Could not find keymap)
# this state should never be reached # this state should never be reached
endif endif
endif endif
# Have we found a keymap.json?
ifneq ("$(wildcard $(KEYMAP_JSON))", "")
KEYMAP_C := $(KEYMAP_OUTPUT)/src/keymap.c
KEYMAP_H := $(KEYMAP_OUTPUT)/src/config.h
# Load the keymap-level rules.mk if exists
-include $(KEYMAP_PATH)/rules.mk
# Load any rules.mk content from keymap.json
INFO_RULES_MK = $(shell $(QMK_BIN) generate-rules-mk --quiet --escape --keyboard $(KEYBOARD) --keymap $(KEYMAP) --output $(KEYMAP_OUTPUT)/src/rules.mk)
include $(INFO_RULES_MK)
# Add rules to generate the keymap files - indentation here is important
$(KEYMAP_OUTPUT)/src/keymap.c: $(KEYMAP_JSON)
$(QMK_BIN) json2c --quiet --output $(KEYMAP_C) $(KEYMAP_JSON)
$(KEYMAP_OUTPUT)/src/config.h: $(KEYMAP_JSON)
$(QMK_BIN) generate-config-h --quiet --keyboard $(KEYBOARD) --keymap $(KEYMAP) --output $(KEYMAP_H)
generated-files: $(KEYMAP_OUTPUT)/src/config.h $(KEYMAP_OUTPUT)/src/keymap.c
endif
ifeq ($(strip $(CTPC)), yes) ifeq ($(strip $(CTPC)), yes)
CONVERT_TO_PROTON_C=yes CONVERT_TO_PROTON_C=yes
endif endif
ifeq ($(strip $(CONVERT_TO_PROTON_C)), yes) ifeq ($(strip $(CONVERT_TO_PROTON_C)), yes)
include platforms/chibios/boards/QMK_PROTON_C/convert_to_proton_c.mk include platforms/chibios/QMK_PROTON_C/convert_to_proton_c.mk
endif endif
include $(BUILDDEFS_PATH)/mcu_selection.mk include quantum/mcu_selection.mk
# Find all the C source files to be compiled in subfolders. # Find all the C source files to be compiled in subfolders.
KEYBOARD_SRC := KEYBOARD_SRC :=
@@ -259,7 +237,6 @@ ifdef MCU_FAMILY
PLATFORM=CHIBIOS PLATFORM=CHIBIOS
PLATFORM_KEY=chibios PLATFORM_KEY=chibios
FIRMWARE_FORMAT?=bin FIRMWARE_FORMAT?=bin
OPT_DEFS += -DMCU_$(MCU_FAMILY)
else ifdef ARM_ATSAM else ifdef ARM_ATSAM
PLATFORM=ARM_ATSAM PLATFORM=ARM_ATSAM
PLATFORM_KEY=arm_atsam PLATFORM_KEY=arm_atsam
@@ -344,7 +321,6 @@ ifeq ("$(USER_NAME)","")
endif endif
USER_PATH := users/$(USER_NAME) USER_PATH := users/$(USER_NAME)
# Pull in user level rules.mk
-include $(USER_PATH)/rules.mk -include $(USER_PATH)/rules.mk
ifneq ("$(wildcard $(USER_PATH)/config.h)","") ifneq ("$(wildcard $(USER_PATH)/config.h)","")
CONFIG_H += $(USER_PATH)/config.h CONFIG_H += $(USER_PATH)/config.h
@@ -354,38 +330,16 @@ ifneq ("$(wildcard $(USER_PATH)/post_config.h)","")
endif endif
# Disable features that a keyboard doesn't support # Disable features that a keyboard doesn't support
-include $(BUILDDEFS_PATH)/disable_features.mk -include disable_features.mk
# Pull in post_rules.mk files from all our subfolders
ifneq ("$(wildcard $(KEYBOARD_PATH_1)/post_rules.mk)","")
include $(KEYBOARD_PATH_1)/post_rules.mk
endif
ifneq ("$(wildcard $(KEYBOARD_PATH_2)/post_rules.mk)","")
include $(KEYBOARD_PATH_2)/post_rules.mk
endif
ifneq ("$(wildcard $(KEYBOARD_PATH_3)/post_rules.mk)","")
include $(KEYBOARD_PATH_3)/post_rules.mk
endif
ifneq ("$(wildcard $(KEYBOARD_PATH_4)/post_rules.mk)","")
include $(KEYBOARD_PATH_4)/post_rules.mk
endif
ifneq ("$(wildcard $(KEYBOARD_PATH_5)/post_rules.mk)","")
include $(KEYBOARD_PATH_5)/post_rules.mk
endif
ifneq ("$(wildcard $(KEYMAP_PATH)/config.h)","") ifneq ("$(wildcard $(KEYMAP_PATH)/config.h)","")
CONFIG_H += $(KEYMAP_PATH)/config.h CONFIG_H += $(KEYMAP_PATH)/config.h
endif endif
ifneq ("$(KEYMAP_H)","")
CONFIG_H += $(KEYMAP_H)
endif
# project specific files # project specific files
SRC += \ SRC += $(KEYBOARD_SRC) \
$(KEYBOARD_SRC) \
$(KEYMAP_C) \ $(KEYMAP_C) \
$(QUANTUM_SRC) \ $(QUANTUM_SRC)
$(QUANTUM_DIR)/main.c \
# Optimize size but this may cause error "relocation truncated to fit" # Optimize size but this may cause error "relocation truncated to fit"
#EXTRALDFLAGS = -Wl,--relax #EXTRALDFLAGS = -Wl,--relax
@@ -395,14 +349,11 @@ VPATH += $(KEYMAP_PATH)
VPATH += $(USER_PATH) VPATH += $(USER_PATH)
VPATH += $(KEYBOARD_PATHS) VPATH += $(KEYBOARD_PATHS)
VPATH += $(COMMON_VPATH) VPATH += $(COMMON_VPATH)
VPATH += $(KEYBOARD_OUTPUT)/src
VPATH += $(KEYMAP_OUTPUT)/src
include $(BUILDDEFS_PATH)/common_features.mk include common_features.mk
include $(BUILDDEFS_PATH)/generic_features.mk
include $(TMK_PATH)/protocol.mk include $(TMK_PATH)/protocol.mk
include $(PLATFORM_PATH)/common.mk include $(TMK_PATH)/common.mk
include $(BUILDDEFS_PATH)/bootloader.mk include bootloader.mk
SRC += $(patsubst %.c,%.clib,$(LIB_SRC)) SRC += $(patsubst %.c,%.clib,$(LIB_SRC))
SRC += $(patsubst %.c,%.clib,$(QUANTUM_LIB_SRC)) SRC += $(patsubst %.c,%.clib,$(QUANTUM_LIB_SRC))
@@ -417,9 +368,7 @@ ifneq ($(REQUIRE_PLATFORM_KEY),)
endif endif
endif endif
include $(PLATFORM_PATH)/$(PLATFORM_KEY)/platform.mk include $(TMK_PATH)/$(PLATFORM_KEY).mk
-include $(PLATFORM_PATH)/$(PLATFORM_KEY)/flash.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
else else
@@ -431,19 +380,26 @@ PROJECT_DEFS := $(OPT_DEFS)
PROJECT_INC := $(VPATH) $(EXTRAINCDIRS) $(KEYBOARD_PATHS) PROJECT_INC := $(VPATH) $(EXTRAINCDIRS) $(KEYBOARD_PATHS)
PROJECT_CONFIG := $(CONFIG_H) PROJECT_CONFIG := $(CONFIG_H)
ifeq ($(strip $(VISUALIZER_ENABLE)), yes)
VISUALIZER_DIR = $(QUANTUM_DIR)/visualizer
VISUALIZER_PATH = $(QUANTUM_PATH)/visualizer
include $(VISUALIZER_PATH)/visualizer.mk
endif
CONFIG_H += $(POST_CONFIG_H) CONFIG_H += $(POST_CONFIG_H)
ALL_CONFIGS := $(PROJECT_CONFIG) $(CONFIG_H) ALL_CONFIGS := $(PROJECT_CONFIG) $(CONFIG_H)
OUTPUTS := $(KEYMAP_OUTPUT) $(KEYBOARD_OUTPUT) OUTPUTS := $(KEYMAP_OUTPUT) $(KEYBOARD_OUTPUT)
$(KEYMAP_OUTPUT)_SRC := $(SRC) $(KEYMAP_OUTPUT)_SRC := $(SRC)
$(KEYMAP_OUTPUT)_DEFS := $(OPT_DEFS) \ $(KEYMAP_OUTPUT)_DEFS := $(OPT_DEFS) $(GFXDEFS) \
-DQMK_KEYBOARD=\"$(KEYBOARD)\" -DQMK_KEYBOARD_H=\"$(QMK_KEYBOARD_H)\" \ -DQMK_KEYBOARD=\"$(KEYBOARD)\" -DQMK_KEYBOARD_H=\"$(QMK_KEYBOARD_H)\" \
-DQMK_KEYMAP=\"$(KEYMAP)\" -DQMK_KEYMAP_H=\"$(KEYMAP).h\" -DQMK_KEYMAP_CONFIG_H=\"$(KEYMAP_PATH)/config.h\" -DQMK_KEYMAP=\"$(KEYMAP)\" -DQMK_KEYMAP_H=\"$(KEYMAP).h\" -DQMK_KEYMAP_CONFIG_H=\"$(KEYMAP_PATH)/config.h\" \
-DQMK_SUBPROJECT -DQMK_SUBPROJECT_H -DQMK_SUBPROJECT_CONFIG_H
$(KEYMAP_OUTPUT)_INC := $(VPATH) $(EXTRAINCDIRS) $(KEYMAP_OUTPUT)_INC := $(VPATH) $(EXTRAINCDIRS)
$(KEYMAP_OUTPUT)_CONFIG := $(CONFIG_H) $(KEYMAP_OUTPUT)_CONFIG := $(CONFIG_H)
$(KEYBOARD_OUTPUT)_SRC := $(PLATFORM_SRC) $(KEYBOARD_OUTPUT)_SRC := $(CHIBISRC) $(GFXSRC)
$(KEYBOARD_OUTPUT)_DEFS := $(PROJECT_DEFS) $(KEYBOARD_OUTPUT)_DEFS := $(PROJECT_DEFS) $(GFXDEFS)
$(KEYBOARD_OUTPUT)_INC := $(PROJECT_INC) $(KEYBOARD_OUTPUT)_INC := $(PROJECT_INC) $(GFXINC)
$(KEYBOARD_OUTPUT)_CONFIG := $(PROJECT_CONFIG) $(KEYBOARD_OUTPUT)_CONFIG := $(PROJECT_CONFIG)
# Default target. # Default target.
@@ -459,8 +415,8 @@ check-size: build
check-md5: build check-md5: build
objs-size: build objs-size: build
include $(BUILDDEFS_PATH)/show_options.mk include show_options.mk
include $(BUILDDEFS_PATH)/common_rules.mk include $(TMK_PATH)/rules.mk
# Ensure we have generated files available for each of the objects # Ensure we have generated files available for each of the objects
define GEN_FILES define GEN_FILES
@@ -7,6 +7,7 @@ define SEARCH_LAYOUTS_REPO
LAYOUT_KEYMAP_C := $$(LAYOUT_KEYMAP_PATH)/keymap.c LAYOUT_KEYMAP_C := $$(LAYOUT_KEYMAP_PATH)/keymap.c
ifneq ("$$(wildcard $$(LAYOUT_KEYMAP_JSON))","") ifneq ("$$(wildcard $$(LAYOUT_KEYMAP_JSON))","")
-include $$(LAYOUT_KEYMAP_PATH)/rules.mk -include $$(LAYOUT_KEYMAP_PATH)/rules.mk
KEYMAP_C := $(KEYBOARD_OUTPUT)/src/keymap.c
KEYMAP_JSON := $$(LAYOUT_KEYMAP_JSON) KEYMAP_JSON := $$(LAYOUT_KEYMAP_JSON)
KEYMAP_PATH := $$(LAYOUT_KEYMAP_PATH) KEYMAP_PATH := $$(LAYOUT_KEYMAP_PATH)
else ifneq ("$$(wildcard $$(LAYOUT_KEYMAP_C))","") else ifneq ("$$(wildcard $$(LAYOUT_KEYMAP_C))","")
@@ -25,8 +26,11 @@ ifneq ($(FORCE_LAYOUT),)
$(info Forcing layout: $(FORCE_LAYOUT)) $(info Forcing layout: $(FORCE_LAYOUT))
LAYOUTS := $(FORCE_LAYOUT) LAYOUTS := $(FORCE_LAYOUT)
else else
$(call CATASTROPHIC_ERROR,Invalid layout,Forced layout does not exist) $(error Forced layout does not exist)
endif endif
endif endif
$(foreach LAYOUT,$(LAYOUTS),$(eval $(call SEARCH_LAYOUTS))) $(foreach LAYOUT,$(LAYOUTS),$(eval $(call SEARCH_LAYOUTS)))
# Use rule from build_json.mk, but update prerequisite in case KEYMAP_JSON was updated
$(KEYBOARD_OUTPUT)/src/keymap.c: $(KEYMAP_JSON)
+69
View File
@@ -0,0 +1,69 @@
ifndef VERBOSE
.SILENT:
endif
.DEFAULT_GOAL := all
include common.mk
TARGET=test/$(TEST)
GTEST_OUTPUT = $(BUILD_DIR)/gtest
TEST_OBJ = $(BUILD_DIR)/test_obj
OUTPUTS := $(TEST_OBJ)/$(TEST) $(GTEST_OUTPUT)
GTEST_INC := \
$(LIB_PATH)/googletest/googletest/include\
$(LIB_PATH)/googletest/googlemock/include\
GTEST_INTERNAL_INC :=\
$(LIB_PATH)/googletest/googletest\
$(LIB_PATH)/googletest/googlemock
$(GTEST_OUTPUT)_SRC :=\
googletest/src/gtest-all.cc\
googletest/src/gtest_main.cc\
googlemock/src/gmock-all.cc
$(GTEST_OUTPUT)_DEFS :=
$(GTEST_OUTPUT)_INC := $(GTEST_INC) $(GTEST_INTERNAL_INC)
LDFLAGS += -lstdc++ -lpthread -shared-libgcc
CREATE_MAP := no
VPATH +=\
$(LIB_PATH)/googletest\
$(LIB_PATH)/googlemock
all: elf
VPATH += $(COMMON_VPATH)
PLATFORM:=TEST
PLATFORM_KEY:=test
ifneq ($(filter $(FULL_TESTS),$(TEST)),)
include tests/$(TEST)/rules.mk
endif
include common_features.mk
include $(TMK_PATH)/common.mk
include $(QUANTUM_PATH)/debounce/tests/rules.mk
include $(QUANTUM_PATH)/sequencer/tests/rules.mk
include $(QUANTUM_PATH)/serial_link/tests/rules.mk
ifneq ($(filter $(FULL_TESTS),$(TEST)),)
include build_full_test.mk
endif
$(TEST_OBJ)/$(TEST)_SRC := $($(TEST)_SRC)
$(TEST_OBJ)/$(TEST)_INC := $($(TEST)_INC) $(VPATH) $(GTEST_INC)
$(TEST_OBJ)/$(TEST)_DEFS := $($(TEST)_DEFS)
$(TEST_OBJ)/$(TEST)_CONFIG := $($(TEST)_CONFIG)
include $(TMK_PATH)/native.mk
include $(TMK_PATH)/rules.mk
$(shell mkdir -p $(BUILD_DIR)/test 2>/dev/null)
$(shell mkdir -p $(TEST_OBJ) 2>/dev/null)
-208
View File
@@ -1,208 +0,0 @@
# Copyright 2017 Jack Humbert
#
# 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/>.
# If it's possible that multiple bootloaders can be used for one project,
# you can leave this unset, and the correct size will be selected
# automatically.
#
# Sets the bootloader defined in the keyboard's/keymap's rules.mk
# Current options:
#
# AVR:
# halfkay PJRC Teensy
# caterina Pro Micro (Sparkfun/generic)
# atmel-dfu Atmel factory DFU
# lufa-dfu LUFA DFU
# qmk-dfu QMK DFU (LUFA + blinkenlight)
# qmk-hid QMK HID (LUFA + blinkenlight)
# bootloadhid HIDBootFlash compatible (ATmega32A)
# usbasploader USBaspLoader (ATmega328P)
# ARM:
# halfkay PJRC Teensy
# kiibohd Input:Club Kiibohd bootloader (only used on their boards)
# stm32duino STM32Duino (STM32F103x8)
# stm32-dfu STM32 USB DFU in ROM
# apm32-dfu APM32 USB DFU in ROM
# RISC-V:
# gd32v-dfu GD32V USB DFU in ROM
#
# If you need to provide your own implementation, you can set inside `rules.mk`
# `BOOTLOADER = custom` -- you'll need to provide your own implementations. See
# the respective file under `platforms/<PLATFORM>/bootloaders/custom.c` to see
# which functions may be overridden.
#
# BOOTLOADER_SIZE can still be defined manually, but it's recommended
# you add any possible configuration to this list
ifeq ($(strip $(BOOTLOADER)), custom)
OPT_DEFS += -DBOOTLOADER_CUSTOM
BOOTLOADER_TYPE = custom
endif
ifeq ($(strip $(BOOTLOADER)), atmel-dfu)
OPT_DEFS += -DBOOTLOADER_ATMEL_DFU
OPT_DEFS += -DBOOTLOADER_DFU
BOOTLOADER_TYPE = dfu
ifneq (,$(filter $(MCU), at90usb162 atmega16u2 atmega32u2 atmega16u4 atmega32u4 at90usb646 at90usb647))
BOOTLOADER_SIZE = 4096
endif
ifneq (,$(filter $(MCU), at90usb1286 at90usb1287))
BOOTLOADER_SIZE = 8192
endif
endif
ifeq ($(strip $(BOOTLOADER)), lufa-dfu)
OPT_DEFS += -DBOOTLOADER_LUFA_DFU
OPT_DEFS += -DBOOTLOADER_DFU
BOOTLOADER_TYPE = dfu
ifneq (,$(filter $(MCU), at90usb162 atmega16u2 atmega32u2 atmega16u4 atmega32u4 at90usb646 at90usb647))
BOOTLOADER_SIZE ?= 4096
endif
ifneq (,$(filter $(MCU), at90usb1286 at90usb1287))
BOOTLOADER_SIZE ?= 8192
endif
endif
ifeq ($(strip $(BOOTLOADER)), qmk-dfu)
OPT_DEFS += -DBOOTLOADER_QMK_DFU
OPT_DEFS += -DBOOTLOADER_DFU
BOOTLOADER_TYPE = dfu
ifneq (,$(filter $(MCU), at90usb162 atmega16u2 atmega32u2 atmega16u4 atmega32u4 at90usb646 at90usb647))
BOOTLOADER_SIZE ?= 4096
endif
ifneq (,$(filter $(MCU), at90usb1286 at90usb1287))
BOOTLOADER_SIZE ?= 8192
endif
endif
ifeq ($(strip $(BOOTLOADER)), qmk-hid)
OPT_DEFS += -DBOOTLOADER_QMK_HID
OPT_DEFS += -DBOOTLOADER_HID
BOOTLOADER_TYPE = dfu
BOOTLOADER_SIZE ?= 4096
endif
ifeq ($(strip $(BOOTLOADER)), halfkay)
OPT_DEFS += -DBOOTLOADER_HALFKAY
BOOTLOADER_TYPE = halfkay
ifeq ($(strip $(MCU)), atmega32u4)
BOOTLOADER_SIZE = 512
endif
ifeq ($(strip $(MCU)), at90usb1286)
BOOTLOADER_SIZE = 1024
endif
endif
ifeq ($(strip $(BOOTLOADER)), caterina)
OPT_DEFS += -DBOOTLOADER_CATERINA
BOOTLOADER_TYPE = caterina
BOOTLOADER_SIZE = 4096
endif
ifneq (,$(filter $(BOOTLOADER), bootloadhid bootloadHID))
OPT_DEFS += -DBOOTLOADER_BOOTLOADHID
BOOTLOADER_TYPE = bootloadhid
BOOTLOADER_SIZE = 4096
endif
ifneq (,$(filter $(BOOTLOADER), usbasploader USBasp))
OPT_DEFS += -DBOOTLOADER_USBASP
BOOTLOADER_TYPE = usbasploader
BOOTLOADER_SIZE = 4096
endif
ifeq ($(strip $(BOOTLOADER)), lufa-ms)
OPT_DEFS += -DBOOTLOADER_MS
BOOTLOADER_TYPE = dfu
BOOTLOADER_SIZE ?= 8192
FIRMWARE_FORMAT = bin
cpfirmware: lufa_warning
.INTERMEDIATE: lufa_warning
lufa_warning: $(FIRMWARE_FORMAT)
$(info @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@)
$(info LUFA MASS STORAGE Bootloader selected)
$(info DO NOT USE THIS BOOTLOADER IN NEW PROJECTS!)
$(info It is extremely prone to bricking, and is only included to support existing boards.)
$(info @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@)
endif
ifdef BOOTLOADER_SIZE
OPT_DEFS += -DBOOTLOADER_SIZE=$(strip $(BOOTLOADER_SIZE))
endif
ifeq ($(strip $(BOOTLOADER)), stm32-dfu)
OPT_DEFS += -DBOOTLOADER_STM32_DFU
BOOTLOADER_TYPE = stm32_dfu
# Options to pass to dfu-util when flashing
DFU_ARGS ?= -d 0483:DF11 -a 0 -s 0x08000000:leave
DFU_SUFFIX_ARGS ?= -v 0483 -p DF11
endif
ifeq ($(strip $(BOOTLOADER)), apm32-dfu)
OPT_DEFS += -DBOOTLOADER_APM32_DFU
BOOTLOADER_TYPE = stm32_dfu
# Options to pass to dfu-util when flashing
DFU_ARGS ?= -d 314B:0106 -a 0 -s 0x08000000:leave
DFU_SUFFIX_ARGS ?= -v 314B -p 0106
endif
ifeq ($(strip $(BOOTLOADER)), gd32v-dfu)
OPT_DEFS += -DBOOTLOADER_GD32V_DFU
BOOTLOADER_TYPE = gd32v_dfu
# Options to pass to dfu-util when flashing
DFU_ARGS ?= -d 28E9:0189 -a 0 -s 0x08000000:leave
DFU_SUFFIX_ARGS ?= -v 28E9 -p 0189
endif
ifeq ($(strip $(BOOTLOADER)), kiibohd)
OPT_DEFS += -DBOOTLOADER_KIIBOHD
BOOTLOADER_TYPE = kiibohd
ifeq ($(strip $(MCU_ORIG)), MK20DX128)
MCU_LDSCRIPT = MK20DX128BLDR4
endif
ifeq ($(strip $(MCU_ORIG)), MK20DX256)
MCU_LDSCRIPT = MK20DX256BLDR8
endif
# Options to pass to dfu-util when flashing
DFU_ARGS = -d 1C11:B007
DFU_SUFFIX_ARGS = -v 1C11 -p B007
endif
ifeq ($(strip $(BOOTLOADER)), stm32duino)
OPT_DEFS += -DBOOTLOADER_STM32DUINO
MCU_LDSCRIPT = STM32F103x8_stm32duino_bootloader
BOARD = STM32_F103_STM32DUINO
BOOTLOADER_TYPE = stm32duino
# Options to pass to dfu-util when flashing
DFU_ARGS = -d 1EAF:0003 -a 2 -R
DFU_SUFFIX_ARGS = -v 1EAF -p 0003
endif
ifeq ($(strip $(BOOTLOADER)), tinyuf2)
OPT_DEFS += -DBOOTLOADER_TINYUF2
BOOTLOADER_TYPE = tinyuf2
endif
ifeq ($(strip $(BOOTLOADER)), halfkay)
OPT_DEFS += -DBOOTLOADER_HALFKAY
BOOTLOADER_TYPE = halfkay
endif
ifeq ($(strip $(BOOTLOADER)), md-boot)
OPT_DEFS += -DBOOTLOADER_MD_BOOT
BOOTLOADER_TYPE = md_boot
endif
ifeq ($(strip $(BOOTLOADER_TYPE)),)
$(call CATASTROPHIC_ERROR,Invalid BOOTLOADER,No bootloader specified. Please set an appropriate 'BOOTLOADER' in your keyboard's 'rules.mk' file.)
endif

Some files were not shown because too many files have changed in this diff Show More