Docker-ized compilation and esc/ctl mod-tap

This commit is contained in:
Daniel Flanagan 2018-10-05 10:41:59 -05:00
parent e1c0d1781c
commit b431504350
5 changed files with 59 additions and 68 deletions

4
Dockerfile Normal file
View file

@ -0,0 +1,4 @@
FROM edasque/qmk_firmware
RUN apt-get update
RUN apt-get install gcc-arm*

View file

@ -1,37 +1,33 @@
# Check that given variables are set and all have non-empty values, QMK_REPO_DIR ?= ${HOME}/.local/share/qmk_firmware
# die with an error otherwise. KB_DIR ?= ${QMK_REPO_DIR}/keyboards/ergodox_infinity/keymaps/lytedev
#
# 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) default: flash-left-then-right
KEYMAP_NAME = "lytedev" ${QMK_REPO_DIR}:
ERGODOX_DIR = "${QMK_DIR}/keyboards/ergodox" @git clone https://github.com/lytedev/qmk_firmware.git "${QMK_REPO_DIR}"
MY_KEYMAP_DIR = "${ERGODOX_DIR}/keymaps/${KEYMAP_NAME}" @cd "${QMK_REPO_DIR}" && make git-submodule
MAKE_DIR = "${ERGODOX_DIR}"
left: prep repo_keymap_files:
@make -C "${MAKE_DIR}" infinity-"${KEYMAP_NAME}" @rm -rf "${KB_DIR}"
@mkdir -p "${KB_DIR}"
@cp keymap.c "${KB_DIR}/"
right: prep flash-left: ${QMK_REPO_DIR} repo_keymap_files
@make -C "${MAKE_DIR}" infinity-"${KEYMAP_NAME}" MASTER=right @cd "${QMK_REPO_DIR}" && sudo make ergodox_infinity:lytedev:dfu-util
dfu-left: flash-right: ${QMK_REPO_DIR} repo_keymap_files
@make -C "${MAKE_DIR}" infinity-"${KEYMAP_NAME}"-dfu-util @cd "${QMK_REPO_DIR}" && sudo make ergodox_infinity:lytedev:dfu-util MASTER=right
dfu-right: build-and-flash-left: ${QMK_REPO_DIR} repo_keymap_files
@make -C "${MAKE_DIR}" infinity-"${KEYMAP_NAME}"-dfu-util MASTER=right @cd "${QMK_REPO_DIR}" && sudo make ergodox_infinity:lytedev
prep: build-and-flash-right: ${QMK_REPO_DIR} repo_keymap_files
@rm -rf "${MY_KEYMAP_DIR}" @cd "${QMK_REPO_DIR}" && sudo make ergodox_infinity:lytedev MASTER=right
@mkdir -p "${MY_KEYMAP_DIR}"
@cp keymap.c "${MY_KEYMAP_DIR}/keymap.c"
flash-left-then-right: flash-left flash-right
build-left: ${QMK_REPO_DIR} repo_keymap_files
@docker run -e keymap=lytedev -e keyboard=ergodox_infinity --rm -v "${QMK_REPO_DIR}":/qmk:rw edasque/qmk_firmware
build-right: ${QMK_REPO_DIR} repo_keymap_files
@docker run -e keymap=lytedev -e MASTER=right -e keyboard=ergodox_infinity --rm -v "${QMK_REPO_DIR}":/qmk:rw edasque/qmk_firmware

View file

