From cea4b9a4bb4090b20612a43efa3378b95a6dcac0 Mon Sep 17 00:00:00 2001 From: Hartmut Goebel Date: Tue, 31 May 2016 16:03:04 +0200 Subject: Update to Makefile an ergodox readme (#365) * Autodetect teensy-loader-cli over teensy_loader_cli. Some distributions (e.g. Arch Linux, Guix) install teensy_loader_cli as teensy-loader-cli. Use this one if it is installed. * Update ergodox_ez/readme.md - Mention Linux distris providing teensy-loader-cli - Mention `make teensy ...` --- keyboard/ergodox_ez/readme.md | 4 ++-- tmk_core/rules.mk | 9 +++++++-- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/keyboard/ergodox_ez/readme.md b/keyboard/ergodox_ez/readme.md index 97a10ff4d8..59130129cd 100644 --- a/keyboard/ergodox_ez/readme.md +++ b/keyboard/ergodox_ez/readme.md @@ -4,7 +4,7 @@ There are two main ways you could customize the ErgoDox EZ. ## The Easy Way: Use an existing firmware file and just flash it -1. Download and install the [Teensy Loader](https://www.pjrc.com/teensy/loader.html) +1. Download and install the [Teensy Loader](https://www.pjrc.com/teensy/loader.html). Some Linux distributions already provide a binary (may be called `teensy-loader-cli`), so you may prefer to use this. 2. Find a firmware file you like. You can find a few if these in the keymaps subdirectory right here. The file you need ends with .hex, and you can look at its .c counterpart (or its PNG image) to see what you'll be getting. You can also use the [Massdrop configurator](https://keyboard-configurator.massdrop.com/ext/ergodox) to create a firmware Hex file you like. 3. Download the firmware file 4. Connect the keyboard, press its Reset button (gently insert a paperclip into the hole in the top-right corner) and flash it using the Teensy loader you installed on step 1 and the firmware you downloaded. @@ -20,7 +20,7 @@ This requires a little bit of familiarity with coding. 4. Copy `keyboard/ergodox_ez/keymaps/default/keymap.c` into `keymaps/your_name/keymap.c` (for example, `keymaps/german/keymap.c`) 5. Edit this file, changing keycodes to your liking (see "Finding the keycodes you need" below). Try to edit the comments as well, so the "text graphics" represent your layout correctly. See below for more tips on sharing your work. 6. Compile your firmware by running `make clean` followed by `make KEYMAP=your_name`. For example, `make KEYMAP=german`. This will result in a hex file, which will always be called `ergodox_ez.hex`, regardless of your keymap name. -6. Flash this hex file using the [Teensy loader](https://www.pjrc.com/teensy/loader.html) as described in step 4 in the "Easy Way" above. +6. Flash this hex file using the [Teensy loader](https://www.pjrc.com/teensy/loader.html) as described in step 4 in the "Easy Way" above. If you prefer you can automatically flash the hex file after successfull build by running `make teensy KEYMAP=your_name`. 7. Submit your work as a pull request to this repository, so others can also use it. :) See below on specifics. Good luck! :) diff --git a/tmk_core/rules.mk b/tmk_core/rules.mk index 37be850f84..326d2a7872 100644 --- a/tmk_core/rules.mk +++ b/tmk_core/rules.mk @@ -317,7 +317,12 @@ REMOVE = rm -f REMOVEDIR = rmdir COPY = cp WINSHELL = cmd - +# Autodecct teensy loader +ifneq (, $(shell which teensy-loader-cli 2>/dev/null))) + TEENSY_LOADER_CLI = teensy-loader-cli +else + TEENSY_LOADER_CLI = teensy_loader_cli +endif # Define Messages # English @@ -425,7 +430,7 @@ program: $(TARGET).hex $(TARGET).eep $(PROGRAM_CMD) teensy: $(TARGET).hex - teensy_loader_cli -mmcu=$(MCU) -w -v $(TARGET).hex + $(TEENSY_LOADER_CLI) -mmcu=$(MCU) -w -v $(TARGET).hex flip: $(TARGET).hex batchisp -hardware usb -device $(MCU) -operation erase f -- cgit v1.2.1