My Marlin configs for Fabrikator Mini and CTC i3 Pro B
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

opt_set 460B

1234567891011121314151617
  1. #!/usr/bin/env bash
  2. # exit on first failure
  3. set -e
  4. SED=$(which gsed || which sed)
  5. while [[ $# > 1 ]]; do
  6. DID=0
  7. for FN in Configuration Configuration_adv; do
  8. "${SED}" -i "/^\(\s*\)\/*\s*\(#define\s\+${1}\b\)\(.*\)$/{s//\1\2 ${2} \/\/ \3/;h};\${x;/./{x;q0};x;q9}" Marlin/$FN.h && DID=1
  9. done
  10. ((DID)) ||
  11. eval "echo '#define ${1} ${2}' >>Marlin/Configuration.h" ||
  12. (echo "ERROR: opt_set Can't set or add ${1}" >&2 && exit 9)
  13. shift 2
  14. done