home

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | README | LICENSE

commit ecbab082b31977ae4e3bd5a6c1a7ad29679fce96
parent 016c83ffa38c002a95dae9deb9c90a573d03c9f9
Author: Vincent Demeester <vincent@sbr.pm>
Date:   Mon,  9 Nov 2020 10:58:11 +0100

tools/ergodox: nixify flashing

Signed-off-by: Vincent Demeester <vincent@sbr.pm>

Diffstat:
Atools/ergodox/default.nix | 66++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Atools/ergodox/flash | 2++
Atools/ergodox/increase-tapping-delay.patch | 13+++++++++++++
Atools/ergodox/rules.mk | 1+
4 files changed, 82 insertions(+), 0 deletions(-)

diff --git a/tools/ergodox/default.nix b/tools/ergodox/default.nix @@ -0,0 +1,66 @@ +{ sources ? import ../../nix +, lib ? sources.lib +, pkgs ? sources.nixpkgs { } +}: + +with pkgs; +let avrlibc = pkgsCross.avr.libcCross; in +rec { + qmkSource = fetchgit { + url = "https://github.com/qmk/qmk_firmware"; + rev = "0.10.50"; + sha256 = "162rvhqyx25fz39395vhhk3allbfn4bd8c1afj8ip9r27zwnqrwd"; + fetchSubmodules = true; + }; + + layout = stdenv.mkDerivation rec { + name = "ergodox_ez_sbr.hex"; + + src = qmkSource; + + buildInputs = [ + dfu-programmer + dfu-util + diffutils + git + python3 + pkgsCross.avr.buildPackages.binutils + pkgsCross.avr.buildPackages.gcc8 + avrlibc + avrdude + ]; + + AVR_CFLAGS = [ + "-isystem ${avrlibc}/avr/include" + "-L${avrlibc}/avr/lib/avr5" + ]; + + AVR_ASFLAGS = AVR_CFLAGS; + + patches = [ ./increase-tapping-delay.patch ]; + + postPatch = '' + mkdir keyboards/ergodox_ez/keymaps/sbr + cp ${./keymap.c} keyboards/ergodox_ez/keymaps/sbr/keymap.c + cp ${./config.h} keyboards/ergodox_ez/keymaps/sbr/config.h + cp ${./rules.mk} keyboards/ergodox_ez/keymaps/sbr/rules.mk + ''; + + buildPhase = '' + make ergodox_ez:sbr + ''; + + installPhase = '' + cp ergodox_ez_sbr.hex $out + ''; + }; + + flash = writeShellScript "flash.sh" '' + ${teensy-loader-cli}/bin/teensy-loader-cli \ + -v \ + --mcu=atmega32u4 \ + -w ${layout} + ''; + + meta.targets = [ "layout" ]; +} diff --git a/tools/ergodox/flash b/tools/ergodox/flash @@ -0,0 +1,2 @@ +#!/usr/bin/env bash +exec "$(nix-build --no-out-link ../.. -A tools.ergodox.flash)" diff --git a/tools/ergodox/increase-tapping-delay.patch b/tools/ergodox/increase-tapping-delay.patch @@ -0,0 +1,13 @@ +diff --git a/keyboards/ergodox_ez/config.h b/keyboards/ergodox_ez/config.h +index ae70c4f2e..776110c09 100644 +--- a/keyboards/ergodox_ez/config.h ++++ b/keyboards/ergodox_ez/config.h +@@ -45,7 +45,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. + /* define if matrix has ghost */ + //#define MATRIX_HAS_GHOST + +-#define TAPPING_TERM 200 ++#define TAPPING_TERM 150 + #define IGNORE_MOD_TAP_INTERRUPT // this makes it possible to do rolling combos (zx) with keys that convert to other keys on hold (z becomes ctrl when you hold it, and when this option isn't enabled, z rapidly followed by x actually sends Ctrl-x. That's bad.) + + /* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */ diff --git a/tools/ergodox/rules.mk b/tools/ergodox/rules.mk @@ -0,0 +1 @@ +LEADER_ENABLE = yes