Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
* 'master' of https://github.com/qmk/qmk_firmware: (475 commits)
  [Keyboard] kbdfans keyboards NKRO enable (qmk#7364)
  [Keyboard] fix DZ60RGB info.json (qmk#7362)
  Adding new pcb with default keymap and personal keymap (qmk#7314)
  [Core] Cleanup rules.mk for F303 keyboards (qmk#7306)
  [Docs] Japanese translation of docs/ja/newbs_best_practices.md (qmk#7337)
  Set device version from config.h for V-USB boards (qmk#7316)
  Add support for configurable polling interval and power usage o… (qmk#7336)
  capslock_led (qmk#7359)
  Move Ergodox EZ RGB Light code to custom driver  (qmk#7309)
  Fix shell.nix by pinning nixpkgs (qmk#6213)
  [Keyboard] add kbdmini; dztech, kbdfans keyboards cleanup (qmk#7223)
  [Docs] Encourage newbs to not download the repo as a zip (qmk#7353)
  Update debounce docs (qmk#7355)
  [Keyboard] Add TG4x (qmk#7351)
  [Keyboard] Add FLX Virgo (qmk#7352)
  format code according to conventions [skip ci]
  Adding verd layout to RSII (qmk#7296)
  Add my custom layouts for GH60, DZ60 and Minivan (qmk#7278)
  [Keyboard] Added abnt2 layout to dz60 (qmk#7340)
  [Keyboard] add Little Keyboards as a seller of helix pcbs outside of japan (qmk#7249)
  ...
  • Loading branch information
Shinichi-Ohki committed Nov 15, 2019
2 parents ee8fffb + 1c9e450 commit 50b3659
Show file tree
Hide file tree
Showing 2,977 changed files with 105,520 additions and 51,532 deletions.
8 changes: 7 additions & 1 deletion .github/ISSUE_TEMPLATE/blank.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
---
name: Blank issue
about: If you're 100% sure that you don't need one of the other issue templates, use this one instead.
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: ''

---


7 changes: 6 additions & 1 deletion .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,12 @@
---
name: Bug report
about: Create a report to help us improve the QMK Firmware
about: Create a report to help us improve QMK Firmware.
title: "[Bug] "
labels: bug, help wanted, discussion
assignees: ''

---

<!-- Provide a general summary of the bug in the title above. -->

<!--- This template is entirely optional and can be removed, but is here to help both you and us. -->
Expand Down
8 changes: 8 additions & 0 deletions .github/ISSUE_TEMPLATE/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
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 changes: 6 additions & 1 deletion .github/ISSUE_TEMPLATE/feature_request.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,12 @@
---
name: Feature request
about: Suggest a new feature or changes to existing features
about: Suggest a new feature or changes to existing features.
title: "[Feature Request] "
labels: enhancement, help wanted, discussion
assignees: ''

---

<!--- Provide a general summary of the changes you want in the title above. -->

<!--- This template is entirely optional and can be removed, but is here to help both you and us. -->
Expand Down
7 changes: 6 additions & 1 deletion .github/ISSUE_TEMPLATE/other_issues.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,12 @@
---
name: Other issues
about: Anything else that doesn't fall into the above categories.
about: Anything else that doesn't fall into the above categories.
title: ''
labels: help wanted, question, discussion
assignees: ''

---

<!--- 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. -->
Expand Down
4 changes: 2 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -60,8 +60,8 @@ util/Win_Check_Output.txt

# ignore image files
*.png
*.jpg
*.gif
*.jpg

# Do not ignore MiniDox left/right hand eeprom files
!keyboards/minidox/*.eep
Expand Down
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
os: linux
dist: trusty
sudo: required
group: edge
language: c
branches:
Expand All @@ -17,6 +16,7 @@ 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
Expand Down
7 changes: 6 additions & 1 deletion .vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
// Suggested extensions
{
"recommendations": [
"EditorConfig.EditorConfig"
"EditorConfig.EditorConfig",
"xaver.clang-format",
"ms-vscode.cpptools",
"bierner.github-markdown-preview",
"donjayamanne.git-extension-pack",
"CoenraadS.bracket-pair-colorizer-2"
]
}
12 changes: 7 additions & 5 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,12 @@
"**/*.hex": true
},
"files.associations": {
"*.h": "c",
"*.c": "c",
"*.cpp": "cpp",
"*.hpp": "cpp",
"xstddef": "c"
"*.h": "c",
"*.c": "c",
"*.cpp": "cpp",
"*.hpp": "cpp",
"xstddef": "c",
"type_traits": "c",
"utility": "c"
}
}
21 changes: 17 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -371,6 +371,9 @@ define PARSE_KEYBOARD
# The same if all was specified
else ifeq ($$(call COMPARE_AND_REMOVE_FROM_RULE,all),true)
$$(eval $$(call PARSE_ALL_KEYMAPS))
# List all keymaps for the given keyboard
else ifeq ($$(call COMPARE_AND_REMOVE_FROM_RULE,list-keymaps),true)
$$(eval $$(call LIST_ALL_KEYMAPS))
# Try to match the specified keyamp with the list of known keymaps
else ifeq ($$(call TRY_TO_MATCH_RULE_FROM_LIST,$$(KEYMAPS)),true)
$$(eval $$(call PARSE_KEYMAP,$$(MATCHED_ITEM)))
Expand Down Expand Up @@ -407,6 +410,16 @@ endef
# endif
# endef

# Prints a list of all known keymaps for the given keyboard
define LIST_ALL_KEYMAPS
COMMAND_true_LIST_KEYMAPS := \
printf "$$(KEYMAPS)\n";
COMMAND_false_LIST_KEYMAPS := \
printf "$$(MSG_AVAILABLE_KEYMAPS)\n"; \
printf "$$(KEYMAPS)\n";
COMMANDS += LIST_KEYMAPS
endef

# $1 Keymap
# This is the meat of compiling a keyboard, when entering this, everything is known
# keyboard, subproject, and keymap
Expand Down Expand Up @@ -545,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 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
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
git submodule status --recursive 2>/dev/null | \
while IFS= read -r x; do \
case "$$x" in \
Expand Down
88 changes: 37 additions & 51 deletions bin/qmk
Original file line number Diff line number Diff line change
Expand Up @@ -4,23 +4,17 @@
import os
import subprocess
import sys
from glob import glob
from time import strftime
from importlib import import_module
from importlib.util import find_spec
from time import strftime

# Add the QMK python libs to our path
script_dir = os.path.dirname(os.path.realpath(__file__))
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('requirements.txt', 'r') as fd:
with open(os.path.join(qmk_dir, 'requirements.txt'), 'r') as fd:
for line in fd.readlines():
line = line.strip().replace('<', '=').replace('>', '=')

Expand All @@ -32,66 +26,58 @@ with open('requirements.txt', 'r') as fd:

module = line.split('=')[0] if '=' in line else line
if not find_spec(module):
print('Your QMK build environment is not fully setup!\n')
print('Please run `./util/qmk_install.sh` to setup QMK.')
print('Could not find module %s!' % module)
print('Please run `pip3 install -r requirements.txt` to install the python dependencies.')
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.PIPE)
result = subprocess.run(command, universal_newlines=True, stdout=subprocess.PIPE, stderr=subprocess.STDOUT)

if result.returncode == 0:
os.environ['QMK_VERSION'] = 'QMK ' + result.stdout.strip()
os.environ['QMK_VERSION'] = result.stdout.strip()
else:
os.environ['QMK_VERSION'] = 'QMK ' + strftime('%Y-%m-%d-%H:%M:%S')
os.environ['QMK_VERSION'] = 'nogit-' + strftime('%Y-%m-%d-%H:%M:%S') + '-dirty'

# Setup the CLI
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')

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)

if sys.argv[1] in ['-V', '--version']:
milc.cli.echo(os.environ['QMK_VERSION'])
exit(0)
@milc.cli.entrypoint('QMK Helper Script')
def qmk_main(cli):
"""The function that gets run when no subcommand is provided.
"""
cli.print_help()

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)
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)

try:
import_module(subcommand)
except ModuleNotFoundError as e:
if e.__class__.__name__ != subcommand:
raise
# Import the subcommands
import qmk.cli

milc.cli.log.error('Invalid subcommand! Could not import %s.', subcommand)
# 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__':
milc.cli()
main()
1 change: 0 additions & 1 deletion bin/qmk-compile-json

This file was deleted.

1 change: 0 additions & 1 deletion bin/qmk-doctor

This file was deleted.

1 change: 0 additions & 1 deletion bin/qmk-hello

This file was deleted.

1 change: 0 additions & 1 deletion bin/qmk-json-keymap

This file was deleted.

36 changes: 19 additions & 17 deletions bootloader.mk
Original file line number Diff line number Diff line change
Expand Up @@ -19,53 +19,55 @@
#
# Sets the bootloader defined in the keyboard's/keymap's rules.mk
# Current options:
# atmel-dfu
# lufa-dfu
# qmk-dfu
# halfkay
# caterina
# bootloadHID
#
# 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)
#
# 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
ifeq ($(strip $(MCU)), atmega32u4)
BOOTLOADER_SIZE = 4096
ifneq (,$(filter $(MCU), at90usb646 atmega16u2 atmega16u4 atmega32u2 atmega32u4))
BOOTLOADER_SIZE = 4096
endif
ifeq ($(strip $(MCU)), at90usb1286)
BOOTLOADER_SIZE = 8192
BOOTLOADER_SIZE = 8192
endif
endif
ifeq ($(strip $(BOOTLOADER)), lufa-dfu)
OPT_DEFS += -DBOOTLOADER_LUFA_DFU
OPT_DEFS += -DBOOTLOADER_DFU
ifeq ($(strip $(MCU)), atmega32u4)
BOOTLOADER_SIZE = 4096
ifneq (,$(filter $(MCU), at90usb646 atmega16u2 atmega16u4 atmega32u2 atmega32u4))
BOOTLOADER_SIZE = 4096
endif
ifeq ($(strip $(MCU)), at90usb1286)
BOOTLOADER_SIZE = 8192
BOOTLOADER_SIZE = 8192
endif
endif
ifeq ($(strip $(BOOTLOADER)), qmk-dfu)
OPT_DEFS += -DBOOTLOADER_QMK_DFU
OPT_DEFS += -DBOOTLOADER_DFU
ifeq ($(strip $(MCU)), atmega32u4)
BOOTLOADER_SIZE = 4096
ifneq (,$(filter $(MCU), at90usb646 atmega16u2 atmega16u4 atmega32u2 atmega32u4))
BOOTLOADER_SIZE = 4096
endif
ifeq ($(strip $(MCU)), at90usb1286)
BOOTLOADER_SIZE = 8192
BOOTLOADER_SIZE = 8192
endif
endif
ifeq ($(strip $(BOOTLOADER)), halfkay)
OPT_DEFS += -DBOOTLOADER_HALFKAY
ifeq ($(strip $(MCU)), atmega32u4)
BOOTLOADER_SIZE = 512
BOOTLOADER_SIZE = 512
endif
ifeq ($(strip $(MCU)), at90usb1286)
BOOTLOADER_SIZE = 1024
BOOTLOADER_SIZE = 1024
endif
endif
ifeq ($(strip $(BOOTLOADER)), caterina)
Expand Down
5 changes: 2 additions & 3 deletions build_json.mk
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,5 @@ else ifneq ("$(wildcard $(MAIN_KEYMAP_PATH_1)/keymap.json)","")
endif

# Generate the keymap.c
ifneq ("$(KEYMAP_JSON)","")
_ = $(shell test -e $(KEYMAP_C) || bin/qmk-json-keymap $(KEYMAP_JSON) -o $(KEYMAP_C))
endif
$(KEYBOARD_OUTPUT)/src/keymap.c:
bin/qmk json-keymap --quiet --output $(KEYMAP_C) $(KEYMAP_JSON)
Loading

0 comments on commit 50b3659

Please sign in to comment.