Skip to content

Commit

Permalink
Merge pull request #3 from qmk/master
Browse files Browse the repository at this point in the history
update to qmk master
  • Loading branch information
jiaxin96 authored May 22, 2021
2 parents 244d968 + 40f235a commit 2549671
Show file tree
Hide file tree
Showing 678 changed files with 30,380 additions and 1,736 deletions.
57 changes: 26 additions & 31 deletions .github/workflows/format.yaml
Original file line number Diff line number Diff line change
@@ -1,47 +1,42 @@
name: Format Codebase
name: PR Lint Format

on:
push:
branches:
- master
- develop
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 }}

- name: Install dependencies
run: |
apt-get update && apt-get install -y dos2unix
fetch-depth: 0

- name: Format files
run: |
bin/qmk cformat -a
bin/qmk pyformat
bin/qmk fileformat
- uses: trilom/file-changes-action@v1.2.4
id: file_changes
with:
output: ' '
fileOutput: ' '

- name: Become QMK Bot
- name: Run qmk cformat and qmk pyformat
shell: 'bash {0}'
run: |
git config user.name 'QMK Bot'
git config user.email 'hello@qmk.fm'
qmk cformat --core-only -n $(< ~/files.txt)
cformat_exit=$?
qmk pyformat -n
pyformat_exit=$?
- name: Create Pull Request
uses: peter-evans/create-pull-request@v3
with:
delete-branch: true
branch: bugfix/format_${{ env.GITHUB_REF_SLUG }}
author: QMK Bot <hello@qmk.fm>
committer: QMK Bot <hello@qmk.fm>
commit-message: Format code according to conventions
title: '[CI] Format code according to conventions'
exit $((cformat_exit + pyformat_exit))
44 changes: 0 additions & 44 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,52 +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'] = line.split('=')[0] if '=' in line else line
module['import'] = module['name'].replace('-', '_')

# 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
6 changes: 5 additions & 1 deletion build_keyboard.mk
Original file line number Diff line number Diff line change
Expand Up @@ -205,6 +205,7 @@ endif
#
# https://docs.qmk.fm/#/feature_layouts?id=tips-for-making-layouts-keyboard-agnostic
#
QMK_KEYBOARD_H = $(KEYBOARD_OUTPUT)/src/default_keyboard.h
ifneq ("$(wildcard $(KEYBOARD_PATH_1)/$(KEYBOARD_FOLDER_1).h)","")
QMK_KEYBOARD_H = $(KEYBOARD_FOLDER_1).h
endif
Expand Down Expand Up @@ -296,10 +297,13 @@ CONFIG_H += $(KEYBOARD_OUTPUT)/src/info_config.h $(KEYBOARD_OUTPUT)/src/layouts.
$(KEYBOARD_OUTPUT)/src/info_config.h: $(INFO_JSON_FILES)
bin/qmk generate-config-h --quiet --keyboard $(KEYBOARD) --output $(KEYBOARD_OUTPUT)/src/info_config.h

$(KEYBOARD_OUTPUT)/src/default_keyboard.h: $(INFO_JSON_FILES)
bin/qmk generate-keyboard-h --quiet --keyboard $(KEYBOARD) --output $(KEYBOARD_OUTPUT)/src/default_keyboard.h

$(KEYBOARD_OUTPUT)/src/layouts.h: $(INFO_JSON_FILES)
bin/qmk generate-layouts --quiet --keyboard $(KEYBOARD) --output $(KEYBOARD_OUTPUT)/src/layouts.h

generated-files: $(KEYBOARD_OUTPUT)/src/info_config.h $(KEYBOARD_OUTPUT)/src/layouts.h
generated-files: $(KEYBOARD_OUTPUT)/src/info_config.h $(KEYBOARD_OUTPUT)/src/default_keyboard.h $(KEYBOARD_OUTPUT)/src/layouts.h

.INTERMEDIATE : generated-files

