Skip to content

Commit

Permalink
Merge branch 'master' into calmh
Browse files Browse the repository at this point in the history
* master: (973 commits)
  Fix AVR SPI parameter configuration, remove timeouts due to sync protocol. (qmk#8775)
  VIA Support: Jane V2 (qmk#8735)
  Add a simple custom keymap for Gergo. (qmk#8662)
  Add via support to keebio/bdn9 (qmk#8620)
  DP60 VIA cleanups (qmk#8697)
  Adding Niu Mini to VIA (qmk#8702)
  Allow trailing whitespace in markdown docs, for formatting purposes. (qmk#8774)
  Add support for hardware and board initialisation overrides. (qmk#8330)
  [Keyboard] Add IDOBAO ID80 (qmk#8728)
  [Keyboard] Quefrency Rev2 Caps Lock LED, set lighting defaults (qmk#8729)
  [Keyboard] Add handwired Fc200rt qmk board (qmk#8726)
  Bugfix for quantum/dip_switch.c (qmk#8731)
  Add *OPT aliases for *ALT keycodes and macros (qmk#8714)
  [Keymap] Add keymap for Nyquist rev3 (qmk#8706)
  format code according to conventions [skip ci]
  Added Workman ZXCVM variation (qmk#8686)
  [Keyboard] jotpad16 status leds (qmk#8643)
  [Keyboard] Add handwired BDN9-BLE (qmk#8192)
  Fix bug with layer caching in get_event_keycode (qmk#8693)
  [Keyboard] Add CannonKeys Atlas keyboard (qmk#8207)
  ...
  • Loading branch information
calmh committed Apr 13, 2020
2 parents f7a0190 + 46e4493 commit a855052
Show file tree
Hide file tree
Showing 4,636 changed files with 186,334 additions and 90,906 deletions.
The diff you're trying to view is too large. We only load the first 3000 changed files.
File renamed without changes.
28 changes: 28 additions & 0 deletions .github/workflows/cli.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
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
6 changes: 3 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -63,13 +63,13 @@ util/Win_Check_Output.txt
*.gif
*.jpg

# Do not ignore MiniDox left/right hand eeprom files
!keyboards/minidox/*.eep

# things travis sees
secrets.tar
id_rsa_*
/.vs

# python things
__pycache__

# prerequisites for updating ChibiOS
/util/fmpp*
4 changes: 3 additions & 1 deletion .gitmodules
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
[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 = k-type-fix
branch = master
[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
Expand Down
19 changes: 12 additions & 7 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,18 @@ env:
- MAKEFLAGS="-j3 --output-sync"
services:
- docker
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:
Expand All @@ -20,13 +32,6 @@ script:
- bash util/travis_test.sh
- bash util/travis_build.sh
- bash util/travis_docs.sh
addons:
apt:
packages:
- pandoc
- diffutils
- dos2unix
- doxygen
after_script:
bash util/travis_compiled_push.sh
notifications:
Expand Down
22 changes: 14 additions & 8 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,21 @@
// Configure glob patterns for excluding files and folders.
"files.exclude": {
"**/.build": true,
"**/*.hex": true
"**/*.hex": true,
"**/*.bin": true
},
"files.associations": {
"*.h": "c",
"*.c": "c",
"*.cpp": "cpp",
"*.hpp": "cpp",
"xstddef": "c",
"type_traits": "c",
"utility": "c"
"*.h": "c",
"*.c": "c",
"*.inc": "c",
"*.cpp": "cpp",
"*.hpp": "cpp",
"xstddef": "c",
"type_traits": "c",
"utility": "c"
},
"[markdown]": {
"editor.trimAutoWhitespace": false,
"files.trimTrailingWhitespace": false
}
}
6 changes: 6 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -623,13 +623,19 @@ 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
Expand Down
67 changes: 38 additions & 29 deletions bin/qmk
Original file line number Diff line number Diff line change
Expand Up @@ -2,52 +2,61 @@
"""CLI wrapper for running QMK commands.
"""
import os
import subprocess
import sys
from importlib.util import find_spec
from time import strftime
from pathlib import Path

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

# Make sure our modules have been setup
with open(os.path.join(qmk_dir, 'requirements.txt'), 'r') as fd:
for line in fd.readlines():
line = line.strip().replace('<', '=').replace('>', '=')

if line[0] == '#':
continue
def _check_modules(requirements):
""" Check if the modules in the given requirements.txt are available.
"""
with Path(qmk_dir / requirements).open() as fd:
for line in fd.readlines():
line = line.strip().replace('<', '=').replace('>', '=')

if len(line) == 0 or line[0] == '#' or line.startswith('-r'):
continue

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

module = line.split('=')[0] if '=' in line else line
module = dict()
module['name'] = module['import'] = line.split('=')[0] if '=' in line else line

if module in ['pep8-naming']:
# Not every module is importable by its own name.
continue
if module['name'] == "pep8-naming":
module['import'] = "pep8ext_naming"

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.')
exit(255)
if not find_spec(module['import']):
print('Could not find module %s!' % module['name'])
print('Please run `python3 -m pip install -r %s` to install required python dependencies.' % str(qmk_dir / requirements))
if developer:
print('You can also turn off developer mode: qmk config user.developer=None')
print()
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)

if result.returncode == 0:
os.environ['QMK_VERSION'] = result.stdout.strip()
else:
os.environ['QMK_VERSION'] = 'nogit-' + strftime('%Y-%m-%d-%H:%M:%S') + '-dirty'
developer = False
# Make sure our modules have been setup
_check_modules('requirements.txt')

# Setup the CLI
import milc # noqa

# For developers additional modules are needed
if milc.cli.config.user.developer:
# Do not run the check for 'config',
# so users can turn off developer mode
if len(sys.argv) == 1 or (len(sys.argv) > 1 and 'config' != sys.argv[1]):
developer = True
_check_modules('requirements-dev.txt')

milc.EMOJI_LOGLEVELS['INFO'] = '{fg_blue}Ψ{style_reset_all}'


Expand Down
7 changes: 7 additions & 0 deletions bootloader.mk
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,13 @@ 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))
Expand Down
2 changes: 1 addition & 1 deletion build_json.mk
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,4 @@ endif

# Generate the keymap.c
$(KEYBOARD_OUTPUT)/src/keymap.c: $(KEYMAP_JSON)
bin/qmk json-keymap --quiet --output $(KEYMAP_C) $(KEYMAP_JSON)
bin/qmk json2c --quiet --output $(KEYMAP_C) $(KEYMAP_JSON)
60 changes: 12 additions & 48 deletions build_keyboard.mk
Original file line number Diff line number Diff line change
Expand Up @@ -231,44 +231,19 @@ endif
# We can assume a ChibiOS target When MCU_FAMILY is defined since it's
# not used for LUFA
ifdef MCU_FAMILY
FIRMWARE_FORMAT?=bin
PLATFORM=CHIBIOS
PLATFORM_KEY=chibios
FIRMWARE_FORMAT?=bin
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)","")
Expand Down Expand Up @@ -304,11 +279,6 @@ 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)
Expand Down Expand Up @@ -354,23 +324,17 @@ SRC += $(TMK_COMMON_SRC)
OPT_DEFS += $(TMK_COMMON_DEFS)
EXTRALDFLAGS += $(TMK_COMMON_LDFLAGS)

ifeq ($(PLATFORM),AVR)
ifeq ($(strip $(PROTOCOL)), VUSB)
include $(TMK_PATH)/protocol/vusb.mk
include $(TMK_PATH)/$(PLATFORM_KEY).mk
ifneq ($(strip $(PROTOCOL)),)
include $(TMK_PATH)/protocol/$(strip $(shell echo $(PROTOCOL) | tr '[:upper:]' '[:lower:]')).mk
else
include $(TMK_PATH)/protocol/lufa.mk
endif
include $(TMK_PATH)/avr.mk
endif

ifeq ($(PLATFORM),ARM_ATSAM)
include $(TMK_PATH)/arm_atsam.mk
include $(TMK_PATH)/protocol/arm_atsam.mk
include $(TMK_PATH)/protocol/$(PLATFORM_KEY).mk
endif

ifeq ($(PLATFORM),CHIBIOS)
include $(TMK_PATH)/protocol/chibios.mk
endif
# TODO: remove this bodge?
PROJECT_DEFS := $(OPT_DEFS)
PROJECT_INC := $(VPATH) $(EXTRAINCDIRS) $(KEYBOARD_PATHS)
PROJECT_CONFIG := $(CONFIG_H)

ifeq ($(strip $(VISUALIZER_ENABLE)), yes)
VISUALIZER_DIR = $(QUANTUM_DIR)/visualizer
Expand Down
1 change: 1 addition & 0 deletions build_test.mk
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ all: elf

VPATH += $(COMMON_VPATH)
PLATFORM:=TEST
PLATFORM_KEY:=test

ifneq ($(filter $(FULL_TESTS),$(TEST)),)
include tests/$(TEST)/rules.mk
Expand Down
Loading

0 comments on commit a855052

Please sign in to comment.