From e8701195e66f2d27ffe17fb514eae8173795aaf7 Mon Sep 17 00:00:00 2001 From: Georgiy Bondarenko <69736697+nehilo@users.noreply.github.com> Date: Thu, 4 Mar 2021 22:54:23 +0500 Subject: Initial commit --- buildroot/bin/pins_set | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 buildroot/bin/pins_set (limited to 'buildroot/bin/pins_set') diff --git a/buildroot/bin/pins_set b/buildroot/bin/pins_set new file mode 100644 index 0000000..87a8692 --- /dev/null +++ b/buildroot/bin/pins_set @@ -0,0 +1,11 @@ +#!/usr/bin/env bash + +IFS='/' read -r -a PINPATH <<< "$1" +DIR=${PINPATH[0]} +NAM=${PINPATH[1]} +PIN=$2 +VAL=$3 + +SED=$(which gsed || which sed) +eval "${SED} -i '/\(\/\/\)*\(#define \+${PIN}\b\).*$/{s//\2 ${VAL}/;h};\${x;/./{x;q0};x;q9}' Marlin/src/pins/$DIR/pins_${NAM}.h" || +(echo "ERROR: pins_set Can't find ${PIN}" >&2 && exit 9) -- cgit v1.2.3