@ -1,4 +1,4 @@
#include "ergodox.h" #include QMK_KEYBOARD_H
#include "debug.h" #include "debug.h"
#include "action_layer.h" #include "action_layer.h"
#include "version.h" #include "version.h"
@ -8,6 +8,8 @@
#define SYM2 2 // symbols 2 #define SYM2 2 // symbols 2
#define MOUS 3 // mouse #define MOUS 3 // mouse
#define ESC_CTL LCTL_T(KC_ESC)
enum custom_keycodes { enum custom_keycodes {
PLACEHOLDER = SAFE_RANGE, // can always be here PLACEHOLDER = SAFE_RANGE, // can always be here
EPRM, EPRM,
@ -24,7 +26,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
* |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------|
* | 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 | ; | ' | * |Esc/Ctl | 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 |
* `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------'
@ -43,7 +45,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
// 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,
KC_ESC, KC_A, KC_S, KC_D, KC_F, KC_G, /* ^^ */ ESC_CTL, KC_A, KC_S, KC_D, KC_F, KC_G, /* ^^ */
KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_LPRN, KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_LPRN,
KC_LCTL, KC_LCTL, KC_LALT, KC_LGUI, MO(SYM2), KC_LCTL, KC_LCTL, KC_LALT, KC_LGUI, MO(SYM2),
@ -72,7 +74,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
* |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------|
* | ` | 1 | 2 | 3 | 4 | 5 | { | | } | 6 | 7 | 8 | 9 | 0 | Del | * | ` | 1 | 2 | 3 | 4 | 5 | { | | } | 6 | 7 | 8 | 9 | 0 | Del |
* |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------|
* | Escape | F1 | F2 | F3 | F4 | F5 |------| |------| F6 | - | = | [ | ] | \ | * |Esc/Ctl | F1 | F2 | F3 | F4 | F5 |------| |------| F6 | - | = | [ | ] | \ |
* |--------+------+------+------+------+------| < | | > |------+------+------+------+------+--------| * |--------+------+------+------+------+------| < | | > |------+------+------+------+------+--------|
* | LShift | F7 | F8 | F9 | F10 | F11 | | | | F12 | Ins | , | . | / | Enter | * | LShift | F7 | F8 | F9 | F10 | F11 | | | | F12 | Ins | , | . | / | Enter |
* `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------'
@ -91,7 +93,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
// 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,
KC_ESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, /* ^^ */ ESC_CTL, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, /* ^^ */
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,
@ -120,11 +122,11 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
* |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------|
* | ~ | ! | @ | # | $ | % | { | | } | ^ | & | * | ( | ) | Back | * | ~ | ! | @ | # | $ | % | { | | } | ^ | & | * | ( | ) | Back |
* |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------|
* | Escape | F1 | F2 | F3 | F4 | F5 |------| |------| F6 | _ | + | { | } | | | * |Esc/Ctl | 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 | PgDn | PgUp | Right | * | Ctrl | Ctrl | Alt | Meta | () | | () | Home | PgDn | PgUp | End |
* `----------------------------------' `------------------------------------' * `----------------------------------' `------------------------------------'
* ,-------------. ,-------------. * ,-------------. ,-------------.
* | Vol- | Menu | | Ins | Vol+ | * | Vol- | Menu | | Ins | Vol+ |
@ -139,7 +141,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
// 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,
KC_ESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, /* ^^ */ ESC_CTL, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, /* ^^ */
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,
@ -153,7 +155,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
KC_RCBR, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_DEL, KC_RCBR, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_DEL,
/* ^^ */ 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_PGDN, KC_PGUP, KC_RGHT, KC_TRNS, KC_HOME, KC_PGDN, KC_PGUP, KC_END,
// Thumb Cluster // Thumb Cluster
KC_INS, KC_VOLU, KC_INS, KC_VOLU,

View file

@ -1,42 +1,30 @@
# Infinity Ergodox # Ergodox Infinity
==================
This contains my `qmk_firmware`-compatible Infinity Ergodox keymap. This contains my `qmk_firmware`-compatible Infinity Ergodox keymap.
## Dependencies
===============
* Docker
* `arm-none-eabi-gcc` and `arm-none-eabi-newlib`
* See the `qmk_firmware` repo for details.
## Flashing ## Flashing
===========
* Clone and setup the repository at Run `make flash-left` to build the firmware and flash the left hand.
https://github.com/jackhumbert/qmk_firmware.git - pay special attention to the `s/left/right` for the right hand.
dependencies (for arch users, `pacman -S avr-libc avr-gcc` and `dfu-programmer`
in the AUR)
* Run the following command, setting `QMK_DIR` to the directory of the repo you **Note**: You may need to run the commands as root.
cloned in the last step:
export QMK_DIR="$HOME/qmk_firmware" **Tip**: If you don't have an extra keyboard to send the command, just prepend
make left `sleep 10 &&` to it to give yourself 10 seconds to hit the flash button.
* Put the **left** hand of the ErgoDox in flashing mode
* In the same terminal (so that `QMK_DIR` is set) run:
make dfu-left
* Repeat the previous commands replacing "`left`" with "`right`"
**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
the `QMK_DIR` environment variable you set previously.
**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
button.
That should be it! Your Ergodox keyboard should now be flashed with this layout.
That should be it! Your Ergodox Infinity keyboard should now be flashed with
this layout.
## Modifying ## Modifying
============
Just modify `keymap.c` and repeat the steps above for flashing! Easy. Just modify `keymap.c` and repeat the steps above for flashing! Easy.
[ergodox_configurator]: https://input.club/configurator-ergodox

View file

@ -7,11 +7,12 @@ This contains my `qmk_firmware`-compatible Planck keymap.
=============== ===============
* Docker * Docker
* See the `qmk_firmware` repo for details.
## Flashing ## Flashing
=========== ===========
`make dfu` Just run `make`.
Don't forget to press the flash button on your keyboard! Don't forget to press the flash button on your keyboard!