|
@@ -3,9 +3,13 @@
|
3
|
3
|
IFS='/' read -r -a PINPATH <<< "$1"
|
4
|
4
|
DIR=${PINPATH[0]}
|
5
|
5
|
NAM=${PINPATH[1]}
|
6
|
|
-PIN=$2
|
7
|
|
-VAL=$3
|
8
|
6
|
|
9
|
7
|
SED=$(which gsed sed | head -n1)
|
10
|
|
-eval "${SED} -i '/^[[:blank:]]*\(\/\/\)*[[:blank:]]*\(#define \+${PIN}\b\).*$/{s//\2 ${VAL}/;h};\${x;/./{x;q0};x;q9}' Marlin/src/pins/$DIR/pins_${NAM}.h" ||
|
11
|
|
-(echo "ERROR: pins_set Can't find ${PIN}" >&2 && exit 9)
|
|
8
|
+
|
|
9
|
+shift
|
|
10
|
+while [[ $# > 1 ]]; do
|
|
11
|
+ PIN=$1 ; VAL=$2
|
|
12
|
+ eval "${SED} -i '/^[[:blank:]]*\(\/\/\)*[[:blank:]]*\(#define \+${PIN}\b\).*$/{s//\2 ${VAL}/;h};\${x;/./{x;q0};x;q9}' Marlin/src/pins/$DIR/pins_${NAM}.h" ||
|
|
13
|
+ (echo "ERROR: pins_set Can't find ${PIN}" >&2 && exit 9)
|
|
14
|
+ shift 2
|
|
15
|
+done
|