Skip to content

Commit

Permalink
Merge pull request qmk#6 from Drugantibus/merging-branch
Browse files Browse the repository at this point in the history
Upstream fetch
  • Loading branch information
Drugantibus authored May 11, 2021
2 parents 8ddb1c5 + 10a656f commit bd30a37
Show file tree
Hide file tree
Showing 6,380 changed files with 185,622 additions and 198,546 deletions.
The diff you're trying to view is too large. We only load the first 3000 changed files.
1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -92,3 +92,4 @@ GRAPHICS
# hex files
*.hex binary
*.eep binary
nix/sources.nix linguist-generated=true
21 changes: 8 additions & 13 deletions .github/workflows/api.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,18 +25,13 @@ jobs:
- name: Generate API Data
run: qmk generate-api

- name: Install rsync
run: |
apt-get update && apt-get install -y rsync
- name: Upload API Data
uses: JamesIves/github-pages-deploy-action@3.7.1
uses: jakejarvis/s3-sync-action@master
with:
ACCESS_TOKEN: ${{ secrets.API_TOKEN_GITHUB }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
BRANCH: main
FOLDER: api_data/v1
CLEAN: true
GIT_CONFIG_EMAIL: hello@qmk.fm
REPOSITORY_NAME: qmk/qmk_keyboards
TARGET_FOLDER: v1
args: --acl public-read --follow-symlinks --delete
env:
AWS_S3_BUCKET: ${{ secrets.API_SPACE_MASTER }}
AWS_ACCESS_KEY_ID: ${{ secrets.SPACES_ACCESS_KEY }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.SPACES_SECRET_KEY }}
AWS_S3_ENDPOINT: https://nyc3.digitaloceanspaces.com
SOURCE_DIR: 'api_data'
21 changes: 8 additions & 13 deletions .github/workflows/develop_api.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,18 +25,13 @@ jobs:
- name: Generate API Data
run: qmk generate-api

- name: Install rsync
run: |
apt-get update && apt-get install -y rsync
- name: Upload API Data
uses: JamesIves/github-pages-deploy-action@3.7.1
uses: jakejarvis/s3-sync-action@master
with:
ACCESS_TOKEN: ${{ secrets.API_TOKEN_GITHUB }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
BRANCH: main
FOLDER: api_data/v1
CLEAN: true
GIT_CONFIG_EMAIL: hello@qmk.fm
REPOSITORY_NAME: qmk/qmk_keyboards_devel
TARGET_FOLDER: v1
args: --acl public-read --follow-symlinks --delete
env:
AWS_S3_BUCKET: ${{ secrets.API_SPACE_DEVELOP }}
AWS_ACCESS_KEY_ID: ${{ secrets.SPACES_ACCESS_KEY }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.SPACES_SECRET_KEY }}
AWS_S3_ENDPOINT: https://nyc3.digitaloceanspaces.com
SOURCE_DIR: 'api_data'
51 changes: 28 additions & 23 deletions .github/workflows/format.yaml
Original file line number Diff line number Diff line change
@@ -1,37 +1,42 @@
name: Format Codebase
name: PR Lint Format

on:
push:
branches:
- master
pull_request:
paths:
- 'drivers/**'
- 'lib/arm_atsam/**'
- 'lib/lib8tion/**'
- 'lib/python/**'
- 'platforms/**'
- 'quantum/**'
- 'tests/**'
- 'tmk_core/**'

jobs:
format:
lint:
runs-on: ubuntu-latest
container: qmkfm/base_container

# protect against those who develop with their fork on master
if: github.repository == 'qmk/qmk_firmware'
container: qmkfm/base_container

steps:
- uses: rlespinasse/github-slug-action@v3.x

- uses: actions/checkout@v2
with:
token: ${{ secrets.API_TOKEN_GITHUB }}
fetch-depth: 0

- name: Install dependencies
run: |
apt-get update && apt-get install -y dos2unix
- uses: trilom/file-changes-action@v1.2.4
id: file_changes
with:
output: ' '
fileOutput: ' '

