Clean up source, add editorconfig, improve makefile errors

This commit is contained in:
Daniel Flanagan 2017-05-10 11:46:19 -05:00
parent 0f69706a73
commit c37dd4d96f
4 changed files with 107 additions and 83 deletions

17
.editorconfig Normal file
View file

@ -0,0 +1,17 @@
root = true
[*]
end_of_line = lf
insert_final_newline = true
[*.{md,markdown}]
indent_style = tab
indent_size = 2
[Makefile]
indent_style = tab
indent_size = 2
[*.c]
indent_style = space
indent_size = 4

View file

@ -1,6 +1,17 @@
ifndef QMK_DIR # Check that given variables are set and all have non-empty values,
$(error QMK_DIR is not defined) # die with an error otherwise.
endif #
# Params:
# 1. Variable name(s) to test.
# 2. (optional) Error message to print.
check_defined = \
$(strip $(foreach 1,$1, \
$(call __check_defined,$1,$(strip $(value 2)))))
__check_defined = \
$(if $(value $1),, \
$(error Undefined $1$(if $2, ($2))))
$(call check_defined, QMK_DIR)
KEYMAP_NAME = "lytedev" KEYMAP_NAME = "lytedev"
ERGODOX_DIR = "${QMK_DIR}/keyboards/ergodox" ERGODOX_DIR = "${QMK_DIR}/keyboards/ergodox"

View file

