Compare commits
1 Commits
Author | SHA1 | Date | |
---|---|---|---|
33fa2ddb95 |
5
.github/ISSUE_TEMPLATE/blank.md
vendored
Normal file
5
.github/ISSUE_TEMPLATE/blank.md
vendored
Normal file
@ -0,0 +1,5 @@
|
||||
---
|
||||
name: Blank issue
|
||||
about: If you're 100% sure that you don't need one of the other issue templates, use this one instead.
|
||||
|
||||
---
|
7
.github/ISSUE_TEMPLATE/bug_report.md
vendored
7
.github/ISSUE_TEMPLATE/bug_report.md
vendored
@ -1,12 +1,7 @@
|
||||
---
|
||||
name: Bug report
|
||||
about: Create a report to help us improve QMK Firmware.
|
||||
title: "[Bug] "
|
||||
labels: bug, help wanted
|
||||
assignees: ''
|
||||
|
||||
about: Create a report to help us improve the QMK Firmware
|
||||
---
|
||||
|
||||
<!-- Provide a general summary of the bug in the title above. -->
|
||||
|
||||
<!--- This template is entirely optional and can be removed, but is here to help both you and us. -->
|
||||
|
8
.github/ISSUE_TEMPLATE/config.yml
vendored
8
.github/ISSUE_TEMPLATE/config.yml
vendored
@ -1,8 +0,0 @@
|
||||
blank_issues_enabled: false
|
||||
contact_links:
|
||||
- name: QMK Discord
|
||||
url: https://discord.gg/Uq7gcHh
|
||||
about: Ask questions, discuss issues and features. Chill.
|
||||
- name: OLKB Subreddit
|
||||
url: https://www.reddit.com/r/olkb
|
||||
about: All things OLKB and QMK.
|
7
.github/ISSUE_TEMPLATE/feature_request.md
vendored
7
.github/ISSUE_TEMPLATE/feature_request.md
vendored
@ -1,12 +1,7 @@
|
||||
---
|
||||
name: Feature request
|
||||
about: Suggest a new feature or changes to existing features.
|
||||
title: "[Feature Request] "
|
||||
labels: enhancement, help wanted
|
||||
assignees: ''
|
||||
|
||||
about: Suggest a new feature or changes to existing features
|
||||
---
|
||||
|
||||
<!--- Provide a general summary of the changes you want in the title above. -->
|
||||
|
||||
<!--- This template is entirely optional and can be removed, but is here to help both you and us. -->
|
||||
|
7
.github/ISSUE_TEMPLATE/other_issues.md
vendored
7
.github/ISSUE_TEMPLATE/other_issues.md
vendored
@ -1,12 +1,7 @@
|
||||
---
|
||||
name: Other issues
|
||||
about: Anything else that doesn't fall into the above categories.
|
||||
title: ''
|
||||
labels: help wanted, question
|
||||
assignees: ''
|
||||
|
||||
about: Anything else that doesn't fall into the above categories.
|
||||
---
|
||||
|
||||
<!--- Provide a general summary of the changes you want in the title above. -->
|
||||
|
||||
<!--- Anything on lines wrapped in comments like these will not show up in the final text. -->
|
||||
|
11
.github/ISSUE_TEMPLATE/zzz_blank.md
vendored
11
.github/ISSUE_TEMPLATE/zzz_blank.md
vendored
@ -1,11 +0,0 @@
|
||||
---
|
||||
name: Blank issue
|
||||
about: If you're 100% sure that you don't need one of the other issue templates, use
|
||||
this one instead.
|
||||
title: ''
|
||||
labels: help wanted, question
|
||||
assignees: ''
|
||||
|
||||
---
|
||||
|
||||
|
58
.github/stale.yml
vendored
58
.github/stale.yml
vendored
@ -1,58 +0,0 @@
|
||||
# Configuration for probot-stale - https://github.com/probot/stale
|
||||
|
||||
# General configuration
|
||||
|
||||
# Pull request specific configuration
|
||||
pulls:
|
||||
staleLabel: awaiting changes
|
||||
# Number of days of inactivity before an Issue or Pull Request becomes stale
|
||||
daysUntilStale: 45
|
||||
# Number of days of inactivity before a stale Issue or Pull Request is closed.
|
||||
# Set to false to disable. If disabled, issues still need to be closed manually, but will remain marked as stale.
|
||||
daysUntilClose: 30
|
||||
# Comment to post when marking as stale. Set to `false` to disable
|
||||
markComment: >
|
||||
Thank you for your contribution!
|
||||
|
||||
This pull request has been automatically marked as stale because it has not had
|
||||
activity in the last 45 days. It will be closed in 30 days if no further activity occurs.
|
||||
Please feel free to give a status update now, or re-open when it's ready.
|
||||
|
||||
For maintainers: Please label with `awaiting review`, `breaking_change`, `in progress`, or `on hold` to prevent
|
||||
the issue from being re-flagged.
|
||||
# Comment to post when closing a stale Issue or Pull Request.
|
||||
closeComment: >
|
||||
Thank you for your contribution!
|
||||
|
||||
This pull request has been automatically closed because it has not had activity in the last 30 days.
|
||||
Please feel free to give a status update now, ping for review, or re-open when it's ready.
|
||||
# Limit the number of actions per hour, from 1-30. Default is 30
|
||||
limitPerRun: 30
|
||||
exemptLabels:
|
||||
- awaiting review
|
||||
- breaking_change
|
||||
- in progress
|
||||
- on hold
|
||||
|
||||
# Issue specific configuration
|
||||
issues:
|
||||
staleLabel: stale
|
||||
limitPerRun: 10
|
||||
daysUntilStale: 90
|
||||
daysUntilClose: 30
|
||||
markComment: >
|
||||
This issue has been automatically marked as stale because it has not had activity in the
|
||||
last 90 days. It will be closed in the next 30 days unless it is tagged properly or other activity
|
||||
occurs.
|
||||
|
||||
For maintainers: Please label with `bug`, `in progress`, `on hold`, `discussion` or `to do` to prevent
|
||||
the issue from being re-flagged.
|
||||
closeComment: >
|
||||
This issue has been automatically closed because it has not had activity in the last 30 days.
|
||||
If this issue is still valid, re-open the issue and let us know.
|
||||
exemptLabels:
|
||||
- bug
|
||||
- in progress
|
||||
- on hold
|
||||
- discussion
|
||||
- to do
|
28
.github/workflows/cli.yml
vendored
28
.github/workflows/cli.yml
vendored
@ -1,28 +0,0 @@
|
||||
name: CLI CI
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- master
|
||||
- future
|
||||
pull_request:
|
||||
paths:
|
||||
- 'lib/python/**'
|
||||
- 'bin/qmk'
|
||||
- 'requirements.txt'
|
||||
- '.github/workflows/cli.yml'
|
||||
|
||||
jobs:
|
||||
test:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
container: qmkfm/base_container
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v1
|
||||
with:
|
||||
submodules: recursive
|
||||
- name: Install dependencies
|
||||
run: pip3 install -r requirements.txt
|
||||
- name: Run tests
|
||||
run: bin/qmk pytest
|
10
.gitignore
vendored
10
.gitignore
vendored
@ -25,7 +25,7 @@ quantum/version.h
|
||||
CMakeLists.txt
|
||||
cmake-build-debug
|
||||
doxygen/
|
||||
.DS_Store
|
||||
.DS_STORE
|
||||
/util/wsl_downloaded
|
||||
/util/win_downloaded
|
||||
/keyboards/*/Makefile
|
||||
@ -60,8 +60,11 @@ util/Win_Check_Output.txt
|
||||
|
||||
# ignore image files
|
||||
*.png
|
||||
*.gif
|
||||
*.jpg
|
||||
*.gif
|
||||
|
||||
# Do not ignore MiniDox left/right hand eeprom files
|
||||
!keyboards/minidox/*.eep
|
||||
|
||||
# things travis sees
|
||||
secrets.tar
|
||||
@ -70,6 +73,3 @@ id_rsa_*
|
||||
|
||||
# python things
|
||||
__pycache__
|
||||
|
||||
# prerequisites for updating ChibiOS
|
||||
/util/fmpp*
|
||||
|
4
.gitmodules
vendored
4
.gitmodules
vendored
@ -1,15 +1,13 @@
|
||||
[submodule "lib/chibios"]
|
||||
path = lib/chibios
|
||||
url = https://github.com/qmk/ChibiOS
|
||||
branch = master
|
||||
[submodule "lib/chibios-contrib"]
|
||||
path = lib/chibios-contrib
|
||||
url = https://github.com/qmk/ChibiOS-Contrib
|
||||
branch = master
|
||||
branch = k-type-fix
|
||||
[submodule "lib/ugfx"]
|
||||
path = lib/ugfx
|
||||
url = https://github.com/qmk/uGFX
|
||||
branch = master
|
||||
[submodule "lib/googletest"]
|
||||
path = lib/googletest
|
||||
url = https://github.com/google/googletest
|
||||
|
21
.travis.yml
21
.travis.yml
@ -1,5 +1,6 @@
|
||||
os: linux
|
||||
dist: trusty
|
||||
sudo: required
|
||||
group: edge
|
||||
language: c
|
||||
branches:
|
||||
@ -12,26 +13,20 @@ env:
|
||||
- MAKEFLAGS="-j3 --output-sync"
|
||||
services:
|
||||
- docker
|
||||
install:
|
||||
- npm install -g moxygen
|
||||
script:
|
||||
- git rev-parse --short HEAD
|
||||
- bash util/travis_test.sh
|
||||
- bash util/travis_build.sh
|
||||
- bash util/travis_docs.sh
|
||||
addons:
|
||||
apt:
|
||||
sources:
|
||||
- ubuntu-toolchain-r-test
|
||||
- llvm-toolchain-trusty-7
|
||||
packages:
|
||||
- pandoc
|
||||
- diffutils
|
||||
- dos2unix
|
||||
- doxygen
|
||||
- clang-format-7
|
||||
- libstdc++-7-dev
|
||||
install:
|
||||
- npm install -g moxygen
|
||||
script:
|
||||
- git rev-parse --short HEAD
|
||||
- git diff --name-only HEAD $TRAVIS_BRANCH
|
||||
- bash util/travis_test.sh
|
||||
- bash util/travis_build.sh
|
||||
- bash util/travis_docs.sh
|
||||
after_script:
|
||||
bash util/travis_compiled_push.sh
|
||||
notifications:
|
||||
|
4
.vscode/settings.json
vendored
4
.vscode/settings.json
vendored
@ -5,13 +5,11 @@
|
||||
// Configure glob patterns for excluding files and folders.
|
||||
"files.exclude": {
|
||||
"**/.build": true,
|
||||
"**/*.hex": true,
|
||||
"**/*.bin": true
|
||||
"**/*.hex": true
|
||||
},
|
||||
"files.associations": {
|
||||
"*.h": "c",
|
||||
"*.c": "c",
|
||||
"*.inc": "c",
|
||||
"*.cpp": "cpp",
|
||||
"*.hpp": "cpp",
|
||||
"xstddef": "c",
|
||||
|
19
Makefile
19
Makefile
@ -272,14 +272,12 @@ define PARSE_RULE
|
||||
# If the rule starts with all, then continue the parsing from
|
||||
# PARSE_ALL_KEYBOARDS
|
||||
ifeq ($$(call COMPARE_AND_REMOVE_FROM_RULE,all),true)
|
||||
KEYBOARD_RULE=all
|
||||
$$(eval $$(call PARSE_ALL_KEYBOARDS))
|
||||
else ifeq ($$(call COMPARE_AND_REMOVE_FROM_RULE,test),true)
|
||||
$$(eval $$(call PARSE_TEST))
|
||||
# If the rule starts with the name of a known keyboard, then continue
|
||||
# the parsing from PARSE_KEYBOARD
|
||||
else ifeq ($$(call TRY_TO_MATCH_RULE_FROM_LIST,$$(KEYBOARDS)),true)
|
||||
KEYBOARD_RULE=$$(MATCHED_ITEM)
|
||||
$$(eval $$(call PARSE_KEYBOARD,$$(MATCHED_ITEM)))
|
||||
# Otherwise use the KEYBOARD variable, which is determined either by
|
||||
# the current directory you run make from, or passed in as an argument
|
||||
@ -382,9 +380,6 @@ define PARSE_KEYBOARD
|
||||
# Otherwise try to match the keymap from the current folder, or arguments to the make command
|
||||
else ifneq ($$(KEYMAP),)
|
||||
$$(eval $$(call PARSE_KEYMAP,$$(KEYMAP)))
|
||||
# Otherwise if we are running make all:<user> just skip
|
||||
else ifeq ($$(KEYBOARD_RULE),all)
|
||||
# $$(info Skipping: No user keymap for $$(CURRENT_KB))
|
||||
# Otherwise, make all keymaps, again this is consistent with how it works without
|
||||
# any arguments
|
||||
else
|
||||
@ -563,10 +558,10 @@ endef
|
||||
if ! python3 --version 1> /dev/null 2>&1; then printf "$(MSG_PYTHON_MISSING)"; fi
|
||||
# Check if the submodules are dirty, and display a warning if they are
|
||||
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-contrib ]; then git submodule sync lib/chibios-contrib && git submodule update --depth 50 --init lib/chibios-contrib; fi
|
||||
if [ ! -e lib/ugfx ]; then git submodule sync lib/ugfx && git submodule update --depth 50 --init lib/ugfx; fi
|
||||
if [ ! -e lib/lufa ]; then git submodule sync lib/lufa && git submodule update --depth 50 --init lib/lufa; fi
|
||||
if [ ! -e lib/chibios ]; then git submodule sync lib/chibios && git submodule update --depth 1 --init lib/chibios; fi
|
||||
if [ ! -e lib/chibios-contrib ]; then git submodule sync lib/chibios-contrib && git submodule update --depth 1 --init lib/chibios-contrib; fi
|
||||
if [ ! -e lib/ugfx ]; then git submodule sync lib/ugfx && git submodule update --depth 1 --init lib/ugfx; fi
|
||||
if [ ! -e lib/lufa ]; then git submodule sync lib/lufa && git submodule update --depth 1 --init lib/lufa; fi
|
||||
git submodule status --recursive 2>/dev/null | \
|
||||
while IFS= read -r x; do \
|
||||
case "$$x" in \
|
||||
@ -623,19 +618,13 @@ endif
|
||||
# Generate the version.h file
|
||||
ifndef SKIP_GIT
|
||||
GIT_VERSION := $(shell git describe --abbrev=6 --dirty --always --tags 2>/dev/null || date +"%Y-%m-%d-%H:%M:%S")
|
||||
CHIBIOS_VERSION := $(shell cd lib/chibios && git describe --abbrev=6 --dirty --always --tags 2>/dev/null || date +"%Y-%m-%d-%H:%M:%S")
|
||||
CHIBIOS_CONTRIB_VERSION := $(shell cd lib/chibios-contrib && git describe --abbrev=6 --dirty --always --tags 2>/dev/null || date +"%Y-%m-%d-%H:%M:%S")
|
||||
else
|
||||
GIT_VERSION := NA
|
||||
CHIBIOS_VERSION := NA
|
||||
CHIBIOS_CONTRIB_VERSION := NA
|
||||
endif
|
||||
ifndef SKIP_VERSION
|
||||
BUILD_DATE := $(shell date +"%Y-%m-%d-%H:%M:%S")
|
||||
$(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 CHIBIOS_VERSION "$(CHIBIOS_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
|
||||
|
99
bin/qmk
99
bin/qmk
@ -4,8 +4,10 @@
|
||||
import os
|
||||
import subprocess
|
||||
import sys
|
||||
from importlib.util import find_spec
|
||||
from glob import glob
|
||||
from time import strftime
|
||||
from importlib import import_module
|
||||
from importlib.util import find_spec
|
||||
|
||||
# Add the QMK python libs to our path
|
||||
script_dir = os.path.dirname(os.path.realpath(__file__))
|
||||
@ -13,8 +15,12 @@ qmk_dir = os.path.abspath(os.path.join(script_dir, '..'))
|
||||
python_lib_dir = os.path.abspath(os.path.join(qmk_dir, 'lib', 'python'))
|
||||
sys.path.append(python_lib_dir)
|
||||
|
||||
# Change to the root of our checkout
|
||||
os.environ['ORIG_CWD'] = os.getcwd()
|
||||
os.chdir(qmk_dir)
|
||||
|
||||
# Make sure our modules have been setup
|
||||
with open(os.path.join(qmk_dir, 'requirements.txt'), 'r') as fd:
|
||||
with open('requirements.txt', 'r') as fd:
|
||||
for line in fd.readlines():
|
||||
line = line.strip().replace('<', '=').replace('>', '=')
|
||||
|
||||
@ -25,64 +31,73 @@ with open(os.path.join(qmk_dir, 'requirements.txt'), 'r') as fd:
|
||||
line = line.split('#')[0]
|
||||
|
||||
module = line.split('=')[0] if '=' in line else line
|
||||
|
||||
if module in ['pep8-naming']:
|
||||
# Not every module is importable by its own name.
|
||||
continue
|
||||
|
||||
if not find_spec(module):
|
||||
print('Could not find module %s!' % module)
|
||||
print('Please run `pip3 install -r requirements.txt` to install the python dependencies.')
|
||||
print('Your QMK build environment is not fully setup!\n')
|
||||
print('Please run `./util/qmk_install.sh` to setup QMK.')
|
||||
exit(255)
|
||||
|
||||
# Figure out our version
|
||||
# TODO(skullydazed/anyone): Find a method that doesn't involve git. This is slow in docker and on windows.
|
||||
command = ['git', 'describe', '--abbrev=6', '--dirty', '--always', '--tags']
|
||||
result = subprocess.run(command, universal_newlines=True, stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
|
||||
result = subprocess.run(command, universal_newlines=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
|
||||
|
||||
if result.returncode == 0:
|
||||
os.environ['QMK_VERSION'] = result.stdout.strip()
|
||||
os.environ['QMK_VERSION'] = 'QMK ' + result.stdout.strip()
|
||||
else:
|
||||
os.environ['QMK_VERSION'] = 'nogit-' + strftime('%Y-%m-%d-%H:%M:%S') + '-dirty'
|
||||
os.environ['QMK_VERSION'] = 'QMK ' + strftime('%Y-%m-%d-%H:%M:%S')
|
||||
|
||||
# Setup the CLI
|
||||
import milc # noqa
|
||||
|
||||
import milc
|
||||
milc.EMOJI_LOGLEVELS['INFO'] = '{fg_blue}Ψ{style_reset_all}'
|
||||
|
||||
# If we were invoked as `qmk <cmd>` massage sys.argv into `qmk-<cmd>`.
|
||||
# This means we can't accept arguments to the qmk script itself.
|
||||
script_name = os.path.basename(sys.argv[0])
|
||||
if script_name == 'qmk':
|
||||
if len(sys.argv) == 1:
|
||||
milc.cli.log.error('No subcommand specified!\n')
|
||||
|
||||
@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.chdir(qmk_dir)
|
||||
|
||||
# Import the subcommands
|
||||
import qmk.cli # noqa
|
||||
|
||||
# Execute
|
||||
return_code = milc.cli()
|
||||
|
||||
if return_code is False:
|
||||
if len(sys.argv) == 1 or sys.argv[1] in ['-h', '--help']:
|
||||
milc.cli.echo('usage: qmk <subcommand> [...]')
|
||||
milc.cli.echo('\nsubcommands:')
|
||||
subcommands = glob(os.path.join(qmk_dir, 'bin', 'qmk-*'))
|
||||
for subcommand in sorted(subcommands):
|
||||
subcommand = os.path.basename(subcommand).split('-', 1)[1]
|
||||
milc.cli.echo('\t%s', subcommand)
|
||||
milc.cli.echo('\nqmk <subcommand> --help for more information')
|
||||
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)
|
||||
if sys.argv[1] in ['-V', '--version']:
|
||||
milc.cli.echo(os.environ['QMK_VERSION'])
|
||||
exit(0)
|
||||
|
||||
exit(return_code)
|
||||
sys.argv[0] = script_name = '-'.join((script_name, sys.argv[1]))
|
||||
del sys.argv[1]
|
||||
|
||||
# Look for which module to import
|
||||
if script_name == 'qmk':
|
||||
milc.cli.print_help()
|
||||
exit(0)
|
||||
elif not script_name.startswith('qmk-'):
|
||||
milc.cli.log.error('Invalid symlink, must start with "qmk-": %s', script_name)
|
||||
else:
|
||||
subcommand = script_name.replace('-', '.').replace('_', '.').split('.')
|
||||
subcommand.insert(1, 'cli')
|
||||
subcommand = '.'.join(subcommand)
|
||||
|
||||
try:
|
||||
import_module(subcommand)
|
||||
except ModuleNotFoundError as e:
|
||||
if e.__class__.__name__ != subcommand:
|
||||
raise
|
||||
|
||||
milc.cli.log.error('Invalid subcommand! Could not import %s.', subcommand)
|
||||
exit(1)
|
||||
|
||||
if __name__ == '__main__':
|
||||
main()
|
||||
return_code = milc.cli()
|
||||
if return_code is False:
|
||||
exit(1)
|
||||
elif return_code is not True and isinstance(return_code, int) and return_code < 256:
|
||||
exit(return_code)
|
||||
else:
|
||||
exit(0)
|
||||
|
1
bin/qmk-compile-json
Symbolic link
1
bin/qmk-compile-json
Symbolic link
@ -0,0 +1 @@
|
||||
qmk
|
1
bin/qmk-doctor
Symbolic link
1
bin/qmk-doctor
Symbolic link
@ -0,0 +1 @@
|
||||
qmk
|
1
bin/qmk-hello
Symbolic link
1
bin/qmk-hello
Symbolic link
@ -0,0 +1 @@
|
||||
qmk
|
1
bin/qmk-json-keymap
Symbolic link
1
bin/qmk-json-keymap
Symbolic link
@ -0,0 +1 @@
|
||||
qmk
|
@ -82,13 +82,6 @@ ifeq ($(strip $(BOOTLOADER)), USBasp)
|
||||
OPT_DEFS += -DBOOTLOADER_USBASP
|
||||
BOOTLOADER_SIZE = 4096
|
||||
endif
|
||||
ifeq ($(strip $(BOOTLOADER)), lufa-ms)
|
||||
# DO NOT USE THIS BOOTLOADER IN NEW PROJECTS!
|
||||
# It is extremely prone to bricking, and is only included to support existing boards.
|
||||
OPT_DEFS += -DBOOTLOADER_MS
|
||||
BOOTLOADER_SIZE = 6144
|
||||
FIRMWARE_FORMAT = bin
|
||||
endif
|
||||
|
||||
ifdef BOOTLOADER_SIZE
|
||||
OPT_DEFS += -DBOOTLOADER_SIZE=$(strip $(BOOTLOADER_SIZE))
|
||||
|
@ -22,5 +22,6 @@ else ifneq ("$(wildcard $(MAIN_KEYMAP_PATH_1)/keymap.json)","")
|
||||
endif
|
||||
|
||||
# Generate the keymap.c
|
||||
$(KEYBOARD_OUTPUT)/src/keymap.c: $(KEYMAP_JSON)
|
||||
bin/qmk json2c --quiet --output $(KEYMAP_C) $(KEYMAP_JSON)
|
||||
ifneq ("$(KEYMAP_JSON)","")
|
||||
_ = $(shell test -e $(KEYMAP_C) || bin/qmk-json-keymap $(KEYMAP_JSON) -o $(KEYMAP_C))
|
||||
endif
|
||||
|
@ -231,19 +231,44 @@ endif
|
||||
# We can assume a ChibiOS target When MCU_FAMILY is defined since it's
|
||||
# not used for LUFA
|
||||
ifdef MCU_FAMILY
|
||||
PLATFORM=CHIBIOS
|
||||
PLATFORM_KEY=chibios
|
||||
FIRMWARE_FORMAT?=bin
|
||||
PLATFORM=CHIBIOS
|
||||
else ifdef ARM_ATSAM
|
||||
PLATFORM=ARM_ATSAM
|
||||
PLATFORM_KEY=arm_atsam
|
||||
FIRMWARE_FORMAT=bin
|
||||
else
|
||||
PLATFORM=AVR
|
||||
PLATFORM_KEY=avr
|
||||
FIRMWARE_FORMAT?=hex
|
||||
endif
|
||||
|
||||
ifeq ($(PLATFORM),CHIBIOS)
|
||||
include $(TMK_PATH)/chibios.mk
|
||||
OPT_OS = chibios
|
||||
ifneq ("$(wildcard $(KEYBOARD_PATH_5)/bootloader_defs.h)","")
|
||||
OPT_DEFS += -include $(KEYBOARD_PATH_5)/bootloader_defs.h
|
||||
else ifneq ("$(wildcard $(KEYBOARD_PATH_5)/boards/$(BOARD)/bootloader_defs.h)","")
|
||||
OPT_DEFS += -include $(KEYBOARD_PATH_5)/boards/$(BOARD)/bootloader_defs.h
|
||||
else ifneq ("$(wildcard $(KEYBOARD_PATH_4)/bootloader_defs.h)","")
|
||||
OPT_DEFS += -include $(KEYBOARD_PATH_4)/bootloader_defs.h
|
||||
else ifneq ("$(wildcard $(KEYBOARD_PATH_4)/boards/$(BOARD)/bootloader_defs.h)","")
|
||||
OPT_DEFS += -include $(KEYBOARD_PATH_4)/boards/$(BOARD)/bootloader_defs.h
|
||||
else ifneq ("$(wildcard $(KEYBOARD_PATH_3)/bootloader_defs.h)","")
|
||||
OPT_DEFS += -include $(KEYBOARD_PATH_3)/bootloader_defs.h
|
||||
else ifneq ("$(wildcard $(KEYBOARD_PATH_3)/boards/$(BOARD)/bootloader_defs.h)","")
|
||||
OPT_DEFS += -include $(KEYBOARD_PATH_3)/boards/$(BOARD)/bootloader_defs.h
|
||||
else ifneq ("$(wildcard $(KEYBOARD_PATH_2)/bootloader_defs.h)","")
|
||||
OPT_DEFS += -include $(KEYBOARD_PATH_2)/bootloader_defs.h
|
||||
else ifneq ("$(wildcard $(KEYBOARD_PATH_2)/boards/$(BOARD)/bootloader_defs.h)","")
|
||||
OPT_DEFS += -include $(KEYBOARD_PATH_2)/boards/$(BOARD)/bootloader_defs.h
|
||||
else ifneq ("$(wildcard $(KEYBOARD_PATH_1)/bootloader_defs.h)","")
|
||||
OPT_DEFS += -include $(KEYBOARD_PATH_1)/bootloader_defs.h
|
||||
else ifneq ("$(wildcard $(KEYBOARD_PATH_1)/boards/$(BOARD)/bootloader_defs.h)","")
|
||||
OPT_DEFS += -include $(KEYBOARD_PATH_1)/boards/$(BOARD)/bootloader_defs.h
|
||||
else ifneq ("$(wildcard $(TOP_DIR)/drivers/boards/$(BOARD)/bootloader_defs.h)","")
|
||||
OPT_DEFS += -include $(TOP_DIR)/drivers/boards/$(BOARD)/bootloader_defs.h
|
||||
endif
|
||||
endif
|
||||
|
||||
# Find all of the config.h files and add them to our CONFIG_H define.
|
||||
CONFIG_H :=
|
||||
ifneq ("$(wildcard $(KEYBOARD_PATH_5)/config.h)","")
|
||||
@ -279,6 +304,11 @@ ifneq ("$(wildcard $(KEYBOARD_PATH_5)/post_config.h)","")
|
||||
POST_CONFIG_H += $(KEYBOARD_PATH_5)/post_config.h
|
||||
endif
|
||||
|
||||
# Save the defines and includes here, so we don't include any keymap specific ones
|
||||
PROJECT_DEFS := $(OPT_DEFS)
|
||||
PROJECT_INC := $(VPATH) $(EXTRAINCDIRS) $(KEYBOARD_PATHS)
|
||||
PROJECT_CONFIG := $(CONFIG_H)
|
||||
|
||||
# Userspace setup and definitions
|
||||
ifeq ("$(USER_NAME)","")
|
||||
USER_NAME := $(KEYMAP)
|
||||
@ -324,17 +354,23 @@ SRC += $(TMK_COMMON_SRC)
|
||||
OPT_DEFS += $(TMK_COMMON_DEFS)
|
||||
EXTRALDFLAGS += $(TMK_COMMON_LDFLAGS)
|
||||
|
||||
include $(TMK_PATH)/$(PLATFORM_KEY).mk
|
||||
ifneq ($(strip $(PROTOCOL)),)
|
||||
include $(TMK_PATH)/protocol/$(strip $(shell echo $(PROTOCOL) | tr '[:upper:]' '[:lower:]')).mk
|
||||
ifeq ($(PLATFORM),AVR)
|
||||
ifeq ($(strip $(PROTOCOL)), VUSB)
|
||||
include $(TMK_PATH)/protocol/vusb.mk
|
||||
else
|
||||
include $(TMK_PATH)/protocol/$(PLATFORM_KEY).mk
|
||||
include $(TMK_PATH)/protocol/lufa.mk
|
||||
endif
|
||||
include $(TMK_PATH)/avr.mk
|
||||
endif
|
||||
|
||||
# TODO: remove this bodge?
|
||||
PROJECT_DEFS := $(OPT_DEFS)
|
||||
PROJECT_INC := $(VPATH) $(EXTRAINCDIRS) $(KEYBOARD_PATHS)
|
||||
PROJECT_CONFIG := $(CONFIG_H)
|
||||
ifeq ($(PLATFORM),ARM_ATSAM)
|
||||
include $(TMK_PATH)/arm_atsam.mk
|
||||
include $(TMK_PATH)/protocol/arm_atsam.mk
|
||||
endif
|
||||
|
||||
ifeq ($(PLATFORM),CHIBIOS)
|
||||
include $(TMK_PATH)/protocol/chibios.mk
|
||||
endif
|
||||
|
||||
ifeq ($(strip $(VISUALIZER_ENABLE)), yes)
|
||||
VISUALIZER_DIR = $(QUANTUM_DIR)/visualizer
|
||||
|
@ -41,7 +41,6 @@ all: elf
|
||||
|
||||
VPATH += $(COMMON_VPATH)
|
||||
PLATFORM:=TEST
|
||||
PLATFORM_KEY:=test
|
||||
|
||||
ifneq ($(filter $(FULL_TESTS),$(TEST)),)
|
||||
include tests/$(TEST)/rules.mk
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -1,75 +0,0 @@
|
||||
# QMK Breaking Change - 2020 Feb 29 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.
|
||||
|
||||
|
||||
## Update ChibiOS/ChibiOS-Contrib/uGFX submodules
|
||||
|
||||
* General Notes
|
||||
* A `make git-submodule` may be required after pulling the latest QMK firmware code to update affected submodules to the upgraded revisions
|
||||
* Enabling link-time-optimization (`LINK_TIME_OPTIMIZATION_ENABLE = yes`) should work on a lot more boards
|
||||
* Upgrade to ChibiOS ver19.1.3
|
||||
* This will allow QMK to update to upstream ChibiOS a lot easier -- the old version was ~2 years out of date. Automated update scripts have been made available to simplify future upgrades.
|
||||
* Includes improved MCU support and bugfixes
|
||||
* ChibiOS revision is now included in Command output
|
||||
* Timers should now be more accurate
|
||||
* Upgrade to newer ChibiOS-Contrib
|
||||
* Also includes improved MCU support and bugfixes
|
||||
* ChibiOS-Contrib revision is now included in Command output
|
||||
* Upgrade to newer uGFX
|
||||
* Required in order to support updated ChibiOS
|
||||
|
||||
|
||||
## Fix ChibiOS timer overflow for 16-bit SysTick devices
|
||||
|
||||
* On 16-bit SysTick devices, the timer subsystem in QMK was incorrectly dealing with overflow.
|
||||
* When running at a 100000 SysTick frequency (possible on 16-bit devices, but uncommon), this overflow would occur after 0.65 seconds.
|
||||
* Timers are now correctly handling this overflow case and timing should now be correct on ChibiOS/ARM.
|
||||
|
||||
|
||||
## Update LUFA submodule
|
||||
|
||||
* Updates the LUFA submodule to include updates from upstream (abcminiuser/lufa)
|
||||
* Includes some cleanup for QMK DFU generation
|
||||
|
||||
|
||||
## Encoder flip
|
||||
|
||||
* Flips the encoder direction so that `clockwise == true` is for actually turning the knob clockwise
|
||||
* Adds `ENCODER_DIRECTION_FLIP` define, so that reversing the expected dirction is simple for users.
|
||||
* Cleans up documentation page for encoders
|
||||
|
||||
|
||||
## Adding support for `BACKLIGHT_ON_STATE` for hardware PWM backlight
|
||||
|
||||
* Previously, the define only affected software PWM, and hardware PWM always assumed an N-channel MOSFET.
|
||||
* The hardware PWM backlight setup has been updated to respect this option.
|
||||
* The default "on" state has been changed to `1` - **this impacts all keyboards using software PWM backlight that do not define it explicitly**. If your keyboard's backlight is acting strange, it may have a P-channel MOSFET, and will need to have `#define BACKLIGHT_ON_STATE 0` added to the keyboard-level `config.h`. Please see the PR for more detailed information.
|
||||
|
||||
|
||||
## Migrating `ACTION_LAYER_TAP_KEY()` entries in `fn_actions` to `LT()` keycodes
|
||||
|
||||
* `fn_actions` is deprecated, and its functionality has been superseded by direct keycodes and `process_record_user()`
|
||||
* The end result of removing this obsolete feature should result in a decent reduction in firmware size and code complexity
|
||||
* All keymaps affected are recommended to switch away from `fn_actions` in favour of the [custom keycode](https://docs.qmk.fm/#/custom_quantum_functions) and [macro](https://docs.qmk.fm/#/feature_macros) features
|
||||
|
||||
|
||||
## Moving backlight keycode handling to `process_keycode/`
|
||||
|
||||
* This refactors the backlight keycode logic to be clearer and more modular.
|
||||
* All backlight-related keycodes are now actioned in a single file.
|
||||
* The `ACTION_BACKLIGHT_*` macros have also been deleted. If you are still using these in a `fn_actions[]` block, please switch to using the backlight keycodes or functions directly.
|
||||
|
||||
|
||||
## Refactor Planck keymaps to use Layout Macros
|
||||
|
||||
* Refactor Planck keymaps to use layout macros instead of raw matrix assignments
|
||||
* Makes keymaps revision-agnostic
|
||||
* Should reduce noise and errors in Travis CI logs
|
||||
|
||||
|
||||
## GON NerD codebase refactor
|
||||
|
||||
* Splits the codebase for GON NerD 60 and NerdD TKL PCBs into two separate directories.
|
||||
* If your keymap is for a NerD 60 PCB, your `make` command is now `make gon/nerd60:<keymap>`.
|
||||
* If your keymap is for a NerD TKL PCB, your `make` command is now `make gon/nerdtkl:<keymap>`.
|
4
docs/LANGS.md
Normal file
4
docs/LANGS.md
Normal file
@ -0,0 +1,4 @@
|
||||
# Languages
|
||||
|
||||
* [English](/)
|
||||
* [Chinese](zh/)
|
@ -9,35 +9,24 @@
|
||||
|
||||
## What is QMK Firmware?
|
||||
|
||||
QMK (*Quantum Mechanical Keyboard*) is an open source community centered around developing computer input devices. The community encompasses all sorts of input devices, such as keyboards, mice, and MIDI devices. A core group of collaborators maintains [QMK Firmware](https://github.com/qmk/qmk_firmware), [QMK Configurator](https://config.qmk.fm), [QMK Toolbox](https://github.com/qmk/qmk_toolbox), [qmk.fm](https://qmk.fm), and this documentation with the help of community members like you.
|
||||
QMK (*Quantum Mechanical Keyboard*) is an open source community that maintains QMK Firmware, QMK Toolbox, qmk.fm, and these docs. QMK Firmware is a keyboard firmware based on the [tmk\_keyboard](http://github.com/tmk/tmk_keyboard) with some useful features for Atmel AVR controllers, and more specifically, the [OLKB product line](http://olkb.com), the [ErgoDox EZ](http://www.ergodox-ez.com) keyboard, and the [Clueboard product line](http://clueboard.co/). It has also been ported to ARM chips using ChibiOS. You can use it to power your own hand-wired or custom keyboard PCB.
|
||||
|
||||
## Get Started
|
||||
## How to Get It
|
||||
|
||||
Totally new to QMK? There are two ways to get started:
|
||||
If you plan on contributing a keymap, keyboard, or features to QMK, the easiest thing to do is [fork the repo through Github](https://github.com/qmk/qmk_firmware#fork-destination-box), and clone your repo locally to make your changes, push them, then open a [Pull Request](https://github.com/qmk/qmk_firmware/pulls) from your fork.
|
||||
|
||||
* Basic: [QMK Configurator](https://config.qmk.fm)
|
||||
* Just select your keyboard from the dropdown and program your keyboard.
|
||||
* We have an [introductory video](https://www.youtube.com/watch?v=-imgglzDMdY) you can watch.
|
||||
* There is also an overview [document you can read](newbs_building_firmware_configurator.md).
|
||||
* Advanced: [Use The Source](newbs.md)
|
||||
* More powerful, but harder to use
|
||||
Otherwise, you can either download it directly ([zip](https://github.com/qmk/qmk_firmware/zipball/master), [tar](https://github.com/qmk/qmk_firmware/tarball/master)), or clone it via git (`git@github.com:qmk/qmk_firmware.git`), or https (`https://github.com/qmk/qmk_firmware.git`).
|
||||
|
||||
## Make It Yours
|
||||
## How to Compile
|
||||
|
||||
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).
|
||||
Before you are able to compile, you'll need to [install an environment](getting_started_build_tools.md) for AVR or/and ARM development. Once that is complete, you'll use the `make` command to build a keyboard and keymap with the following notation:
|
||||
|
||||
## Need help?
|
||||
make planck/rev4:default
|
||||
|
||||
Check out the [support page](support.md) to see how you can get help using QMK.
|
||||
This would build the `rev4` revision of the `planck` with the `default` keymap. Not all keyboards have revisions (also called subprojects or folders), in which case, it can be omitted:
|
||||
|
||||
## Give Back
|
||||
make preonic:default
|
||||
|
||||
There are a lot of ways you can contribute to the QMK Community. The easiest way to get started is to use it and spread the word to your friends.
|
||||
## How to Customize
|
||||
|
||||
* Help people out on our forums and chat rooms:
|
||||
* [/r/olkb](https://www.reddit.com/r/olkb/)
|
||||
* [Discord Server](https://discord.gg/Uq7gcHh)
|
||||
* Contribute to our documentation by clicking "Edit This Page" at the bottom
|
||||
* [Translate our documentation into your language](translating.md)
|
||||
* [Report a bug](https://github.com/qmk/qmk_firmware/issues/new/choose)
|
||||
* [Open a Pull Request](contributing.md)
|
||||
QMK has lots of [features](features.md) to explore, and a good deal of [reference documentation](http://docs.qmk.fm) to dig through. Most features are taken advantage of by modifying your [keymap](keymap.md), and changing the [keycodes](keycodes.md).
|
||||
|
@ -1,9 +0,0 @@
|
||||
- Translations
|
||||
- [:uk: English](/)
|
||||
- [:cn: 中文](/zh-cn/)
|
||||
- [:es: Español](/es/)
|
||||
- [:fr: Français](/fr-fr/)
|
||||
- [:he: עברית](/he-il/)
|
||||
- [:brazil: Português](/pt-br/)
|
||||
- [:ru: Русский](/ru-ru/)
|
||||
- [:jp: 日本語](/ja/)
|
255
docs/_summary.md
255
docs/_summary.md
@ -1,162 +1,119 @@
|
||||
* Tutorial
|
||||
* [Introduction](newbs.md)
|
||||
* [Setup](newbs_getting_started.md)
|
||||
* [Complete Newbs Guide](newbs.md)
|
||||
* [Getting Started](newbs_getting_started.md)
|
||||
* [Building Your First Firmware](newbs_building_firmware.md)
|
||||
* [Flashing Firmware](newbs_flashing.md)
|
||||
* [Testing and Debugging](newbs_testing_debugging.md)
|
||||
* [Getting Help/Support](support.md)
|
||||
* [Other Resources](newbs_learn_more_resources.md)
|
||||
* [Git Best Practices](newbs_best_practices.md)
|
||||
* [Learning Resources](newbs_learn_more_resources.md)
|
||||
|
||||
* FAQs
|
||||
* [QMK Basics](README.md)
|
||||
* [QMK Introduction](getting_started_introduction.md)
|
||||
* [QMK CLI](cli.md)
|
||||
* [Contributing to QMK](contributing.md)
|
||||
* [How to Use Github](getting_started_github.md)
|
||||
* [Getting Help](getting_started_getting_help.md)
|
||||
|
||||
* [Breaking Changes](breaking_changes.md)
|
||||
* [2019 Aug 30](ChangeLog/20190830.md)
|
||||
|
||||
* [FAQ](faq.md)
|
||||
* [General FAQ](faq_general.md)
|
||||
* [Build/Compile QMK](faq_build.md)
|
||||
* [Debugging/Troubleshooting QMK](faq_debug.md)
|
||||
* [Keymap FAQ](faq_keymap.md)
|
||||
* [Keymap](faq_keymap.md)
|
||||
* [Driver Installation with Zadig](driver_installation_zadig.md)
|
||||
|
||||
* Detailed Guides
|
||||
* [Install Build Tools](getting_started_build_tools.md)
|
||||
* [Vagrant Guide](getting_started_vagrant.md)
|
||||
* [Build/Compile Instructions](getting_started_make_guide.md)
|
||||
* [Flashing Firmware](flashing.md)
|
||||
* [Customizing Functionality](custom_quantum_functions.md)
|
||||
* [Keymap Overview](keymap.md)
|
||||
|
||||
* [Hardware](hardware.md)
|
||||
* [AVR Processors](hardware_avr.md)
|
||||
* [Drivers](hardware_drivers.md)
|
||||
|
||||
* Reference
|
||||
* [Keyboard Guidelines](hardware_keyboard_guidelines.md)
|
||||
* [Config Options](config_options.md)
|
||||
* [Keycodes](keycodes.md)
|
||||
* [Coding Conventions - C](coding_conventions_c.md)
|
||||
* [Coding Conventions - Python](coding_conventions_python.md)
|
||||
* [Documentation Best Practices](documentation_best_practices.md)
|
||||
* [Documentation Templates](documentation_templates.md)
|
||||
* [Glossary](reference_glossary.md)
|
||||
* [Unit Testing](unit_testing.md)
|
||||
* [Useful Functions](ref_functions.md)
|
||||
* [Configurator Support](reference_configurator_support.md)
|
||||
* [info.json Format](reference_info_json.md)
|
||||
* [Python Development](python_development.md)
|
||||
|
||||
* Configurator
|
||||
* [Overview](newbs_building_firmware_configurator.md)
|
||||
* [Step by Step](configurator_step_by_step.md)
|
||||
* [Troubleshooting](configurator_troubleshooting.md)
|
||||
* QMK API
|
||||
* [Overview](api_overview.md)
|
||||
* [API Documentation](api_docs.md)
|
||||
* [Keyboard Support](reference_configurator_support.md)
|
||||
* [Features](features.md)
|
||||
* [Basic Keycodes](keycodes_basic.md)
|
||||
* [US ANSI Shifted Keys](keycodes_us_ansi_shifted.md)
|
||||
* [Quantum Keycodes](quantum_keycodes.md)
|
||||
* [Advanced Keycodes](feature_advanced_keycodes.md)
|
||||
* [Audio](feature_audio.md)
|
||||
* [Auto Shift](feature_auto_shift.md)
|
||||
* [Backlight](feature_backlight.md)
|
||||
* [Bluetooth](feature_bluetooth.md)
|
||||
* [Bootmagic](feature_bootmagic.md)
|
||||
* [Combos](feature_combo.md)
|
||||
* [Command](feature_command.md)
|
||||
* [Debounce API](feature_debounce_type.md)
|
||||
* [DIP Switch](feature_dip_switch.md)
|
||||
* [Dynamic Macros](feature_dynamic_macros.md)
|
||||
* [Encoders](feature_encoders.md)
|
||||
* [Grave Escape](feature_grave_esc.md)
|
||||
* [Haptic Feedback](feature_haptic_feedback.md)
|
||||
* [HD44780 LCD Controller](feature_hd44780.md)
|
||||
* [Key Lock](feature_key_lock.md)
|
||||
* [Layouts](feature_layouts.md)
|
||||
* [Leader Key](feature_leader_key.md)
|
||||
* [LED Matrix](feature_led_matrix.md)
|
||||
* [Macros](feature_macros.md)
|
||||
* [Mouse Keys](feature_mouse_keys.md)
|
||||
* [OLED Driver](feature_oled_driver.md)
|
||||
* [One Shot Keys](feature_advanced_keycodes.md#one-shot-keys)
|
||||
* [Pointing Device](feature_pointing_device.md)
|
||||
* [PS/2 Mouse](feature_ps2_mouse.md)
|
||||
* [RGB Lighting](feature_rgblight.md)
|
||||
* [RGB Matrix](feature_rgb_matrix.md)
|
||||
* [Space Cadet](feature_space_cadet.md)
|
||||
* [Split Keyboard](feature_split_keyboard.md)
|
||||
* [Stenography](feature_stenography.md)
|
||||
* [Swap Hands](feature_swap_hands.md)
|
||||
* [Tap Dance](feature_tap_dance.md)
|
||||
* [Terminal](feature_terminal.md)
|
||||
* [Thermal Printer](feature_thermal_printer.md)
|
||||
* [Unicode](feature_unicode.md)
|
||||
* [Userspace](feature_userspace.md)
|
||||
* [Velocikey](feature_velocikey.md)
|
||||
|
||||
* CLI
|
||||
* [Overview](cli.md)
|
||||
* [Configuration](cli_configuration.md)
|
||||
* [Commands](cli_commands.md)
|
||||
* For Makers and Modders
|
||||
* [Hand Wiring Guide](hand_wire.md)
|
||||
* [ISP Flashing Guide](isp_flashing_guide.md)
|
||||
* [ARM Debugging Guide](arm_debugging.md)
|
||||
* [I2C Driver](i2c_driver.md)
|
||||
* [GPIO Controls](internals_gpio_control.md)
|
||||
* [Proton C Conversion](proton_c_conversion.md)
|
||||
|
||||
* Using QMK
|
||||
* Guides
|
||||
* [Customizing Functionality](custom_quantum_functions.md)
|
||||
* [Driver Installation with Zadig](driver_installation_zadig.md)
|
||||
* [Keymap Overview](keymap.md)
|
||||
* [Vagrant Guide](getting_started_vagrant.md)
|
||||
* Flashing
|
||||
* [Flashing](flashing.md)
|
||||
* [Flashing ATmega32A (ps2avrgb)](flashing_bootloadhid.md)
|
||||
* IDEs
|
||||
* [Using Eclipse with QMK](other_eclipse.md)
|
||||
* [Using VSCode with QMK](other_vscode.md)
|
||||
* Git Best Practices
|
||||
* [Introduction](newbs_git_best_practices.md)
|
||||
* [Your Fork](newbs_git_using_your_master_branch.md)
|
||||
* [Merge Conflicts](newbs_git_resolving_merge_conflicts.md)
|
||||
* [Fixing Your Branch](newbs_git_resynchronize_a_branch.md)
|
||||
* Keyboard Building
|
||||
* [Hand Wiring Guide](hand_wire.md)
|
||||
* [ISP Flashing Guide](isp_flashing_guide.md)
|
||||
* For a Deeper Understanding
|
||||
* [How Keyboards Work](how_keyboards_work.md)
|
||||
* [Understanding QMK](understanding_qmk.md)
|
||||
|
||||
* Simple Keycodes
|
||||
* [Full List](keycodes.md)
|
||||
* [Basic Keycodes](keycodes_basic.md)
|
||||
* [Modifier Keys](feature_advanced_keycodes.md)
|
||||
* [Quantum Keycodes](quantum_keycodes.md)
|
||||
* Other Topics
|
||||
* [Using Eclipse with QMK](other_eclipse.md)
|
||||
* [Using VSCode with QMK](other_vscode.md)
|
||||
* [Support](support.md)
|
||||
|
||||
* Advanced Keycodes
|
||||
* [Command](feature_command.md)
|
||||
* [Dynamic Macros](feature_dynamic_macros.md)
|
||||
* [Grave Escape](feature_grave_esc.md)
|
||||
* [Leader Key](feature_leader_key.md)
|
||||
* [Mod-Tap](mod_tap.md)
|
||||
* [Macros](feature_macros.md)
|
||||
* [Mouse Keys](feature_mouse_keys.md)
|
||||
* [Space Cadet Shift](feature_space_cadet.md)
|
||||
* [US ANSI Shifted Keys](keycodes_us_ansi_shifted.md)
|
||||
|
||||
* Software Features
|
||||
* [Auto Shift](feature_auto_shift.md)
|
||||
* [Combos](feature_combo.md)
|
||||
* [Debounce API](feature_debounce_type.md)
|
||||
* [Key Lock](feature_key_lock.md)
|
||||
* [Layers](feature_layers.md)
|
||||
* [One Shot Keys](one_shot_keys.md)
|
||||
* [Pointing Device](feature_pointing_device.md)
|
||||
* [Swap Hands](feature_swap_hands.md)
|
||||
* [Tap Dance](feature_tap_dance.md)
|
||||
* [Tap-Hold Configuration](tap_hold.md)
|
||||
* [Terminal](feature_terminal.md)
|
||||
* [Unicode](feature_unicode.md)
|
||||
* [Userspace](feature_userspace.md)
|
||||
* [WPM Calculation](feature_wpm.md)
|
||||
|
||||
* Hardware Features
|
||||
* Displays
|
||||
* [HD44780 LCD Controller](feature_hd44780.md)
|
||||
* [OLED Driver](feature_oled_driver.md)
|
||||
* Lighting
|
||||
* [Backlight](feature_backlight.md)
|
||||
* [LED Matrix](feature_led_matrix.md)
|
||||
* [RGB Lighting](feature_rgblight.md)
|
||||
* [RGB Matrix](feature_rgb_matrix.md)
|
||||
* [Audio](feature_audio.md)
|
||||
* [Bluetooth](feature_bluetooth.md)
|
||||
* [Bootmagic](feature_bootmagic.md)
|
||||
* [Custom Matrix](custom_matrix.md)
|
||||
* [DIP Switch](feature_dip_switch.md)
|
||||
* [Encoders](feature_encoders.md)
|
||||
* [Haptic Feedback](feature_haptic_feedback.md)
|
||||
* [Proton C Conversion](proton_c_conversion.md)
|
||||
* [PS/2 Mouse](feature_ps2_mouse.md)
|
||||
* [Split Keyboard](feature_split_keyboard.md)
|
||||
* [Stenography](feature_stenography.md)
|
||||
* [Thermal Printer](feature_thermal_printer.md)
|
||||
* [Velocikey](feature_velocikey.md)
|
||||
|
||||
* Developing QMK
|
||||
* Breaking Changes
|
||||
* [Overview](breaking_changes.md)
|
||||
* [My Pull Request Was Flagged](breaking_changes_instructions.md)
|
||||
* History
|
||||
* [2020 Feb 29](ChangeLog/20200229.md)
|
||||
* [2019 Aug 30](ChangeLog/20190830.md)
|
||||
|
||||
* C Development
|
||||
* [ARM Debugging Guide](arm_debugging.md)
|
||||
* [AVR Processors](hardware_avr.md)
|
||||
* [Coding Conventions](coding_conventions_c.md)
|
||||
* [Compatible Microcontrollers](compatible_microcontrollers.md)
|
||||
* [Drivers](hardware_drivers.md)
|
||||
* [ADC Driver](adc_driver.md)
|
||||
* [I2C Driver](i2c_driver.md)
|
||||
* [WS2812 Driver](ws2812_driver.md)
|
||||
* [EEPROM Driver](eeprom_driver.md)
|
||||
* [GPIO Controls](internals_gpio_control.md)
|
||||
* [Keyboard Guidelines](hardware_keyboard_guidelines.md)
|
||||
|
||||
* Python Development
|
||||
* [Coding Conventions](coding_conventions_python.md)
|
||||
* [QMK CLI Development](cli_development.md)
|
||||
|
||||
* Configurator Development
|
||||
* QMK API
|
||||
* [Development Environment](api_development_environment.md)
|
||||
* [Architecture Overview](api_development_overview.md)
|
||||
|
||||
* QMK Reference
|
||||
* [Contributing to QMK](contributing.md)
|
||||
* [Translating the QMK Docs](translating.md)
|
||||
* [Config Options](config_options.md)
|
||||
* [Make Documentation](getting_started_make_guide.md)
|
||||
* [Documentation Best Practices](documentation_best_practices.md)
|
||||
* [Documentation Templates](documentation_templates.md)
|
||||
* [Community Layouts](feature_layouts.md)
|
||||
* [Unit Testing](unit_testing.md)
|
||||
* [Useful Functions](ref_functions.md)
|
||||
* [info.json Format](reference_info_json.md)
|
||||
|
||||
* For a Deeper Understanding
|
||||
* [How Keyboards Work](how_keyboards_work.md)
|
||||
* [How a Matrix Works](how_a_matrix_works.md)
|
||||
* [Understanding QMK](understanding_qmk.md)
|
||||
|
||||
* QMK Internals (In Progress)
|
||||
* [Defines](internals_defines.md)
|
||||
* [Input Callback Reg](internals_input_callback_reg.md)
|
||||
* [Midi Device](internals_midi_device.md)
|
||||
* [Midi Device Setup Process](internals_midi_device_setup_process.md)
|
||||
* [Midi Util](internals_midi_util.md)
|
||||
* [Send Functions](internals_send_functions.md)
|
||||
* [Sysex Tools](internals_sysex_tools.md)
|
||||
* QMK Internals (In Progress)
|
||||
* [Defines](internals_defines.md)
|
||||
* [Input Callback Reg](internals_input_callback_reg.md)
|
||||
* [Midi Device](internals_midi_device.md)
|
||||
* [Midi Device Setup Process](internals_midi_device_setup_process.md)
|
||||
* [Midi Util](internals_midi_util.md)
|
||||
* [Send Functions](internals_send_functions.md)
|
||||
* [Sysex Tools](internals_sysex_tools.md)
|
||||
|
@ -1,153 +0,0 @@
|
||||
# ADC Driver
|
||||
|
||||
QMK can leverage the Analog-to-Digital Converter (ADC) on supported MCUs to measure voltages on certain pins. This can be useful for implementing things such as battery level indicators for Bluetooth keyboards, or volume controls using a potentiometer, as opposed to a [rotary encoder](feature_encoders.md).
|
||||
|
||||
This driver currently supports both AVR and a limited selection of ARM devices. The values returned are 10-bit integers (0-1023) mapped between 0V and VCC (usually 5V or 3.3V for AVR, 3.3V only for ARM), however on ARM there is more flexibility in control of operation through `#define`s if you need more precision.
|
||||
|
||||
## Usage
|
||||
|
||||
To use this driver, add the following to your `rules.mk`:
|
||||
|
||||
```make
|
||||
SRC += analog.c
|
||||
```
|
||||
|
||||
Then place this include at the top of your code:
|
||||
|
||||
```c
|
||||
#include "analog.h"
|
||||
```
|
||||
|
||||
## Channels
|
||||
|
||||
### AVR
|
||||
|
||||
|Channel|AT90USB64/128|ATmega16/32U4|ATmega32A|ATmega328P|
|
||||
|-------|-------------|-------------|---------|----------|
|
||||
|0 |`F0` |`F0` |`A0` |`C0` |
|
||||
|1 |`F1` |`F1` |`A1` |`C1` |
|
||||
|2 |`F2` | |`A2` |`C2` |
|
||||
|3 |`F3` | |`A3` |`C3` |
|
||||
|4 |`F4` |`F4` |`A4` |`C4` |
|
||||
|5 |`F5` |`F5` |`A5` |`C5` |
|
||||
|6 |`F6` |`F6` |`A6` |* |
|
||||
|7 |`F7` |`F7` |`A7` |* |
|
||||
|8 | |`D4` | | |
|
||||
|9 | |`D6` | | |
|
||||
|10 | |`D7` | | |
|
||||
|11 | |`B4` | | |
|
||||
|12 | |`B5` | | |
|
||||
|13 | |`B6` | | |
|
||||
|
||||
<sup>\* The ATmega328P possesses two extra ADC channels; however, they are not present on the DIP pinout, and are not shared with GPIO pins. You can use `adc_read()` directly to gain access to these.</sup>
|
||||
|
||||
### ARM
|
||||
|
||||
Note that some of these pins are doubled-up on ADCs with the same channel. This is because the pins can be used for either ADC.
|
||||
|
||||
Also note that the F0 and F3 use different numbering schemes. The F0 has a single ADC and the channels are 0-based, whereas the F3 has 4 ADCs and the channels are 1 based. This is because the F0 uses the `ADCv1` implementation of the ADC, whereas the F3 uses the `ADCv3` implementation.
|
||||
|
||||
|ADC|Channel|STM32F0XX|STM32F3XX|
|
||||
|---|-------|---------|---------|
|
||||
|1 |0 |`A0` | |
|
||||
|1 |1 |`A1` |`A0` |
|
||||
|1 |2 |`A2` |`A1` |
|
||||
|1 |3 |`A3` |`A2` |
|
||||
|1 |4 |`A4` |`A3` |
|
||||
|1 |5 |`A5` |`F4` |
|
||||
|1 |6 |`A6` |`C0` |
|
||||
|1 |7 |`A7` |`C1` |
|
||||
|1 |8 |`B0` |`C2` |
|
||||
|1 |9 |`B1` |`C3` |
|
||||
|1 |10 |`C0` |`F2` |
|
||||
|1 |11 |`C1` | |
|
||||
|1 |12 |`C2` | |
|
||||
|1 |13 |`C3` | |
|
||||
|1 |14 |`C4` | |
|
||||
|1 |15 |`C5` | |
|
||||
|1 |16 | | |
|
||||
|2 |1 | |`A4` |
|
||||
|2 |2 | |`A5` |
|
||||
|2 |3 | |`A6` |
|
||||
|2 |4 | |`A7` |
|
||||
|2 |5 | |`C4` |
|
||||
|2 |6 | |`C0` |
|
||||
|2 |7 | |`C1` |
|
||||
|2 |8 | |`C2` |
|
||||
|2 |9 | |`C3` |
|
||||
|2 |10 | |`F2` |
|
||||
|2 |11 | |`C5` |
|
||||
|2 |12 | |`B2` |
|
||||
|2 |13 | | |
|
||||
|2 |14 | | |
|
||||
|2 |15 | | |
|
||||
|2 |16 | | |
|
||||
|3 |1 | |`B1` |
|
||||
|3 |2 | |`E9` |
|
||||
|3 |3 | |`E13` |
|
||||
|3 |4 | | |
|
||||
|3 |5 | | |
|
||||
|3 |6 | |`E8` |
|
||||
|3 |7 | |`D10` |
|
||||
|3 |8 | |`D11` |
|
||||
|3 |9 | |`D12` |
|
||||
|3 |10 | |`D13` |
|
||||
|3 |11 | |`D14` |
|
||||
|3 |12 | |`B0` |
|
||||
|3 |13 | |`E7` |
|
||||
|3 |14 | |`E10` |
|
||||
|3 |15 | |`E11` |
|
||||
|3 |16 | |`E12` |
|
||||
|4 |1 | |`E14` |
|
||||
|4 |2 | |`B12` |
|
||||
|4 |3 | |`B13` |
|
||||
|4 |4 | |`B14` |
|
||||
|4 |5 | |`B15` |
|
||||
|4 |6 | |`E8` |
|
||||
|4 |7 | |`D10` |
|
||||
|4 |8 | |`D11` |
|
||||
|4 |9 | |`D12` |
|
||||
|4 |10 | |`D13` |
|
||||
|4 |11 | |`D14` |
|
||||
|4 |12 | |`D8` |
|
||||
|4 |13 | |`D9` |
|
||||
|4 |14 | | |
|
||||
|4 |15 | | |
|
||||
|4 |16 | | |
|
||||
|
||||
## Functions
|
||||
|
||||
### AVR
|
||||
|
||||
|Function |Description |
|
||||
|----------------------------|-------------------------------------------------------------------------------------------------------------------|
|
||||
|`analogReference(mode)` |Sets the analog voltage reference source. Must be one of `ADC_REF_EXTERNAL`, `ADC_REF_POWER` or `ADC_REF_INTERNAL`.|
|
||||
|`analogRead(pin)` |Reads the value from the specified Arduino pin, eg. `4` for ADC6 on the ATmega32U4. |
|
||||
|`analogReadPin(pin)` |Reads the value from the specified QMK pin, eg. `F6` for ADC6 on the ATmega32U4. |
|
||||
|`pinToMux(pin)` |Translates a given QMK pin to a mux value. If an unsupported pin is given, returns the mux value for "0V (GND)". |
|
||||
|`adc_read(mux)` |Reads the value from the ADC according to the specified mux. See your MCU's datasheet for more information. |
|
||||
|
||||
### ARM
|
||||
|
||||
Note that care was taken to match all of the functions used for AVR devices, however complications in the ARM platform prevent that from always being possible. For example, the `STM32` chips do not have assigned Arduino pins. We could use the default pin numbers, but those numbers change based on the package type of the device. For this reason, please specify your target pins with their identifiers (`A0`, `F3`, etc.). Also note that there are some variants of functions that accept the target ADC for the pin. Some pins can be used for multiple ADCs, and this specified can help you pick which ADC will be used to interact with that pin.
|
||||
|
||||
|Function |Description |
|
||||
|----------------------------|--------------------------------------------------------------------------------------------------------------------|
|
||||
|`analogReadPin(pin)` |Reads the value from the specified QMK pin, eg. `A0` for channel 0 on the STM32F0 and ADC1 channel 1 on the STM32F3. Note that if a pin can be used for multiple ADCs, it will pick the lower numbered ADC for this function. eg. `C0` will be channel 6 of ADC 1 when it could be used for ADC 2 as well.|
|
||||
|`analogReadPinAdc(pin, adc)`|Reads the value from the specified QMK pin and ADC, eg. `C0, 1` will read from channel 6, ADC 2 instead of ADC 1. Note that the ADCs are 0-indexed for this function.|
|
||||
|`pinToMux(pin)` |Translates a given QMK pin to a channel and ADC combination. If an unsupported pin is given, returns the mux value for "0V (GND)".|
|
||||
|`adc_read(mux)` |Reads the value from the ADC according to the specified pin and adc combination. See your MCU's datasheet for more information.|
|
||||
|
||||
## Configuration
|
||||
|
||||
## ARM
|
||||
|
||||
The ARM implementation of the ADC has a few additional options that you can override in your own keyboards and keymaps to change how it operates.
|
||||
|
||||
|`#define` |Type |Default |Description|
|
||||
|-------------------|------|---------------------|-----------|
|
||||
|ADC_CIRCULAR_BUFFER|`bool`|`false` |If `TRUE`, then the implementation will use a circular buffer.|
|
||||
|ADC_NUM_CHANNELS |`int` |`1` |Sets the number of channels that will be scanned as part of an ADC operation. The current implementation only supports `1`.|
|
||||
|ADC_BUFFER_DEPTH |`int` |`2` |Sets the depth of each result. Since we are only getting a 12-bit result by default, we set this to `2` bytes so we can contain our one value. This could be set to 1 if you opt for a 8-bit or lower result.|
|
||||
|ADC_SAMPLING_RATE |`int` |`ADC_SMPR_SMP_1P5` |Sets the sampling rate of the ADC. By default, it is set to the fastest setting. Please consult the corresponding `hal_adc_lld.h` in ChibiOS for your specific microcontroller for further documentation on your available options.|
|
||||
|ADC_RESOLUTION |`int` |`ADC_CFGR1_RES_12BIT`|The resolution of your result. We choose 12 bit by default, but you can opt for 12, 10, 8, or 6 bit. Please consult the corresponding `hal_adc_lld.h` in ChibiOS for your specific microcontroller for further documentation on your available options.|
|
@ -1,3 +0,0 @@
|
||||
# Development Environment Setup
|
||||
|
||||
To setup a development stack head over to the [qmk_web_stack](https://github.com/qmk/qmk_web_stack).
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user