Expand Down
12 changes: 12 additions & 0 deletions docs/cli_commands.md
Original file line number Diff line number Diff line change
Expand Up @@ -228,6 +228,18 @@ This command is directory aware. It will automatically fill in KEYBOARD if you a
qmk list-keymaps -kb planck/ez
```

## `qmk new-keyboard`

This command creates a new keyboard based on available templates.

This command will prompt for input to guide you though the generation process.

**Usage**:

```
qmk new-keyboard
```

## `qmk new-keymap`

This command creates a new keymap based on a keyboard's existing default keymap.
Expand Down
17 changes: 17 additions & 0 deletions docs/feature_encoders.md
Original file line number Diff line number Diff line change
Expand Up @@ -81,3 +81,20 @@ void encoder_update_user(uint8_t index, bool clockwise) {
## Hardware
The A an B lines of the encoders should be wired directly to the MCU, and the C/common lines should be wired to ground.
## Multiple Encoders
Multiple encoders may share pins so long as each encoder has a distinct pair of pins.
For example you can support two encoders using only 3 pins like this
```
#define ENCODERS_PAD_A { B1, B1 }
#define ENCODERS_PAD_B { B2, B3 }
```
You could even support three encoders using only three pins (one per encoder) however in this configuration, rotating two encoders which share pins simultaneously will often generate incorrect output. For example:
```
#define ENCODERS_PAD_A { B1, B1, B2 }
#define ENCODERS_PAD_B { B2, B3, B3 }
```
Here rotating Encoder 0 `B1 B2` and Encoder 1 `B1 B3` could be interpreted as rotating Encoder 2 `B2 B3` or `B3 B2` depending on the timing. This may still be a useful configuration depending on your use case
6 changes: 3 additions & 3 deletions docs/feature_rgblight.md
Original file line number Diff line number Diff line change
Expand Up @@ -359,9 +359,9 @@ rgblight_set(); // Utility functions do not call rgblight_set() automatically, s

Example:
```c
rgblight_sethsv(HSV_WHITE, 0); // led 0
rgblight_sethsv(HSV_RED, 1); // led 1
rgblight_sethsv(HSV_GREEN, 2); // led 2
rgblight_sethsv_at(HSV_WHITE, 0); // led 0
rgblight_sethsv_at(HSV_RED, 1); // led 1
rgblight_sethsv_at(HSV_GREEN, 2); // led 2
// The above functions automatically calls rgblight_set(), so there is no need to call it explicitly.
// Note that it is inefficient to call repeatedly.
```
Expand Down
6 changes: 6 additions & 0 deletions docs/feature_split_keyboard.md
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,12 @@ However, you'll have to flash the EEPROM files for the correct hand to each cont
* `:dfu-util-split-left`
* `:dfu-util-split-right`

Example:

```
make crkbd:default:avrdude-split-left
```

This setting is not changed when re-initializing the EEPROM using the `EEP_RST` key, or using the `eeconfig_init()` function. However, if you reset the EEPROM outside of the firmware's built in options (such as flashing a file that overwrites the `EEPROM`, like how the [QMK Toolbox]()'s "Reset EEPROM" button works), you'll need to re-flash the controller with the `EEPROM` files.

You can find the `EEPROM` files in the QMK firmware repo, [here](https://github.com/qmk/qmk_firmware/tree/master/quantum/split_common).
Expand Down
20 changes: 4 additions & 16 deletions docs/newbs_getting_started.md
Original file line number Diff line number Diff line change
Expand Up @@ -104,19 +104,13 @@ You can also try the `qmk-git` package from AUR:

### ** FreeBSD **

#### Prerequisites

You will need to install Git and Python. It's possible that you already have both, but if not, run the following commands to install them:

pkg install git python3

Make sure that `$HOME/.local/bin` is added to your `$PATH` so that locally installed Python packages are available.

#### Installation

Install the QMK CLI by running:
Install the FreeBSD package for QMK CLI by running:

python3 -m pip install --user qmk
pkg install -g "py*-qmk"

NOTE: remember to follow the instructions printed at the end of installation (use `pkg info -Dg "py*-qmk"` to show them again).

<!-- tabs:end -->

Expand Down Expand Up @@ -162,12 +156,6 @@ After installing QMK you can set it up with this command:

In most situations you will want to answer `y` to all of the prompts.

?>**Note on FreeBSD**:
It is suggested to run `qmk setup` as a non-`root` user to start with, but this will likely identify packages that need to be installed to your
base system using `pkg`. However the installation will probably fail when run as an unprivileged user.
To manually install the base dependencies, run `./util/qmk_install.sh` either as `root`, or with `sudo`.
Once that completes, re-run `qmk setup` to complete the setup and checks.

<!-- tabs:end -->

?> The qmk home folder can be specified at setup with `qmk setup -H <path>`, and modified afterwards using the [cli configuration](cli_configuration.md?id=single-key-example) and the variable `user.qmk_home`. For all available options run `qmk setup --help`.
Expand Down
16 changes: 8 additions & 8 deletions drivers/haptic/haptic.h
Original file line number Diff line number Diff line change
Expand Up @@ -34,14 +34,14 @@
typedef union {
uint32_t raw;
struct {
bool enable : 1;
uint8_t feedback : 2;
uint8_t mode : 7;
bool buzz : 1;
uint8_t dwell : 7;
bool cont : 1;
uint8_t amplitude : 8;
uint16_t reserved : 7;
bool enable : 1;
uint8_t feedback : 2;
uint8_t mode : 7;
bool buzz : 1;
uint8_t dwell : 7;
bool cont : 1;
uint8_t amplitude : 8;
uint8_t reserved : 5;
};
} haptic_config_t;

Expand Down
6 changes: 3 additions & 3 deletions keyboards/acekeyboard/titan60/config.h
Original file line number Diff line number Diff line change
Expand Up @@ -53,15 +53,15 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
/*
* Split Keyboard specific options, make sure you have 'SPLIT_KEYBOARD = yes' in your rules.mk, and define SOFT_SERIAL_PIN.
*/
#define SOFT_SERIAL_PIN D0 // or D1, D2, D3, E6
// #define SOFT_SERIAL_PIN D0 // or D1, D2, D3, E6

#define BACKLIGHT_PIN B7
#define BACKLIGHT_LEVELS 3
#define BACKLIGHT_BREATHING

#define RGB_DI_PIN D2
#define RGB_DI_PIN D0
#ifdef RGB_DI_PIN
# define RGBLED_NUM 14
# define RGBLED_NUM 6
# define RGBLIGHT_HUE_STEP 8
# define RGBLIGHT_SAT_STEP 8
# define RGBLIGHT_VAL_STEP 8
Expand Down
Loading

0 comments on commit 2549671

Please sign in to comment.