- name: Format files
- name: Run qmk cformat and qmk pyformat
shell: 'bash {0}'
run: |
bin/qmk cformat -a
bin/qmk pyformat
bin/qmk fileformat
qmk cformat -n $(< ~/files.txt)
cformat_exit=$?
qmk pyformat -n
pyformat_exit=$?
- name: Commit files
uses: stefanzweifel/git-auto-commit-action@v4
with:
commit_message: Format code according to conventions for $GITHUB_SHA
commit_user_name: QMK Bot
commit_user_email: hello@qmk.fm
commit_author: QMK Bot <hello@qmk.fm>
exit $((cformat_exit + pyformat_exit))
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ doxygen/
.browse.VC.db*
*.stackdump
# Let these ones be user specific, since we have so many different configurations
*.code-workspace
.vscode/c_cpp_properties.json
.vscode/launch.json
.vscode/tasks.json
Expand Down
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -501,8 +501,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 bin/qmk works. This will be a failing check after the next develop merge
if ! bin/qmk hello 1> /dev/null 2>&1; then printf "$(MSG_PYTHON_MISSING)"; fi
# Ensure that bin/qmk works.
if ! bin/qmk hello 1> /dev/null 2>&1; then printf "$(MSG_PYTHON_MISSING)"; exit 1; 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
Expand Down
43 changes: 0 additions & 43 deletions bin/qmk
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
"""
import os
import sys
from importlib.util import find_spec
from pathlib import Path

# Add the QMK python libs to our path
Expand All @@ -12,51 +11,9 @@ qmk_dir = script_dir.parent
python_lib_dir = Path(qmk_dir / 'lib' / 'python').resolve()
sys.path.append(str(python_lib_dir))


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]

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

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

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.' % (qmk_dir / requirements,))
if developer:
print('You can also turn off developer mode: qmk config user.developer=None')
print()
exit(255)


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
47 changes: 33 additions & 14 deletions bootloader.mk
Original file line number Diff line number Diff line change
Expand Up @@ -20,23 +20,27 @@
# Sets the bootloader defined in the keyboard's/keymap's rules.mk
# Current options:
#
# 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)
# kiibohd Input:Club Kiibohd bootloader (only used on their boards)
# stm32duino STM32Duino (STM32F103x8)
# AVR:
# halfkay PJRC Teensy
# caterina Pro Micro (Sparkfun/generic)
# atmel-dfu Atmel factory DFU
# lufa-dfu LUFA DFU
# qmk-dfu QMK DFU (LUFA + blinkenlight)
# bootloadHID HIDBootFlash compatible (ATmega32A)
# USBasp USBaspLoader (ATmega328P)
# ARM:
# kiibohd Input:Club Kiibohd bootloader (only used on their boards)
# stm32duino STM32Duino (STM32F103x8)
# stm32-dfu STM32 USB DFU in ROM
# apm32-dfu APM32 USB DFU in ROM
#
# BOOTLOADER_SIZE can still be defined manually, but it's recommended
# you add any possible configuration to this list

ifeq ($(strip $(BOOTLOADER)), atmel-dfu)
OPT_DEFS += -DBOOTLOADER_ATMEL_DFU
OPT_DEFS += -DBOOTLOADER_DFU
ifneq (,$(filter $(MCU), atmega16u2 atmega32u2 atmega16u4 atmega32u4 at90usb646 at90usb647))
ifneq (,$(filter $(MCU), at90usb162 atmega16u2 atmega32u2 atmega16u4 atmega32u4 at90usb646 at90usb647))
BOOTLOADER_SIZE = 4096
endif
ifneq (,$(filter $(MCU), at90usb1286 at90usb1287))
Expand All @@ -46,7 +50,7 @@ endif
ifeq ($(strip $(BOOTLOADER)), lufa-dfu)
OPT_DEFS += -DBOOTLOADER_LUFA_DFU
OPT_DEFS += -DBOOTLOADER_DFU
ifneq (,$(filter $(MCU), atmega16u2 atmega32u2 atmega16u4 atmega32u4 at90usb646 at90usb647))
ifneq (,$(filter $(MCU), at90usb162 atmega16u2 atmega32u2 atmega16u4 atmega32u4 at90usb646 at90usb647))
BOOTLOADER_SIZE = 4096
endif
ifneq (,$(filter $(MCU), at90usb1286 at90usb1287))
Expand All @@ -56,7 +60,7 @@ endif
ifeq ($(strip $(BOOTLOADER)), qmk-dfu)
OPT_DEFS += -DBOOTLOADER_QMK_DFU
OPT_DEFS += -DBOOTLOADER_DFU
ifneq (,$(filter $(MCU), atmega16u2 atmega32u2 atmega16u4 atmega32u4 at90usb646 at90usb647))
ifneq (,$(filter $(MCU), at90usb162 atmega16u2 atmega32u2 atmega16u4 atmega32u4 at90usb646 at90usb647))
BOOTLOADER_SIZE = 4096
endif
ifneq (,$(filter $(MCU), at90usb1286 at90usb1287))
Expand Down Expand Up @@ -95,6 +99,20 @@ ifdef BOOTLOADER_SIZE
OPT_DEFS += -DBOOTLOADER_SIZE=$(strip $(BOOTLOADER_SIZE))
endif

ifeq ($(strip $(BOOTLOADER)), stm32-dfu)
OPT_DEFS += -DBOOTLOADER_STM32_DFU

# Options to pass to dfu-util when flashing
DFU_ARGS ?= -d 0483:DF11 -a 0 -s 0x08000000:leave
DFU_SUFFIX_ARGS ?= -v 0483 -p DF11
endif
ifeq ($(strip $(BOOTLOADER)), apm32-dfu)
OPT_DEFS += -DBOOTLOADER_APM32_DFU

# Options to pass to dfu-util when flashing
DFU_ARGS ?= -d 314B:0106 -a 0 -s 0x08000000:leave
DFU_SUFFIX_ARGS ?= -v 314B -p 0106
endif
ifeq ($(strip $(BOOTLOADER)), kiibohd)
OPT_DEFS += -DBOOTLOADER_KIIBOHD
ifeq ($(strip $(MCU_ORIG)), MK20DX128)
Expand All @@ -104,17 +122,18 @@ ifeq ($(strip $(BOOTLOADER)), kiibohd)
MCU_LDSCRIPT = MK20DX256BLDR8
endif

# Options to pass to dfu-util when flashing
DFU_ARGS = -d 1C11:B007
DFU_SUFFIX_ARGS = -v 1C11 -p B007
endif

ifeq ($(strip $(BOOTLOADER)), stm32duino)
OPT_DEFS += -DBOOTLOADER_STM32DUINO
MCU_LDSCRIPT = STM32F103x8_stm32duino_bootloader
BOARD = STM32_F103_STM32DUINO
# STM32F103 does NOT have an USB bootloader in ROM (only serial), so setting anything here does not make much sense
STM32_BOOTLOADER_ADDRESS = 0x80000000

DFU_ARGS = -d 1EAF:0003 -a2 -R
# Options to pass to dfu-util when flashing
DFU_ARGS = -d 1EAF:0003 -a 2 -R
DFU_SUFFIX_ARGS = -v 1EAF -p 0003
endif
Loading

0 comments on commit bd30a37

Please sign in to comment.