@ -9,38 +9,37 @@
#define MOUS 3 // mouse #define MOUS 3 // mouse
enum custom_keycodes { enum custom_keycodes {
PLACEHOLDER = SAFE_RANGE, // can always be here PLACEHOLDER = SAFE_RANGE, // can always be here
EPRM, EPRM,
VRSN, VRSN,
RGB_SLD RGB_SLD
}; };
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
/* Layer 0: Basic /* Layer 0: Basic
* *
* ,--------------------------------------------------. ,--------------------------------------------------. * ,--------------------------------------------------. ,--------------------------------------------------.
* | ` | 1 | 2 | 3 | 4 | 5 | F11 | | F12 | 6 | 7 | 8 | 9 | 0 | Back | * | ` | 1 | 2 | 3 | 4 | 5 | F11 | | F12 | 6 | 7 | 8 | 9 | 0 | Back |
* |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------|
* | Tab | Q | W | E | R | T | [ | | ] | Y | U | I | O | P | Back | * | Tab | Q | W | E | R | T | [ | | ] | Y | U | I | O | P | Back |
* |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------|
* | Escape | A | S | D | F | G |------| |------| H | J | K | L | ; | ' | * | Escape | A | S | D | F | G |------| |------| H | J | K | L | ; | ' |
* |--------+------+------+------+------+------| ( | | ) |------+------+------+------+------+--------| * |--------+------+------+------+------+------| ( | | ) |------+------+------+------+------+--------|
* | LShift | Z | X | C | V | B | | | | N | M | , | . | / | Enter | * | LShift | Z | X | C | V | B | | | | N | M | , | . | / | Enter |
* `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------'
* | Ctrl | Ctrl | Alt | Meta | L2 | | L1 | Left | Down | Up | Right | * | Ctrl | Ctrl | Alt | Meta | L2 | | L1 | Left | Down | Up | Right |
* `----------------------------------' `------------------------------------' * `----------------------------------' `------------------------------------'
* ,-------------. ,-------------. * ,-------------. ,-------------.
* | Vol- | Menu | | Ins | Vol+ | * | Vol- | Menu | | Ins | Vol+ |
* ,------+------+------| |------+------+------. * ,------+------+------| |------+------+------.
* | | | Home | | End | | | * | | | Home | | End | | |
* | Spce | Back |------| |------| Enter| Spce | * | Spce | Back |------| |------| Enter| Spce |
* | | | NmLk | | Prnt | | | * | | | NmLk | | Prnt | | |
* `--------------------' `--------------------' * `--------------------' `--------------------'
*/ */
[BASE] = KEYMAP(
[BASE] = KEYMAP(
// Left Hand // Left Hand
KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_F11, KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_F11,
KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_LBRC, KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_LBRC,
@ -66,31 +65,29 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
KC_PSCR, KC_ENT, KC_SPC KC_PSCR, KC_ENT, KC_SPC
), ),
/* Layer 1: Symbols1
*
* ,--------------------------------------------------. ,--------------------------------------------------.
* | ~ | ! | @ | # | $ | % | F11 | | F12 | ^ | & | * | ( | ) | Back |
* |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------|
* | ` | 1 | 2 | 3 | 4 | 5 | { | | } | 6 | 7 | 8 | 9 | 0 | Back |
* |--------+------+------+------+------+------| | | |------+------+------+------+------+--------|
* | Escape | F1 | F2 | F3 | F4 | F5 |------| |------| F6 | - | = | [ | ] | \ |
* |--------+------+------+------+------+------| < | | > |------+------+------+------+------+--------|
* | LShift | F7 | F8 | F9 | F10 | F11 | | | | F12 | Ins | , | . | / | Enter |
* `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------'
* | Ctrl | Ctrl | Alt | Meta | () | | () | Left | Down | Up | Right |
* `----------------------------------' `------------------------------------'
* ,-------------. ,-------------.
* | Vol- | Menu | | Ins | Vol+ |
* ,------+------+------| |------+------+------.
* | | | Home | | End | | |
* | Spce | Back |------| |------| Enter| Spce |
* | | | FLSH | | FLSH | | |
* `--------------------' `--------------------'
*/
/* Layer 1: Symbols1 [SYM1] = KEYMAP(
*
* ,--------------------------------------------------. ,--------------------------------------------------.
* | ~ | ! | @ | # | $ | % | F11 | | F12 | ^ | & | * | ( | ) | Back |
* |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------|
* | ` | 1 | 2 | 3 | 4 | 5 | { | | } | 6 | 7 | 8 | 9 | 0 | Back |
* |--------+------+------+------+------+------| | | |------+------+------+------+------+--------|
* | Escape | F1 | F2 | F3 | F4 | F5 |------| |------| F6 | - | = | [ | ] | \ |
* |--------+------+------+------+------+------| < | | > |------+------+------+------+------+--------|
* | LShift | F7 | F8 | F9 | F10 | F11 | | | | F12 | Ins | , | . | / | Enter |
* `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------'
* | Ctrl | Ctrl | Alt | Meta | () | | () | Left | Down | Up | Right |
* `----------------------------------' `------------------------------------'
* ,-------------. ,-------------.
* | Vol- | Menu | | Ins | Vol+ |
* ,------+------+------| |------+------+------.
* | | | Home | | End | | |
* | Spce | Back |------| |------| Enter| Spce |
* | | | FLSH | | FLSH | | |
* `--------------------' `--------------------'
*/
[SYM1] = KEYMAP(
// Left Hand // Left Hand
KC_TILD, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_F11, KC_TILD, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_F11,
KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_LCBR, KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_LCBR,
@ -116,30 +113,29 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
RESET, KC_ENT, KC_SPC RESET, KC_ENT, KC_SPC
), ),
/* Layer 2: Symbols2 /* Layer 2: Symbols2
* *
* ,--------------------------------------------------. ,--------------------------------------------------. * ,--------------------------------------------------. ,--------------------------------------------------.
* | ` | F1 | F2 | F3 | F4 | F5 | F6 | | F7 | F8 | F9 | F10 | F11 | F12 | Back | * | ` | F1 | F2 | F3 | F4 | F5 | F6 | | F7 | F8 | F9 | F10 | F11 | F12 | Back |
* |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------|
* | ~ | ! | @ | # | $ | % | { | | } | ^ | & | * | ( | ) | Back | * | ~ | ! | @ | # | $ | % | { | | } | ^ | & | * | ( | ) | Back |
* |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------|
* | Escape | F1 | F2 | F3 | F4 | F5 |------| |------| F6 | _ | + | { | } | | | * | Escape | F1 | F2 | F3 | F4 | F5 |------| |------| F6 | _ | + | { | } | | |
* |--------+------+------+------+------+------| < | | > |------+------+------+------+------+--------| * |--------+------+------+------+------+------| < | | > |------+------+------+------+------+--------|
* | LShift | F7 | F8 | F9 | F10 | F11 | | | | F12 | Ins | < | > | / | Enter | * | LShift | F7 | F8 | F9 | F10 | F11 | | | | F12 | Ins | < | > | / | Enter |
* `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------'
* | Ctrl | Ctrl | Alt | Meta | () | | () | Left | Down | Up | Right | * | Ctrl | Ctrl | Alt | Meta | () | | () | Left | Down | Up | Right |
* `----------------------------------' `------------------------------------' * `----------------------------------' `------------------------------------'
* ,-------------. ,-------------. * ,-------------. ,-------------.
* | Vol- | Menu | | Ins | Vol+ | * | Vol- | Menu | | Ins | Vol+ |
* ,------+------+------| |------+------+------. * ,------+------+------| |------+------+------.
* | | | Home | | End | | | * | | | Home | | End | | |
* | Spce | Back |------| |------| Enter| Spce | * | Spce | Back |------| |------| Enter| Spce |
* | | | FLSH | | FLSH | | | * | | | FLSH | | FLSH | | |
* `--------------------' `--------------------' * `--------------------' `--------------------'
*/ */
[SYM2] = KEYMAP(
[SYM2] = KEYMAP(
// Left Hand // Left Hand
KC_GRV, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_GRV, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6,
KC_TILD, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_LCBR, KC_TILD, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_LCBR,
@ -147,17 +143,17 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
KC_LSFT, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_LABK, KC_LSFT, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_LABK,
KC_LCTL, KC_LCTL, KC_LALT, KC_LGUI, KC_TRNS, KC_LCTL, KC_LCTL, KC_LALT, KC_LGUI, KC_TRNS,
// Thumb Cluster // Thumb Cluster
KC_VOLD, KC_APP, KC_VOLD, KC_APP,
/* vv */ /* vv */ KC_HOME, /* vv */ /* vv */ KC_HOME,
KC_SPC, KC_BSPC, RESET, KC_SPC, KC_BSPC, RESET,
// Right Hand // Right Hand
KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_BSPC, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_BSPC,
KC_RCBR, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_BSPC, KC_RCBR, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_BSPC,
/* ^^ */ KC_F6, KC_UNDS, KC_PLUS, KC_LCBR, KC_RCBR, KC_BSLS, /* ^^ */ KC_F6, KC_UNDS, KC_PLUS, KC_LCBR, KC_RCBR, KC_BSLS,
KC_RABK, KC_F12, KC_INS, KC_LABK, KC_RABK, KC_QUES, KC_ENT, KC_RABK, KC_F12, KC_INS, KC_LABK, KC_RABK, KC_QUES, KC_ENT,
KC_TRNS, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT, KC_TRNS, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT,
// Thumb Cluster // Thumb Cluster
KC_INS, KC_VOLU, KC_INS, KC_VOLU,

View file

@ -25,7 +25,7 @@ This contains my `qmk_firmware`-compatible Infinity Ergodox keymap.
**Note**: You may need to run the `make dfu-left` and `make dfu-right` commands **Note**: You may need to run the `make dfu-left` and `make dfu-right` commands
as root. In this case, use `sudo -E make dfu-{left,right}` so that you preserve as root. In this case, use `sudo -E make dfu-{left,right}` so that you preserve
the `QMK_DIR` environment variable. the `QMK_DIR` environment variable you set previously.
**Tip**: If you don't have an extra keyboard to send the `make dfu` command, **Tip**: If you don't have an extra keyboard to send the `make dfu` command,
just prepend `sleep 10 &&` to it to give yourself 10 seconds to hit the flash just prepend `sleep 10 &&` to it to give yourself 10 seconds to hit the flash