Compare commits

...
20 Commits
Author SHA1 Message Date
Drashna Jaelre a116b3f1ae Improve EEPROM defaults for Dynamic Keymaps (#12853) 2021-05-10 15:37:36 -07:00
Zach WhiteandErovia bc38c38f8c Move the module checking and updating to lib/python (#12416)
* move the module checking and updating to lib/python

* make flake8 happy

* Update lib/python/qmk/cli/__init__.py

Co-authored-by: Erovia <[email protected]>

* prompt the user to disable developer mode

* pyformat

* flake8

Co-authored-by: Erovia <[email protected]>
2021-05-10 12:00:52 -07:00
Zach White a3e7f3e7c5 Improve our CI tests (#11476)
* add a test and dry-run to qmk generate-api

* add a dry-run to qmk pyformat

* Add a --dry-run to qmk cformat

* reverse the order of nose2 and flake8 tests

* run CI test against cformat and pyformat

* fix programming errors

* tweak job name

* fix argument

* refine the files we select

* fix stack trace in --ci

* make cformat exit clean

* fix c file extensions

* decouple CI from pyformat

* remove --ci arg

* make ci happy

* use the environment var instead

* change output to text

* fix log message

* replace tabs
2021-05-10 11:18:44 -07:00
James Young 66ed80ad3a Lagrange handwired Configurator bugfix (#12854)
* use human-friendly formatting

* correct key object order
2021-05-10 10:37:05 -07:00
Joel ChallisandZach White 3f854e16ac Catch 'LAYOUTS = all' in lint (#12848)
Co-authored-by: Zach White <[email protected]>
2021-05-09 22:39:48 +02:00
Ryan 4fa32f0f04 KBDMini refactor (#12850) 2021-05-10 05:16:29 +10:00
Zach White 5c924efa04 fix the makefile snippet so flake8 and yapf don't fight (#12849) 2021-05-09 11:30:17 -07:00
Erovia 30aae6298b CLI: Use BASH if SHELL variable is not set (Windows) (#12847) 2021-05-09 19:19:42 +02:00
github-actions[bot]andQMK Bot 6c5e94061c [CI] Format code according to conventions (#12838)
Co-authored-by: QMK Bot <[email protected]>
2021-05-10 03:15:00 +10:00
Nick BrasselandErovia 1426ffc0ee Add script to perform parallel builds. (#12497)
Co-authored-by: Erovia <[email protected]>
2021-05-09 17:06:44 +02:00
Joel Challis f544b60aaa Align qmk info ascii logic with milc logging (#11627) 2021-05-09 15:53:18 +02:00
Joel Challis 7725d813c9 Allow MAKE environment override for 'qmk clean' (#12473) 2021-05-09 12:57:49 +02:00
Purdea AndreiandDrashna Jaelre 60a39f4f5d haptic: correct size of reserved field in the haptic structure. This saves 1 byte of wasted SRAM. (#12483)
Co-authored-by: Drashna Jaelre <[email protected]>
2021-05-08 20:45:41 -07:00
Sean Johnson df57590ec6 add ttys0's planck and preonic keymaps (#10560)
* resynced with upstream, and adjusted keymap layout for planck

* updated keyboard layout

Signed-off-by: Sean Johnson <[email protected]>

* swapped out bspc for del on symb layer

Signed-off-by: Sean Johnson <[email protected]>

* fixed typo with brightness media keys

* turns out my brightness config was correct, it was macOS that had gone sideways

* updated to bring in line with requirements for merging into upstream

* removed redundant config from rules.mk

moved media controls to FUNC layer for Planck layout

* added GPL2+ compatible license header

Signed-off-by: Sean Johnson <[email protected]>

* removed unused MIDI comment

Signed-off-by: Sean Johnson <[email protected]>

* removed extraneous MIDI comments

* removed extraneous comments
2021-05-08 20:00:11 -07:00
Seth Barberee b7fe24923e Update sethBarberee Userspace (#12620)
* update for LTO and guard RGBLED_SPLIT

* Revert "update for LTO and guard RGBLED_SPLIT"

This reverts commit ce81177cbe330ae3e1e14c264dc0cb0946f08d70.

* Revert "Revert "update for LTO and guard RGBLED_SPLIT""

This reverts commit 67da0ce9f38777064ad094c1ecba7ce17a40994f.

* update iris keymap for keymap_kc removal and overhaul userspace

* add licenses

* fix tap_dance error when rgblight is disabled and update/clean iris/sinc maps
2021-05-08 10:26:51 -07:00
067a6f0174 Hbbisenieks keymap update to remove kc_ keymaps (#12391)
* hbbisenieks keymap

* change from kc_ keymap

* Apply suggestions from code review

Co-authored-by: Takeshi ISHII <[email protected]>

Co-authored-by: Hilary Brenum <[email protected]>
Co-authored-by: Zach White <[email protected]>
Co-authored-by: Takeshi ISHII <[email protected]>
2021-05-08 09:35:32 -07:00
Mateusz Piotrowski 189e0d5b98 Update FreeBSD install method (#12815)
The easiest way to install QMK CLI and all the necessary
dependencies on FreeBSD is to use the packages
from the official FreeBSD Ports Collection.

This is possible since QMK CLI has been added to the Ports Collection:
https://www.freshports.org/sysutils/py-qmk/
2021-05-07 19:22:05 +02:00
stanrc85 56e5a83e68 [Keymap] My Arisu layout setup (#12647) 2021-05-07 19:51:47 +10:00
kb-elmo 34f3918244 Fix DZ60 64 key layout (#12551)
* add gk64 layout

* Apply suggestions from code review

* fix dz60 gk64 layout
2021-05-06 14:07:51 -07:00
timothynsheehan f3a1629469 Add docs on multiple encoders sharing pins (#11678)
Added explanation of how multiple encoders can share pins and the limitations of this configuration
2021-05-06 20:17:10 +02:00
54 changed files with 2069 additions and 598 deletions

No files matched your search

+28 -33
View File
@@ -1,47 +1,42 @@
name: Format Codebase name: PR Lint Format
on: on:
push: pull_request:
branches: paths:
- master - 'drivers/**'
- develop - 'lib/arm_atsam/**'
- 'lib/lib8tion/**'
- 'lib/python/**'
- 'platforms/**'
- 'quantum/**'
- 'tests/**'
- 'tmk_core/**'
jobs: jobs:
format: lint:
runs-on: ubuntu-latest runs-on: ubuntu-latest
container: qmkfm/base_container
# protect against those who develop with their fork on master container: qmkfm/base_container
if: github.repository == 'qmk/qmk_firmware'
steps: steps:
- uses: rlespinasse/[email protected] - uses: rlespinasse/[email protected]
- uses: actions/checkout@v2 - uses: actions/checkout@v2
with: with:
token: ${{ secrets.API_TOKEN_GITHUB }} fetch-depth: 0
- name: Install dependencies - uses: trilom/[email protected]
run: | id: file_changes
apt-get update && apt-get install -y dos2unix
- name: Format files
run: |
bin/qmk cformat -a
bin/qmk pyformat
bin/qmk fileformat
- name: Become QMK Bot
run: |
git config user.name 'QMK Bot'
git config user.email '[email protected]'
- name: Create Pull Request
uses: peter-evans/create-pull-request@v3
with: with:
delete-branch: true output: ' '
branch: bugfix/format_${{ env.GITHUB_REF_SLUG }} fileOutput: ' '
author: QMK Bot <[email protected]>
committer: QMK Bot <[email protected]> - name: Run qmk cformat and qmk pyformat
commit-message: Format code according to conventions shell: 'bash {0}'
title: '[CI] Format code according to conventions' run: |
qmk cformat -n $(< ~/files.txt)
cformat_exit=$?
qmk pyformat -n
pyformat_exit=$?
exit $((cformat_exit + pyformat_exit))
-44
View File
@@ -3,7 +3,6 @@
""" """
import os import os
import sys import sys
from importlib.util import find_spec
from pathlib import Path from pathlib import Path
# Add the QMK python libs to our path # Add the QMK python libs to our path
@@ -12,52 +11,9 @@ qmk_dir = script_dir.parent
python_lib_dir = Path(qmk_dir / 'lib' / 'python').resolve() python_lib_dir = Path(qmk_dir / 'lib' / 'python').resolve()
sys.path.append(str(python_lib_dir)) 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 # Setup the CLI
import milc # noqa 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}' milc.EMOJI_LOGLEVELS['INFO'] = '{fg_blue}Ψ{style_reset_all}'
+17
View File
@@ -81,3 +81,20 @@ void encoder_update_user(uint8_t index, bool clockwise) {
## Hardware ## 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. 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
+4 -16
View File
@@ -104,19 +104,13 @@ You can also try the `qmk-git` package from AUR:
### ** FreeBSD ** ### ** 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 #### 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 --> <!-- tabs:end -->
@@ -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. 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 --> <!-- 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`. ?> 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`.
+8 -8
View File
@@ -34,14 +34,14 @@
typedef union { typedef union {
uint32_t raw; uint32_t raw;
struct { struct {
bool enable : 1; bool enable : 1;
uint8_t feedback : 2; uint8_t feedback : 2;
uint8_t mode : 7; uint8_t mode : 7;
bool buzz : 1; bool buzz : 1;
uint8_t dwell : 7; uint8_t dwell : 7;
bool cont : 1; bool cont : 1;
uint8_t amplitude : 8; uint8_t amplitude : 8;
uint16_t reserved : 7; uint8_t reserved : 5;
}; };
} haptic_config_t; } haptic_config_t;
+50
View File
@@ -0,0 +1,50 @@
/* Copyright 2021 Stanrc85
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include QMK_KEYBOARD_H
#include "stanrc85.h"
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
[_QWERTY] = LAYOUT(
KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, KC_BSPC, KC_PGUP,
KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, KC_PGDN,
KC_CTLE, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, MO(_FN2_60),
KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_UP,
KC_LCTL, KC_LALT, LT_BPCF, KC_LGUI, LT_SPCF, TD_TWIN, KC_LEFT, KC_DOWN, KC_RGHT
),
[_DEFAULT] = LAYOUT(
KC_GESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSLS, KC_GRV, KC_PGUP,
KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSPC, KC_PGDN,
KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, MO(_FN2_60),
KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_UP,
KC_LCTL, KC_LALT, KC_SPC, MO(_FN1_60), KC_SPC, KC_RALT, KC_LEFT, KC_DOWN, KC_RGHT
),
[_FN1_60] = LAYOUT(
KC_TILD, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_DEL, KC_DEL, _______,
_______, _______, CA_QUOT, _______, CA_SCLN, KC_VOLU, KC_PGUP, KC_BSPC, KC_UP, KC_DEL, KC_PSCR, _______, _______, KC_INS, _______,
KC_CAPS, _______, _______, KC_LCTL, KC_LSFT, KC_VOLD, KC_PGDN, KC_LEFT, KC_DOWN, KC_RGHT, _______, _______, _______, _______,
_______, KC_RDP, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
_______, _______, _______, _______, _______, _______, _______, _______, _______
),
[_FN2_60] = LAYOUT(
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, RESET, _______,
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_MAKE, _______,
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
_______, _______, _______, _______, _______, _______, _______, _______, TG(_DEFAULT)
)
};
@@ -0,0 +1 @@
USER_NAME := stanrc85
+7 -7
View File
@@ -711,7 +711,7 @@
/* LAYOUT_64_ansi /* LAYOUT_64_ansi
* ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───────┐ * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───────┐
* │00 │01 │02 │03 │04 │05 │06 │07 │08 │09 │0a │0b │0c │0d │ * │00 │01 │02 │03 │04 │05 │06 │07 │08 │09 │0a │0b │0c │0e │
* ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─────┤ * ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─────┤
* │10 │12 │13 │14 │15 │16 │17 │18 │19 │1a │1b │1c │1d │1e │ * │10 │12 │13 │14 │15 │16 │17 │18 │19 │1a │1b │1c │1d │1e │
* ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴─────┤ * ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴─────┤
@@ -723,15 +723,15 @@
* └────┴────┴────┴────────────────────────┴───┴───┴───┴───┴───┘ * └────┴────┴────┴────────────────────────┴───┴───┴───┴───┴───┘
*/ */
#define LAYOUT_64_ansi( \ #define LAYOUT_64_ansi( \
k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0a, k0b, k0c, k0d, \ k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0a, k0b, k0c, k0e, \
k10, k12, k13, k14, k15, k16, k17, k18, k19, k1a, k1b, k1c, k1d, k1e, \ k10, k12, k13, k14, k15, k16, k17, k18, k19, k1a, k1b, k1c, k1d, k1e, \
k20, k22, k23, k24, k25, k26, k27, k28, k29, k2a, k2b, k2c, k2d, \ k20, k22, k23, k24, k25, k26, k27, k28, k29, k2a, k2b, k2c, k2d, \
k30, k32, k33, k34, k35, k36, k37, k38, k39, k3a, k3b, k3c, k3d, k3e, \ k30, k32, k33, k34, k35, k36, k37, k38, k39, k3a, k3b, k3c, k3d, k3e, \
k40, k41, k43, k46, k4a, k4b, k4c, k4d, k4e \ k40, k41, k43, k46, k4a, k4b, k4c, k4d, k4e \
) { \ ) { \
{ k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0a, k0b, k0c, k0d, KC_NO }, \ { k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0a, k0b, k0c, KC_NO, k0e }, \
{ k10, KC_NO, k12, k13, k14, k15, k16, k17, k18, k19, k1a, k1b, k1c, k1d, k1e }, \ { k10, KC_NO, k12, k13, k14, k15, k16, k17, k18, k19, k1a, k1b, k1c, k1d, k1e }, \
{ k20, KC_NO, k22, k23, k24, k25, k26, k27, k28, k29, k2a, k2b, k2c, k2d, KC_NO }, \ { k20, KC_NO, k22, k23, k24, k25, k26, k27, k28, k29, k2a, k2b, k2c, k2d, KC_NO }, \
{ k30, KC_NO, k32, k33, k34, k35, k36, k37, k38, k39, k3a, k3b, k3c, k3d, k3e }, \ { k30, KC_NO, k32, k33, k34, k35, k36, k37, k38, k39, k3a, k3b, k3c, k3d, k3e }, \
{ k40, k41, KC_NO, k43, KC_NO, KC_NO, k46, KC_NO, KC_NO, KC_NO, k4a, k4b, k4c, k4d, k4e } \ { k40, k41, KC_NO, k43, KC_NO, KC_NO, k46, KC_NO, KC_NO, KC_NO, k4a, k4b, k4c, k4d, k4e } \
} }
+86 -18
View File
@@ -1,21 +1,89 @@
{ {
"keyboard_name": "Lagrange", "keyboard_name": "Lagrange",
"url": "https://github.com/dpapavas/lagrange-keyboard", "url": "https://github.com/dpapavas/lagrange-keyboard",
"maintainer": "dpapavas", "maintainer": "dpapavas",
"width": 19, "width": 19,
"height": 8.5, "height": 8.5,
"layouts": { "layouts": {
"LAYOUT": { "LAYOUT": {
"layout": [ "layout": [
{"x":0, "y":0.75, "w":1.5}, {"x":1.5, "y":0.75}, {"x":2.5, "y":0.375}, {"x":3.5, "y":0}, {"x":4.5, "y":0.5}, {"x":5.5, "y":0.5}, {"x":12.5, "y":0.5}, {"x":13.5, "y":0.5}, {"x":14.5, "y":0}, {"x":15.5, "y":0.375}, {"x":16.5, "y":0.75}, {"x":17.5, "y":0.75, "w":1.5}, {"x":0, "y":0.75, "w":1.5},
{"x":0, "y":1.75, "w":1.5}, {"x":1.5, "y":1.75}, {"x":2.5, "y":1.375}, {"x":3.5, "y":1}, {"x":4.5, "y":1.5}, {"x":5.5, "y":1.5}, {"x":12.5, "y":1.5}, {"x":13.5, "y":1.5}, {"x":14.5, "y":1}, {"x":15.5, "y":1.375}, {"x":16.5, "y":1.75}, {"x":17.5, "y":1.75, "w":1.5}, {"x":1.5, "y":0.75},
{"x":0, "y":2.75, "w":1.5}, {"x":1.5, "y":2.75}, {"x":2.5, "y":2.375}, {"x":3.5, "y":2}, {"x":4.5, "y":2.5}, {"x":5.5, "y":2.5}, {"x":12.5, "y":2.5}, {"x":13.5, "y":2.5}, {"x":14.5, "y":2}, {"x":15.5, "y":2.375}, {"x":16.5, "y":2.75}, {"x":17.5, "y":2.75, "w":1.5}, {"x":2.5, "y":0.375},
{"x":0, "y":3.75, "w":1.5}, {"x":1.5, "y":3.75}, {"x":2.5, "y":3.375}, {"x":3.5, "y":3}, {"x":4.5, "y":3.5}, {"x":5.5, "y":3.5}, {"x":12.5, "y":3.5}, {"x":13.5, "y":3.5}, {"x":14.5, "y":3}, {"x":15.5, "y":3.375}, {"x":16.5, "y":3.75}, {"x":17.5, "y":3.75, "w":1.5}, {"x":3.5, "y":0},
{"x":0, "y":4.75, "w":1.5}, {"x":2.5, "y":4.375}, {"x":3.5, "y":4}, {"x":14.5, "y":4}, {"x":15.5, "y":4.5}, {"x":17.5, "y":4.75, "w":1.5}, {"x":4.5, "y":0.5},
{"x":5, "y":5, "h":1.25}, {"x":6, "y":5, "h":1.5}, {"x":7, "y":5, "h":1.5}, {"x":8, "y":5.5}, {"x":10, "y":5.5}, {"x":11, "y":5, "h":1.5}, {"x":12, "y":5, "h":1.5}, {"x":13, "y":5, "h":1.25}, {"x":5.5, "y":0.5},
{"x":5, "y":7}, {"x":6, "y":6.5}, {"x":7, "y":7}, {"x":11, "y":7}, {"x":12, "y":6.5}, {"x":13, "y":7}, {"x":12.5, "y":0.5},
{"x":6, "y":7.5}, {"x":12, "y":7.5} {"x":13.5, "y":0.5},
] {"x":14.5, "y":0},
{"x":15.5, "y":0.375},
{"x":16.5, "y":0.75},
{"x":17.5, "y":0.75, "w":1.5},
{"x":0, "y":1.75, "w":1.5},
{"x":1.5, "y":1.75},
{"x":2.5, "y":1.375},
{"x":3.5, "y":1},
{"x":4.5, "y":1.5},
{"x":5.5, "y":1.5},
{"x":12.5, "y":1.5},
{"x":13.5, "y":1.5},
{"x":14.5, "y":1},
{"x":15.5, "y":1.375},
{"x":16.5, "y":1.75},
{"x":17.5, "y":1.75, "w":1.5},
{"x":0, "y":2.75, "w":1.5},
{"x":1.5, "y":2.75},
{"x":2.5, "y":2.375},
{"x":3.5, "y":2},
{"x":4.5, "y":2.5},
{"x":5.5, "y":2.5},
{"x":12.5, "y":2.5},
{"x":13.5, "y":2.5},
{"x":14.5, "y":2},
{"x":15.5, "y":2.375},
{"x":16.5, "y":2.75},
{"x":17.5, "y":2.75, "w":1.5},
{"x":0, "y":3.75, "w":1.5},
{"x":1.5, "y":3.75},
{"x":2.5, "y":3.375},
{"x":3.5, "y":3},
{"x":4.5, "y":3.5},
{"x":5.5, "y":3.5},
{"x":12.5, "y":3.5},
{"x":13.5, "y":3.5},
{"x":14.5, "y":3},
{"x":15.5, "y":3.375},
{"x":16.5, "y":3.75},
{"x":17.5, "y":3.75, "w":1.5},
{"x":0, "y":4.75, "w":1.5},
{"x":2.5, "y":4.375},
{"x":3.5, "y":4},
{"x":5, "y":5, "h":1.25},
{"x":6, "y":5, "h":1.5},
{"x":7, "y":5, "h":1.5},
{"x":8, "y":5.5},
{"x":10, "y":5.5},
{"x":11, "y":5, "h":1.5},
{"x":12, "y":5, "h":1.5},
{"x":13, "y":5, "h":1.25},
{"x":14.5, "y":4},
{"x":15.5, "y":4.5},
{"x":17.5, "y":4.75, "w":1.5},
{"x":5, "y":7},
{"x":6, "y":6.5},
{"x":7, "y":7},
{"x":11, "y":7},
{"x":12, "y":6.5},
{"x":13, "y":7},
{"x":6, "y":7.5},
{"x":12, "y":7.5}
]
}
} }
}
} }
+22 -3
View File
@@ -7,17 +7,32 @@
#define PRODUCT_ID 0x2001 #define PRODUCT_ID 0x2001
#define DEVICE_VER 0x0001 #define DEVICE_VER 0x0001
#define MANUFACTURER DZTECH #define MANUFACTURER DZTECH
#define PRODUCT KBDMINI #define PRODUCT KBDMINI
/* key matrix size */
#define MATRIX_ROWS 4 #define MATRIX_ROWS 4
#define MATRIX_COLS 13 #define MATRIX_COLS 13
#define MATRIX_ROW_PINS {B7, E6, F5, F4} /*
#define MATRIX_COL_PINS {B3, B2, B1, B0, F1, F0, C6, B6, B5, B4, D7, D6, D4} * Keyboard Matrix Assignments
*
* Change this to how you wired your keyboard
* COLS: AVR pins used for columns, left to right
* ROWS: AVR pins used for rows, top to bottom
* DIODE_DIRECTION: COL2ROW = COL = Anode (+), ROW = Cathode (-, marked on diode)
* ROW2COL = ROW = Anode (+), COL = Cathode (-, marked on diode)
*
*/
#define MATRIX_ROW_PINS { B7, E6, F5, F4 }
#define MATRIX_COL_PINS { B3, B2, B1, B0, F1, F0, C6, B6, B5, B4, D7, D6, D4 }
#define UNUSED_PINS #define UNUSED_PINS
/* COL2ROW, ROW2COL */
#define DIODE_DIRECTION COL2ROW #define DIODE_DIRECTION COL2ROW
/* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */
#define DEBOUNCE 3 #define DEBOUNCE 3
#ifdef RGB_MATRIX_ENABLE #ifdef RGB_MATRIX_ENABLE
#define RGB_DISABLE_AFTER_TIMEOUT 0 // number of ticks to wait until disabling effects #define RGB_DISABLE_AFTER_TIMEOUT 0 // number of ticks to wait until disabling effects
#define RGB_DISABLE_WHEN_USB_SUSPENDED true // turn off effects when suspended #define RGB_DISABLE_WHEN_USB_SUSPENDED true // turn off effects when suspended
@@ -44,3 +59,7 @@
#define DRIVER_1_LED_TOTAL 52 #define DRIVER_1_LED_TOTAL 52
#define DRIVER_LED_TOTAL DRIVER_1_LED_TOTAL #define DRIVER_LED_TOTAL DRIVER_1_LED_TOTAL
#endif #endif
/* disable these deprecated features by default */
#define NO_ACTION_MACRO
#define NO_ACTION_FUNCTION
+68
View File
@@ -0,0 +1,68 @@
{
"keyboard_name": "KBDMini",
"url": "",
"maintainer": "KBDFans",
"width": 13,
"height": 4,
"layouts": {
"LAYOUT": {
"layout": [
{"x": 0, "y": 0},
{"x": 1, "y": 0},
{"x": 2, "y": 0},
{"x": 3, "y": 0},
{"x": 4, "y": 0},
{"x": 5, "y": 0},
{"x": 6, "y": 0},
{"x": 7, "y": 0},
{"x": 8, "y": 0},
{"x": 9, "y": 0},
{"x": 10, "y": 0},
{"x": 11, "y": 0},
{"x": 12, "y": 0},
{"x": 0, "y": 1},
{"x": 1, "y": 1},
{"x": 2, "y": 1},
{"x": 3, "y": 1},
{"x": 4, "y": 1},
{"x": 5, "y": 1},
{"x": 6, "y": 1},
{"x": 7, "y": 1},
{"x": 8, "y": 1},
{"x": 9, "y": 1},
{"x": 10, "y": 1},
{"x": 11, "y": 1},
{"x": 12, "y": 1},
{"x": 0, "y": 2},
{"x": 1, "y": 2},
{"x": 2, "y": 2},
{"x": 3, "y": 2},
{"x": 4, "y": 2},
{"x": 5, "y": 2},
{"x": 6, "y": 2},
{"x": 7, "y": 2},
{"x": 8, "y": 2},
{"x": 9, "y": 2},
{"x": 10, "y": 2},
{"x": 11, "y": 2},
{"x": 12, "y": 2},
{"x": 0, "y": 3},
{"x": 1, "y": 3},
{"x": 2, "y": 3},
{"x": 3, "y": 3},
{"x": 4, "y": 3},
{"x": 5, "y": 3},
{"x": 6, "y": 3},
{"x": 7, "y": 3},
{"x": 8, "y": 3},
{"x": 9, "y": 3},
{"x": 10, "y": 3},
{"x": 11, "y": 3},
{"x": 12, "y": 3}
]
}
}
}
+74 -82
View File
@@ -1,96 +1,88 @@
#include "kbdmini.h" #include "kbdmini.h"
#include "config.h"
const is31_led g_is31_leds[DRIVER_LED_TOTAL] = { const is31_led g_is31_leds[DRIVER_LED_TOTAL] = {
{0, B_9, A_9, C_9}, //LA33 { 0, B_9, A_9, C_9 }, //LA33
{0, B_10, A_10, C_10}, //LA37 { 0, B_10, A_10, C_10 }, //LA37
{0, B_11, A_11, C_11}, //LA41 { 0, B_11, A_11, C_11 }, //LA41
{0, B_12, A_12, C_12}, //LA45 { 0, B_12, A_12, C_12 }, //LA45
{0, B_13, A_13, C_13}, //LA49 { 0, B_13, A_13, C_13 }, //LA49
{0, B_14, A_14, C_14}, //LA53 { 0, B_14, A_14, C_14 }, //LA53
{0, B_15, A_15, C_15}, //LA57 { 0, B_15, A_15, C_15 }, //LA57
{0, B_6, A_6, C_6}, //LA21 { 0, B_6, A_6, C_6 }, //LA21
{0, B_5, A_5, C_5}, //LA17 { 0, B_5, A_5, C_5 }, //LA17
{0, B_4, A_4, C_4}, //LA13 { 0, B_4, A_4, C_4 }, //LA13
{0, B_3, A_3, C_3}, //LA9 { 0, B_3, A_3, C_3 }, //LA9
{0, B_2, A_2, C_2}, //LA5 { 0, B_2, A_2, C_2 }, //LA5
{0, B_1, A_1, C_1}, //LA1 { 0, B_1, A_1, C_1 }, //LA1
{0, E_9, D_9, F_9}, //LA34 { 0, E_9, D_9, F_9 }, //LA34
{0, E_10, D_10, F_10}, //LA38 { 0, E_10, D_10, F_10 }, //LA38
{0, E_11, D_11, F_11}, //LA42 { 0, E_11, D_11, F_11 }, //LA42
{0, E_12, D_12, F_12}, //LA46 { 0, E_12, D_12, F_12 }, //LA46
{0, E_13, D_13, F_13}, //LA50 { 0, E_13, D_13, F_13 }, //LA50
{0, E_14, D_14, F_14}, //LA54 { 0, E_14, D_14, F_14 }, //LA54
{0, E_15, D_15, F_15}, //LA58 { 0, E_15, D_15, F_15 }, //LA58
{0, E_6, D_6, F_6}, //LA22 { 0, E_6, D_6, F_6 }, //LA22
{0, E_5, D_5, F_5}, //LA18 { 0, E_5, D_5, F_5 }, //LA18
{0, E_4, D_4, F_4}, //LA14 { 0, E_4, D_4, F_4 }, //LA14
{0, E_3, D_3, F_3}, //LA10 { 0, E_3, D_3, F_3 }, //LA10
{0, E_2, D_2, F_2}, //LA6 { 0, E_2, D_2, F_2 }, //LA6
{0, E_1, D_1, F_1}, //LA2 { 0, E_1, D_1, F_1 }, //LA2
{0, H_9, G_9, I_9}, //LA35 { 0, H_9, G_9, I_9 }, //LA35
{0, H_10, G_10, I_10}, //LA39 { 0, H_10, G_10, I_10 }, //LA39
{0, H_11, G_11, I_11}, //LA43 { 0, H_11, G_11, I_11 }, //LA43
{0, H_12, G_12, I_12}, //LA47 { 0, H_12, G_12, I_12 }, //LA47
{0, H_13, G_13, I_13}, //LA51 { 0, H_13, G_13, I_13 }, //LA51
{0, H_14, G_14, I_14}, //LA55 { 0, H_14, G_14, I_14 }, //LA55
{0, H_15, G_15, I_15}, //LA59 { 0, H_15, G_15, I_15 }, //LA59
{0, H_6, G_6, I_6}, //LA23 { 0, H_6, G_6, I_6 }, //LA23
{0, H_5, G_5, I_5}, //LA19 { 0, H_5, G_5, I_5 }, //LA19
{0, H_4, G_4, I_4}, //LA15 { 0, H_4, G_4, I_4 }, //LA15
{0, H_3, G_3, I_3}, //LA11 { 0, H_3, G_3, I_3 }, //LA11
{0, H_2, G_2, I_2}, //LA7 { 0, H_2, G_2, I_2 }, //LA7
{0, H_1, G_1, I_1}, //LA3 { 0, H_1, G_1, I_1 }, //LA3
{0, K_9, J_9, L_9}, //LA36 { 0, K_9, J_9, L_9 }, //LA36
{0, K_10, J_10, L_10}, //LA40 { 0, K_10, J_10, L_10 }, //LA40
{0, K_11, J_11, L_11}, //LA44 { 0, K_11, J_11, L_11 }, //LA44
{0, K_12, J_12, L_12}, //LA48 { 0, K_12, J_12, L_12 }, //LA48
{0, K_13, J_13, L_13}, //LA52 { 0, K_13, J_13, L_13 }, //LA52
{0, K_14, J_14, L_14}, //LA56 { 0, K_14, J_14, L_14 }, //LA56
{0, K_15, J_15, L_15}, //LA60 { 0, K_15, J_15, L_15 }, //LA60
{0, K_6, J_6, L_6}, //LA24 { 0, K_6, J_6, L_6 }, //LA24
{0, K_5, J_5, L_5}, //LA20 { 0, K_5, J_5, L_5 }, //LA20
{0, K_4, J_4, L_4}, //LA16 { 0, K_4, J_4, L_4 }, //LA16
{0, K_3, J_3, L_3}, //LA12 { 0, K_3, J_3, L_3 }, //LA12
{0, K_2, J_2, L_2}, //LA8 { 0, K_2, J_2, L_2 }, //LA8
{0, K_1, J_1, L_1}//LA4 { 0, K_1, J_1, L_1 } //LA4
}; };
led_config_t g_led_config = { { led_config_t g_led_config = {
{ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12}, {
{ 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25}, { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12 },
{ 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38}, { 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25 },
{ 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51} { 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38 },
}, { { 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51 }
{ 0, 0 }, { 19, 0 }, { 38, 0 }, { 57, 0 }, { 76, 0 }, { 95, 0 }, { 114, 0 }, { 133, 0 }, { 152, 0 }, { 171, 0 }, { 190, 0 }, { 209, 0 }, { 224, 0 }, }, {
{ 0, 21 }, { 19, 21 }, { 38, 21 }, { 57, 21 }, { 76, 21 }, { 95, 21 }, { 114, 21 }, { 133, 21 }, { 152, 21 }, { 171, 21 }, { 190, 21 }, { 209, 21 }, { 224, 21 }, { 0, 0 }, { 19, 0 }, { 38, 0 }, { 57, 0 }, { 76, 0 }, { 95, 0 }, { 114, 0 }, { 133, 0 }, { 152, 0 }, { 171, 0 }, { 190, 0 }, { 209, 0 }, { 224, 0 },
{ 0, 42 }, { 19, 42 }, { 38, 42 }, { 57, 42 }, { 76, 42 }, { 95, 42 }, { 114, 42 }, { 133, 42 }, { 152, 42 }, { 171, 42 }, { 190, 42 }, { 209, 42 }, { 224, 42 }, { 0, 21 }, { 19, 21 }, { 38, 21 }, { 57, 21 }, { 76, 21 }, { 95, 21 }, { 114, 21 }, { 133, 21 }, { 152, 21 }, { 171, 21 }, { 190, 21 }, { 209, 21 }, { 224, 21 },
{ 0, 64 }, { 19, 64 }, { 38, 64 }, { 57, 64 }, { 76, 64 }, { 95, 64 }, { 114, 64 }, { 133, 64 }, { 152, 64 }, { 171, 64 }, { 190, 64 }, { 209, 64 }, { 224, 64 } { 0, 42 }, { 19, 42 }, { 38, 42 }, { 57, 42 }, { 76, 42 }, { 95, 42 }, { 114, 42 }, { 133, 42 }, { 152, 42 }, { 171, 42 }, { 190, 42 }, { 209, 42 }, { 224, 42 },
}, { { 0, 64 }, { 19, 64 }, { 38, 64 }, { 57, 64 }, { 76, 64 }, { 95, 64 }, { 114, 64 }, { 133, 64 }, { 152, 64 }, { 171, 64 }, { 190, 64 }, { 209, 64 }, { 224, 64 }
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, }, {
1, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 1, 1, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 1, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 1,
} }; 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1
void matrix_init_kb(void) { }
matrix_init_user(); };
}
void matrix_scan_kb(void) { void suspend_power_down_kb(void) {
matrix_scan_user();
}
bool process_record_kb(uint16_t keycode, keyrecord_t *record) {
return process_record_user(keycode, record);
}
void suspend_power_down_kb(void)
{
rgb_matrix_set_suspend_state(true); rgb_matrix_set_suspend_state(true);
suspend_power_down_user(); suspend_power_down_user();
} }
void suspend_wakeup_init_kb(void) void suspend_wakeup_init_kb(void) {
{
rgb_matrix_set_suspend_state(false); rgb_matrix_set_suspend_state(false);
suspend_wakeup_init_user(); suspend_wakeup_init_user();
} }
+5 -5
View File
@@ -1,15 +1,15 @@
#pragma once #pragma once
#include "quantum.h" #include "quantum.h"
#define LAYOUT( \ #define LAYOUT( \
K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C,\ K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, \
K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C,\ K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, \
K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2C,\ K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2C, \
K30, K31, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, K3C \ K30, K31, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, K3C \
) { \ ) { \
{ K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C }, \ { K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C }, \
{ K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C }, \ { K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C }, \
{ K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2C }, \ { K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2C }, \
{ K30, K31, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, K3C } \ { K30, K31, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, K3C } \
} }
@@ -1,9 +1,10 @@
#include QMK_KEYBOARD_H #include QMK_KEYBOARD_H
#define _LAYER0 0
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
[_LAYER0] = LAYOUT( [0] = LAYOUT(
KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC,
KC_ESC, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_BSPC, KC_ESC, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_BSPC,
KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_UP, KC_ENT, KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_UP, KC_ENT,
KC_F5, KC_CAPS, KC_LCTL, KC_LGUI, KC_F1, KC_SPC,KC_F2, KC_RALT, KC_RGUI, KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT), KC_F5, KC_CAPS, KC_LCTL, KC_LGUI, KC_F1, KC_SPC, KC_F2, KC_RALT, KC_RGUI, KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT
)
}; };
+3 -3
View File
@@ -2,9 +2,9 @@
![KBDMINI](imgur.com image replace me!) ![KBDMINI](imgur.com image replace me!)
Keyboard Maintainer: [DZTECH](https://github.com/moyi4681) * Keyboard Maintainer: [DZTECH](https://github.com/moyi4681)
Hardware Supported: KBDMINI * Hardware Supported: KBDMINI
Hardware Availability: [KBDFans](https://kbdfans.cn/) * Hardware Availability: [KBDFans](https://kbdfans.cn/)
Make example for this keyboard (after setting up your build environment): Make example for this keyboard (after setting up your build environment):
+7 -16
View File
@@ -2,13 +2,6 @@
MCU = atmega32u4 MCU = atmega32u4
# Bootloader selection # Bootloader selection
# Teensy halfkay
# Pro Micro caterina
# Atmel DFU atmel-dfu
# LUFA DFU lufa-dfu
# QMK DFU qmk-dfu
# ATmega32A bootloadHID
# ATmega328P USBasp
BOOTLOADER = atmel-dfu BOOTLOADER = atmel-dfu
# Build Options # Build Options
@@ -18,16 +11,14 @@ BOOTMAGIC_ENABLE = lite # Virtual DIP switch configuration
MOUSEKEY_ENABLE = yes # Mouse keys MOUSEKEY_ENABLE = yes # Mouse keys
EXTRAKEY_ENABLE = yes # Audio control and System control EXTRAKEY_ENABLE = yes # Audio control and System control
CONSOLE_ENABLE = no # Console for debug CONSOLE_ENABLE = no # Console for debug
COMMAND_ENABLE = no # Commands for debug and configuration COMMAND_ENABLE = no # Commands for debug and configuration
# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE # Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE
SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend
# if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work # if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work
NKRO_ENABLE = yes # USB Nkey Rollover NKRO_ENABLE = yes # USB Nkey Rollover
BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality
MIDI_ENABLE = no # MIDI support RGBLIGHT_ENABLE = no # Enable keyboard RGB underglow
UNICODE_ENABLE = no # Unicode BLUETOOTH_ENABLE = no # Enable Bluetooth
BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID AUDIO_ENABLE = no # Audio output
AUDIO_ENABLE = no # Audio output on port C6 RGB_MATRIX_ENABLE = yes
RGB_MATRIX_ENABLE = yes # Use RGB matrix
RGB_MATRIX_DRIVER = IS31FL3733 RGB_MATRIX_DRIVER = IS31FL3733
NO_USB_STARTUP_CHECK = no # Disable initialization only when usb is plugged in
@@ -17,6 +17,9 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#pragma once #pragma once
#include "config_common.h"
/* Use I2C or Serial, not both */ /* Use I2C or Serial, not both */
#define USE_SERIAL #define USE_SERIAL
@@ -16,8 +16,6 @@ enum custom_keycodes {
CHUS, CHUS,
}; };
#define KC_ KC_TRNS
#define KC_CAPW LGUI(LSFT(KC_3)) // Capture whole screen #define KC_CAPW LGUI(LSFT(KC_3)) // Capture whole screen
#define KC_CPYW LGUI(LSFT(LCTL(KC_3))) // Copy whole screen #define KC_CPYW LGUI(LSFT(LCTL(KC_3))) // Copy whole screen
#define KC_CAPP LGUI(LSFT(KC_4)) // Capture portion of screen #define KC_CAPP LGUI(LSFT(KC_4)) // Capture portion of screen
@@ -49,46 +47,47 @@ enum custom_keycodes {
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
[_QWERTY] = LAYOUT_kc( [_QWERTY] = LAYOUT(
//,----+----+----+----+----+----. ,----+----+----+----+----+----. //,-------+-------+-------+-------+-------+-------. ,-------+-------+-------+-------+-------+-------.
GRV , 1 , 2 , 3 , 4 , 5 , 6 , 7 , 8 , 9 , 0 ,BSPC, KC_GRV , KC_1 , KC_2 , KC_3 , KC_4 , KC_5 , KC_6 , KC_7 , KC_8 , KC_9 , KC_0 ,KC_BSPC,
//|----+----+----+----+----+----| |----+----+----+----+----+----| //|-------+-------+-------+-------+-------+-------| |-------+-------+-------+-------+-------+-------|
TAB , Q , W , E , R , T , Y , U , I , O , P ,BSLS, KC_TAB , KC_Q , KC_W , KC_E , KC_R , KC_T , KC_Y , KC_U , KC_I , KC_O , KC_P ,KC_BSLS,
//|----+----+----+----+----+----| |----+----+----+----+----+----| //|-------+-------+-------+-------+-------+-------| |-------+-------+-------+-------+-------+-------|
ESC , A , S , D , F , G , H , J , K , L ,SCLN,QUOT, KC_ESC , KC_A , KC_S , KC_D , KC_F , KC_G , KC_H , KC_J , KC_K , KC_L ,KC_SCLN,KC_QUOT,
//|----+----+----+----+----+----+----. ,----|----+----+----+----+----+----| //|-------+-------+-------+-------+-------+-------+-------. ,-------|-------+-------+-------+-------+-------+-------|
LSBR, Z , X , C , V , B ,TT_L, TT_R, N , M ,COMM,DOT ,SLSH,RSBR, KC_LSBR, KC_Z , KC_X , KC_C , KC_V , KC_B ,KC_TT_L, KC_TT_R, KC_N , KC_M ,KC_COMM,KC_DOT ,KC_SLSH,KC_RSBR,
//`----+----+----+--+-+----+----+----/ \----+----+----+----+----+----+----' //`-------+-------+-------+---+---+-------+-------+-------/ \-------+-------+-------+---+---+-------+-------+-------'
LCTL,SMIN,LGUI, ENT ,SPC ,LALT KC_LCTL,KC_SMIN,KC_LGUI, KC_ENT ,KC_SPC ,KC_LALT
// `----+----+----' `----+----+----' // `-------+-------+-------' `-------+-------+-------'
), ),
[_LOWER] = LAYOUT_kc( [_LOWER] = LAYOUT(
//,----+----+----+----+----+----. ,----+----+----+----+----+----. //,-------+-------+-------+-------+-------+-------. ,-------+-------+-------+-------+-------+-------.
TILD,EXLM, AT ,HASH,DLR ,PERC, CIRC,AMPR,ASTR,MINS,EQL , , KC_TILD,KC_EXLM, KC_AT ,KC_HASH,KC_DLR ,KC_PERC, KC_CIRC,KC_AMPR,KC_ASTR,KC_MINS,KC_EQL ,_______,
//|----+----+----+----+----+----| |----+----+----+----+----+----| //|-------+-------+-------+-------+-------+-------| |-------+-------+-------+-------+-------+-------|
,SLOK, , UP , ,RGBT, P7 , P8 , P9 , E , F ,LPRN, _______,KC_SLOK,_______, KC_UP ,_______,KC_RGBT, KC_P7 , KC_P8 , KC_P9 , KC_E , KC_F ,KC_LPRN,
//|----+----+----+----+----+----| |----+----+----+----+----+----| //|-------+-------+-------+-------+-------+-------| |-------+-------+-------+-------+-------+-------|
DEL , ,LEFT,DOWN,RGHT,GUSR, P4 , P5 , P6 , C , D ,RPRN, KC_DEL ,_______,KC_LEFT,KC_DOWN,KC_RGHT,KC_GUSR, KC_P4 , KC_P5 , KC_P6 , KC_C , KC_D ,KC_RPRN,
//|----+----+----+----+----+----+----. ,----|----+----+----+----+----+----| //|-------+-------+-------+-------+-------+-------+-------. ,-------|-------+-------+-------+-------+-------+-------|
BL_S, , , ,HGRP,CHUS, , , P1 , P2 , P3 , A , B , , KC_BL_S,_______,_______,_______,KC_HGRP,KC_CHUS,_______, _______, KC_P1 , KC_P2 , KC_P3 , KC_A , KC_B ,_______,
//`----+----+----+--+-+----+----+----/ \----+----+----+----+----+----+----' //`-------+-------+-------+---+---+-------+-------+-------/ \-------+-------+-------+---+---+-------+-------+-------'
, , , DOT , P0 ,COLN _______,_______,_______, KC_DOT , KC_P0 ,KC_COLN
// `----+----+----' `----+----+----' // `-------+-------+-------' `-------+-------+-------'
), ),
[_RAISE] = LAYOUT_kc( [_RAISE] = LAYOUT(
//,----+----+----+----+----+----. ,----+----+----+----+----+----. //,-------+-------+-------+-------+-------+-------. ,-------+-------+-------+-------+-------+-------.
F12 , F1 , F2 , F3 , F4 , F5 , F6 , F7 , F8 , F9 ,F10 ,F11 , KC_F12 , KC_F1 , KC_F2 , KC_F3 , KC_F4 , KC_F5 , KC_F6 , KC_F7 , KC_F8 , KC_F9 ,KC_F10 ,KC_F11 ,
//|----+----+----+----+----+----| |----+----+----+----+----+----| //|-------+-------+-------+-------+-------+-------| |-------+-------+-------+-------+-------+-------|
,RGBT,RGBM, , , , ,AMPR,MUTE, , , , _______,KC_RGBT,KC_RGBM,_______,_______,_______, _______,KC_AMPR,KC_MUTE,_______,_______,_______,
//|----+----+----+----+----+----| |----+----+----+----+----+----| //|-------+-------+-------+-------+-------+-------| |-------+-------+-------+-------+-------+-------|
,CAPW,CPYW,CAPP,CPYP,PGUP, EQL ,HOME,VOLU,MRWD,MFFD, , _______,KC_CAPW,KC_CPYW,KC_CAPP,KC_CPYP,KC_PGUP, KC_EQL ,KC_HOME,KC_VOLU,KC_MRWD,KC_MFFD,_______,
//|----+----+----+----+----+----+----. ,----|----+----+----+----+----+----| //|-------+-------+-------+-------+-------+-------+-------. ,-------|-------+-------+-------+-------+-------+-------|
, , , , ,PGDN, , ,PLUS,END ,VOLD,MPLY,MSTP, , _______,_______,_______,_______,_______,KC_PGDN,_______, _______,KC_PLUS,KC_END ,KC_VOLD,KC_MPLY,KC_MSTP,_______,
//`----+----+----+--+-+----+----+----/ \----+----+----+----+----+----+----' //`-------+-------+-------+---+---+-------+-------+-------/ \-------+-------+-------+---+---+-------+-------+-------'
, , , , , _______,_______,_______, _______,_______,_______
// `----+----+----' `----+----+----' // `-------+-------+-------' `-------+-------+-------'
), ),
[_ADJUST] = LAYOUT( [_ADJUST] = LAYOUT(
@@ -30,32 +30,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#undef RGBLED_NUM #undef RGBLED_NUM
#define RGBLED_NUM 8 #define RGBLED_NUM 8
#define RGBLIGHT_ANIMATIONS
#define RGBLIGHT_SLEEP
#define RGBLIGHT_HUE_STEP 8
#define RGBLIGHT_SAT_STEP 8
#define RGBLIGHT_VAL_STEP 8
#undef RGBLED_SPLIT #undef RGBLED_SPLIT
#define RGBLED_SPLIT { RGBLED_NUM, 0} // defined to sync animations #define RGBLED_SPLIT { RGBLED_NUM, 0}
#define FORCE_NKRO // force NKRO on by default
#undef TAPPING_TERM
#define TAPPING_TERM 200
#if !defined(NO_DEBUG) && !defined(CONSOLE_ENABLE)
#define NO_DEBUG
#endif // !NO_DEBUG
#if !defined(NO_PRINT) && !defined(CONSOLE_ENABLE)
#define NO_PRINT
#endif // !NO_PRINT
#define NO_MUSIC_MODE
// Override caps lock indication from my userspace
//#undef NORMAL_MODE
//#define NORMAL_MODE 1
//#undef CAPS_LOCK_MODE
//#define CAPS_LOCK_MODE 28
@@ -1,26 +1,24 @@
#include QMK_KEYBOARD_H /* Copyright 2021 SethBarberee <[email protected]>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include "sethBarberee.h" #include "sethBarberee.h"
extern backlight_config_t backlight_config; extern backlight_config_t backlight_config;
enum layers {
_QWERTY,
_LOWER,
_RAISE,
_ADJUST
};
enum custom_keycodes {
QWERTY = SAFE_RANGE,
LOWER,
RAISE,
ADJUST,
};
#define KC_ KC_TRNS #define KC_ KC_TRNS
#define KC_LOWR LOWER
#define KC_RASE RAISE
#define KC_RST RESET #define KC_RST RESET
#define KC_BL_S BL_STEP #define KC_BL_S BL_STEP
#define KC_RTOG RGB_TOG #define KC_RTOG RGB_TOG
@@ -33,147 +31,54 @@ enum custom_keycodes {
#define KC_RVAD RGB_VAD #define KC_RVAD RGB_VAD
#define KC_VK VLK_TOG #define KC_VK VLK_TOG
#define LAYOUT_wrapper(...) LAYOUT(__VA_ARGS__)
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
[_QWERTY] = LAYOUT_kc( [_QWERTY] = LAYOUT_wrapper(
//,----+----+----+----+----+----. ,----+----+----+----+----+----. KC_ECAP, ________________NUMBER_LEFT________________, ________________NUMBER_RIGHT_______________, KC_MINS,
ECAP, 1 , 2 , 3 , 4 , 5 , 6 , 7 , 8 , 9 , 0 ,MINS, KC_TAB , _________________QWERTY_L1_________________, _________________QWERTY_R1_________________, KC_DEL ,
//|----+----+----+----+----+----| |----+----+----+----+----+----| KC_LSFT, _________________QWERTY_L2_________________, _________________QWERTY_R2_________________,
TAB , Q , W , E , R , T , Y , U , I , O , P ,DEL , KC_LCTL, _________________QWERTY_L3_________________, KC_SPC, KC_RASE, _________________QWERTY_R3_________________,KC_RSFT,
//|----+----+----+----+----+----| |----+----+----+----+----+----| KC_LGUI, KC_LOWR, KC_SPC, KC_BSPC , KC_ENT, KC_LALT
LSFT, A , S , D , F , G , H , J , K , L ,SCLN,QUOT,
//|----+----+----+----+----+----+----. ,----|----+----+----+----+----+----|
LCTL, Z , X , C , V , B , SPC, RASE, N , M ,COMM,DOT ,SLSH,RSFT,
//`----+----+----+--+-+----+----+----/ \----+----+----+----+----+----+----'
LGUI,LOWR, SPC, BSPC ,ENT,LALT
// `----+----+----' `----+----+----'
), ),
[_LOWER] = LAYOUT_kc( [_LOWER] = LAYOUT(
//,----+----+----+----+----+----. ,----+----+----+----+----+----. KC_TILD,KC_EXLM, KC_AT ,KC_HASH,KC_DLR ,KC_PERC, KC_CIRC,KC_AMPR,KC_ASTR,KC_LPRN,KC_RPRN,KC_BSPC,
TILD,EXLM, AT ,HASH,DLR ,PERC, CIRC,AMPR,ASTR,LPRN,RPRN,BSPC, KC_RST ,_______,_______, KC_UP ,_______,_______, KC_GRV , KC_P7 , KC_P8 , KC_P9 ,_______,_______,
//|----+----+----+----+----+----| |----+----+----+----+----+----| KC_DEL ,_______,KC_LEFT,KC_DOWN,KC_RGHT,KC_LBRC, KC_RBRC, KC_P4 , KC_P5 , KC_P6 ,KC_PLUS,KC_PIPE,
RST , , , UP , , , GRV , P7 , P8 , P9 , , , KC_BL_S,_______,_______,_______,_______,KC_LCBR,KC_LPRN, KC_RPRN,KC_RCBR, KC_P1 , KC_P2 , KC_P3 ,KC_MINS,_______,
//|----+----+----+----+----+----| |----+----+----+----+----+----| _______,_______,KC_LPRN, KC_DEL ,_______, KC_P0
DEL , ,LEFT,DOWN,RGHT,LBRC, RBRC, P4 , P5 , P6 ,PLUS,PIPE,
//|----+----+----+----+----+----+----. ,----|----+----+----+----+----+----|
BL_S, , , , ,LCBR,LPRN, RPRN,RCBR, P1 , P2 , P3 ,MINS, ,
//`----+----+----+--+-+----+----+----/ \----+----+----+----+----+----+----'
, ,LPRN , DEL , , P0
// `----+----+----' `----+----+----'
), ),
[_RAISE] = LAYOUT_kc( [_RAISE] = LAYOUT(
//,----+----+----+----+----+----. ,----+----+----+----+----+----. KC_F12 , KC_F1 , KC_F2 , KC_F3 , KC_F4 , KC_F5 , KC_F6 , KC_F7 , KC_F8 , KC_F9 ,KC_F10 ,KC_F11 ,
F12 , F1 , F2 , F3 , F4 , F5 , F6 , F7 , F8 , F9 ,F10 ,F11 , _______,_______,_______,_______,_______,_______, _______, _______,_______,_______,_______,_______,
//|----+----+----+----+----+----| |----+----+----+----+----+----| _______,KC_MPRV,KC_MNXT,KC_VOLU,KC_PGUP,KC_UNDS, KC_EQL ,KC_HOME,_______,_______,_______,KC_BSLS,
, , , , , , , , , , , , KC_MUTE,KC_MSTP,KC_MPLY,KC_VOLD,KC_PGDN,KC_MINS,_______, _______,KC_PLUS,KC_END ,_______,_______,_______,_______,
//|----+----+----+----+----+----| |----+----+----+----+----+----| _______,_______,_______, _______,_______, _______
,MPRV,MNXT,VOLU,PGUP,UNDS, EQL ,HOME, , , ,BSLS,
//|----+----+----+----+----+----+----. ,----|----+----+----+----+----+----|
MUTE,MSTP,MPLY,VOLD,PGDN,MINS, , ,PLUS,END , , , , ,
//`----+----+----+--+-+----+----+----/ \----+----+----+----+----+----+----'
, , , , ,
// `----+----+----' `----+----+----'
), ),
[_ADJUST] = LAYOUT_kc( [_ADJUST] = LAYOUT(
//,----+----+----+----+----+----. ,----+----+----+----+----+----. //,----+----+----+----+----+----. ,----+----+----+----+----+----.
, , , , , , , , , , , , _______,_______,_______,_______,_______,_______, _______,_______,_______,_______,_______,_______,
//|----+----+----+----+----+----| |----+----+----+----+----+----| //|----+----+----+----+----+----| |----+----+----+----+----+----|
RTOG,RMOD,RHUI,RSAI,RVAI, , , , , , , , KC_RTOG,KC_RMOD,KC_RHUI,KC_RSAI,KC_RVAI,_______, _______,_______,_______,_______,_______,_______,
//|----+----+----+----+----+----| |----+----+----+----+----+----| //|----+----+----+----+----+----| |----+----+----+----+----+----|
VK, ,RHUD,RSAD,RVAD, , , , , , , , KC_VK, _______,KC_RHUD,KC_RSAD,KC_RVAD,_______, _______,_______,_______,_______,_______,_______,
//|----+----+----+----+----+----+----. ,----|----+----+----+----+----+----| //|----+----+----+----+----+----+----. ,----|----+----+----+----+----+----|
BL_S,RST , , , , , , , , , , , , , KC_BL_S,KC_RST ,_______,_______,_______,_______,_______, _______,_______,_______,_______,_______,_______,_______,
//`----+----+----+--+-+----+----+----/ \----+----+----+----+----+----+----' //`----+----+----+--+-+----+----+----/ \----+----+----+----+----+----+----'
, , , , , _______,_______,_______, _______,_______, _______
// `----+----+----' `----+----+----' // `----+----+----' `----+----+----'
) )
}; };
void keyboard_pre_init_user(void) { void suspend_power_down_keymap(void){
// Make sure the red LEDs don't light
setPinOutput(D5);
writePinHigh(D5);
setPinOutput(B0);
writePinHigh(B0);
}
void keyboard_post_init_user(void){
rgblight_enable_noeeprom(); // enable the RGBs
rgblight_sethsv_noeeprom_red(); // set to red
rgblight_mode_noeeprom(RGBLIGHT_MODE_BREATHING + 3); // set to breathing
}
void suspend_power_down_user(void){
backlight_config.enable = false; // disable LED backlight backlight_config.enable = false; // disable LED backlight
} }
void suspend_wakeup_init_user(void){ void suspend_wakeup_init_keymap(void){
backlight_config.enable = true; // enable LED backlight backlight_config.enable = true; // enable LED backlight
} }
bool process_record_user(uint16_t keycode, keyrecord_t *record) {
switch (keycode) {
case QWERTY:
if (record->event.pressed) {
set_single_persistent_default_layer(_QWERTY);
}
return false;
break;
case LOWER:
if (record->event.pressed) {
layer_on(_LOWER);
update_tri_layer(_LOWER, _RAISE, _ADJUST);
} else {
layer_off(_LOWER);
update_tri_layer(_LOWER, _RAISE, _ADJUST);
}
return false;
break;
case RAISE:
if (record->event.pressed) {
layer_on(_RAISE);
update_tri_layer(_LOWER, _RAISE, _ADJUST);
} else {
layer_off(_RAISE);
update_tri_layer(_LOWER, _RAISE, _ADJUST);
}
return false;
break;
case ADJUST:
if (record->event.pressed) {
layer_on(_ADJUST);
} else {
layer_off(_ADJUST);
}
return false;
break;
}
return true;
}
uint32_t layer_state_set_user(uint32_t state){
switch(biton32(state)) {
case _QWERTY:
rgblight_sethsv_noeeprom(HSV_RED);
break;
case _LOWER:
rgblight_sethsv_noeeprom(HSV_GREEN);
break;
case _RAISE:
rgblight_sethsv_noeeprom(HSV_BLUE);
break;
case _ADJUST:
rgblight_sethsv_noeeprom(HSV_ORANGE);
break;
default:
rgblight_mode_noeeprom(RGBLIGHT_MODE_STATIC_GRADIENT + 3);
break;
}
return state;
}
@@ -1,9 +1,5 @@
BOOTMAGIC_ENABLE = no
CONSOLE_ENABLE = no CONSOLE_ENABLE = no
EXTRAKEY_ENABLE = yes # Audio control and System control(+450) NKRO_ENABLE = yes
NKRO_ENABLE = yes # Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work
BACKLIGHT_ENABLE = yes # Enable my Red LEDS
RGBLIGHT_ENABLE = yes # Enable my RGBS
VELOCIKEY_ENABLE = yes # I like RGB VELOCIKEY_ENABLE = yes # I like RGB
TAP_DANCE_ENABLE = yes # fancy fancy Caps TAP_DANCE_ENABLE = yes # fancy fancy Caps
LTO_ENABLE = yes # Enable link time optimization LTO_ENABLE = yes # Enable link time optimization
@@ -0,0 +1,30 @@
/*
Copyright 2017 Danny Nguyen <[email protected]>
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#pragma once
/* Use I2C or Serial, not both */
//
//#define USE_SERIAL
//#define USE_I2C
//#ifdef RGBLIGHT_ENABLE
//# ifdef NORMAL_MODE
//# undef NORMAL_MODE
//# define NORMAL_MODE RGBLIGHT_MODE_TWINKLE + 4
//# endif
//#endif
@@ -0,0 +1,71 @@
/* Copyright 2021 SethBarberee <[email protected]>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include "sethBarberee.h"
#define LAYOUT_80_with_macro_wrapper(...) LAYOUT_80_with_macro(__VA_ARGS__)
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
[_QWERTY] = LAYOUT_80_with_macro_wrapper(
KC_MUTE, KC_ECAP, _________________FUNC_LEFT_________________, _________________FUNC_RIGHT________________, KC_F11, KC_F12, KC_DEL, KC_MUTE,
KC_F1, KC_F2, KC_GRV, ________________NUMBER_LEFT________________, ________________NUMBER_RIGHT_______________,KC_MINS, KC_EQL, _______, KC_BSPC, KC_HOME,
KC_F3, KC_F4, KC_TAB, _________________QWERTY_L1_________________, _________________QWERTY_R1_________________, KC_LBRC, KC_RBRC, KC_BSLS, KC_END,
KC_F5, KC_F6, KC_LSFT, _________________QWERTY_L2_________________, _________________QWERTY_R2_________________, KC_ENT, KC_PGUP,
KC_F7, KC_F8, KC_LSFT, _________________QWERTY_L3_________________, _________________QWERTY_R3_________________, KC_RSFT, KC_UP, KC_PGDN,
KC_F9, KC_F10, KC_LCTL, KC_LALT, KC_LGUI, KC_LOWR, _______, KC_SPC, KC_RASE, KC_BSPC, KC_RALT, KC_RCTL, KC_RGUI, KC_LEFT, KC_DOWN, KC_RGHT
),
[_LOWER] = LAYOUT_80_with_macro_wrapper(
RGB_TOG, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_PSCR,
RGB_HUI, RGB_HUD, KC_GESC, _________________FUNC_LEFT_________________, _________________FUNC_RIGHT________________, KC_F11, KC_F12, _______, _______, KC_MPRV,
RGB_SAI, RGB_SAD, RGB_TOG, _______, _______, _______, _______, KC_LPRN, KC_RPRN, _______, _______, _______, _______, _______, _______, _______, KC_MNXT,
RGB_VAI, RGB_VAD, _______, _______, _______, _______, _______, KC_LCBR, KC_RCBR, _______, _______, _______, _______, _______, _______, KC_VOLU,
RGB_MOD, RGB_RMOD, _______, _______, _______, _______, _______, KC_LBRC, KC_RBRC, _______, _______, _______, _______, _______, _______, KC_VOLD,
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______
),
[_RAISE] = LAYOUT_80_with_macro_wrapper(
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
RESET, KC_VRSN, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______
),
[_ADJUST] = LAYOUT_80_with_macro_wrapper(
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______
),
};
void encoder_update_user(uint8_t index, bool clockwise) {
if (index == 0) {
if (clockwise) {
tap_code(KC_PGDN);
} else {
tap_code(KC_PGUP);
}
} else if (index == 1) {
if (clockwise) {
tap_code(KC_VOLU);
} else {
tap_code(KC_VOLD);
}
}
}
@@ -0,0 +1,3 @@
BACKLIGHT_ENABLE=no
CONSOLE_ENABLE=no
TAP_DANCE_ENABLE=yes
+24
View File
@@ -0,0 +1,24 @@
/* Copyright 2021 Sean Johnson
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#pragma once
#ifdef AUDIO_ENABLE
#define STARTUP_SONG SONG(COLEMAK_SOUND)
#endif
// Most tactile encoders have detents every 4 stages
#define ENCODER_RESOLUTION 4
+280
View File
@@ -0,0 +1,280 @@
/* Copyright 2021 Sean Johnson
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include QMK_KEYBOARD_H
#include "muse.h"
#define a KC_A
#define b KC_B
#define c KC_C
#define d KC_D
#define e KC_E
#define f KC_F
#define g KC_G
#define h KC_H
#define i KC_I
#define j KC_J
#define k KC_K
#define l KC_L
#define m KC_M
#define n KC_N
#define o KC_O
#define p KC_P
#define q KC_Q
#define r KC_R
#define s KC_S
#define t KC_T
#define u KC_U
#define v KC_V
#define w KC_W
#define x KC_X
#define y KC_Y
#define z KC_Z
#define lopt KC_LALT
#define lctl KC_LCTL
#define lsft KC_LSFT
#define ropt KC_RALT
#define rctl KC_RCTL
#define rsft KC_RSFT
#define n0 KC_0
#define n1 KC_1
#define n2 KC_2
#define n3 KC_3
#define n4 KC_4
#define n5 KC_5
#define n6 KC_6
#define n7 KC_7
#define n8 KC_8
#define n9 KC_9
#define bspc KC_BSPC
#define caps KC_CAPS
#define comm KC_COMM
#define dash A(KC_MINS)
#define scln KC_SCLN
#define slsh KC_SLSH
#define spc KC_SPC
#define tab KC_TAB
#define del KC_DEL
#define dot KC_DOT
#define ent KC_ENT
#define mins KC_MINS
#define quot KC_QUOT
#define esc KC_ESC
#define escg KC_GESC
#define down KC_DOWN
#define home G(KC_LEFT)
#define end G(KC_RGHT)
#define up KC_UP
#define pgdn KC_PGDN
#define pgup KC_PGUP
#define left KC_LEFT
#define rght KC_RGHT
#define tabl G(S(KC_LBRC))
#define tabr G(S(KC_RBRC))
#define fwd G(KC_RBRC)
#define back G(KC_LBRC)
#define dtl C(KC_LEFT)
#define dtr C(KC_RGHT)
#define slup S(A(KC_UP))
#define sldn S(A(KC_DOWN))
#define f1 KC_F1
#define f2 KC_F2
#define f3 KC_F3
#define f4 KC_F4
#define f5 KC_F5
#define f6 KC_F6
#define f7 KC_F7
#define f8 KC_F8
#define f9 KC_F9
#define f10 KC_F10
#define f11 KC_F11
#define f12 KC_F12
#define f13 KC_F13
#define f14 KC_F14
#define f15 KC_F15
#define f16 KC_F16
#define f17 KC_F17
#define f18 KC_F18
#define f19 KC_F19
#define f20 KC_F20
#define mute KC_MUTE
#define next KC_MNXT
#define play KC_MPLY
#define prev KC_MPRV
#define vold KC_VOLD
#define volu KC_VOLU
#define symb MO(SYMB)
#define move MO(MOVE)
#define func MO(FUNC)
#define rset RESET
#define powr KC_POWER
#define ____ KC_TRNS
#define xxxx KC_NO
#define emji LCMD(LCTL(KC_SPC))
#define hypr OSM(MOD_HYPR)
#define brup KC_BRMU
#define brdn KC_BRMD
#define escf LT(FUNC,KC_ESC)
enum planck_layers {
BASE,
SYMB,
MOVE,
FUNC,
};
enum planck_keycodes {
ampr = SAFE_RANGE,
astr,
at,
bsls,
circ,
dlr,
eql,
exlm,
grv,
hash,
lbrc,
lcbr,
lprn,
perc,
pipe,
plus,
rbrc,
rcbr,
rprn,
tild,
cmd,
};
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
[BASE] = LAYOUT_planck_grid(
tab, q, w, f, p, g, j, l, u, y, scln, mins,
bspc, a, r, s, t, d, h, n, e, i, o, quot,
lsft, z, x, c, v, b, k, m, comm, dot, slsh, rsft,
hypr, lctl, lopt, cmd, move, ent, spc, symb, cmd, ropt, rctl, func
),
[SYMB] = LAYOUT_planck_grid(
esc, n7, n5, n3, n1, n9, n8, n0, n2, n4, n6, dash,
bspc, lbrc, lcbr, lprn, hash, pipe, astr, dlr, rprn, rcbr, rbrc, at,
____, grv, exlm, circ, tild, perc, ampr, plus, mins, eql, bsls, ____,
____, ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, ____
),
[MOVE] = LAYOUT_planck_grid(
esc, xxxx, slup, dtl, dtr, xxxx, xxxx, home, up, end, xxxx, ____,
del, xxxx, sldn, tabl, tabr, xxxx, xxxx, left, down, rght, xxxx, ____,
____, xxxx, xxxx, back, fwd, xxxx, xxxx, pgdn, pgup, xxxx, xxxx, ____,
____, ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, ____
),
[FUNC] = LAYOUT_planck_grid(
rset, f7, f5, f3, f1, f9, f8, f10, f2, f4, f6, volu,
powr, f17, f15, f13, f11, f19, f18, f20, f12, f14, f16, vold,
brup, ____, xxxx, xxxx, xxxx, xxxx, xxxx, xxxx, xxxx, xxxx, xxxx, mute,
brdn, caps, ____, ____, ____, ____, ____, ____, prev, next, play, ____
),
};
bool send_string_if_keydown(keyrecord_t *record, const char *s) {
if (record->event.pressed) {
send_string(s);
}
return true;
}
int cmd_keys_down = 0;
bool process_record_user(uint16_t keycode, keyrecord_t *record) {
switch (keycode) {
// Override the default auto shifted symbols to use SEND_STRING See
// https://github.com/qmk/qmk_firmware/issues/4072
case ampr:
return send_string_if_keydown(record, "&");
case astr:
return send_string_if_keydown(record, "*");
case at:
return send_string_if_keydown(record, "@");
case bsls:
return send_string_if_keydown(record, "\\");
case circ:
return send_string_if_keydown(record, "^");
case dlr:
return send_string_if_keydown(record, "$");
case eql:
return send_string_if_keydown(record, "=");
case exlm:
return send_string_if_keydown(record, "!");
case grv:
return send_string_if_keydown(record, "`");
case hash:
return send_string_if_keydown(record, "#");
case lbrc:
return send_string_if_keydown(record, "[");
case lcbr:
return send_string_if_keydown(record, "{");
case lprn:
return send_string_if_keydown(record, "(");
case perc:
return send_string_if_keydown(record, "%");
case pipe:
return send_string_if_keydown(record, "|");
case plus:
return send_string_if_keydown(record, "+");
case rbrc:
return send_string_if_keydown(record, "]");
case rcbr:
return send_string_if_keydown(record, "}");
case rprn:
return send_string_if_keydown(record, ")");
case tild:
return send_string_if_keydown(record, "~");
// cmd + cmd -> cmd + ctl
case cmd:
if (record->event.pressed) {
if (cmd_keys_down == 0) {
register_code(KC_LCMD);
} else {
register_code(KC_LCTL);
}
cmd_keys_down++;
} else {
if (cmd_keys_down == 1) {
unregister_code(KC_LCMD);
} else {
unregister_code(KC_LCTL);
}
cmd_keys_down--;
}
return true;
}
return true;
}
+5
View File
@@ -0,0 +1,5 @@
# Sean's Planck Config
This is basically a copy of the `callum` layout with a few minor adjustments to better fit my style.
[Keyboard Layout Editor](http://www.keyboard-layout-editor.com/#/gists/7fef3554143712e2317b466c09a73a27)
+4
View File
@@ -0,0 +1,4 @@
# Make some noise
SRC += muse.c
+29
View File
@@ -0,0 +1,29 @@
/* Copyright 2021 Sean Johnson
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#pragma once
#ifdef AUDIO_ENABLE
#define STARTUP_SONG SONG(PREONIC_SOUND)
#define DEFAULT_LAYER_SONGS { SONG(QWERTY_SOUND), \
SONG(COLEMAK_SOUND), \
SONG(DVORAK_SOUND) \
}
#endif
// Most tactile encoders have detents every 4 stages
#define ENCODER_RESOLUTION 4
+283
View File
@@ -0,0 +1,283 @@
/* Copyright 2021 Sean Johnson
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include QMK_KEYBOARD_H
#include "muse.h"
#define a KC_A
#define b KC_B
#define c KC_C
#define d KC_D
#define e KC_E
#define f KC_F
#define g KC_G
#define h KC_H
#define i KC_I
#define j KC_J
#define k KC_K
#define l KC_L
#define m KC_M
#define n KC_N
#define o KC_O
#define p KC_P
#define q KC_Q
#define r KC_R
#define s KC_S
#define t KC_T
#define u KC_U
#define v KC_V
#define w KC_W
#define x KC_X
#define y KC_Y
#define z KC_Z
#define lopt KC_LALT
#define lctl KC_LCTL
#define lsft KC_LSFT
#define ropt KC_RALT
#define rctl KC_RCTL
#define rsft KC_RSFT
#define n0 KC_0
#define n1 KC_1
#define n2 KC_2
#define n3 KC_3
#define n4 KC_4
#define n5 KC_5
#define n6 KC_6
#define n7 KC_7
#define n8 KC_8
#define n9 KC_9
#define bspc KC_BSPC
#define caps KC_CAPS
#define comm KC_COMM
#define dash A(KC_MINS)
#define scln KC_SCLN
#define slsh KC_SLSH
#define spc KC_SPC
#define tab KC_TAB
#define del KC_DEL
#define dot KC_DOT
#define ent KC_ENT
#define mins KC_MINS
#define quot KC_QUOT
#define esc KC_ESC
#define down KC_DOWN
#define home G(KC_LEFT)
#define end G(KC_RGHT)
#define up KC_UP
#define pgdn KC_PGDN
#define pgup KC_PGUP
#define left KC_LEFT
#define rght KC_RGHT
#define tabl G(S(KC_LBRC))
#define tabr G(S(KC_RBRC))
#define fwd G(KC_RBRC)
#define back G(KC_LBRC)
#define dtl C(KC_LEFT)
#define dtr C(KC_RGHT)
#define slup S(A(KC_UP))
#define sldn S(A(KC_DOWN))
#define f1 KC_F1
#define f2 KC_F2
#define f3 KC_F3
#define f4 KC_F4
#define f5 KC_F5
#define f6 KC_F6
#define f7 KC_F7
#define f8 KC_F8
#define f9 KC_F9
#define f10 KC_F10
#define f11 KC_F11
#define f12 KC_F12
#define f13 KC_F13
#define f14 KC_F14
#define f15 KC_F15
#define f16 KC_F16
#define f17 KC_F17
#define f18 KC_F18
#define f19 KC_F19
#define f20 KC_F20
#define mute KC_MUTE
#define next KC_MNXT
#define play KC_MPLY
#define prev KC_MPRV
#define vold KC_VOLD
#define volu KC_VOLU
#define symb MO(SYMB)
#define move MO(MOVE)
#define func MO(FUNC)
#define rset RESET
#define powr KC_POWER
#define ____ KC_TRNS
#define xxxx KC_NO
#define emji LCMD(LCTL(KC_SPC))
#define hypr OSM(MOD_HYPR)
#define brup KC_BRMU
#define brdn KC_BRMD
#define escf LT(FUNC,KC_ESC)
enum preonic_layers {
BASE,
SYMB,
MOVE,
FUNC,
};
enum preonic_keycodes {
ampr = SAFE_RANGE,
astr,
at,
bsls,
circ,
dlr,
eql,
exlm,
grv,
hash,
lbrc,
lcbr,
lprn,
perc,
pipe,
plus,
rbrc,
rcbr,
rprn,
tild,
cmd,
};
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
[BASE] = LAYOUT_preonic_grid(
tild, n7, n5, n3, n1, n9, n8, n0, n2, n4, n6, mins,
tab, q, w, f, p, g, j, l, u, y, scln, pipe,
bspc, a, r, s, t, d, h, n, e, i, o, quot,
lsft, z, x, c, v, b, k, m, comm, dot, slsh, rsft,
hypr, lctl, lopt, cmd, move, ent, spc, symb, cmd, ropt, rctl, escf
),
[SYMB] = LAYOUT_preonic_grid(
____, ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, ____,
tild, n7, n5, n3, n1, n9, n8, n0, n2, n4, n6, dash,
bspc, lbrc, lcbr, lprn, hash, pipe, astr, dlr, rprn, rcbr, rbrc, at,
____, grv, exlm, circ, ampr, ____, ____, plus, mins, eql, bsls, perc,
caps, ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, ____
),
[MOVE] = LAYOUT_preonic_grid(
____, ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, ____,
____, xxxx, slup, dtl, dtr, xxxx, xxxx, home, up, end, xxxx, xxxx,
del, xxxx, sldn, tabl, tabr, xxxx, xxxx, left, down, rght, xxxx, xxxx,
____, xxxx, xxxx, back, fwd, xxxx, xxxx, pgdn, pgup, xxxx, xxxx, ____,
____, ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, ____
),
[FUNC] = LAYOUT_preonic_grid(
____, ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, ____,
rset, f7, f5, f3, f1, f9, f8, f10, f2, f4, f6, volu,
powr, f17, f15, f13, f11, f19, f18, f20, f12, f14, f16, vold,
brup, brdn, xxxx, xxxx, xxxx, xxxx, xxxx, xxxx, xxxx, xxxx, xxxx, ____,
____, ____, ____, ____, ____, ____, ____, mute, play, prev, next, ____
),
};
bool send_string_if_keydown(keyrecord_t *record, const char *s) {
if (record->event.pressed) {
send_string(s);
}
return true;
}
int cmd_keys_down = 0;
bool process_record_user(uint16_t keycode, keyrecord_t *record) {
switch (keycode) {
// Override the default auto shifted symbols to use SEND_STRING See
// https://github.com/qmk/qmk_firmware/issues/4072
case ampr:
return send_string_if_keydown(record, "&");
case astr:
return send_string_if_keydown(record, "*");
case at:
return send_string_if_keydown(record, "@");
case bsls:
return send_string_if_keydown(record, "\\");
case circ:
return send_string_if_keydown(record, "^");
case dlr:
return send_string_if_keydown(record, "$");
case eql:
return send_string_if_keydown(record, "=");
case exlm:
return send_string_if_keydown(record, "!");
case grv:
return send_string_if_keydown(record, "`");
case hash:
return send_string_if_keydown(record, "#");
case lbrc:
return send_string_if_keydown(record, "[");
case lcbr:
return send_string_if_keydown(record, "{");
case lprn:
return send_string_if_keydown(record, "(");
case perc:
return send_string_if_keydown(record, "%");
case pipe:
return send_string_if_keydown(record, "|");
case plus:
return send_string_if_keydown(record, "+");
case rbrc:
return send_string_if_keydown(record, "]");
case rcbr:
return send_string_if_keydown(record, "}");
case rprn:
return send_string_if_keydown(record, ")");
case tild:
return send_string_if_keydown(record, "~");
// cmd + cmd -> cmd + ctl
case cmd:
if (record->event.pressed) {
if (cmd_keys_down == 0) {
register_code(KC_LCMD);
} else {
register_code(KC_LCTL);
}
cmd_keys_down++;
} else {
if (cmd_keys_down == 1) {
unregister_code(KC_LCMD);
} else {
unregister_code(KC_LCTL);
}
cmd_keys_down--;
}
return true;
}
return true;
}
@@ -0,0 +1,3 @@
# Sean's Preonic Config
This is basically a copy of the `callum` Planck layout adjusted to the Preonic layout with a few minor adjustments.
+2
View File
@@ -0,0 +1,2 @@
# Make some noise
SRC += muse.c
@@ -1 +1,2 @@
BOOTMAGIC_ENABLE = lite BOOTMAGIC_ENABLE = lite
VIA_ENABLE = yes
+121 -23
View File
@@ -2,32 +2,79 @@
We list each subcommand here explicitly because all the reliable ways of searching for modules are slow and delay startup. We list each subcommand here explicitly because all the reliable ways of searching for modules are slow and delay startup.
""" """
import os
import shlex
import sys import sys
from importlib.util import find_spec
from pathlib import Path
from subprocess import run
from milc import cli, __VERSION__ from milc import cli, __VERSION__
from milc.questions import yesno
from . import c2json
from . import cformat
from . import chibios
from . import clean
from . import compile
from . import config
from . import docs
from . import doctor
from . import fileformat
from . import flash
from . import format
from . import generate
from . import hello
from . import info
from . import json2c
from . import lint
from . import list
from . import kle2json
from . import new
from . import pyformat
from . import pytest
def _run_cmd(*command):
"""Run a command in a subshell.
"""
if 'windows' in cli.platform.lower():
safecmd = map(shlex.quote, command)
safecmd = ' '.join(safecmd)
command = [os.environ['SHELL'], '-c', safecmd]
return run(command)
def _find_broken_requirements(requirements):
""" Check if the modules in the given requirements.txt are available.
Args:
requirements
The path to a requirements.txt file
Returns a list of modules that couldn't be imported
"""
with Path(requirements).open() as fd:
broken_modules = []
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_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):
broken_modules.append(module_name)
return broken_modules
def _broken_module_imports(requirements):
"""Make sure we can import all the python modules.
"""
broken_modules = _find_broken_requirements(requirements)
for module in broken_modules:
print('Could not find module %s!' % module)
if broken_modules:
return True
return False
# Make sure our python is new enough
#
# Supported version information # Supported version information
# #
# Based on the OSes we support these are the minimum python version available by default. # Based on the OSes we support these are the minimum python version available by default.
@@ -53,9 +100,60 @@ if sys.version_info[0] != 3 or sys.version_info[1] < 7:
milc_version = __VERSION__.split('.') milc_version = __VERSION__.split('.')
if int(milc_version[0]) < 2 and int(milc_version[1]) < 3: if int(milc_version[0]) < 2 and int(milc_version[1]) < 3:
from pathlib import Path
requirements = Path('requirements.txt').resolve() requirements = Path('requirements.txt').resolve()
print(f'Your MILC library is too old! Please upgrade: python3 -m pip install -U -r {str(requirements)}') print(f'Your MILC library is too old! Please upgrade: python3 -m pip install -U -r {str(requirements)}')
exit(127) exit(127)
# Check to make sure we have all our dependencies
msg_install = 'Please run `python3 -m pip install -r %s` to install required python dependencies.'
if _broken_module_imports('requirements.txt'):
if yesno('Would you like to install the required Python modules?'):
_run_cmd(sys.executable, '-m', 'pip', 'install', '-r', 'requirements.txt')
else:
print()
print(msg_install % (str(Path('requirements.txt').resolve()),))
print()
exit(1)
if cli.config.user.developer:
args = sys.argv[1:]
while args and args[0][0] == '-':
del args[0]
if not args or args[0] != 'config':
if _broken_module_imports('requirements-dev.txt'):
if yesno('Would you like to install the required developer Python modules?'):
_run_cmd(sys.executable, '-m', 'pip', 'install', '-r', 'requirements-dev.txt')
elif yesno('Would you like to disable developer mode?'):
_run_cmd(sys.argv[0], 'config', 'user.developer=None')
else:
print()
print(msg_install % (str(Path('requirements-dev.txt').resolve()),))
print('You can also turn off developer mode: qmk config user.developer=None')
print()
exit(1)
# Import our subcommands
from . import c2json # noqa
from . import cformat # noqa
from . import chibios # noqa
from . import clean # noqa
from . import compile # noqa
from . import config # noqa
from . import docs # noqa
from . import doctor # noqa
from . import fileformat # noqa
from . import flash # noqa
from . import format # noqa
from . import generate # noqa
from . import hello # noqa
from . import info # noqa
from . import json2c # noqa
from . import lint # noqa
from . import list # noqa
from . import kle2json # noqa
from . import multibuild # noqa
from . import new # noqa
from . import pyformat # noqa
from . import pytest # noqa
+92 -31
View File
@@ -1,6 +1,7 @@
"""Format C code according to QMK's style. """Format C code according to QMK's style.
""" """
import subprocess import subprocess
from os import path
from shutil import which from shutil import which
from argcomplete.completers import FilesCompleter from argcomplete.completers import FilesCompleter
@@ -9,58 +10,118 @@ from milc import cli
from qmk.path import normpath from qmk.path import normpath
from qmk.c_parse import c_source_files from qmk.c_parse import c_source_files
c_file_suffixes = ('c', 'h', 'cpp')
core_dirs = ('drivers', 'quantum', 'tests', 'tmk_core', 'platforms')
ignored = ('tmk_core/protocol/usb_hid', 'quantum/template', 'platforms/chibios')
def cformat_run(files, all_files):
def find_clang_format():
"""Returns the path to clang-format.
"""
for clang_version in range(20, 6, -1):
binary = f'clang-format-{clang_version}'
if which(binary):
return binary
return 'clang-format'
def find_diffs(files):
"""Run clang-format and diff it against a file.
"""
found_diffs = False
for file in files:
cli.log.debug('Checking for changes in %s', file)
clang_format = subprocess.Popen([find_clang_format(), file], stdout=subprocess.PIPE, stderr=subprocess.PIPE, universal_newlines=True)
diff = cli.run(['diff', '-u', f'--label=a/{file}', f'--label=b/{file}', str(file), '-'], stdin=clang_format.stdout, capture_output=True)
if diff.returncode != 0:
print(diff.stdout)
found_diffs = True
return found_diffs
def cformat_run(files):
"""Spawn clang-format subprocess with proper arguments """Spawn clang-format subprocess with proper arguments
""" """
# Determine which version of clang-format to use # Determine which version of clang-format to use
clang_format = ['clang-format', '-i'] clang_format = [find_clang_format(), '-i']
for clang_version in range(20, 6, -1):
binary = 'clang-format-%d' % clang_version
if which(binary):
clang_format[0] = binary
break
try:
if not files:
cli.log.warn('No changes detected. Use "qmk cformat -a" to format all files')
return False
subprocess.run(clang_format + [file for file in files], check=True)
cli.log.info('Successfully formatted the C code.')
except subprocess.CalledProcessError: try:
cli.run(clang_format + list(map(str, files)), check=True, capture_output=False)
cli.log.info('Successfully formatted the C code.')
return True
except subprocess.CalledProcessError as e:
cli.log.error('Error formatting C code!') cli.log.error('Error formatting C code!')
cli.log.debug('%s exited with returncode %s', e.cmd, e.returncode)
cli.log.debug('STDOUT:')
cli.log.debug(e.stdout)
cli.log.debug('STDERR:')
cli.log.debug(e.stderr)
return False return False
@cli.argument('-a', '--all-files', arg_only=True, action='store_true', help='Format all core files.') def filter_files(files):
"""Yield only files to be formatted and skip the rest
"""
for file in files:
if file.name.split('.')[-1] in c_file_suffixes:
yield file
else:
cli.log.debug('Skipping file %s', file)
@cli.argument('-n', '--dry-run', arg_only=True, action='store_true', help="Flag only, don't automatically format.")
@cli.argument('-b', '--base-branch', default='origin/master', help='Branch to compare to diffs to.') @cli.argument('-b', '--base-branch', default='origin/master', help='Branch to compare to diffs to.')
@cli.argument('files', nargs='*', arg_only=True, completer=FilesCompleter('.c'), help='Filename(s) to format.') @cli.argument('-a', '--all-files', arg_only=True, action='store_true', help='Format all core files.')
@cli.argument('files', nargs='*', arg_only=True, type=normpath, completer=FilesCompleter('.c'), help='Filename(s) to format.')
@cli.subcommand("Format C code according to QMK's style.", hidden=False if cli.config.user.developer else True) @cli.subcommand("Format C code according to QMK's style.", hidden=False if cli.config.user.developer else True)
def cformat(cli): def cformat(cli):
"""Format C code according to QMK's style. """Format C code according to QMK's style.
""" """
# Empty array for files
files = []
# Core directories for formatting
core_dirs = ['drivers', 'quantum', 'tests', 'tmk_core', 'platforms']
ignores = ['tmk_core/protocol/usb_hid', 'quantum/template', 'platforms/chibios']
# Find the list of files to format # Find the list of files to format
if cli.args.files: if cli.args.files:
files.extend(normpath(file) for file in cli.args.files) files = list(filter_files(cli.args.files))
if not files:
cli.log.error('No C files in filelist: %s', ', '.join(map(str, cli.args.files)))
exit(0)
if cli.args.all_files: if cli.args.all_files:
cli.log.warning('Filenames passed with -a, only formatting: %s', ','.join(map(str, files))) cli.log.warning('Filenames passed with -a, only formatting: %s', ','.join(map(str, files)))
# If -a is specified
elif cli.args.all_files: elif cli.args.all_files:
all_files = c_source_files(core_dirs) all_files = c_source_files(core_dirs)
# The following statement checks each file to see if the file path is in the ignored directories. # The following statement checks each file to see if the file path is in the ignored directories.
files.extend(file for file in all_files if not any(i in str(file) for i in ignores)) files = [file for file in all_files if not any(i in str(file) for i in ignored)]
# No files specified & no -a flag
else: else:
base_args = ['git', 'diff', '--name-only', cli.args.base_branch] git_diff_cmd = ['git', 'diff', '--name-only', cli.args.base_branch, *core_dirs]
out = subprocess.run(base_args + core_dirs, check=True, stdout=subprocess.PIPE) git_diff = cli.run(git_diff_cmd)
changed_files = filter(None, out.stdout.decode('UTF-8').split('\n'))
filtered_files = [normpath(file) for file in changed_files if not any(i in file for i in ignores)] if git_diff.returncode != 0:
files.extend(file for file in filtered_files if file.exists() and file.suffix in ['.c', '.h', '.cpp']) cli.log.error("Error running %s", git_diff_cmd)
print(git_diff.stderr)
return git_diff.returncode
files = []
for file in git_diff.stdout.strip().split('\n'):
if not any([file.startswith(ignore) for ignore in ignored]):
if path.exists(file) and file.split('.')[-1] in c_file_suffixes:
files.append(file)
# Sanity check
if not files:
cli.log.error('No changed files detected. Use "qmk cformat -a" to format all files')
return False
# Run clang-format on the files we've found # Run clang-format on the files we've found
cformat_run(files, cli.args.all_files) if cli.args.dry_run:
return not find_diffs(files)
else:
return cformat_run(files)
+2 -6
View File
@@ -1,16 +1,12 @@
"""Clean the QMK firmware folder of build artifacts. """Clean the QMK firmware folder of build artifacts.
""" """
from qmk.commands import run from qmk.commands import run, create_make_target
from milc import cli from milc import cli
import shutil
@cli.argument('-a', '--all', arg_only=True, action='store_true', help='Remove *.hex and *.bin files in the QMK root as well.') @cli.argument('-a', '--all', arg_only=True, action='store_true', help='Remove *.hex and *.bin files in the QMK root as well.')
@cli.subcommand('Clean the QMK firmware folder of build artifacts.') @cli.subcommand('Clean the QMK firmware folder of build artifacts.')
def clean(cli): def clean(cli):
"""Runs `make clean` (or `make distclean` if --all is passed) """Runs `make clean` (or `make distclean` if --all is passed)
""" """
make_cmd = 'gmake' if shutil.which('gmake') else 'make' run(create_make_target('distclean' if cli.args.all else 'clean'))
run([make_cmd, 'distclean' if cli.args.all else 'clean'])
+23 -12
View File
@@ -13,6 +13,7 @@ from qmk.json_schema import json_load
from qmk.keyboard import list_keyboards from qmk.keyboard import list_keyboards
@cli.argument('-n', '--dry-run', arg_only=True, action='store_true', help="Don't write the data to disk.")
@cli.subcommand('Creates a new keymap for the keyboard of your choosing', hidden=False if cli.config.user.developer else True) @cli.subcommand('Creates a new keymap for the keyboard of your choosing', hidden=False if cli.config.user.developer else True)
def generate_api(cli): def generate_api(cli):
"""Generates the QMK API data. """Generates the QMK API data.
@@ -40,10 +41,14 @@ def generate_api(cli):
keyboard_readme_src = Path('keyboards') / keyboard_name / 'readme.md' keyboard_readme_src = Path('keyboards') / keyboard_name / 'readme.md'
keyboard_dir.mkdir(parents=True, exist_ok=True) keyboard_dir.mkdir(parents=True, exist_ok=True)
keyboard_info.write_text(json.dumps({'last_updated': current_datetime(), 'keyboards': {keyboard_name: kb_all[keyboard_name]}})) keyboard_json = json.dumps({'last_updated': current_datetime(), 'keyboards': {keyboard_name: kb_all[keyboard_name]}})
if not cli.args.dry_run:
keyboard_info.write_text(keyboard_json)
cli.log.debug('Wrote file %s', keyboard_info)
if keyboard_readme_src.exists(): if keyboard_readme_src.exists():
copyfile(keyboard_readme_src, keyboard_readme) copyfile(keyboard_readme_src, keyboard_readme)
cli.log.debug('Copied %s -> %s', keyboard_readme_src, keyboard_readme)
if 'usb' in kb_all[keyboard_name]: if 'usb' in kb_all[keyboard_name]:
usb = kb_all[keyboard_name]['usb'] usb = kb_all[keyboard_name]['usb']
@@ -57,20 +62,26 @@ def generate_api(cli):
if 'vid' in usb and 'pid' in usb: if 'vid' in usb and 'pid' in usb:
usb_list[usb['vid']][usb['pid']][keyboard_name] = usb usb_list[usb['vid']][usb['pid']][keyboard_name] = usb
# Write the global JSON files # Generate data for the global files
keyboard_all_file.write_text(json.dumps({'last_updated': current_datetime(), 'keyboards': kb_all}, cls=InfoJSONEncoder))
usb_file.write_text(json.dumps({'last_updated': current_datetime(), 'usb': usb_list}, cls=InfoJSONEncoder))
keyboard_list = sorted(kb_all) keyboard_list = sorted(kb_all)
keyboard_list_file.write_text(json.dumps({'last_updated': current_datetime(), 'keyboards': keyboard_list}, cls=InfoJSONEncoder))
keyboard_aliases = json_load(Path('data/mappings/keyboard_aliases.json')) keyboard_aliases = json_load(Path('data/mappings/keyboard_aliases.json'))
keyboard_aliases_file.write_text(json.dumps({'last_updated': current_datetime(), 'keyboard_aliases': keyboard_aliases}, cls=InfoJSONEncoder))
keyboard_metadata = { keyboard_metadata = {
'last_updated': current_datetime(), 'last_updated': current_datetime(),
'keyboards': keyboard_list, 'keyboards': keyboard_list,
'keyboard_aliases': keyboard_aliases, 'keyboard_aliases': keyboard_aliases,
'usb': usb_list, 'usb': usb_list,
} }
keyboard_metadata_file.write_text(json.dumps(keyboard_metadata, cls=InfoJSONEncoder))
# Write the global JSON files
keyboard_all_json = json.dumps({'last_updated': current_datetime(), 'keyboards': kb_all}, cls=InfoJSONEncoder)
usb_json = json.dumps({'last_updated': current_datetime(), 'usb': usb_list}, cls=InfoJSONEncoder)
keyboard_list_json = json.dumps({'last_updated': current_datetime(), 'keyboards': keyboard_list}, cls=InfoJSONEncoder)
keyboard_aliases_json = json.dumps({'last_updated': current_datetime(), 'keyboard_aliases': keyboard_aliases}, cls=InfoJSONEncoder)
keyboard_metadata_json = json.dumps(keyboard_metadata, cls=InfoJSONEncoder)
if not cli.args.dry_run:
keyboard_all_file.write_text(keyboard_all_json)
usb_file.write_text(usb_json)
keyboard_list_file.write_text(keyboard_list_json)
keyboard_aliases_file.write_text(keyboard_aliases_json)
keyboard_metadata_file.write_text(keyboard_metadata_json)
+16 -4
View File
@@ -2,20 +2,20 @@
Compile an info.json for a particular keyboard and pretty-print it. Compile an info.json for a particular keyboard and pretty-print it.
""" """
import sys
import json import json
import platform
from milc import cli from milc import cli
from qmk.json_encoders import InfoJSONEncoder from qmk.json_encoders import InfoJSONEncoder
from qmk.constants import COL_LETTERS, ROW_LETTERS from qmk.constants import COL_LETTERS, ROW_LETTERS
from qmk.decorators import automagic_keyboard, automagic_keymap from qmk.decorators import automagic_keyboard, automagic_keymap
from qmk.keyboard import keyboard_completer, keyboard_folder, render_layouts, render_layout from qmk.keyboard import keyboard_completer, keyboard_folder, render_layouts, render_layout, rules_mk
from qmk.keymap import locate_keymap from qmk.keymap import locate_keymap
from qmk.info import info_json from qmk.info import info_json
from qmk.path import is_keyboard from qmk.path import is_keyboard
platform_id = platform.platform().lower() UNICODE_SUPPORT = sys.stdout.encoding.lower().startswith('utf')
def show_keymap(kb_info_json, title_caps=True): def show_keymap(kb_info_json, title_caps=True):
@@ -124,12 +124,20 @@ def print_text_output(kb_info_json):
show_keymap(kb_info_json, False) show_keymap(kb_info_json, False)
def print_parsed_rules_mk(keyboard_name):
rules = rules_mk(keyboard_name)
for k in sorted(rules.keys()):
print('%s = %s' % (k, rules[k]))
return
@cli.argument('-kb', '--keyboard', type=keyboard_folder, completer=keyboard_completer, help='Keyboard to show info for.') @cli.argument('-kb', '--keyboard', type=keyboard_folder, completer=keyboard_completer, help='Keyboard to show info for.')
@cli.argument('-km', '--keymap', help='Show the layers for a JSON keymap too.') @cli.argument('-km', '--keymap', help='Show the layers for a JSON keymap too.')
@cli.argument('-l', '--layouts', action='store_true', help='Render the layouts.') @cli.argument('-l', '--layouts', action='store_true', help='Render the layouts.')
@cli.argument('-m', '--matrix', action='store_true', help='Render the layouts with matrix information.') @cli.argument('-m', '--matrix', action='store_true', help='Render the layouts with matrix information.')
@cli.argument('-f', '--format', default='friendly', arg_only=True, help='Format to display the data in (friendly, text, json) (Default: friendly).') @cli.argument('-f', '--format', default='friendly', arg_only=True, help='Format to display the data in (friendly, text, json) (Default: friendly).')
@cli.argument('--ascii', action='store_true', default='windows' in platform_id, help='Render layout box drawings in ASCII only.') @cli.argument('--ascii', action='store_true', default=not UNICODE_SUPPORT, help='Render layout box drawings in ASCII only.')
@cli.argument('-r', '--rules-mk', action='store_true', help='Render the parsed values of the keyboard\'s rules.mk file.')
@cli.subcommand('Keyboard information.') @cli.subcommand('Keyboard information.')
@automagic_keyboard @automagic_keyboard
@automagic_keymap @automagic_keymap
@@ -146,6 +154,10 @@ def info(cli):
cli.log.error('Invalid keyboard: "%s"', cli.config.info.keyboard) cli.log.error('Invalid keyboard: "%s"', cli.config.info.keyboard)
return False return False
if bool(cli.args.rules_mk):
print_parsed_rules_mk(cli.config.info.keyboard)
return False
# Build the info.json file # Build the info.json file
kb_info_json = info_json(cli.config.info.keyboard) kb_info_json = info_json(cli.config.info.keyboard)
+78
View File
@@ -0,0 +1,78 @@
"""Compile all keyboards.
This will compile everything in parallel, for testing purposes.
"""
import re
from pathlib import Path
from milc import cli
from qmk.constants import QMK_FIRMWARE
from qmk.commands import _find_make
import qmk.keyboard
def _make_rules_mk_filter(key, value):
def _rules_mk_filter(keyboard_name):
rules_mk = qmk.keyboard.rules_mk(keyboard_name)
return True if key in rules_mk and rules_mk[key].lower() == str(value).lower() else False
return _rules_mk_filter
def _is_split(keyboard_name):
rules_mk = qmk.keyboard.rules_mk(keyboard_name)
return True if 'SPLIT_KEYBOARD' in rules_mk and rules_mk['SPLIT_KEYBOARD'].lower() == 'yes' else False
@cli.argument('-j', '--parallel', type=int, default=1, help="Set the number of parallel make jobs to run.")
@cli.argument('-c', '--clean', arg_only=True, action='store_true', help="Remove object files before compiling.")
@cli.argument('-f', '--filter', arg_only=True, action='append', default=[], help="Filter the list of keyboards based on the supplied value in rules.mk. Supported format is 'SPLIT_KEYBOARD=yes'. May be passed multiple times.")
@cli.subcommand('Compile QMK Firmware for all keyboards.', hidden=False if cli.config.user.developer else True)
def multibuild(cli):
"""Compile QMK Firmware against all keyboards.
"""
make_cmd = _find_make()
if cli.args.clean:
cli.run([make_cmd, 'clean'], capture_output=False, text=False)
builddir = Path(QMK_FIRMWARE) / '.build'
makefile = builddir / 'parallel_kb_builds.mk'
keyboard_list = qmk.keyboard.list_keyboards()
filter_re = re.compile(r'^(?P<key>[A-Z0-9_]+)\s*=\s*(?P<value>[^#]+)$')
for filter_txt in cli.args.filter:
f = filter_re.match(filter_txt)
if f is not None:
keyboard_list = filter(_make_rules_mk_filter(f.group('key'), f.group('value')), keyboard_list)
keyboard_list = list(sorted(keyboard_list))
if len(keyboard_list) == 0:
return
builddir.mkdir(parents=True, exist_ok=True)
with open(makefile, "w") as f:
for keyboard_name in keyboard_list:
keyboard_safe = keyboard_name.replace('/', '_')
# yapf: disable
f.write(
f"""\
all: {keyboard_safe}_binary
{keyboard_safe}_binary:
@rm -f "{QMK_FIRMWARE}/.build/failed.log.{keyboard_safe}" || true
+@$(MAKE) -C "{QMK_FIRMWARE}" -f "{QMK_FIRMWARE}/build_keyboard.mk" KEYBOARD="{keyboard_name}" KEYMAP="default" REQUIRE_PLATFORM_KEY= COLOR=true SILENT=false \\
>>"{QMK_FIRMWARE}/.build/build.log.{keyboard_safe}" 2>&1 \\
|| cp "{QMK_FIRMWARE}/.build/build.log.{keyboard_safe}" "{QMK_FIRMWARE}/.build/failed.log.{keyboard_safe}"
@{{ grep '\[ERRORS\]' "{QMK_FIRMWARE}/.build/build.log.{keyboard_safe}" >/dev/null 2>&1 && printf "Build %-64s \e[1;31m[ERRORS]\e[0m\\n" "{keyboard_name}:default" ; }} \\
|| {{ grep '\[WARNINGS\]' "{QMK_FIRMWARE}/.build/build.log.{keyboard_safe}" >/dev/null 2>&1 && printf "Build %-64s \e[1;33m[WARNINGS]\e[0m\\n" "{keyboard_name}:default" ; }} \\
|| printf "Build %-64s \e[1;32m[OK]\e[0m\\n" "{keyboard_name}:default"
@rm -f "{QMK_FIRMWARE}/.build/build.log.{keyboard_safe}" || true
"""# noqa
)
# yapf: enable
cli.run([make_cmd, '-j', str(cli.args.parallel), '-f', makefile, 'all'], capture_output=False, text=False)
+12 -3
View File
@@ -5,13 +5,22 @@ from milc import cli
import subprocess import subprocess
@cli.argument('-n', '--dry-run', arg_only=True, action='store_true', help="Flag only, don't automatically format.")
@cli.subcommand("Format python code according to QMK's style.", hidden=False if cli.config.user.developer else True) @cli.subcommand("Format python code according to QMK's style.", hidden=False if cli.config.user.developer else True)
def pyformat(cli): def pyformat(cli):
"""Format python code according to QMK's style. """Format python code according to QMK's style.
""" """
edit = '--diff' if cli.args.dry_run else '--in-place'
yapf_cmd = ['yapf', '-vv', '--recursive', edit, 'bin/qmk', 'lib/python']
try: try:
subprocess.run(['yapf', '-vv', '-ri', 'bin/qmk', 'lib/python'], check=True) cli.run(yapf_cmd, check=True, capture_output=False)
cli.log.info('Successfully formatted the python code in `bin/qmk` and `lib/python`.') cli.log.info('Python code in `bin/qmk` and `lib/python` is correctly formatted.')
return True
except subprocess.CalledProcessError: except subprocess.CalledProcessError:
cli.log.error('Error formatting python code!') if cli.args.dry_run:
cli.log.error('Python code in `bin/qmk` and `lib/python` incorrectly formatted!')
else:
cli.log.error('Error formatting python code!')
return False
+2 -1
View File
@@ -11,6 +11,7 @@ from milc import cli
def pytest(cli): def pytest(cli):
"""Run several linting/testing commands. """Run several linting/testing commands.
""" """
flake8 = subprocess.run(['flake8', 'lib/python', 'bin/qmk'])
nose2 = subprocess.run(['nose2', '-v']) nose2 = subprocess.run(['nose2', '-v'])
flake8 = subprocess.run(['flake8', 'lib/python', 'bin/qmk'])
return flake8.returncode | nose2.returncode return flake8.returncode | nose2.returncode
+29 -7
View File
@@ -29,6 +29,33 @@ def _find_make():
return make_cmd return make_cmd
def create_make_target(target, parallel=1, **env_vars):
"""Create a make command
Args:
target
Usually a make rule, such as 'clean' or 'all'.
parallel
The number of make jobs to run in parallel
**env_vars
Environment variables to be passed to make.
Returns:
A command that can be run to make the specified keyboard and keymap
"""
env = []
make_cmd = _find_make()
for key, value in env_vars.items():
env.append(f'{key}={value}')
return [make_cmd, '-j', str(parallel), *env, target]
def create_make_command(keyboard, keymap, target=None, parallel=1, **env_vars): def create_make_command(keyboard, keymap, target=None, parallel=1, **env_vars):
"""Create a make compile command """Create a make compile command
@@ -53,17 +80,12 @@ def create_make_command(keyboard, keymap, target=None, parallel=1, **env_vars):
A command that can be run to make the specified keyboard and keymap A command that can be run to make the specified keyboard and keymap
""" """
env = []
make_args = [keyboard, keymap] make_args = [keyboard, keymap]
make_cmd = _find_make()
if target: if target:
make_args.append(target) make_args.append(target)
for key, value in env_vars.items(): return create_make_target(':'.join(make_args), parallel, **env_vars)
env.append(f'{key}={value}')
return [make_cmd, '-j', str(parallel), *env, ':'.join(make_args)]
def get_git_version(repo_dir='.', check_dir='.'): def get_git_version(repo_dir='.', check_dir='.'):
@@ -216,6 +238,6 @@ def run(command, *args, **kwargs):
safecmd = map(str, command) safecmd = map(str, command)
safecmd = map(shlex.quote, safecmd) safecmd = map(shlex.quote, safecmd)
safecmd = ' '.join(safecmd) safecmd = ' '.join(safecmd)
command = [os.environ['SHELL'], '-c', safecmd] command = [os.environ.get('SHELL', '/usr/bin/bash'), '-c', safecmd]
return subprocess.run(command, *args, **kwargs) return subprocess.run(command, *args, **kwargs)
+13
View File
@@ -19,6 +19,12 @@ true_values = ['1', 'on', 'yes']
false_values = ['0', 'off', 'no'] false_values = ['0', 'off', 'no']
def _valid_community_layout(layout):
"""Validate that a declared community list exists
"""
return (Path('layouts/default') / layout).exists()
def info_json(keyboard): def info_json(keyboard):
"""Generate the info.json data for a specific keyboard. """Generate the info.json data for a specific keyboard.
""" """
@@ -71,6 +77,13 @@ def info_json(keyboard):
if not info_data.get('layouts'): if not info_data.get('layouts'):
_log_error(info_data, 'No LAYOUTs defined! Need at least one layout defined in the keyboard.h or info.json.') _log_error(info_data, 'No LAYOUTs defined! Need at least one layout defined in the keyboard.h or info.json.')
# Filter out any non-existing community layouts
for layout in info_data.get('community_layouts', []):
if not _valid_community_layout(layout):
# Ignore layout from future checks
info_data['community_layouts'].remove(layout)
_log_error(info_data, 'Claims to support a community layout that does not exist: %s' % (layout))
# Make sure we supply layout macros for the community layouts we claim to support # Make sure we supply layout macros for the community layouts we claim to support
for layout in info_data.get('community_layouts', []): for layout in info_data.get('community_layouts', []):
layout_name = 'LAYOUT_' + layout layout_name = 'LAYOUT_' + layout
+13 -3
View File
@@ -33,10 +33,15 @@ def check_returncode(result, expected=[0]):
def test_cformat(): def test_cformat():
result = check_subcommand('cformat', 'quantum/matrix.c') result = check_subcommand('cformat', '-n', 'quantum/matrix.c')
check_returncode(result) check_returncode(result)
def test_cformat_all():
result = check_subcommand('cformat', '-n', '-a')
check_returncode(result, [0, 1])
def test_compile(): def test_compile():
result = check_subcommand('compile', '-kb', 'handwired/pytest/basic', '-km', 'default', '-n') result = check_subcommand('compile', '-kb', 'handwired/pytest/basic', '-km', 'default', '-n')
check_returncode(result) check_returncode(result)
@@ -83,9 +88,9 @@ def test_hello():
def test_pyformat(): def test_pyformat():
result = check_subcommand('pyformat') result = check_subcommand('pyformat', '--dry-run')
check_returncode(result) check_returncode(result)
assert 'Successfully formatted the python code' in result.stdout assert 'Python code in `bin/qmk` and `lib/python` is correctly formatted.' in result.stdout
def test_list_keyboards(): def test_list_keyboards():
@@ -225,6 +230,11 @@ def test_clean():
assert result.stdout.count('done') == 2 assert result.stdout.count('done') == 2
def test_generate_api():
result = check_subcommand('generate-api', '--dry-run')
check_returncode(result)
def test_generate_rgb_breathe_table(): def test_generate_rgb_breathe_table():
result = check_subcommand("generate-rgb-breathe-table", "-c", "1.2", "-m", "127") result = check_subcommand("generate-rgb-breathe-table", "-c", "1.2", "-m", "127")
check_returncode(result) check_returncode(result)
+4 -2
View File
@@ -35,9 +35,11 @@
// Explicitly override it if the keyboard uses a microcontroller with // Explicitly override it if the keyboard uses a microcontroller with
// more EEPROM *and* it makes sense to increase it. // more EEPROM *and* it makes sense to increase it.
#ifndef DYNAMIC_KEYMAP_EEPROM_MAX_ADDR #ifndef DYNAMIC_KEYMAP_EEPROM_MAX_ADDR
# if defined(__AVR_AT90USB646__) || defined(__AVR_AT90USB647__) || defined(__AVR_AT90USB1286__) || defined(__AVR_AT90USB1287__) # if defined(__AVR_AT90USB646__) || defined(__AVR_AT90USB647__)
# define DYNAMIC_KEYMAP_EEPROM_MAX_ADDR 2047 # define DYNAMIC_KEYMAP_EEPROM_MAX_ADDR 2047
# elif defined(__AVR_AT90USB162__) # elif defined(__AVR_AT90USB1286__) || defined(__AVR_AT90USB1287__)
# define DYNAMIC_KEYMAP_EEPROM_MAX_ADDR 4095
# elif defined(__AVR_ATmega16U2__) || defined(__AVR_ATmega16U4__) || defined(__AVR_AT90USB162__) || defined(__AVR_ATtiny85__)
# define DYNAMIC_KEYMAP_EEPROM_MAX_ADDR 511 # define DYNAMIC_KEYMAP_EEPROM_MAX_ADDR 511
# else # else
# define DYNAMIC_KEYMAP_EEPROM_MAX_ADDR 1023 # define DYNAMIC_KEYMAP_EEPROM_MAX_ADDR 1023
+65 -4
View File
@@ -1,8 +1,69 @@
/* Copyright 2021 SethBarberee <[email protected]>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#pragma once
#ifdef RGBLIGHT_ENABLE #ifdef RGBLIGHT_ENABLE
# define RGBLIGHT_SLEEP
# ifndef RGBLIGHT_HUE_STEP
# define RGBLIGHT_HUE_STEP 8
#endif
# ifndef RGBLIGHT_SAT_STEPT
# define RGBLIGHT_SAT_STEP 8
#endif
# ifndef RGBLIGHT_VAL_STEP
# define RGBLIGHT_VAL_STEP 8
#endif
// Trim animations I don't use/like
# ifdef RGBLIGHT_ANIMATIONS
# undef RGBLIGHT_ANIMATIONS
# endif
# define RGBLIGHT_EFFECT_BREATHING
# define RGBLIGHT_EFFECT_STATIC_GRADIENT
# define RGBLIGHT_EFFECT_TWINKLE
# ifndef CAPS_LOCK_MODE # ifndef CAPS_LOCK_MODE
# define CAPS_LOCK_MODE 1 # define CAPS_LOCK_MODE RGBLIGHT_MODE_STATIC_LIGHT
# endif
# ifndef NORMAL_MODE
# define NORMAL_MODE 4
# endif # endif
#endif // RGBLIGHT_ENABLE
#ifndef AUDIO_ENABLE
# define NO_MUSIC_MODE
#endif // AUDIO_ENABLE
#define FORCE_NKRO // Force NKRO on by default
// Totally taken from @drashna's userspace
#ifdef TAPPING_TERM
# undef TAPPING_TERM
#endif // TAPPING_TERM
//
// Keeping these commented for examples when I want to tweak per keyboard
// but setting a default across my boards for now
//
//#if defined(KEYBOARD_ergodox_ez)
//# define TAPPING_TERM 185
#if defined(KEYBOARD_crkbd)
# define TAPPING_TERM 185
#else
# define TAPPING_TERM 200
#endif
/* Disable unused and unneeded features to reduce on firmware size */
#ifdef LOCKING_SUPPORT_ENABLE
# undef LOCKING_SUPPORT_ENABLE
#endif
#ifdef LOCKING_RESYNC_ENABLE
# undef LOCKING_RESYNC_ENABLE
#endif #endif
+52
View File
@@ -0,0 +1,52 @@
/* Copyright 2021 SethBarberee <[email protected]>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include "rgb_light.h"
#if defined(RGBLIGHT_ENABLE)
layer_state_t layer_state_set_rgb_light(layer_state_t state){
switch(get_highest_layer(state)) {
case _QWERTY:
rgblight_set_hsv_and_mode(HSV_RED, RGBLIGHT_MODE_BREATHING + 3);
break;
case _LOWER:
rgblight_set_hsv_and_mode(HSV_GREEN, RGBLIGHT_MODE_BREATHING + 3);
break;
case _RAISE:
rgblight_set_hsv_and_mode(HSV_BLUE, RGBLIGHT_MODE_BREATHING + 3);
break;
case _ADJUST:
rgblight_set_hsv_and_mode(HSV_GOLDENROD, RGBLIGHT_MODE_BREATHING + 3);
break;
default:
rgblight_set_hsv_and_mode(HSV_PINK, RGBLIGHT_MODE_TWINKLE + 3);
break;
}
return state;
}
void rgblight_set_hsv_and_mode(uint8_t hue, uint8_t sat, uint8_t val, uint8_t mode) {
rgblight_sethsv_noeeprom(hue, sat, val);
// wait_us(175); // Add a slight delay between color and mode to ensure it's processed correctly
rgblight_mode_noeeprom(mode);
}
void keyboard_post_init_rgb_light(void)
{
layer_state_set_rgb_light(layer_state);
}
#endif
+21
View File
@@ -0,0 +1,21 @@
/* Copyright 2021 SethBarberee <[email protected]>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#pragma once
#include "sethBarberee.h"
layer_state_t layer_state_set_rgb_light(layer_state_t state);
void keyboard_post_init_rgb_light(void);
void rgblight_set_hsv_and_mode(uint8_t hue, uint8_t sat, uint8_t val, uint8_t mode);
+9
View File
@@ -1 +1,10 @@
SRC += sethBarberee.c SRC += sethBarberee.c
# Add in custom tap dances when tap dance is enabled
ifeq ($(strip $(TAP_DANCE_ENABLE)), yes)
SRC += tap_dance.c
endif
ifeq ($(strip $(RGBLIGHT_ENABLE)), yes)
SRC += rgb_light.c
endif
+79 -39
View File
@@ -1,45 +1,85 @@
/* Copyright 2021 SethBarberee <[email protected]>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include "sethBarberee.h" #include "sethBarberee.h"
#ifdef RGBLIGHT_ENABLE #include "version.h"
#ifdef TAP_DANCE_ENABLE
// Initialize it now __attribute__ ((weak)) void keyboard_pre_init_keymap(void) {}
tap caps_status = {
.toggled = false,
.toggle_mode = CAPS_LOCK_MODE,
.normal_mode = NORMAL_MODE
};
void dance_ecap_finished (qk_tap_dance_state_t *state, void *user_data){ void keyboard_pre_init_user(void){
if(state->count == 1){ #if defined(BOOTLOADER_CATERINA)
register_code(KC_ESC); // Make sure the red LEDs don't light
} else { setPinOutput(D5);
register_code(KC_CAPS); writePinHigh(D5);
if(!caps_status.toggled){
// Toggling caps so indicate setPinOutput(B0);
caps_status.toggled = true; writePinHigh(B0);
rgblight_mode_noeeprom(caps_status.toggle_mode); #endif
} else { keyboard_pre_init_keymap();
// Turning off so return to normal mode }
caps_status.toggled = false;
rgblight_mode_noeeprom(caps_status.normal_mode); __attribute__ ((weak)) layer_state_t layer_state_set_keymap (layer_state_t state) { return state; }
layer_state_t layer_state_set_user(layer_state_t state){
if (!is_keyboard_master()) {
return state;
}
state = update_tri_layer_state(state, _RAISE, _LOWER, _ADJUST);
#if defined(RGBLIGHT_ENABLE)
state = layer_state_set_rgb_light(state);
#endif
return layer_state_set_keymap(state);
}
__attribute__ ((weak)) void keyboard_post_init_keymap(void) {}
void keyboard_post_init_user(void)
{
#if defined(RGBLIGHT_ENABLE)
keyboard_post_init_rgb_light();
#endif
keyboard_post_init_keymap();
}
__attribute__((weak)) void suspend_power_down_keymap(void) {}
void suspend_power_down_user(void) {
#ifdef OLED_DRIVER_ENABLE
oled_off();
#endif
suspend_power_down_keymap();
}
__attribute__((weak)) void suspend_wakeup_init_keymap(void) {}
void suspend_wakeup_init_user(void) { suspend_wakeup_init_keymap(); }
__attribute__ ((weak)) bool process_record_keymap(uint16_t keycode, keyrecord_t *record) { return true;}
bool process_record_user(uint16_t keycode, keyrecord_t *record) {
if (process_record_keymap(keycode, record))
{
switch (keycode) {
case KC_VRSN: // Prints firmware version
if (record->event.pressed) {
SEND_STRING(QMK_KEYBOARD "/" QMK_KEYMAP " @ " QMK_VERSION ", Built on: " QMK_BUILDDATE);
}
break;
} }
} }
return true;
} }
void dance_ecap_reset (qk_tap_dance_state_t *state, void *user_data){
if(state->count == 1){
unregister_code(KC_ESC);
} else {
unregister_code(KC_CAPS);
}
}
//Tap Dance Definitions
qk_tap_dance_action_t tap_dance_actions[] = {
//Tap once for Esc, twice for Caps Lock
[TD_ECAP] = ACTION_TAP_DANCE_FN_ADVANCED(NULL, dance_ecap_finished, dance_ecap_reset),
// Other declarations would go here, separated by commas, if you have them
};
#endif
#endif
+43 -13
View File
@@ -1,20 +1,50 @@
#ifndef USERSPACE /* Copyright 2021 SethBarberee <[email protected]>
#define USERSPACE *
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#pragma once
#include "quantum.h" #include QMK_KEYBOARD_H
#ifdef TAP_DANCE_ENABLE // only enable for tap dances #include "wrappers.h"
enum {
TD_ECAP = 0,
};
#define KC_ECAP TD(TD_ECAP) enum layers {
_QWERTY,
_LOWER,
_RAISE,
_ADJUST
};
typedef struct { enum userspace_keycodes {
bool toggled; // store whether we have toggled caps lock KC_VRSN = SAFE_RANGE,
int toggle_mode; // idk why but maybe do something with this.. NEW_SAFE_RANGE
int normal_mode; };
} tap;
#define KC_LOWR MO(_LOWER)
#define KC_RASE MO(_RAISE)
#ifdef TAP_DANCE_ENABLE
# include "tap_dance.h"
#endif #endif
#ifdef RGBLIGHT_ENABLE
# include "rgb_light.h"
#endif #endif
void keyboard_pre_init_keymap(void);
void keyboard_post_init_keymap(void);
void suspend_power_down_keymap(void);
void suspend_wakeup_init_keymap(void);
layer_state_t layer_state_set_keymap (layer_state_t state);
bool process_record_keymap(uint16_t keycode, keyrecord_t *record);
+89
View File
@@ -0,0 +1,89 @@
/* Copyright 2021 SethBarberee <[email protected]>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include "tap_dance.h"
// Shamelessly stolen from QMK Docs
int cur_dance (qk_tap_dance_state_t *state) {
if (state->count == 1) {
if (state->interrupted || !state->pressed) {
return SINGLE_TAP;
} else {
return SINGLE_HOLD;
}
}
else if (state->count == 2) {
if (state->interrupted) return DOUBLE_SINGLE_TAP;
else if (state->pressed) return DOUBLE_HOLD;
else return DOUBLE_TAP;
}
if (state->count == 3) {
if (state->interrupted || !state->pressed) return TRIPLE_TAP;
else return TRIPLE_HOLD;
}
else return 8;
}
// Initialize it now
tap caps_status = {
.toggled = false,
.state = 0
};
void dance_ecap_finished (qk_tap_dance_state_t *state, void *user_data){
caps_status.state = cur_dance(state);
switch(caps_status.state){
case SINGLE_TAP:
tap_code(KC_ESC);
break;
case SINGLE_HOLD:
register_code(KC_LCTRL);
break;
case DOUBLE_TAP:
tap_code(KC_CAPS);
if(!caps_status.toggled){
// Toggling caps so indicate
caps_status.toggled = true;
#ifdef RGBLIGHT_ENABLE
// Save mode we can from
caps_status.normal_mode = rgblight_get_mode();
rgblight_mode_noeeprom(CAPS_LOCK_MODE);
#endif
} else {
// Turning off so return to normal mode
caps_status.toggled = false;
#ifdef RGBLIGHT_ENABLE
rgblight_mode_noeeprom(caps_status.normal_mode);
#endif
}
break;
}
}
void dance_ecap_reset (qk_tap_dance_state_t *state, void *user_data){
if(caps_status.state == SINGLE_HOLD){
unregister_code(KC_LCTRL);
}
caps_status.state = 0;
}
//Tap Dance Definitions
qk_tap_dance_action_t tap_dance_actions[] = {
//Tap once for Esc, twice for Caps Lock
[TD_ECAP] = ACTION_TAP_DANCE_FN_ADVANCED(NULL, dance_ecap_finished, dance_ecap_reset),
// Other declarations would go here, separated by commas, if you have them
};
+43
View File
@@ -0,0 +1,43 @@
/* Copyright 2021 SethBarberee <[email protected]>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#pragma once
#include "sethBarberee.h"
//Define a type for as many tap dance states as you need
enum {
SINGLE_TAP = 1,
SINGLE_HOLD = 2,
DOUBLE_TAP = 3,
DOUBLE_HOLD = 4,
DOUBLE_SINGLE_TAP = 5, //send two single taps
TRIPLE_TAP = 6,
TRIPLE_HOLD = 7
};
enum {
TD_ECAP = 0,
};
#define KC_ECAP TD(TD_ECAP)
typedef struct {
bool toggled; // store whether we have toggled caps lock
#ifdef RGBLIGHT_ENABLE
int normal_mode;
#endif // RGBLIGHT_ENABLE
int state;
} tap;
+55
View File
@@ -0,0 +1,55 @@
/* Copyright 2021 SethBarberee <[email protected]>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#pragma once
#include "sethBarberee.h"
/*
Since our quirky block definitions are basically a list of comma separated
arguments, we need a wrapper in order for these definitions to be
expanded before being used as arguments to the LAYOUT_xxx macro.
*/
/*
Blocks for each of the four major keyboard layouts
Organized so we can quickly adapt and modify all of them
at once, rather than for each keyboard, one at a time.
And this allows for much cleaner blocks in the keymaps.
For instance Tap/Hold for Control on all of the layouts
NOTE: These are all the same length. If you do a search/replace
then you need to add/remove underscores to keep the
lengths consistent.
*/
// clang-format off
#define _________________QWERTY_L1_________________ KC_Q, KC_W, KC_E, KC_R, KC_T
#define _________________QWERTY_L2_________________ KC_A, KC_S, KC_D, KC_F, KC_G
#define _________________QWERTY_L3_________________ KC_Z, KC_X, KC_C, KC_V, KC_B
#define _________________QWERTY_R1_________________ KC_Y, KC_U, KC_I, KC_O, KC_P
#define _________________QWERTY_R2_________________ KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT
#define _________________QWERTY_R3_________________ KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH
#define ________________NUMBER_LEFT________________ KC_1, KC_2, KC_3, KC_4, KC_5
#define ________________NUMBER_RIGHT_______________ KC_6, KC_7, KC_8, KC_9, KC_0
#define _________________FUNC_LEFT_________________ KC_F1, KC_F2, KC_F3, KC_F4, KC_F5
#define _________________FUNC_RIGHT________________ KC_F6, KC_F7, KC_F8, KC_F9, KC_F10
#define ___________________BLANK___________________ _______, _______, _______, _______, _______
// clang-format on