Compare commits
No commits in common. "1c213ed8daf455fb261cf74cea8471c046756f01" and "6e84592338d6a9cd5b818f26f83308148437973c" have entirely different histories.
1c213ed8da
...
6e84592338
4
.gitignore
vendored
4
.gitignore
vendored
@ -1,3 +1,5 @@
|
|||||||
output
|
/venv
|
||||||
|
/build
|
||||||
|
qmk/qmk.conf
|
||||||
|
|
||||||
secrets.h
|
secrets.h
|
10
.gitmodules
vendored
10
.gitmodules
vendored
@ -0,0 +1,10 @@
|
|||||||
|
[submodule "qmk/qmk_fw"]
|
||||||
|
path = qmk/qmk_fw
|
||||||
|
url = ssh://git@git.betalupi.com:33/mirrors-QMK/qmk_firmware.git
|
||||||
|
[submodule "qmk/qmk_cli"]
|
||||||
|
path = qmk/qmk_cli
|
||||||
|
url = ssh://git@git.betalupi.com:33/mirrors-QMK/qmk_cli.git
|
||||||
|
[submodule "qmk_cli"]
|
||||||
|
url = ssh://git@git.betalupi.com:33/QMK/qmk_cli.git
|
||||||
|
[submodule "qmk_fw"]
|
||||||
|
url = ssh://git@git.betalupi.com:33/QMK/qmk_firmware.git
|
85
Makefile
Normal file
85
Makefile
Normal file
@ -0,0 +1,85 @@
|
|||||||
|
QMK_REPO := ssh://git@git.betalupi.com:33/Mark/qmk_betalupi.git
|
||||||
|
|
||||||
|
# QMK command
|
||||||
|
QMK_CONF := $(shell pwd)/qmk/qmk.conf
|
||||||
|
QMK := qmk --config-file $(QMK_CONF)
|
||||||
|
|
||||||
|
# Where to create venv
|
||||||
|
VENV := $(shell pwd)/venv
|
||||||
|
|
||||||
|
# Where to build firmware
|
||||||
|
BUILD_DIR := $(shell pwd)/build
|
||||||
|
|
||||||
|
# Path to submodules
|
||||||
|
QMK_CLI := $(shell pwd)/qmk/qmk_cli
|
||||||
|
QMK_DIR := $(shell pwd)/qmk/qmk_fw
|
||||||
|
|
||||||
|
|
||||||
|
.PHONY: git-submodule
|
||||||
|
git-submodule:
|
||||||
|
@git submodule sync --recursive
|
||||||
|
@git submodule update --init --recursive --progress
|
||||||
|
@echo ""
|
||||||
|
|
||||||
|
|
||||||
|
# Link keyboards into qmk_fw
|
||||||
|
KEYBOARDS := $(notdir $(shell find keyboards -maxdepth 1 -mindepth 1 -type d))
|
||||||
|
.PHONY: $(KEYBOARDS)
|
||||||
|
$(KEYBOARDS):
|
||||||
|
@echo "Linking keyboards into $(QMK_DIR)/keyboards..."
|
||||||
|
@ln -sT \
|
||||||
|
$(shell pwd)/keyboards/$@ \
|
||||||
|
$(QMK_DIR)/keyboards/$@
|
||||||
|
|
||||||
|
@echo ""
|
||||||
|
|
||||||
|
# Clone all repos and configure qmk
|
||||||
|
.PHONY: setup
|
||||||
|
setup: git-submodule $(KEYBOARDS)
|
||||||
|
@echo "Preparing venv..."
|
||||||
|
@python -m venv $(VENV) --prompt=qmk_venv
|
||||||
|
|
||||||
|
@echo "Building and installing qmk_cli"
|
||||||
|
@source $(VENV)/bin/activate && \
|
||||||
|
cd $(QMK_CLI) && \
|
||||||
|
python3 -m pip install build --quiet && \
|
||||||
|
python3 -m build > /dev/null && \
|
||||||
|
python3 -m pip install $$(find dist -name 'qmk-*.tar.gz') --quiet
|
||||||
|
|
||||||
|
@echo ""
|
||||||
|
@echo ""
|
||||||
|
|
||||||
|
@source $(VENV)/bin/activate && \
|
||||||
|
$(QMK) config user.qmk_home=$(QMK_DIR) && \
|
||||||
|
$(QMK) doctor
|
||||||
|
|
||||||
|
|
||||||
|
# Undo all changes done in setup
|
||||||
|
.PHONY: unsetup
|
||||||
|
unsetup:
|
||||||
|
-rm -drf $(VENV) $(BUILD_DIR)
|
||||||
|
-rm $(QMK_CONF)
|
||||||
|
-rm -dr $(QMK_CLI)/dist $(QMK_CLI)/qmk.egg-info
|
||||||
|
-rm $(KEYBOARDS:%=$(QMK_DIR)/keyboards/%)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
# Compile and flash a keyboard
|
||||||
|
.PHONY: flash
|
||||||
|
flash:
|
||||||
|
@source $(VENV)/bin/activate && \
|
||||||
|
$(QMK) flash \
|
||||||
|
-e AVR_CFLAGS="-Wno-array-bounds" \
|
||||||
|
-e BUILD_DIR=$(BUILD_DIR) \
|
||||||
|
-kb betalupi_ergodox \
|
||||||
|
-km default
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
# Compile and flash a keyboard
|
||||||
|
.PHONY: comp-db
|
||||||
|
comp-db:
|
||||||
|
@source $(VENV)/bin/activate && \
|
||||||
|
$(QMK) generate-compilation-database \
|
||||||
|
-kb betalupi_ergodox \
|
||||||
|
-km default
|
18
README.md
18
README.md
@ -13,8 +13,22 @@ This repository contains everything required to build qmk firmware.
|
|||||||
|
|
||||||
-------------------------------------------------
|
-------------------------------------------------
|
||||||
|
|
||||||
|
## Setup
|
||||||
|
|
||||||
## Building
|
To initialize the build environment, run `make setup`. This does a few things:
|
||||||
|
|
||||||
Run `./build.sh`. Uses docker, doesn't need a local install of qmk.
|
- Updates all submodules
|
||||||
|
- Symlinks all directories in `keyboards` into `qmk/qmk_fm/keyboards`
|
||||||
|
- Creates a python virtualenv in `venv`
|
||||||
|
- Builds and installs `qmk/qmk_cli` into that venv
|
||||||
|
- Creates a QMK config file in `qmk/qmk.conf`
|
||||||
|
- Runs `qmk doctor` to make sure everything worked.
|
||||||
|
|
||||||
|
Once `make setup` has been run, this directory (or its parents) CANNOT BE RENAMED OR MOVED!
|
||||||
|
If you want to move this directory, run `make unsetup`, then run `make setup` again. No data should be lost.
|
||||||
|
|
||||||
|
|
||||||
|
## Using QMK
|
||||||
|
|
||||||
|
Run `make flash` to build and flash firmware. If you want to execute qmk manually, activate the virtualenv and use `./qmk.sh`.
|
||||||
|
|
||||||
|
13
build.sh
13
build.sh
@ -1,13 +0,0 @@
|
|||||||
#!/bin/bash
|
|
||||||
|
|
||||||
# Uses the qmk container found here:
|
|
||||||
# https://git.betalupi.com/Mark/docker
|
|
||||||
#
|
|
||||||
# Be careful, it may not be using the latest QMK.
|
|
||||||
|
|
||||||
docker run -it \
|
|
||||||
--user $(id -u):$(id -g) \
|
|
||||||
-v "$(pwd)/output:/build_output" \
|
|
||||||
-v "$(pwd)/keyboards:/qmk_firmware/keyboards:ro" \
|
|
||||||
-e QMK_TARGET="betalupi_ergodox:default" \
|
|
||||||
git.betalupi.com/mark/qmk
|
|
@ -10,17 +10,15 @@
|
|||||||
// Values that should not be saved to git.
|
// Values that should not be saved to git.
|
||||||
// Create a `secrets.h` in the keymap directory.
|
// Create a `secrets.h` in the keymap directory.
|
||||||
//
|
//
|
||||||
// It should contain the following:
|
// It should define the following:
|
||||||
// #define SECRET_EMAIL "val"
|
// SECRET_EMAIL
|
||||||
// #define SECRET_GMAIL "val"
|
|
||||||
// #define SECRET_SCHOOL_EMAIL "val"
|
|
||||||
#include "secrets.h"
|
#include "secrets.h"
|
||||||
|
|
||||||
|
|
||||||
// Send a special character.
|
// Send a special character.
|
||||||
// Returns false if character was caught, true otherwise.
|
// Returns false if character was caught, true otherwise.
|
||||||
bool send_special_character(uint16_t keycode) {
|
bool send_special_character(uint16_t keycode) {
|
||||||
if ( (keycode > M_SPECIAL_TOP) && (keycode < M_SPECIAL_BOTTOM) ) {
|
if ( (keycode > M_SPECIAL_TOP) && (keycode < M_SPECIAL_BOTTОM) ) {
|
||||||
hid_send_special_char(keycode - M_SPECIAL_TOP - 1);
|
hid_send_special_char(keycode - M_SPECIAL_TOP - 1);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
@ -55,5 +55,5 @@ enum custom_keycodes {
|
|||||||
M_SC_BYUS,
|
M_SC_BYUS,
|
||||||
M_SC_YAE,
|
M_SC_YAE,
|
||||||
M_SC_SHRUG,
|
M_SC_SHRUG,
|
||||||
M_SPECIAL_BOTTOM
|
M_SPECIAL_BOTTОM
|
||||||
};
|
};
|
||||||
|
1
qmk/qmk_cli
Submodule
1
qmk/qmk_cli
Submodule
@ -0,0 +1 @@
|
|||||||
|
Subproject commit 7cb41c2daa0e90ced9bbb25e46df810aded78d9c
|
1
qmk/qmk_fw
Submodule
1
qmk/qmk_fw
Submodule
@ -0,0 +1 @@
|
|||||||
|
Subproject commit 2106acc24a5c223a5429ea5413bd78f6f0ad038c
|
Loading…
x
Reference in New Issue
Block a user