Skip to content

Commit

Permalink
Merge branch 'master' into dev
Browse files Browse the repository at this point in the history
  • Loading branch information
slugger7 committed Jul 21, 2019
2 parents b6ff4a2 + ecb7e53 commit acede11
Show file tree
Hide file tree
Showing 3,620 changed files with 154,042 additions and 40,243 deletions.
The diff you're trying to view is too large. We only load the first 3000 changed files.
6 changes: 3 additions & 3 deletions .clang-format
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
---
---
BasedOnStyle: Google
AlignAfterOpenBracket: Align
AlignConsecutiveAssignments: 'true'
Expand All @@ -13,14 +13,14 @@ BinPackParameters: 'true'
ColumnLimit: '1000'
IndentCaseLabels: 'true'
IndentPPDirectives: AfterHash
IndentWidth: '2'
IndentWidth: '4'
MaxEmptyLinesToKeep: '1'
PointerAlignment: Right
SortIncludes: 'false'
SpaceBeforeAssignmentOperators: 'true'
SpaceBeforeParens: ControlStatements
SpaceInEmptyParentheses: 'false'
TabWidth: '2'
TabWidth: '4'
UseTab: Never

...
8 changes: 7 additions & 1 deletion .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ root = true

[*]
indent_style = space
indent_size = 2
indent_size = 4

# We recommend you to keep these unchanged
charset = utf-8
Expand All @@ -16,12 +16,18 @@ insert_final_newline = true
trim_trailing_whitespace = false
indent_size = 4

[{qmk,*.py}]
charset = utf-8
max_line_length = 200

# Make these match what we have in .gitattributes
[*.mk]
end_of_line = lf
indent_style = tab

[Makefile]
end_of_line = lf
indent_style = tab

[*.sh]
end_of_line = lf
Expand Down
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ util/Win_Check_Output.txt
.vscode/tasks.json
.vscode/last.sql
.vscode/temp.sql
.vscode/ipch/
.stfolder
.tags

Expand All @@ -69,3 +70,6 @@ util/Win_Check_Output.txt
secrets.tar
id_rsa_*
/.vs

# python things
__pycache__
21 changes: 7 additions & 14 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,27 +10,20 @@ branches:
env:
global:
- secure: vBTSL34BDPxDilKUuTXqU4CJ26Pv5hogD2nghatkxSQkI1/jbdnLj/DQdPUrMJFDIY6TK3AltsBx72MaMsLQ1JO/Ou24IeHINHXzUC1FlS9yQa48cpxnhX5kzXNyGs3oa0qaFbvnr7RgYRWtmD52n4bIZuSuW+xpBv05x2OCizdT2ZonH33nATaHGFasxROm4qYZ241VfzcUv766V6RVHgL4x9V08warugs+RENVkfzxxwhk3NmkrISabze0gSVJLHBPHxroZC6EUcf/ocobcuDrCwFqtEt90i7pNIAFUE7gZsN2uE75LmpzAWin21G7lLPcPL2k4FJVd8an1HiP2WmscJU6U89fOfMb2viObnKcCzebozBCmKGtHEuXZo9FcReOx49AnQSpmESJGs+q2dL/FApkTjQiyT4J6O5dJpoww0/r57Wx0cmmqjETKBb5rSgXM51Etk3wO09mvcPHsEwrT7qH8r9XWdyCDoEn7FCLX3/LYnf/D4SmZ633YPl5gv3v9XEwxR5+04akjgnvWDSNIaDbWBdxHNb7l4pMc+WR1bwCyMyA7KXj0RrftEGOrm9ZRLe6BkbT4cycA+j77nbPOMcyZChliV9pPQos+4TOJoTzcK2L8yWVoY409aDNVuAjdP6Yum0R2maBGl/etLmIMpJC35C5/lZ+dUNjJAM=
before_install:
- wget http://ww1.microchip.com/downloads/en/DeviceDoc/avr8-gnu-toolchain-3.5.4.1709-linux.any.x86_64.tar.gz || wget http://qmk.fm/avr8-gnu-toolchain-3.5.4.1709-linux.any.x86_64.tar.gz
- MAKEFLAGS="-j3 --output-sync"
services:
- docker
install:
- tar -zxf avr8-gnu-toolchain-3.5.4.1709-linux.any.x86_64.tar.gz
- export PATH="$PATH:$TRAVIS_BUILD_DIR/avr8-gnu-toolchain-linux_x86_64/bin"
- npm install -g moxygen
before_script:
- avr-gcc --version
script:
- git rev-parse --short HEAD
- make test:all
- bash util/travis_build.sh
- bash util/travis_docs.sh
- git rev-parse --short HEAD
- bash util/travis_test.sh
- bash util/travis_build.sh
- bash util/travis_docs.sh
addons:
apt:
packages:
- dfu-programmer
- pandoc
- gcc-arm-none-eabi
- binutils-arm-none-eabi
- libnewlib-arm-none-eabi
- diffutils
- dos2unix
- doxygen
Expand Down
26 changes: 2 additions & 24 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,29 +1,7 @@
FROM debian:9

