Add makefile to automate this

This commit is contained in:
Dejvino 2023-10-22 05:44:46 +02:00
parent 96a7967e0e
commit 9fa165a9a0
2 changed files with 28 additions and 16 deletions

16
Makefile Normal file
View File

@ -0,0 +1,16 @@
all: clean build flash
clean:
rm qmk_firmware/ktec_ergodone_dejvino.hex
build: qmk_firmware/ktec_ergodone_dejvino.hex
flash: build | hid_bootloader_cli
sudo ./hid_bootloader_cli -mmcu=atmega32u4 qmk_firmware/ktec_ergodone_dejvino.hex
qmk_firmware/ktec_ergodone_dejvino.hex:
cd qmk_firmware && make ktec/ergodone:dejvino
hid_bootloader_cli:
wget https://raw.githubusercontent.com/kairyu/tkg-toolkit/master/linux/bin/hid_bootloader_cli -O hid_bootloader_cli
chmod +x hid_bootloader_cli

View File

@ -1,30 +1,26 @@
# Dejvino's ErgoDone Keyboard Firmware # Dejvino's ErgoDone Keyboard Firmware
## Compile ## Setup
1. Clone this repo in recursive mode (with submodules): `git clone --recurse-submodules <url>` 1. Clone this repo in recursive mode (with submodules): `git clone --recurse-submodules <url>`
2. Setup QMK (see [docs](https://docs.qmk.fm/#/newbs_getting_started)) 2. Setup QMK (see [docs](https://docs.qmk.fm/#/newbs_getting_started))
1. Install qmk helper: `python3 -m pip install --user qmk` 1. Install qmk helper: `python3 -m pip install --user qmk`
2. Run the setup: `qmk setup` 2. Run the setup: `qmk setup`
3. Compile (inside `qmk_firmware`) 3. Install Dejvino's keyboard layout: `ln -s $(pwd)../keymap keyboards/ktec/ergodone/keymaps/dejvino`
1. default ErgoDone keyboard (optional): `make ktec/ergodone:default`
2. link Dejvino's keyboard layout: `ln -s $(pwd)../keymap keyboards/ktec/ergodone/keymaps/dejvino` ## Compile
3. Dejvino's ErgoDone keyboard layout: `make ktec/ergodone:dejvino` Run `make build`.
## Flash ## Flash
(see [ErgoDone Readme](./qmk_firmware/keyboards/ktec/ergodone/readme.md)) If you're not on Linux, download the [TKG Toolkit](https://github.com/kairyu/tkg-toolkit) flashing utility for your system manually, otherwise let `make` do it.
Get the [TKG Toolkit](https://github.com/kairyu/tkg-toolkit) flashing utility: `wget https://raw.githubusercontent.com/kairyu/tkg-toolkit/master/linux/bin/hid_bootloader_cli -O hid_bootloader_cli && chmod +x hid_bootloader_cli` 1. Enter flashing mode
1. Disconnect KBD
2. Press and hold two top-right-most keys on the left-half KBD
3. Connect KBD (LEDs will be blinking)
2. Run `make flash`.
### Enter flashing mode (see [ErgoDone Readme](https://github.com/qmk/qmk_firmware/blob/master/keyboards/ktec/ergodone/readme.md) for details)
1. Disconnect KBD
2. Press and hold two top-right-most keys on the left-half KBD
3. Connect KBD (LEDs will be blinking)
### Flashing
1. `sudo ./hid_bootloader_cli -mmcu=atmega32u4 qmk_firmware/ktec_ergodone_dejvino.hex`
2. Disconnect & connect KBD
## Resources ## Resources
- [QMK Firmware](https://github.com/qmk/qmk_firmware) - [QMK Firmware](https://github.com/qmk/qmk_firmware)
- [TKG Toolkit](https://github.com/kairyu/tkg-toolkit) - [TKG Toolkit](https://github.com/kairyu/tkg-toolkit)
- [ErgoDone Readme](./qmk_firmware/keyboards/ktec/ergodone/readme.md)