RUN apt-get update && apt-get install --no-install-recommends -y \
avr-libc \
avrdude \
binutils-arm-none-eabi \
binutils-avr \
build-essential \
dfu-programmer \
dfu-util \
gcc \
gcc-arm-none-eabi \
gcc-avr \
git \
libnewlib-arm-none-eabi \
software-properties-common \
unzip \
wget \
zip \
&& rm -rf /var/lib/apt/lists/*

ENV KEYBOARD=ergodox_ez
ENV KEYMAP=default
FROM qmkfm/base_container

VOLUME /qmk_firmware
WORKDIR /qmk_firmware
COPY . .

CMD make clean ; make git-submodule ; make $KEYBOARD:$KEYMAP
CMD make all:default
2 changes: 2 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -534,6 +534,8 @@ endef
%:
# Check if we have the CMP tool installed
cmp $(ROOT_DIR)/Makefile $(ROOT_DIR)/Makefile >/dev/null 2>&1; if [ $$? -gt 0 ]; then printf "$(MSG_NO_CMP)"; exit 1; fi;
# Ensure that python3 is installed. This check can be removed after python is used in more places.
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
Expand Down
33 changes: 23 additions & 10 deletions Vagrantfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ Vagrant.configure(2) do |config|

# VMware/Virtualbox ( and also Hyperv/Parallels) 64 bit
config.vm.box = "generic/debian9"

config.vm.synced_folder '.', '/vagrant'

# This section allows you to customize the Virtualbox VM
# settings, ie showing the GUI or upping the memory
Expand Down Expand Up @@ -50,26 +52,37 @@ Vagrant.configure(2) do |config|
end

# Docker provider pulls from hub.docker.com respecting docker.image if
# config.vm.box is nil. Note that this bind-mounts from the current dir to
# config.vm.box is nil. In this case, we adhoc build util/vagrant/Dockerfile.
# Note that this bind-mounts from the current dir to
# /vagrant in the guest, so unless your UID is 1000 to match vagrant in the
# image, you'll need to: chmod -R a+rw .
config.vm.provider "docker" do |docker, override|
override.vm.box = nil
docker.image = "jesselang/debian-vagrant:stretch"
docker.build_dir = "util/vagrant"
docker.has_ssh = true
end

# This script ensures the required packages for AVR programming are installed
# It also ensures the system always gets the latest updates when powered on
# If this causes issues you can run a 'vagrant destroy' and then
# add a # before ,run: (or change "always" to "once") and run 'vagrant up' to get a working
# non-updated box and then attempt to troubleshoot or open a Github issue
config.vm.provision "shell", inline: "/bin/sh -c 'yes | /vagrant/util/qmk_install.sh'", run: "always"
# Unless we are running the docker container directly
# 1. run container detached on vm
# 2. attach on 'vagrant ssh'
["virtualbox", "vmware_workstation", "vmware_fusion"].each do |type|
config.vm.provider type do |virt, override|
override.vm.provision "docker" do |d|
d.run "qmkfm/base_container",
cmd: "tail -f /dev/null",
args: "--privileged -v /dev:/dev -v '/vagrant:/vagrant'"
end

override.vm.provision "shell", inline: <<-SHELL
echo 'docker restart qmkfm-base_container && exec docker exec -it qmkfm-base_container /bin/bash -l' >> ~vagrant/.bashrc
SHELL
end
end

config.vm.post_up_message = <<-EOT
Log into the VM using 'vagrant ssh'. QMK directory synchronized with host is
located at /vagrant
Log into the environment using 'vagrant ssh'. QMK directory synchronized with
host is located at /vagrant
To compile the .hex files use make command inside this directory, e.g.
cd /vagrant
make <keyboard>:default
Expand Down
97 changes: 97 additions & 0 deletions bin/qmk
Original file line number Diff line number Diff line change
@@ -0,0 +1,97 @@
#!/usr/bin/env python3
"""CLI wrapper for running QMK commands.
"""
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

# 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:
for line in fd.readlines():
line = line.strip().replace('<', '=').replace('>', '=')

if line[0] == '#':
continue

if '#' in line:
line = line.split('#')[0]

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.')
exit(255)

# Figure out our version
command = ['git', 'describe', '--abbrev=6', '--dirty', '--always', '--tags']
result = subprocess.run(command, text=True, capture_output=True)

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

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

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__':
milc.cli()
1 change: 1 addition & 0 deletions bin/qmk-compile-json
1 change: 1 addition & 0 deletions bin/qmk-doctor
1 change: 1 addition & 0 deletions bin/qmk-hello
1 change: 1 addition & 0 deletions bin/qmk-json-keymap
4 changes: 4 additions & 0 deletions bootloader.mk
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,10 @@ ifeq ($(strip $(BOOTLOADER)), bootloadHID)
OPT_DEFS += -DBOOTLOADER_BOOTLOADHID
BOOTLOADER_SIZE = 4096
endif
ifeq ($(strip $(BOOTLOADER)), USBasp)
OPT_DEFS += -DBOOTLOADER_USBASP
BOOTLOADER_SIZE = 4096
endif

ifdef BOOTLOADER_SIZE
OPT_DEFS += -DBOOTLOADER_SIZE=$(strip $(BOOTLOADER_SIZE))
Expand Down
27 changes: 27 additions & 0 deletions build_json.mk
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# Look for a json keymap file
ifneq ("$(wildcard $(MAIN_KEYMAP_PATH_5)/keymap.json)","")
KEYMAP_C := $(KEYBOARD_OUTPUT)/src/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 := $(KEYBOARD_OUTPUT)/src/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 := $(KEYBOARD_OUTPUT)/src/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 := $(KEYBOARD_OUTPUT)/src/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 := $(KEYBOARD_OUTPUT)/src/keymap.c
KEYMAP_JSON := $(MAIN_KEYMAP_PATH_1)/keymap.json
KEYMAP_PATH := $(MAIN_KEYMAP_PATH_1)
endif

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

0 comments on commit acede11

Please sign in to comment.