Merge upstream changes from Marlin 2.1.2.5
This commit is contained in:
0
buildroot/bin/__init__.py
Normal file
0
buildroot/bin/__init__.py
Normal file
@@ -2,31 +2,48 @@
|
||||
#
|
||||
# Usage:
|
||||
#
|
||||
# build_all_examples [-b|--branch=<branch>] - Branch to fetch from Configurations repo
|
||||
# build_all_examples [-b|--branch=<branch>] - Branch to fetch from Configurations repo (import-2.1.x)
|
||||
# [-B|--base] - Base path of configurations, overriding -b
|
||||
# [-c|--continue] - Continue the paused build
|
||||
# [-d|--debug] - Print extra debug output
|
||||
# [-i|--ini] - Archive ini/json/yml files in the temp config folder
|
||||
# [-l|--limit=#] - Limit the number of builds in this run
|
||||
# [-n|--nobuild] - Don't actually build anything.
|
||||
# [-p|--purge] - Purge the status file and start over
|
||||
# [-s|--skip] - Continue the paused build, skipping one
|
||||
# [-r|--resume=<path>] - Start at some config in the filesystem order
|
||||
# [-s|--skip] - Do the thing
|
||||
#
|
||||
# build_all_examples [...] branch [resume-from]
|
||||
# [-l|--limit=#] - Limit the number of builds in this run
|
||||
# [-d|--debug] - Print extra debug output (after)
|
||||
# [-n|--nobuild] - Don't actually build anything
|
||||
# [-f|--nofail] - Don't stop on a failed build
|
||||
# [-e|--export=N] - Set CONFIG_EXPORT and export into each config folder
|
||||
# [-a|--archive] - Copy the binary to the export location
|
||||
# [-o|--output] - Redirect export / archiving to another location
|
||||
# (By default export to origin config folders)
|
||||
# [-h|--help] - Print usage and exit
|
||||
#
|
||||
|
||||
HERE=`dirname $0`
|
||||
PATH="$HERE:$PATH"
|
||||
|
||||
. "$HERE/mfutil"
|
||||
. mfutil
|
||||
|
||||
GITREPO=https://github.com/MarlinFirmware/Configurations.git
|
||||
STAT_FILE=./.pio/.buildall
|
||||
|
||||
usage() { echo "
|
||||
Usage: $SELF [-b|--branch=<branch>] [-d|--debug] [-i|--ini] [-r|--resume=<path>]
|
||||
$SELF [-b|--branch=<branch>] [-d|--debug] [-i|--ini] [-c|--continue]
|
||||
$SELF [-b|--branch=<branch>] [-d|--debug] [-i|--ini] [-s|--skip]
|
||||
$SELF [-b|--branch=<branch>] [-d|--debug] [-n|--nobuild]
|
||||
$SELF [...] branch [resume-point]
|
||||
usage() { echo "Usage:
|
||||
|
||||
build_all_examples [-b|--branch=<branch>] - Branch to fetch from Configurations repo (import-2.1.x)
|
||||
[-B|--base] - Base path of configurations, overriding -b
|
||||
[-c|--continue] - Continue the paused build
|
||||
[-p|--purge] - Purge the status file and start over
|
||||
[-s|--skip] - Continue the paused build, skipping one
|
||||
[-r|--resume=<path>] - Start at some config in the filesystem order
|
||||
[-e|--export=N] - Set CONFIG_EXPORT and export to the export location
|
||||
[-a|--archive] - Copy the binary to the export location
|
||||
[-o|--output] - Redirect export / archiving to another location
|
||||
(By default export to origin config folders)
|
||||
[-d|--debug] - Print extra debug output (after)
|
||||
[-l|--limit=#] - Limit the number of builds in this run
|
||||
[-n|--nobuild] - Don't actually build anything
|
||||
[-f|--nofail] - Don't stop on a failed build
|
||||
[-h|--help] - Print usage and exit
|
||||
"
|
||||
}
|
||||
|
||||
@@ -36,50 +53,60 @@ unset FIRST_CONF
|
||||
EXIT_USAGE=
|
||||
LIMIT=1000
|
||||
|
||||
while getopts 'b:cdhil:nqr:sv-:' OFLAG; do
|
||||
while getopts 'aB:b:ce:fdhl:no:pr:sv-:' OFLAG; do
|
||||
case "${OFLAG}" in
|
||||
b) BRANCH=$OPTARG ; bugout "Branch: $BRANCH" ;;
|
||||
r) FIRST_CONF="$OPTARG" ; bugout "Resume: $FIRST_CONF" ;;
|
||||
c) CONTINUE=1 ; bugout "Continue" ;;
|
||||
s) CONTSKIP=1 ; bugout "Continue, skipping" ;;
|
||||
i) COPY_INI=1 ; bugout "Archive INI/JSON/YML files" ;;
|
||||
a) ARCHIVE=1 ; bugout "Archiving" ;;
|
||||
B) CBASE=${OPTARG%/} ; bugout "Base: $CBASE" ;;
|
||||
b) BRANCH=$OPTARG ; bugout "Branch: $BRANCH" ;;
|
||||
f) NOFAIL=1 ; bugout "Continue on Fail" ;;
|
||||
r) ISRES=1 ; FIRST_CONF=$OPTARG ; bugout "Resume: $FIRST_CONF" ;;
|
||||
c) CONTINUE=1 ; bugout "Continue" ;;
|
||||
s) CONTSKIP=1 ; bugout "Continue, skipping" ;;
|
||||
e) CEXPORT=$OPTARG ; bugout "Export $CEXPORT" ;;
|
||||
o) OUTBASE="${OPTARG%/}" ; bugout "Archive to $OUTBASE" ;;
|
||||
h) EXIT_USAGE=1 ; break ;;
|
||||
l) LIMIT=$OPTARG ; bugout "Limit to $LIMIT build(s)" ;;
|
||||
d|v) DEBUG=1 ; bugout "Debug ON" ;;
|
||||
n) DRYRUN=1 ; bugout "Dry Run" ;;
|
||||
-) IFS="=" read -r ONAM OVAL <<< "$OPTARG"
|
||||
l) LIMIT=$OPTARG ; bugout "Limit to $LIMIT build(s)" ;;
|
||||
d|v) DEBUG=1 ; bugout "Debug ON" ;;
|
||||
n) DRYRUN=1 ; bugout "Dry Run" ;;
|
||||
p) PURGE=1 ; bugout "Purge stat file" ;;
|
||||
-) ONAM="${OPTARG%%=*}" ; OVAL="${OPTARG#*=}"
|
||||
case "$ONAM" in
|
||||
branch) BRANCH=$OVAL ; bugout "Branch: $BRANCH" ;;
|
||||
resume) FIRST_CONF="$OVAL" ; bugout "Resume: $FIRST_CONF" ;;
|
||||
continue) CONTINUE=1 ; bugout "Continue" ;;
|
||||
skip) CONTSKIP=2 ; bugout "Continue, skipping" ;;
|
||||
limit) LIMIT=$OVAL ; bugout "Limit to $LIMIT build(s)" ;;
|
||||
ini) COPY_INI=1 ; bugout "Archive INI/JSON/YML files" ;;
|
||||
archive) ARCHIVE=1 ; bugout "Archiving" ;;
|
||||
base) CBASE=${OVAL%/} ; bugout "Base: $CBASE" ;;
|
||||
branch) BRANCH=$OVAL ; bugout "Branch: $BRANCH" ;;
|
||||
nofail) NOFAIL=1 ; bugout "Continue on Fail" ;;
|
||||
resume) ISRES=1 ; FIRST_CONF=$OVAL ; bugout "Resume: $FIRST_CONF" ;;
|
||||
continue) CONTINUE=1 ; bugout "Continue" ;;
|
||||
skip) CONTSKIP=1 ; bugout "Continue, skipping" ;;
|
||||
export) CEXPORT=$OVAL ; bugout "Export $EXPORT" ;;
|
||||
output) OUTBASE="${OVAL%/}" ; bugout "Archive to $OUTBASE" ;;
|
||||
limit) LIMIT=$OVAL ; bugout "Limit to $LIMIT build(s)" ;;
|
||||
help) [[ -z "$OVAL" ]] || perror "option can't take value $OVAL" $ONAM ; EXIT_USAGE=1 ;;
|
||||
debug) DEBUG=1 ; bugout "Debug ON" ;;
|
||||
nobuild) DRYRUN=1 ; bugout "Dry Run" ;;
|
||||
debug) DEBUG=1 ; bugout "Debug ON" ;;
|
||||
nobuild) DRYRUN=1 ; bugout "Dry Run" ;;
|
||||
purge) PURGE=1 ; bugout "Purge stat file" ;;
|
||||
*) EXIT_USAGE=2 ; echo "$SELF: unrecognized option \`--$ONAM'" ; break ;;
|
||||
esac
|
||||
;;
|
||||
*) EXIT_USAGE=2 ; break ;;
|
||||
esac
|
||||
done
|
||||
|
||||
# Extra arguments count as BRANCH, FIRST_CONF
|
||||
shift $((OPTIND - 1))
|
||||
[[ $# > 0 ]] && { BRANCH=$1 ; shift 1 ; bugout "BRANCH=$BRANCH" ; }
|
||||
[[ $# > 0 ]] && { FIRST_CONF=$1 ; shift 1 ; bugout "FIRST_CONF=$FIRST_CONF" ; }
|
||||
[[ $# > 0 ]] && { EXIT_USAGE=2 ; echo "too many arguments" ; }
|
||||
|
||||
# Check for mixed continue, skip, resume arguments. Only one should be used.
|
||||
((CONTINUE + CONTSKIP + ISRES + PURGE > 1)) && { echo "Don't mix -c, -p, -s, and -r options" ; echo ; EXIT_USAGE=2 ; }
|
||||
|
||||
# Exit with helpful usage information
|
||||
((EXIT_USAGE)) && { usage ; let EXIT_USAGE-- ; exit $EXIT_USAGE ; }
|
||||
|
||||
echo "This script downloads each Configuration and attempts to build it."
|
||||
echo "On failure the last-built configs will be left in your working copy."
|
||||
echo
|
||||
echo "This script downloads all example configs and attempts to build them."
|
||||
echo "On failure the last-built configs are left in your working copy."
|
||||
echo "Restore your configs with 'git checkout -f' or 'git reset --hard HEAD'."
|
||||
echo
|
||||
|
||||
if [[ -f "$STAT_FILE" ]]; then
|
||||
IFS='*' read BRANCH FIRST_CONF <"$STAT_FILE"
|
||||
fi
|
||||
[[ -n $PURGE ]] && rm -f "$STAT_FILE"
|
||||
[[ -z $FIRST_CONF && -f "$STAT_FILE" ]] && IFS='*' read BRANCH FIRST_CONF <"$STAT_FILE"
|
||||
|
||||
# If -c is given start from the last attempted build
|
||||
if ((CONTINUE)); then
|
||||
@@ -97,77 +124,90 @@ elif ((CONTSKIP)); then
|
||||
fi
|
||||
|
||||
# Check if the current repository has unmerged changes
|
||||
if [[ $SKIP_CONF ]]; then
|
||||
if ((SKIP_CONF)); then
|
||||
echo "Skipping $FIRST_CONF"
|
||||
elif [[ $FIRST_CONF ]]; then
|
||||
elif [[ -n $FIRST_CONF ]]; then
|
||||
echo "Resuming from $FIRST_CONF"
|
||||
else
|
||||
git diff --quiet || { echo "The working copy is modified. Commit or stash changes before proceeding."; exit ; }
|
||||
fi
|
||||
|
||||
# Create a temporary folder inside .pio
|
||||
TMP=./.pio/build-$BRANCH
|
||||
[[ -d "$TMP" ]] || mkdir -p $TMP
|
||||
|
||||
# Download Configurations into the temporary folder
|
||||
if [[ ! -e "$TMP/README.md" ]]; then
|
||||
echo "Fetching Configurations from GitHub to $TMP"
|
||||
git clone --depth=1 --single-branch --branch "$BRANCH" $GITREPO "$TMP" || { echo "Failed to clone the configuration repository"; exit ; }
|
||||
# Check for the given base path
|
||||
if [[ -n $CBASE ]]; then
|
||||
CBASE="${CBASE/#\~/$HOME}"
|
||||
[[ -d "$CBASE" ]] || { echo "Given base -B $CBASE not found." ; exit ; }
|
||||
else
|
||||
echo "Using cached Configurations at $TMP"
|
||||
# Make a Configurations temporary folder if needed
|
||||
CBASE=./.pio/build-$BRANCH
|
||||
[[ -d "$CBASE" ]] || mkdir -p "$CBASE"
|
||||
# Download the specified Configurations branch if needed
|
||||
if [[ ! -e "$CBASE/README.md" ]]; then
|
||||
echo "Fetching Configurations from GitHub to $CBASE"
|
||||
git clone --depth=1 --single-branch --branch "$BRANCH" $GITREPO "$CBASE" || { echo "Failed to clone the configuration repository"; exit ; }
|
||||
fi
|
||||
fi
|
||||
|
||||
echo -e "Start build...\n====================="
|
||||
# Build
|
||||
echo -e "=====================\nProceed with builds...\n====================="
|
||||
shopt -s nullglob
|
||||
IFS='
|
||||
'
|
||||
CONF_TREE=$( ls -d "$TMP"/config/examples/*/ "$TMP"/config/examples/*/*/ "$TMP"/config/examples/*/*/*/ "$TMP"/config/examples/*/*/*/*/ | grep -vE ".+\.(\w+)$" )
|
||||
for CONF in $CONF_TREE ; do
|
||||
|
||||
export PAUSE=1
|
||||
|
||||
# Get a list of all folders that contain a file matching "Configuration*.h"
|
||||
find -ds "$CBASE"/config/examples -type d -name 'Configuration.h' -o -name 'Configuration_adv.h' -print0 | while IFS= read -r -d $'\0' CONF; do
|
||||
|
||||
# Remove the file name and slash from the end of the path
|
||||
CONF=${CONF%/*}
|
||||
|
||||
# Get a config's directory name
|
||||
DIR=$( echo $CONF | "$SED" "s|$TMP/config/examples/||" )
|
||||
DIR=${CONF#$CBASE/config/examples/}
|
||||
|
||||
# If looking for a config, skip others
|
||||
[[ $FIRST_CONF ]] && [[ $FIRST_CONF != $DIR && "$FIRST_CONF/" != $DIR ]] && continue
|
||||
[[ $FIRST_CONF ]] && [[ $FIRST_CONF != $DIR && "$FIRST_CONF/" != $DIR ]] && { ((DEBUG)) && echo "[SKIP] $DIR" ; continue ; }
|
||||
# Once found, stop looking
|
||||
unset FIRST_CONF
|
||||
|
||||
# If skipping, don't build the found one
|
||||
[[ $SKIP_CONF ]] && { unset SKIP_CONF ; continue ; }
|
||||
|
||||
# ...if skipping, don't build this one
|
||||
compgen -G "${CONF}Con*.h" > /dev/null || continue
|
||||
# Either Configuration.h or Configuration_adv.h must exist
|
||||
[[ -f "$CONF"/Configuration.h || -f "$CONF"/Configuration_adv.h ]] || { echo "[NONE] $DIR" ; continue ; }
|
||||
|
||||
# Command arguments for 'build_example'
|
||||
CARGS=("-b" "$CBASE" "-c" "$DIR")
|
||||
|
||||
# Exporting? Add -e argument
|
||||
((CEXPORT)) && CARGS+=("-e" "$CEXPORT")
|
||||
|
||||
# Continue on fail? Add -f argument
|
||||
((NOFAIL)) && CARGS+=("-f")
|
||||
|
||||
# Archive the build? Add -a argument
|
||||
((ARCHIVE)) && CARGS+=("-a")
|
||||
|
||||
# Redirecting the export/archive output? Add -o argument
|
||||
[[ -n $OUTBASE ]] && CARGS+=("-o" "$OUTBASE")
|
||||
|
||||
# Build or print build command for --nobuild
|
||||
if [[ $DRYRUN ]]; then
|
||||
echo -e "\033[0;32m[DRYRUN] build_example internal \"$TMP\" \"$DIR\"\033[0m"
|
||||
if ((DRYRUN)); then
|
||||
echo -e "\033[0;32m[DRYRUN] build_example ${CARGS[@]}\033[0m"
|
||||
else
|
||||
# Remember where we are in case of failure
|
||||
echo "${BRANCH}*${DIR}" >"$STAT_FILE"
|
||||
# Build folder is unknown so delete all report files
|
||||
if [[ $COPY_INI ]]; then
|
||||
IFIND='find ./.pio/build/ -name "config.ini" -o -name "schema.json" -o -name "schema.yml"'
|
||||
$IFIND -exec rm "{}" \;
|
||||
fi
|
||||
((DEBUG)) && echo "\"$HERE/build_example\" internal \"$TMP\" \"$DIR\""
|
||||
"$HERE/build_example" internal "$TMP" "$DIR" || { echo "Failed to build $DIR"; exit ; }
|
||||
# Build folder is unknown so copy all report files
|
||||
[[ $COPY_INI ]] && $IFIND -exec cp "{}" "$CONF" \;
|
||||
((DEBUG)) && echo "build_example ${CARGS[@]}"
|
||||
# Invoke build_example
|
||||
build_example "${CARGS[@]}" || { echo "Failed to build $DIR" ; exit ; }
|
||||
fi
|
||||
|
||||
((--LIMIT)) || { echo "Limit reached" ; PAUSE=1 ; break ; }
|
||||
echo
|
||||
((--LIMIT)) || { echo "Specified limit reached" ; break ; }
|
||||
echo
|
||||
|
||||
export PAUSE=0
|
||||
|
||||
done
|
||||
|
||||
# Delete the build state if not paused early
|
||||
[[ $PAUSE ]] || rm "$STAT_FILE"
|
||||
echo "Exiting"
|
||||
|
||||
# Delete the temp folder if not preserving generated INI files
|
||||
if [[ -e "$TMP/config/examples" ]]; then
|
||||
if [[ $COPY_INI ]]; then
|
||||
OPEN=$( which gnome-open xdg-open open | head -n1 )
|
||||
$OPEN "$TMP"
|
||||
elif [[ ! $PAUSE ]]; then
|
||||
rm -rf "$TMP"
|
||||
fi
|
||||
fi
|
||||
# Delete the build state if not paused early
|
||||
((PAUSE)) || rm -f "$STAT_FILE"
|
||||
|
@@ -1,43 +1,229 @@
|
||||
#!/usr/bin/env bash
|
||||
#
|
||||
# build_example
|
||||
# Usage:
|
||||
#
|
||||
# Usage: build_example internal config-home config-folder
|
||||
# build_example -b|--base=<path> - Configurations root folder (e.g., ./.pio/build-BRANCH)
|
||||
# -c|--config=<rel> - Sub-path of the configs to build (within config/examples)
|
||||
# [-e|--export=N] - Use CONFIG_EXPORT N to export the config to the export location
|
||||
# [-a|--archive] - Archive the build (to the export location)
|
||||
# [-o|--output] - Redirect export / archiving to another location
|
||||
# (By default export to origin config folder)
|
||||
# [-f|--nofail] - Don't stop on a failed build
|
||||
# [-w|--nowarn] - Suppress warnings with extra config options
|
||||
# [-r|--reveal] - Reveal the config/export folder after the build
|
||||
# [-h|--help] - Print usage and exit
|
||||
# [--allow] - Allow this script to run standalone
|
||||
#
|
||||
|
||||
usage() { echo "Usage:
|
||||
|
||||
build_example -b|--base=<path> - Configurations root folder (e.g., ./.pio/build-BRANCH)
|
||||
-c|--config=<rel> - Sub-path of the configs to build (within config/examples)
|
||||
[-e|--export=N] - Use CONFIG_EXPORT N to export the config to the export location
|
||||
[-a|--archive] - Archive the build (to the export location)
|
||||
[-o|--output] - Redirect export / archiving to another location
|
||||
(By default export to origin config folder)
|
||||
[-f|--nofail] - Don't stop on a failed build
|
||||
[-w|--nowarn] - Suppress warnings with extra config options
|
||||
[-r|--reveal] - Reveal the config/export folder after the build
|
||||
[-h|--help] - Print usage and exit
|
||||
[--allow] - Allow this script to run standalone
|
||||
"
|
||||
}
|
||||
|
||||
HERE=`dirname $0`
|
||||
PATH="$HERE:$PATH"
|
||||
|
||||
. "$HERE/mfutil"
|
||||
. mfutil
|
||||
|
||||
# Require 'internal' as the first argument
|
||||
[[ "$1" == "internal" ]] || { echo "Don't call this script directly, use build_all_examples instead." ; exit 1 ; }
|
||||
annc() { echo -e "\033[0;32m$1\033[0m" ; }
|
||||
alrt() { echo -e "\033[0;31m$1\033[0m" ; }
|
||||
|
||||
echo "Testing $3:"
|
||||
# Get arguments
|
||||
BUILD=./.pio/build
|
||||
CLEANER=
|
||||
ALLOW=
|
||||
ARCHIVE=
|
||||
BASE=
|
||||
CONFIG=
|
||||
REVEAL=
|
||||
EXPNUM=
|
||||
NOFAIL=
|
||||
OUTBASE=
|
||||
while getopts 'ab:c:e:fhio:r-:' OFLAG; do
|
||||
case "${OFLAG}" in
|
||||
a) ARCHIVE=1 ;;
|
||||
b) BASE="${OPTARG%/}" ;;
|
||||
c) CONFIG="${OPTARG%/}" ;;
|
||||
e) EXPNUM="$OPTARG" ;;
|
||||
o) OUTBASE="${OPTARG%/}" ;;
|
||||
h) EXIT_USAGE=1 ; break ;;
|
||||
f) NOFAIL=1 ;;
|
||||
r) REVEAL=1 ;;
|
||||
-) ONAM="${OPTARG%%=*}" ; OVAL="${OPTARG#*=}"
|
||||
case "$ONAM" in
|
||||
archive) ARCHIVE=1 ;;
|
||||
allow) ALLOW=1 ;;
|
||||
base) BASE="${OVAL%/}" ;;
|
||||
config) CONFIG="${OVAL%/}" ;;
|
||||
export) EXPNUM="$OVAL" ;;
|
||||
output) OUTBASE="${OVAL%/}" ;;
|
||||
help) EXIT_USAGE=1 ; break ;;
|
||||
nofail) NOFAIL=1 ;;
|
||||
reveal) REVEAL=1 ;;
|
||||
*) EXIT_USAGE=2 ; echo "$SELF: unrecognized option \`--$ONAM'" ; break ;;
|
||||
esac
|
||||
;;
|
||||
*) EXIT_USAGE=2 ; break ;;
|
||||
esac
|
||||
done
|
||||
shift $((OPTIND - 1))
|
||||
|
||||
SUB=$2/config/examples/$3
|
||||
[[ -d "$SUB" ]] || { echo "$SUB is not a good path" ; exit 1 ; }
|
||||
# Must be called from another script (or with --allow)
|
||||
[[ $ALLOW || $SHLVL -gt 2 ]] || { echo "Don't call this script directly, use build_all_examples instead." ; exit 1 ; }
|
||||
|
||||
compgen -G "${SUB}Con*.h" > /dev/null || { echo "No configuration files found in $SUB" ; exit 1 ; }
|
||||
# Exit with helpful usage information
|
||||
((EXIT_USAGE)) && { usage ; let EXIT_USAGE-- ; exit $EXIT_USAGE ; }
|
||||
|
||||
# -b|--base and -c|--config are required
|
||||
[[ -z $BASE ]] && { echo "-b|--base is required" ; exit 1 ; }
|
||||
[[ -z $CONFIG ]] && { echo "-c|--config is required" ; exit 1 ; }
|
||||
|
||||
# Expand ~ to $HOME in provided arguments
|
||||
BASE=${BASE/#\~/$HOME}
|
||||
CONFIG=${CONFIG/#\~/$HOME}
|
||||
|
||||
# Make sure the examples exist
|
||||
SUB1="$BASE/config/examples"
|
||||
[[ -d "$SUB1" ]] || { echo "-b|--base $BASE doesn't contain config/examples" ; exit 1 ; }
|
||||
|
||||
# Make sure the specific config folder exists
|
||||
SUB="$SUB1/$CONFIG"
|
||||
[[ -d "$SUB" ]] || { echo "-c|--config $CONFIG doesn't exist" ; exit 1 ; }
|
||||
|
||||
# ...and contains Configuration.h or Configuration_adv.h
|
||||
[[ -f "$SUB"/Configuration.h || -f "$SUB"/Configuration_adv.h ]] || { echo "No configuration files found in $SUB" ; exit 1 ; }
|
||||
|
||||
# Get the location for exports and archives
|
||||
if [[ -n $OUTBASE ]]; then
|
||||
ARCSUB="${OUTBASE/#\~/$HOME}/$CONFIG"
|
||||
mkdir -p "$ARCSUB"
|
||||
else
|
||||
ARCSUB="$SUB"
|
||||
fi
|
||||
|
||||
# Delete any config files from previous builds
|
||||
rm -f Marlin/_Bootscreen.h Marlin/_Statusscreen.h
|
||||
|
||||
# Copy configurations into the Marlin folder
|
||||
echo "Getting configuration files from $SUB"
|
||||
cp "$2/config/default"/*.h Marlin/
|
||||
cp "$SUB"/Configuration.h Marlin/ 2>/dev/null
|
||||
cp "$SUB"/Configuration_adv.h Marlin/ 2>/dev/null
|
||||
cp "$SUB"/_Bootscreen.h Marlin/ 2>/dev/null
|
||||
cp "$SUB"/_Statusscreen.h Marlin/ 2>/dev/null
|
||||
cp "$BASE"/config/default/*.h Marlin/
|
||||
cp "$SUB"/*.h Marlin/
|
||||
|
||||
rm -f Marlin/Config.h Marlin/Config-export.h
|
||||
|
||||
set -e
|
||||
|
||||
# Strip #error lines from Configuration.h
|
||||
IFS=$'\n'; set -f
|
||||
$SED -i~ -e "20,30{/#error/d}" Marlin/Configuration.h
|
||||
rm Marlin/Configuration.h~
|
||||
unset IFS; set +f
|
||||
# Strip #error lines from Configuration.h using
|
||||
awk 'NR < 20 || NR > 30 || !/#error/' Marlin/Configuration.h > Marlin/Configuration.h~
|
||||
mv Marlin/Configuration.h~ Marlin/Configuration.h
|
||||
|
||||
# Hide several warnings when not exporting
|
||||
[[ -z $EXPNUM ]] && CLEANER=1
|
||||
|
||||
# Suppress fatal warnings
|
||||
echo -e "\n#define NO_CONTROLLER_CUSTOM_WIRING_WARNING" >> Marlin/Configuration.h
|
||||
if ((CLEANER)); then
|
||||
opt_add NO_CONTROLLER_CUSTOM_WIRING_WARNING
|
||||
opt_add NO_AUTO_ASSIGN_WARNING
|
||||
opt_add NO_CREALITY_DRIVER_WARNING
|
||||
opt_add DIAG_JUMPERS_REMOVED
|
||||
opt_add DIAG_PINS_REMOVED
|
||||
opt_add NO_MK3_FAN_PINS_WARNING
|
||||
opt_add NO_USER_FEEDBACK_WARNING
|
||||
opt_add NO_Z_SAFE_HOMING_WARNING
|
||||
opt_add NO_LCD_CONTRAST_WARNING
|
||||
opt_add NO_MICROPROBE_WARNING
|
||||
opt_add NO_CONFIGURATION_EMBEDDING_WARNING
|
||||
opt_add NO_HOMING_CURRENT_WARNING
|
||||
fi
|
||||
|
||||
echo "Building the firmware now..."
|
||||
"$HERE/mftest" -s -a -n1 || { echo "Failed"; exit 1; }
|
||||
# Possible exported file names (in the build folder)
|
||||
ENAME=("-name" "marlin_config.json" \
|
||||
"-o" "-name" "config.ini" \
|
||||
"-o" "-name" "schema.json" \
|
||||
"-o" "-name" "schema.yml")
|
||||
|
||||
echo "Success"
|
||||
# Possible built firmware names (in the build folder)
|
||||
BNAME=("-name" 'firmware*.hex' \
|
||||
"-o" "-name" "firmware*.bin" \
|
||||
"-o" "-name" "project*.bin" \
|
||||
"-o" "-name" "Robin*.bin" \
|
||||
"-o" "-name" "main_*.bin")
|
||||
|
||||
mkdir -p "$BUILD"
|
||||
|
||||
# If EXPNUM is set then apply to the config before build
|
||||
if [[ $EXPNUM ]]; then
|
||||
opt_set CONFIG_EXPORT $EXPNUM
|
||||
# Clean up old exports
|
||||
find "$BUILD" \( "${ENAME[@]}" \) -exec rm "{}" \;
|
||||
fi
|
||||
|
||||
((ARCHIVE)) && find "$BUILD" \( "${BNAME[@]}" \) -exec rm "{}" \;
|
||||
|
||||
set +e
|
||||
|
||||
echo "Building example $CONFIG ..."
|
||||
mftest -s -a -n1 ; ERR=$?
|
||||
|
||||
((ERR)) && alrt "Failed ($ERR)" || annc "Success"
|
||||
|
||||
set -e
|
||||
|
||||
if [[ $ERR -gt 0 ]]; then
|
||||
|
||||
# Error? For --nofail simply log. Otherwise return the error.
|
||||
if [[ -n $NOFAIL ]]; then
|
||||
date +"%F %T [FAIL] $CONFIG" >>./.pio/error-log.txt
|
||||
else
|
||||
exit $ERR
|
||||
fi
|
||||
|
||||
else
|
||||
|
||||
# Copy exports back to the configs
|
||||
if [[ -n $EXPNUM ]]; then
|
||||
annc "Exporting $EXPNUM"
|
||||
[[ -f Marlin/Config-export.h ]] && { cp Marlin/Config-export.h "$ARCSUB"/Config.h ; }
|
||||
find "$BUILD" \( "${ENAME[@]}" \) -exec cp "{}" "$ARCSUB" \;
|
||||
fi
|
||||
|
||||
# Copy potential firmware files into the config folder
|
||||
# TODO: Consider firmware that needs an STM32F4_UPDATE folder.
|
||||
# Currently only BOARD_CREALITY_F401RE env:STM32F401RE_creality
|
||||
if ((ARCHIVE)); then
|
||||
annc "Archiving"
|
||||
rm -f "$ARCSUB"/*.bin.tar.gz "$ARCSUB"/*.hex.tar.gz
|
||||
find "$BUILD" \( "${BNAME[@]}" \) -exec sh -c '
|
||||
ARCSUB="$1"
|
||||
CONFIG="$2"
|
||||
shift 2
|
||||
for FILE in "$@"; do
|
||||
cd "${FILE%/*}"
|
||||
NAME=${FILE##*/}
|
||||
SHRT=${NAME%.*}
|
||||
SHASUM=$(sha256sum "$NAME" | cut -d" " -f1)
|
||||
tar -czf "$ARCSUB/$SHRT.tar.gz" "$NAME"
|
||||
echo "$CONFIG\n$SHASUM" > "$ARCSUB/$NAME.sha256.txt"
|
||||
rm "$NAME"
|
||||
cd - >/dev/null
|
||||
done
|
||||
' sh "$ARCSUB" "$CONFIG" {} +
|
||||
fi
|
||||
|
||||
# Reveal the configs after the build, if requested
|
||||
((REVEAL)) && { annc "Revealing $ARCSUB" ; open "$ARCSUB" ; }
|
||||
|
||||
fi
|
||||
|
||||
exit 0
|
||||
|
@@ -3,12 +3,10 @@
|
||||
# exit on first failure
|
||||
set -e
|
||||
|
||||
SED=$(which gsed sed | head -n1)
|
||||
FN="platformio.ini"
|
||||
|
||||
if [[ $1 == "-n" ]]; then
|
||||
"${SED}" -i "s/default_src_filter/org_src_filter/" $FN
|
||||
"${SED}" -i "/org_src_filter/ s/^/default_src_filter = +<src\/*>\n/" $FN
|
||||
awk '/default_src_filter/ { sub("default_src_filter", "org_src_filter"); print "default_src_filter = +<src/*>"; } 1' $FN > $FN~ && mv $FN~ $FN
|
||||
else
|
||||
git checkout $FN 2>/dev/null
|
||||
fi
|
||||
|
96
buildroot/bin/config.py
Executable file
96
buildroot/bin/config.py
Executable file
@@ -0,0 +1,96 @@
|
||||
'''
|
||||
config.py - Helper functions for config manipulation
|
||||
'''
|
||||
import re
|
||||
|
||||
FILES = ('Marlin/Configuration.h', 'Marlin/Configuration_adv.h')
|
||||
|
||||
def set(file_path, define_name, value):
|
||||
'''
|
||||
Replaces a define in a file with a new value.
|
||||
Returns True if the define was found and replaced, False otherwise.
|
||||
'''
|
||||
# Read the contents of the file
|
||||
with open(file_path, 'r') as f:
|
||||
content = f.readlines()
|
||||
|
||||
modified = False
|
||||
for i in range(len(content)):
|
||||
# Regex to match the desired pattern
|
||||
match = re.match(r'^(\s*)(/*)(\s*)(#define\s+{})\s+(.*)$'.format(re.escape(define_name)), content[i])
|
||||
if match:
|
||||
new_line = f"{match[1]}{match[3]}{match[4]} {value} // {match[5]}\n"
|
||||
content[i] = new_line
|
||||
modified = True
|
||||
|
||||
# Write the modified content back to the file only if changes were made
|
||||
if modified:
|
||||
with open(file_path, 'w') as f:
|
||||
f.writelines(content)
|
||||
return True
|
||||
|
||||
return False
|
||||
|
||||
def add(file_path, define_name, value=""):
|
||||
'''
|
||||
Insert a define on the first blank line in a file.
|
||||
Returns True if the define was found and replaced, False otherwise.
|
||||
'''
|
||||
with open(file_path, 'r') as f:
|
||||
content = f.readlines()
|
||||
|
||||
# Prepend a space to the value if it's not empty
|
||||
if value != "":
|
||||
value = " " + value
|
||||
|
||||
# Find the first blank line to insert the new define
|
||||
for i in range(len(content)):
|
||||
if content[i].strip() == '':
|
||||
# Insert the define at the first blank line
|
||||
content.insert(i, f"#define {define_name}{value}\n")
|
||||
break
|
||||
else:
|
||||
# If no blank line is found, append to the end
|
||||
content.append(f"#define {define_name}{value}\n")
|
||||
|
||||
with open(file_path, 'w') as f:
|
||||
f.writelines(content)
|
||||
|
||||
def enable(file_path, define_name, enable=True):
|
||||
'''
|
||||
Uncomment or comment the named defines in the given file path.
|
||||
Returns True if the define was found, False otherwise.
|
||||
'''
|
||||
# Read the contents of the file
|
||||
with open(file_path, 'r') as f:
|
||||
content = f.readlines()
|
||||
|
||||
# Prepare the regex
|
||||
regex = re.compile(r'^(\s*)(/*)(\s*)(#define\s+{}\b.*?)( *//.*)?$'.format(re.escape(define_name)))
|
||||
|
||||
# Find the define in the file and uncomment or comment it
|
||||
found = False
|
||||
modified = False
|
||||
for i in range(len(content)):
|
||||
match = regex.match(content[i])
|
||||
if not match: continue
|
||||
found = True
|
||||
if enable:
|
||||
if match[2]:
|
||||
modified = True
|
||||
comment = '' if match[5] is None else ' ' + match[5]
|
||||
content[i] = f"{match[1]}{match[3]}{match[4]}{comment}\n"
|
||||
else:
|
||||
if not match[2]:
|
||||
modified = True
|
||||
comment = '' if match[5] is None else match[5]
|
||||
if comment.startswith(' '): comment = comment[2:]
|
||||
content[i] = f"{match[1]}//{match[3]}{match[4]}{comment}\n"
|
||||
break
|
||||
|
||||
# Write the modified content back to the file only if changes were made
|
||||
if modified:
|
||||
with open(file_path, 'w') as f:
|
||||
f.writelines(content)
|
||||
|
||||
return found
|
@@ -19,6 +19,7 @@ VERSION="$(git -C "${DIR}" describe --tags --first-parent 2>/dev/null || true)"
|
||||
STRING_DISTRIBUTION_DATE="${STRING_DISTRIBUTION_DATE:-$(date '+%Y-%m-%d %H:%M')}"
|
||||
SHORT_BUILD_VERSION="${SHORT_BUILD_VERSION:-${BRANCH}}"
|
||||
DETAILED_BUILD_VERSION="${DETAILED_BUILD_VERSION:-${BRANCH}-${VERSION}}"
|
||||
PROTOCOL_VERSION="1.0"
|
||||
|
||||
# Gets some misc options from their defaults
|
||||
DEFAULT_MACHINE_UUID="${DEFAULT_MACHINE_UUID:-$(awk -F'"' \
|
||||
@@ -65,68 +66,52 @@ cat > "${WRITE_FILE}" <<EOF
|
||||
*/
|
||||
|
||||
/**
|
||||
* Marlin release version identifier
|
||||
*/
|
||||
#ifndef SHORT_BUILD_VERSION
|
||||
#define SHORT_BUILD_VERSION "${SHORT_BUILD_VERSION}"
|
||||
#endif
|
||||
* Marlin release version identifier
|
||||
*/
|
||||
#define SHORT_BUILD_VERSION "${SHORT_BUILD_VERSION}"
|
||||
|
||||
/**
|
||||
* Verbose version identifier which should contain a reference to the location
|
||||
* from where the binary was downloaded or the source code was compiled.
|
||||
*/
|
||||
#ifndef DETAILED_BUILD_VERSION
|
||||
#define DETAILED_BUILD_VERSION "${DETAILED_BUILD_VERSION}"
|
||||
#endif
|
||||
* Verbose version identifier which should contain a reference to the location
|
||||
* from where the binary was downloaded or the source code was compiled.
|
||||
*/
|
||||
#define DETAILED_BUILD_VERSION "${DETAILED_BUILD_VERSION}"
|
||||
|
||||
/**
|
||||
* The STRING_DISTRIBUTION_DATE represents when the binary file was built,
|
||||
* here we define this default string as the date where the latest release
|
||||
* version was tagged.
|
||||
*/
|
||||
#ifndef STRING_DISTRIBUTION_DATE
|
||||
#define STRING_DISTRIBUTION_DATE "${STRING_DISTRIBUTION_DATE}"
|
||||
#endif
|
||||
* The STRING_DISTRIBUTION_DATE represents when the binary file was built,
|
||||
* here we define this default string as the date where the latest release
|
||||
* version was tagged.
|
||||
*/
|
||||
#define STRING_DISTRIBUTION_DATE "${STRING_DISTRIBUTION_DATE}"
|
||||
|
||||
/**
|
||||
* The protocol for communication to the host. Protocol indicates communication
|
||||
* standards such as the use of ASCII, "echo:" and "error:" line prefixes, etc.
|
||||
* (Other behaviors are given by the firmware version and capabilities report.)
|
||||
*/
|
||||
#ifndef PROTOCOL_VERSION
|
||||
#define PROTOCOL_VERSION "${PROTOCOL_VERSION}"
|
||||
#endif
|
||||
* The protocol for communication to the host. Protocol indicates communication
|
||||
* standards such as the use of ASCII, "echo:" and "error:" line prefixes, etc.
|
||||
* (Other behaviors are given by the firmware version and capabilities report.)
|
||||
*/
|
||||
#define PROTOCOL_VERSION "${PROTOCOL_VERSION}"
|
||||
|
||||
/**
|
||||
* Defines a generic printer name to be output to the LCD after booting Marlin.
|
||||
*/
|
||||
#ifndef MACHINE_NAME
|
||||
#define MACHINE_NAME "${MACHINE_NAME}"
|
||||
#endif
|
||||
* Defines a generic printer name to be output to the LCD after booting Marlin.
|
||||
*/
|
||||
#define MACHINE_NAME "${MACHINE_NAME}"
|
||||
|
||||
/**
|
||||
* The SOURCE_CODE_URL is the location where users will find the Marlin Source
|
||||
* Code which is installed on the device. In most cases —unless the manufacturer
|
||||
* has a distinct Github fork— the Source Code URL should just be the main
|
||||
* Marlin repository.
|
||||
*/
|
||||
#ifndef SOURCE_CODE_URL
|
||||
#define SOURCE_CODE_URL "${SOURCE_CODE_URL}"
|
||||
#endif
|
||||
* The SOURCE_CODE_URL is the location where users will find the Marlin Source
|
||||
* Code which is installed on the device. In most cases —unless the manufacturer
|
||||
* has a distinct Github fork— the Source Code URL should just be the main
|
||||
* Marlin repository.
|
||||
*/
|
||||
#define SOURCE_CODE_URL "${SOURCE_CODE_URL}"
|
||||
|
||||
/**
|
||||
* Default generic printer UUID.
|
||||
*/
|
||||
#ifndef DEFAULT_MACHINE_UUID
|
||||
#define DEFAULT_MACHINE_UUID "${DEFAULT_MACHINE_UUID}"
|
||||
#endif
|
||||
* Default generic printer UUID.
|
||||
*/
|
||||
#define DEFAULT_MACHINE_UUID "${DEFAULT_MACHINE_UUID}"
|
||||
|
||||
/**
|
||||
* The WEBSITE_URL is the location where users can get more information such as
|
||||
* documentation about a specific Marlin release.
|
||||
*/
|
||||
#ifndef WEBSITE_URL
|
||||
#define WEBSITE_URL "${WEBSITE_URL}"
|
||||
#endif
|
||||
* The WEBSITE_URL is the location where users can get more information such as
|
||||
* documentation about a specific Marlin release.
|
||||
*/
|
||||
#define WEBSITE_URL "${WEBSITE_URL}"
|
||||
|
||||
EOF
|
||||
|
@@ -8,7 +8,7 @@
|
||||
|
||||
[[ -d Marlin/src ]] || { echo "Please 'cd' to the Marlin repo root." ; exit 1 ; }
|
||||
|
||||
which pio || { echo "Make sure 'pio' is in your execution PATH." ; exit 1 ; }
|
||||
which pio >/dev/null || { echo "Make sure 'pio' is in your execution PATH." ; exit 1 ; }
|
||||
|
||||
perror() { echo -e "$0: \033[0;31m$1 -- $2\033[0m" ; }
|
||||
errout() { echo -e "\033[0;31m$1\033[0m" ; }
|
||||
@@ -41,7 +41,6 @@ env shortcuts: tree due esp lin lp8|lpc8 lp9|lpc9 m128 m256|mega stm|f1 f4 f7 s6
|
||||
TESTPATH=buildroot/tests
|
||||
|
||||
STATE_FILE="./.pio/.mftestrc"
|
||||
SED=$(which gsed sed | head -n1)
|
||||
|
||||
shopt -s extglob nocasematch
|
||||
|
||||
@@ -74,7 +73,7 @@ while getopts 'abdhmrsuvyn:t:-:' OFLAG; do
|
||||
u) AUTO_BUILD=2 ; bugout "Auto-Upload target..." ;;
|
||||
v) DEBUG=1 ; bugout "Debug ON" ;;
|
||||
y) BUILD_YES='Y' ; bugout "Build will initiate..." ;;
|
||||
-) IFS="=" read -r ONAM OVAL <<< "$OPTARG"
|
||||
-) ONAM="${OPTARG%%=*}" ; OVAL="${OPTARG#*=}"
|
||||
case "$ONAM" in
|
||||
help) [[ -z "$OVAL" ]] || perror "option can't take value $OVAL" $ONAM ; EXIT_USAGE=1 ;;
|
||||
autobuild) AUTO_BUILD=1 ; bugout "Auto-Build target..." ;;
|
||||
@@ -107,6 +106,7 @@ debug|verbose) DEBUG=1 ; bugout "Debug ON" ;;
|
||||
*) EXIT_USAGE=2 ;;
|
||||
esac
|
||||
done
|
||||
shift $((OPTIND - 1))
|
||||
|
||||
((EXIT_USAGE)) && { usage ; let EXIT_USAGE-- ; exit $EXIT_USAGE ; }
|
||||
|
||||
@@ -158,13 +158,19 @@ if ((AUTO_BUILD)); then
|
||||
*) SYS='uni' ;;
|
||||
esac
|
||||
echo ; echo -n "Auto " ; ((AUTO_BUILD == 2)) && echo "Upload..." || echo "Build..."
|
||||
MB=$( grep -E "^\s*#define MOTHERBOARD" Marlin/Configuration.h | awk '{ print $3 }' | $SED 's/BOARD_//;s/\r//' )
|
||||
|
||||
#
|
||||
# Get the MOTHERBOARD define value from the .h file and strip off the "BOARD_" prefix
|
||||
#
|
||||
ACODE='/^[[:space:]]*#define[[:space:]]MOTHERBOARD[[:space:]]/ { sub(/^BOARD_/, "", $3); print $3 }'
|
||||
MB=$(awk "$ACODE" Marlin/Configuration.h 2>/dev/null)
|
||||
[[ -z $MB ]] && MB=$(awk "$ACODE" Marlin/Config.h 2>/dev/null)
|
||||
[[ -z $MB ]] && { echo "Error - Can't read MOTHERBOARD setting." ; exit 1 ; }
|
||||
BLINE=$( grep -E "define\s+BOARD_$MB\b" Marlin/src/core/boards.h )
|
||||
BNUM=$( $SED -E 's/^.+BOARD_[^ ]+ +([0-9]+).+$/\1/' <<<"$BLINE" )
|
||||
BDESC=$( $SED -E 's/^.+\/\/ *(.+)$/\1/' <<<"$BLINE" )
|
||||
BNUM=$( sed -E 's/^.+BOARD_[^ ]+ +([0-9]+).+$/\1/' <<<"$BLINE" )
|
||||
BDESC=$( sed -E 's/^.+\/\/ *(.+)$/\1/' <<<"$BLINE" )
|
||||
[[ -z $BNUM ]] && { echo "Error - Can't find BOARD_$MB in core/boards.h." ; exit 1 ; }
|
||||
ENVS=( $( grep -EA1 "MB\(.*\b$MB\b.*\)" Marlin/src/pins/pins.h | grep -E "#include.+//.+(env|$SYS):[^ ]+" | grep -oE "(env|$SYS):[^ ]+" | $SED -E "s/(env|$SYS)://" ) )
|
||||
ENVS=( $( grep -EA1 "MB\(.*\b$MB\b.*\)" Marlin/src/pins/pins.h | grep -E "#include.+//.+(env|$SYS):[^ ]+" | grep -oE "(env|$SYS):[^ ]+" | sed -E "s/(env|$SYS)://" ) )
|
||||
[[ -z $ENVS ]] && { errout "Error - Can't find target(s) for $MB ($BNUM)." ; exit 1 ; }
|
||||
ECOUNT=${#ENVS[*]}
|
||||
|
||||
@@ -192,6 +198,9 @@ if ((AUTO_BUILD)); then
|
||||
[[ $CHOICE > $ECOUNT ]] && { echo "Environment selection out of range." ; exit 1 ; }
|
||||
fi
|
||||
TARGET="${ENVS[$CHOICE-1]}"
|
||||
if [[ $MB == 'SIMULATED' && $TARGET == 'linux_native' ]]; then
|
||||
TARGET="simulator_linux_release" # Skip the linux_native environment
|
||||
fi
|
||||
echo "Selected $TARGET"
|
||||
fi
|
||||
|
||||
@@ -270,7 +279,7 @@ if [[ $CHOICE == 0 ]]; then
|
||||
while IFS= read -r LINE
|
||||
do
|
||||
if [[ $LINE =~ $ISEXEC ]]; then
|
||||
DESC=$( "$SED" -E 's/^exec_test \$1 \$2 "([^"]+)".*$/\1/g' <<<"$LINE" )
|
||||
DESC=$( sed -E 's/^exec_test \$1 \$2 "([^"]+)".*$/\1/g' <<<"$LINE" )
|
||||
(( ++IND < 10 )) && echo -n " "
|
||||
echo " $IND) $DESC"
|
||||
fi
|
||||
@@ -315,7 +324,7 @@ echo "$OUT" | {
|
||||
((IND == CHOICE)) && {
|
||||
GOTX=1
|
||||
[[ -n $DL_DEFAULTS && $LINE =~ $ISRST ]] && LINE="use_example_configs"
|
||||
[[ $CMD == "" ]] && CMD="$LINE" || CMD=$( echo -e "$CMD$LINE" | $SED -e 's/\\//g' | $SED -E 's/ +/ /g' )
|
||||
[[ $CMD == "" ]] && CMD="$LINE" || CMD=$( echo -e "$CMD$LINE" | sed -e 's/\\//g' | sed -E 's/ +/ /g' )
|
||||
[[ $LINE =~ $ISCONT ]] || { echo "$CMD" ; eval "$CMD" ; CMD="" ; }
|
||||
}
|
||||
fi
|
||||
|
@@ -4,11 +4,9 @@
|
||||
#
|
||||
|
||||
# Check dependencies
|
||||
which curl 1>/dev/null 2>&1 || { echo "curl not found! Please install it."; exit ; }
|
||||
which git 1>/dev/null 2>&1 || { echo "git not found! Please install it."; exit ; }
|
||||
|
||||
SED=$(which gsed sed | head -n1)
|
||||
[[ -z "$SED" ]] && { echo "No sed found, please install sed" ; exit 1 ; }
|
||||
which curl &>/dev/null || { echo "curl not found! Please install it."; exit 1 ; }
|
||||
which git &>/dev/null || { echo "git not found! Please install it."; exit 1 ; }
|
||||
which sed &>/dev/null || { echo "sed not found! Please install it."; exit 1 ; }
|
||||
|
||||
OPEN=$( which gnome-open xdg-open open | head -n1 )
|
||||
|
||||
|
@@ -1,3 +1,11 @@
|
||||
#!/usr/bin/env bash
|
||||
#!/usr/bin/env python
|
||||
|
||||
eval "echo '#define ${@}' | cat - Marlin/Configuration.h > temp && mv temp Marlin/Configuration.h"
|
||||
import sys, config
|
||||
|
||||
def main():
|
||||
args = sys.argv[1:]
|
||||
for name in args:
|
||||
config.add(config.FILES[0], name)
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
||||
|
@@ -1,15 +1,21 @@
|
||||
#!/usr/bin/env bash
|
||||
#!/usr/bin/env python
|
||||
|
||||
# exit on first failure
|
||||
set -e
|
||||
import sys, os,config
|
||||
|
||||
SED=$(which gsed sed | head -n1)
|
||||
def main():
|
||||
args = sys.argv[1:]
|
||||
|
||||
for opt in "$@" ; do
|
||||
DID=0 ; FOUND=0
|
||||
for FN in Configuration Configuration_adv; do
|
||||
"${SED}" -i "/^\(\s*\)\(#define\s\+${opt}\b\s\?\)\(\s\s\)\?/{s//\1\/\/\2/;h};\${x;/./{x;q0};x;q9}" Marlin/$FN.h && DID=1
|
||||
((DID||FOUND)) || { grep -E "^\s*//\s*#define\s+${opt}\b" Marlin/$FN.h >/dev/null && FOUND=1 ; }
|
||||
done
|
||||
((DID||FOUND)) || (echo "ERROR: $(basename $0) Can't find ${opt}" >&2 && exit 9)
|
||||
done
|
||||
for name in args:
|
||||
changed = False
|
||||
|
||||
for file in config.FILES:
|
||||
if os.path.exists(file):
|
||||
if config.enable(file, name, False):
|
||||
changed = True
|
||||
|
||||
if not changed:
|
||||
print(f"ERROR: Can't find {name}")
|
||||
exit(1)
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
||||
|
@@ -1,15 +1,21 @@
|
||||
#!/usr/bin/env bash
|
||||
#!/usr/bin/env python
|
||||
|
||||
# exit on first failure
|
||||
set -e
|
||||
import sys, os,config
|
||||
|
||||
SED=$(which gsed sed | head -n1)
|
||||
def main():
|
||||
args = sys.argv[1:]
|
||||
|
||||
for opt in "$@" ; do
|
||||
DID=0 ; FOUND=0
|
||||
for FN in Configuration Configuration_adv; do
|
||||
"${SED}" -i "/^\(\s*\)\/\/\(\s*\)\(#define\s\+${opt}\b\)\( \?\)/{s//\1\2\3\4\4\4/;h};\${x;/./{x;q0};x;q9}" Marlin/$FN.h && DID=1
|
||||
((DID||FOUND)) || { grep -E "^\s*#define\s+${opt}\b" Marlin/$FN.h >/dev/null && FOUND=1 ; }
|
||||
done
|
||||
((DID||FOUND)) || (echo "ERROR: $(basename $0) Can't find ${opt}" >&2 && exit 9)
|
||||
done
|
||||
for name in args:
|
||||
changed = False
|
||||
|
||||
for file in config.FILES:
|
||||
if os.path.exists(file):
|
||||
if config.enable(file, name):
|
||||
changed = True
|
||||
|
||||
if not changed:
|
||||
print(f"ERROR: Can't find {name}")
|
||||
exit(1)
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
||||
|
@@ -23,8 +23,8 @@ esac
|
||||
|
||||
while [[ $# > 0 ]]; do
|
||||
DID=0
|
||||
for FN in Configuration Configuration_adv; do
|
||||
FOUND=$( grep -HEn "^\s*${COMM}#define\s+[A-Z0-9_]*${1}" "Marlin/$FN.h" 2>/dev/null )
|
||||
for FN in Marlin/Configuration.h Marlin/Configuration_adv.h; do
|
||||
FOUND=$( grep -HEn "^\s*${COMM}#define\s+[A-Z0-9_]*${1}" $FN 2>/dev/null )
|
||||
[[ -n "$FOUND" ]] && { echo "$FOUND" ; DID=1 ; }
|
||||
done
|
||||
((DID)) || { echo "ERROR: ${MYNAME} - No ${TYPE}match for ${1}" ; exit 9; }
|
||||
|
@@ -1,17 +1,25 @@
|
||||
#!/usr/bin/env bash
|
||||
#!/usr/bin/env python
|
||||
|
||||
# exit on first failure
|
||||
set -e
|
||||
import sys, os, config
|
||||
|
||||
SED=$(which gsed sed | head -n1)
|
||||
def main():
|
||||
args = sys.argv[1:]
|
||||
if len(args) % 2 != 0:
|
||||
print("ERROR: Please provide pairs of <name> <value>")
|
||||
return
|
||||
|
||||
while [[ $# > 1 ]]; do
|
||||
DID=0
|
||||
for FN in Configuration Configuration_adv; do
|
||||
"${SED}" -i "/^\(\s*\)\/*\s*\(#define\s\+${1}\b\) *\(.*\)$/{s//\1\2 ${2} \/\/ \3/;h};\${x;/./{x;q0};x;q9}" Marlin/$FN.h && DID=1
|
||||
done
|
||||
((DID)) ||
|
||||
eval "echo '#define ${1} ${2}' >>Marlin/Configuration.h" ||
|
||||
(echo "ERROR: opt_set Can't set or add ${1}" >&2 && exit 9)
|
||||
shift 2
|
||||
done
|
||||
for i in range(0, len(args), 2):
|
||||
name = args[i]
|
||||
value = args[i + 1]
|
||||
changed = False
|
||||
|
||||
for file in config.FILES:
|
||||
if os.path.exists(file):
|
||||
if config.set(file, name, value):
|
||||
changed = True
|
||||
|
||||
if not changed:
|
||||
config.add(config.FILES[0], name, value)
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
||||
|
@@ -1,16 +0,0 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
IFS='/' read -r -a PINPATH <<< "$1"
|
||||
DIR=${PINPATH[0]}
|
||||
NAM=${PINPATH[1]}
|
||||
|
||||
SED=$(which gsed sed | head -n1)
|
||||
|
||||
shift
|
||||
while [[ $# > 1 ]]; do
|
||||
PIN=$1 ; VAL=$2
|
||||
FOUT="${DIR}/pins_${NAM}.h"
|
||||
eval "${SED} -i '/^[[:blank:]]*\(\/\/\)*[[:blank:]]*\(#define \+${PIN}\b\).*$/{s//\2 ${VAL}/;h};\${x;/./{x;q0};x;q9}' Marlin/src/pins/${FOUT}" ||
|
||||
(echo "ERROR: pins_set Can't find ${PIN} in ${FOUT}" >&2 && exit 9)
|
||||
shift 2
|
||||
done
|
@@ -7,5 +7,6 @@ if [[ $1 == '-d' || $1 == '--default' ]]; then
|
||||
else
|
||||
git checkout Marlin/Configuration.h 2>/dev/null
|
||||
git checkout Marlin/Configuration_adv.h 2>/dev/null
|
||||
git checkout Marlin/src/pins/ramps/pins_RAMPS.h 2>/dev/null
|
||||
git checkout Marlin/config.ini 2>/dev/null
|
||||
git checkout Marlin/src/pins/*/pins_*.h 2>/dev/null
|
||||
fi
|
||||
|
@@ -7,7 +7,7 @@ TMPDIR=`mktemp -d`
|
||||
HERE=`dirname "$0"`
|
||||
|
||||
# Reformat a single file to tmp/
|
||||
if uncrustify -l CPP -c "$HERE/../share/extras/uncrustify.cfg" -f "$1" >$TMPDIR/uncrustify.out ; then
|
||||
if uncrustify -l CPP -c "$HERE/../share/uncrustify/uncrustify.cfg" -f "$1" >$TMPDIR/uncrustify.out ; then
|
||||
cp "$TMPDIR/uncrustify.out" "$1" ; # Replace the original file
|
||||
else
|
||||
echo "Something went wrong with uncrustify."
|
||||
|
@@ -31,7 +31,6 @@ def enabled_defines(filepath):
|
||||
our crude scraping method and the actual compiler output.
|
||||
We end up with the actual configured state,
|
||||
better than what the config files say. You can then use the
|
||||
a decent reflection of all enabled options that (probably) came from
|
||||
resulting config.ini to produce more exact configuration files.
|
||||
'''
|
||||
outdict = {}
|
||||
@@ -188,7 +187,7 @@ def compute_build_signature(env):
|
||||
|
||||
ini_fmt = '{0:40} = {1}'
|
||||
ext_fmt = '{0:40} {1}'
|
||||
ignore = ('CONFIGURATION_H_VERSION', 'CONFIGURATION_ADV_H_VERSION', 'CONFIG_EXPORT')
|
||||
ignore = ('CONFIGURATION_H_VERSION', 'CONFIGURATION_ADV_H_VERSION', 'CONFIG_EXAMPLES_DIR', 'CONFIG_EXPORT')
|
||||
|
||||
if extended_dump:
|
||||
# Extended export will dump config options by section
|
||||
|
@@ -0,0 +1,337 @@
|
||||
/*
|
||||
pins_arduino.h - Pin definition functions for mega1281
|
||||
|
||||
Originally part of Arduino
|
||||
Copyright (c) 2007 David A. Mellis
|
||||
|
||||
Modifications for mega1281 by Lubomir Rintel <lkundrak@v3.sk>
|
||||
and Minitronics: <https://reprap.org/wiki/File:MinitronicsArduinoAddon.zip>
|
||||
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2.1 of the License, or (at your option) any later version.
|
||||
|
||||
This library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General
|
||||
Public License along with this library; if not, write to the
|
||||
Free Software Foundation, Inc., 59 Temple Place, Suite 330,
|
||||
Boston, MA 02111-1307 USA
|
||||
*/
|
||||
|
||||
#ifndef Pins_Arduino_h
|
||||
#define Pins_Arduino_h
|
||||
|
||||
#include <avr/pgmspace.h>
|
||||
|
||||
#define NUM_DIGITAL_PINS 53
|
||||
#define NUM_ANALOG_INPUTS 8
|
||||
#define analogInputToDigitalPin(p) ((p < 16) ? (p) + 54 : -1)
|
||||
#define digitalPinHasPWM(p) (((p) >= 2 && (p) <= 13) || ((p) >= 44 && (p)<= 46))
|
||||
|
||||
#define PIN_SPI_SS (9)
|
||||
#define PIN_SPI_MOSI (11)
|
||||
#define PIN_SPI_MISO (12)
|
||||
#define PIN_SPI_SCK (10)
|
||||
|
||||
static const uint8_t SS = PIN_SPI_SS;
|
||||
static const uint8_t MOSI = PIN_SPI_MOSI;
|
||||
static const uint8_t MISO = PIN_SPI_MISO;
|
||||
static const uint8_t SCK = PIN_SPI_SCK;
|
||||
|
||||
#define PIN_WIRE_SDA (20)
|
||||
#define PIN_WIRE_SCL (21)
|
||||
|
||||
static const uint8_t SDA = PIN_WIRE_SDA;
|
||||
static const uint8_t SCL = PIN_WIRE_SCL;
|
||||
|
||||
#define LED_BUILTIN 46
|
||||
|
||||
#define PIN_A0 (46)
|
||||
#define PIN_A1 (47)
|
||||
#define PIN_A2 (48)
|
||||
#define PIN_A3 (49)
|
||||
#define PIN_A4 (50)
|
||||
#define PIN_A5 (51)
|
||||
#define PIN_A6 (52)
|
||||
#define PIN_A7 (53)
|
||||
|
||||
static const uint8_t A0 = PIN_A0;
|
||||
static const uint8_t A1 = PIN_A1;
|
||||
static const uint8_t A2 = PIN_A2;
|
||||
static const uint8_t A3 = PIN_A3;
|
||||
static const uint8_t A4 = PIN_A4;
|
||||
static const uint8_t A5 = PIN_A5;
|
||||
static const uint8_t A6 = PIN_A6;
|
||||
static const uint8_t A7 = PIN_A7;
|
||||
|
||||
// A majority of the pins are NOT PCINTs, SO BE WARNED (i.e. you cannot use them as receive pins)
|
||||
// Only pins available for RECEIVE (TRANSMIT can be on any pin):
|
||||
// (I've deliberately left out pin mapping to the Hardware USARTs - seems senseless to me)
|
||||
// Pins: 10, 11, 12, 13, 50, 51, 52, 53, 62, 63, 64, 65, 66, 67, 68, 69
|
||||
|
||||
#define digitalPinToPCICR(p) ( (((p) >= 10) && ((p) <= 13)) || \
|
||||
(((p) >= 50) && ((p) <= 53)) || \
|
||||
(((p) >= 62) && ((p) <= 69)) ? (&PCICR) : ((uint8_t *)0) )
|
||||
|
||||
#define digitalPinToPCICRbit(p) ( (((p) >= 10) && ((p) <= 13)) || (((p) >= 50) && ((p) <= 53)) ? 0 : \
|
||||
( (((p) >= 62) && ((p) <= 69)) ? 2 : \
|
||||
0 ) )
|
||||
|
||||
#define digitalPinToPCMSK(p) ( (((p) >= 10) && ((p) <= 13)) || (((p) >= 50) && ((p) <= 53)) ? (&PCMSK0) : \
|
||||
( (((p) >= 62) && ((p) <= 69)) ? (&PCMSK2) : \
|
||||
((uint8_t *)0) ) )
|
||||
|
||||
#define digitalPinToPCMSKbit(p) ( (((p) >= 10) && ((p) <= 13)) ? ((p) - 6) : \
|
||||
( ((p) == 50) ? 3 : \
|
||||
( ((p) == 51) ? 2 : \
|
||||
( ((p) == 52) ? 1 : \
|
||||
( ((p) == 53) ? 0 : \
|
||||
( (((p) >= 62) && ((p) <= 69)) ? ((p) - 62) : \
|
||||
0 ) ) ) ) ) )
|
||||
|
||||
#define digitalPinToInterrupt(p) ((p) == 2 ? 0 : ((p) == 3 ? 1 : ((p) >= 18 && (p) <= 21 ? 23 - (p) : NOT_AN_INTERRUPT)))
|
||||
|
||||
#ifdef ARDUINO_MAIN
|
||||
|
||||
const uint16_t PROGMEM port_to_mode_PGM[] = {
|
||||
NOT_A_PORT,
|
||||
(uint16_t) &DDRA,
|
||||
(uint16_t) &DDRB,
|
||||
(uint16_t) &DDRC,
|
||||
(uint16_t) &DDRD,
|
||||
(uint16_t) &DDRE,
|
||||
(uint16_t) &DDRF,
|
||||
(uint16_t) &DDRG,
|
||||
};
|
||||
|
||||
const uint16_t PROGMEM port_to_output_PGM[] = {
|
||||
NOT_A_PORT,
|
||||
(uint16_t) &PORTA,
|
||||
(uint16_t) &PORTB,
|
||||
(uint16_t) &PORTC,
|
||||
(uint16_t) &PORTD,
|
||||
(uint16_t) &PORTE,
|
||||
(uint16_t) &PORTF,
|
||||
(uint16_t) &PORTG,
|
||||
};
|
||||
|
||||
const uint16_t PROGMEM port_to_input_PGM[] = {
|
||||
NOT_A_PIN,
|
||||
(uint16_t) &PINA,
|
||||
(uint16_t) &PINB,
|
||||
(uint16_t) &PINC,
|
||||
(uint16_t) &PIND,
|
||||
(uint16_t) &PINE,
|
||||
(uint16_t) &PINF,
|
||||
(uint16_t) &PING,
|
||||
};
|
||||
|
||||
const uint8_t PROGMEM digital_pin_to_port_PGM[] = {
|
||||
// PORTLIST
|
||||
// -------------------------------------------
|
||||
PE , // PE 0 ** 0 ** USART0_RX
|
||||
PE , // PE 1 ** 1 ** USART0_TX
|
||||
PE , // PE 4 ** 2 ** PWM0
|
||||
PE , // PE 5 ** 3 ** PWM1
|
||||
PG , // PG 5 ** 4 ** PWM2
|
||||
PE , // PE 3 ** 5 ** PWM3
|
||||
PB , // PB 4 ** 6 ** PWM4
|
||||
PB , // PB 5 ** 7 ** PWM5
|
||||
PB , // PB 6 ** 8 ** PWM6
|
||||
PB , // PB 7 ** 9 ** PWM7
|
||||
PB , // PB 1 ** 10 ** SPI_SCK
|
||||
PB , // PB 2 ** 11 ** SPI_MOSI
|
||||
PB , // PB 3 ** 12 ** SPI_MISO
|
||||
PE , // PE 2 ** 13 ** D13
|
||||
PE , // PE 6 ** 14 ** D14
|
||||
PE , // PE 7 ** 15 ** D15
|
||||
PB , // PB 0 ** 16 ** SPI_SS
|
||||
PD , // PD 0 ** 17 ** I2C_SCL
|
||||
PD , // PD 1 ** 18 ** I2C_SDA
|
||||
PD , // PD 2 ** 19 ** D19
|
||||
PD , // PD 3 ** 20 ** D20
|
||||
PD , // PD 4 ** 21 ** D21
|
||||
PD , // PD 5 ** 22 ** D22
|
||||
PD , // PD 6 ** 23 ** D23
|
||||
PD , // PD 7 ** 24 ** D24
|
||||
PG , // PG 0 ** 25 ** D25
|
||||
PG , // PG 1 ** 26 ** D26
|
||||
PG , // PG 2 ** 27 ** D27
|
||||
PG , // PG 3 ** 28 ** D28
|
||||
PG , // PG 4 ** 29 ** D29
|
||||
PC , // PC 0 ** 30 ** D30
|
||||
PC , // PC 1 ** 31 ** D31
|
||||
PC , // PC 2 ** 32 ** D32
|
||||
PC , // PC 3 ** 33 ** D33
|
||||
PC , // PC 4 ** 34 ** D34
|
||||
PC , // PC 5 ** 35 ** D35
|
||||
PC , // PC 6 ** 36 ** D36
|
||||
PC , // PC 7 ** 37 ** D37
|
||||
PA , // PA 0 ** 38 ** D38
|
||||
PA , // PA 1 ** 39 ** D39
|
||||
PA , // PA 2 ** 40 ** D40
|
||||
PA , // PA 3 ** 41 ** D41
|
||||
PA , // PA 4 ** 42 ** D42
|
||||
PA , // PA 5 ** 43 ** D43
|
||||
PA , // PA 6 ** 44 ** D44
|
||||
PA , // PA 7 ** 45 ** D45
|
||||
PF , // PF 0 ** 46 ** A0
|
||||
PF , // PF 1 ** 47 ** A1
|
||||
PF , // PF 2 ** 48 ** A2
|
||||
PF , // PF 3 ** 49 ** A3
|
||||
PF , // PF 4 ** 50 ** A4
|
||||
PF , // PF 5 ** 51 ** A5
|
||||
PF , // PF 6 ** 52 ** A6
|
||||
PF , // PF 7 ** 53 ** A7
|
||||
};
|
||||
|
||||
const uint8_t PROGMEM digital_pin_to_bit_mask_PGM[] = {
|
||||
// PIN IN PORT
|
||||
// -------------------------------------------
|
||||
|
||||
_BV( 0 ) , // PE 0 ** 0 ** USART0_RX
|
||||
_BV( 1 ) , // PE 1 ** 1 ** USART0_TX
|
||||
_BV( 4 ) , // PE 4 ** 2 ** PWM0
|
||||
_BV( 5 ) , // PE 5 ** 3 ** PWM1
|
||||
_BV( 5 ) , // PG 5 ** 4 ** PWM2
|
||||
_BV( 3 ) , // PE 3 ** 5 ** PWM3
|
||||
_BV( 4 ) , // PB 4 ** 6 ** PWM4
|
||||
_BV( 5 ) , // PB 5 ** 7 ** PWM5
|
||||
_BV( 6 ) , // PB 6 ** 8 ** PWM6
|
||||
_BV( 7 ) , // PB 7 ** 9 ** PWM7
|
||||
_BV( 1 ) , // PB 1 ** 10 ** SPI_SCK
|
||||
_BV( 2 ) , // PB 2 ** 11 ** SPI_MOSI
|
||||
_BV( 3 ) , // PB 3 ** 12 ** SPI_MISO
|
||||
_BV( 2 ) , // PE 2 ** 13 ** D13
|
||||
_BV( 6 ) , // PE 6 ** 14 ** D14
|
||||
_BV( 7 ) , // PE 7 ** 15 ** D15
|
||||
_BV( 0 ) , // PB 0 ** 16 ** SPI_SS
|
||||
_BV( 0 ) , // PD 0 ** 17 ** I2C_SCL
|
||||
_BV( 1 ) , // PD 1 ** 18 ** I2C_SDA
|
||||
_BV( 2 ) , // PD 2 ** 19 ** D19
|
||||
_BV( 3 ) , // PD 3 ** 20 ** D20
|
||||
_BV( 4 ) , // PD 4 ** 21 ** D21
|
||||
_BV( 5 ) , // PA 5 ** 22 ** D22
|
||||
_BV( 6 ) , // PA 6 ** 23 ** D23
|
||||
_BV( 7 ) , // PA 7 ** 24 ** D24
|
||||
_BV( 0 ) , // PG 0 ** 25 ** D25
|
||||
_BV( 1 ) , // PG 1 ** 26 ** D26
|
||||
_BV( 2 ) , // PG 2 ** 27 ** D27
|
||||
_BV( 3 ) , // PG 3 ** 28 ** D28
|
||||
_BV( 4 ) , // PG 4 ** 29 ** D29
|
||||
_BV( 0 ) , // PC 0 ** 30 ** D30
|
||||
_BV( 1 ) , // PC 1 ** 31 ** D31
|
||||
_BV( 2 ) , // PC 2 ** 32 ** D32
|
||||
_BV( 3 ) , // PC 3 ** 33 ** D33
|
||||
_BV( 4 ) , // PC 4 ** 34 ** D34
|
||||
_BV( 5 ) , // PC 5 ** 35 ** D35
|
||||
_BV( 6 ) , // PC 6 ** 36 ** D36
|
||||
_BV( 7 ) , // PC 7 ** 37 ** D37
|
||||
_BV( 0 ) , // PA 0 ** 38 ** D38
|
||||
_BV( 1 ) , // PA 1 ** 39 ** D39
|
||||
_BV( 2 ) , // PA 2 ** 40 ** D40
|
||||
_BV( 3 ) , // PA 3 ** 41 ** D41
|
||||
_BV( 4 ) , // PA 4 ** 42 ** D42
|
||||
_BV( 5 ) , // PA 5 ** 43 ** D43
|
||||
_BV( 6 ) , // PA 6 ** 44 ** D44
|
||||
_BV( 7 ) , // PA 7 ** 45 ** D45
|
||||
_BV( 0 ) , // PF 0 ** 46 ** A0
|
||||
_BV( 1 ) , // PF 1 ** 47 ** A1
|
||||
_BV( 2 ) , // PF 2 ** 48 ** A2
|
||||
_BV( 3 ) , // PF 3 ** 49 ** A3
|
||||
_BV( 4 ) , // PF 4 ** 50 ** A4
|
||||
_BV( 5 ) , // PF 5 ** 51 ** A5
|
||||
_BV( 6 ) , // PF 6 ** 52 ** A6
|
||||
_BV( 7 ) , // PF 7 ** 53 ** A7
|
||||
};
|
||||
|
||||
const uint8_t PROGMEM digital_pin_to_timer_PGM[] = {
|
||||
// TIMERS
|
||||
// -------------------------------------------
|
||||
NOT_ON_TIMER , // PE 0 ** 0 ** USART0_RX
|
||||
NOT_ON_TIMER , // PE 1 ** 1 ** USART0_TX
|
||||
TIMER3B , // PE 4 ** 2 ** PWM0
|
||||
TIMER3C , // PE 5 ** 3 ** PWM1
|
||||
TIMER0B , // PG 5 ** 4 ** PWM2
|
||||
TIMER3A , // PE 3 ** 5 ** PWM3
|
||||
TIMER2A , // PB 4 ** 6 ** PWM4
|
||||
TIMER1A , // PB 5 ** 7 ** PWM5
|
||||
TIMER1B , // PB 6 ** 8 ** PWM6
|
||||
TIMER0A , // PB 7 ** 9 ** PWM7
|
||||
NOT_ON_TIMER , // PB 1 ** 10 ** SPI_SCK
|
||||
NOT_ON_TIMER , // PB 2 ** 11 ** SPI_MOSI
|
||||
NOT_ON_TIMER , // PB 3 ** 12 ** SPI_MISO
|
||||
NOT_ON_TIMER , // PE 2 ** 13 ** D13
|
||||
NOT_ON_TIMER , // PE 6 ** 14 ** D14
|
||||
NOT_ON_TIMER , // PE 7 ** 15 ** D15
|
||||
NOT_ON_TIMER , // PB 0 ** 16 ** SPI_SS
|
||||
NOT_ON_TIMER , // PD 0 ** 17 ** I2C_SCL
|
||||
NOT_ON_TIMER , // PD 1 ** 18 ** I2C_SDA
|
||||
NOT_ON_TIMER , // PD 2 ** 19 ** D19
|
||||
NOT_ON_TIMER , // PD 3 ** 20 ** D20
|
||||
NOT_ON_TIMER , // PD 4 ** 21 ** D21
|
||||
NOT_ON_TIMER , // PA 5 ** 22 ** D22
|
||||
NOT_ON_TIMER , // PA 6 ** 23 ** D23
|
||||
NOT_ON_TIMER , // PA 7 ** 24 ** D24
|
||||
NOT_ON_TIMER , // PG 0 ** 25 ** D25
|
||||
NOT_ON_TIMER , // PG 1 ** 26 ** D26
|
||||
NOT_ON_TIMER , // PG 2 ** 27 ** D27
|
||||
NOT_ON_TIMER , // PG 3 ** 28 ** D28
|
||||
NOT_ON_TIMER , // PG 4 ** 29 ** D29
|
||||
NOT_ON_TIMER , // PC 0 ** 30 ** D30
|
||||
NOT_ON_TIMER , // PC 1 ** 31 ** D31
|
||||
NOT_ON_TIMER , // PC 2 ** 32 ** D32
|
||||
NOT_ON_TIMER , // PC 3 ** 33 ** D33
|
||||
NOT_ON_TIMER , // PC 4 ** 34 ** D34
|
||||
NOT_ON_TIMER , // PC 5 ** 35 ** D35
|
||||
NOT_ON_TIMER , // PC 6 ** 36 ** D36
|
||||
NOT_ON_TIMER , // PC 7 ** 37 ** D37
|
||||
NOT_ON_TIMER , // PA 0 ** 38 ** D38
|
||||
NOT_ON_TIMER , // PA 1 ** 39 ** D39
|
||||
NOT_ON_TIMER , // PA 2 ** 40 ** D40
|
||||
NOT_ON_TIMER , // PA 3 ** 41 ** D41
|
||||
NOT_ON_TIMER , // PA 4 ** 42 ** D42
|
||||
NOT_ON_TIMER , // PA 5 ** 43 ** D43
|
||||
NOT_ON_TIMER , // PA 6 ** 44 ** D44
|
||||
NOT_ON_TIMER , // PA 7 ** 45 ** D45
|
||||
NOT_ON_TIMER , // PF 0 ** 46 ** A0
|
||||
NOT_ON_TIMER , // PF 1 ** 47 ** A1
|
||||
NOT_ON_TIMER , // PF 2 ** 48 ** A2
|
||||
NOT_ON_TIMER , // PF 3 ** 49 ** A3
|
||||
NOT_ON_TIMER , // PF 4 ** 50 ** A4
|
||||
NOT_ON_TIMER , // PF 5 ** 51 ** A5
|
||||
NOT_ON_TIMER , // PF 6 ** 52 ** A6
|
||||
NOT_ON_TIMER , // PF 7 ** 53 ** A7
|
||||
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
// These serial port names are intended to allow libraries and architecture-neutral
|
||||
// sketches to automatically default to the correct port name for a particular type
|
||||
// of use. For example, a GPS module would normally connect to SERIAL_PORT_HARDWARE_OPEN,
|
||||
// the first hardware serial port whose RX/TX pins are not dedicated to another use.
|
||||
//
|
||||
// SERIAL_PORT_MONITOR Port which normally prints to the Arduino Serial Monitor
|
||||
//
|
||||
// SERIAL_PORT_USBVIRTUAL Port which is USB virtual serial
|
||||
//
|
||||
// SERIAL_PORT_LINUXBRIDGE Port which connects to a Linux system via Bridge library
|
||||
//
|
||||
// SERIAL_PORT_HARDWARE Hardware serial port, physical RX & TX pins.
|
||||
//
|
||||
// SERIAL_PORT_HARDWARE_OPEN Hardware serial ports which are open for use. Their RX & TX
|
||||
// pins are NOT connected to anything by default.
|
||||
#define SERIAL_PORT_MONITOR Serial
|
||||
#define SERIAL_PORT_HARDWARE Serial
|
||||
#define SERIAL_PORT_HARDWARE1 Serial1
|
||||
#define SERIAL_PORT_HARDWARE2 Serial2
|
||||
#define SERIAL_PORT_HARDWARE_OPEN Serial1
|
||||
#define SERIAL_PORT_HARDWARE_OPEN1 Serial2
|
||||
|
||||
#endif
|
@@ -20,7 +20,7 @@ cmake_minimum_required(VERSION 3.5)
|
||||
# and add the path to the module path #
|
||||
#====================================================================#
|
||||
|
||||
set(SCRIPT_BRANCH 1.0.2) #Set to wanted marlin-cmake release tag or branch
|
||||
set(SCRIPT_BRANCH 1.0.2) # Set to wanted marlin-cmake release tag or branch
|
||||
|
||||
if(NOT EXISTS ${CMAKE_CURRENT_LIST_DIR}/marlin-cmake)
|
||||
|
||||
@@ -88,7 +88,7 @@ file(WRITE "${CMAKE_CURRENT_LIST_DIR}/marlin-cmake/Platform/Arduino.cmake" "${NE
|
||||
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${CMAKE_CURRENT_LIST_DIR}/marlin-cmake/modules)
|
||||
|
||||
#====================================================================#
|
||||
# Custom path to Arduino SDK can be set here. #
|
||||
# Custom path to Arduino SDK can be set here #
|
||||
# It can also be set from command line. eg.: #
|
||||
# cmake .. -DARDUINO_SDK_PATH="/path/to/arduino-1.x.x" #
|
||||
#====================================================================#
|
||||
@@ -113,14 +113,14 @@ set(CMAKE_TOOLCHAIN_FILE ${CMAKE_CURRENT_LIST_DIR}/marlin-cmake/toolchain/Arduin
|
||||
# If you receive this error: #
|
||||
# 'Unknown CMake command "_cmake_record_install_prefix".' #
|
||||
# #
|
||||
# Go to the file in your CMake directory. #
|
||||
# Go to the file in your CMake directory #
|
||||
# #
|
||||
# For Windows: cmake\Modules\Platform\WindowsPaths.cmake #
|
||||
# For Linux: cmake/Modules/Platform/UnixPaths.cmake #
|
||||
# #
|
||||
# Comment out "_cmake_record_install_prefix()" #
|
||||
# - OR - #
|
||||
# Add "include(CMakeSystemSpecificInformation)" above the line. #
|
||||
# Add "include(CMakeSystemSpecificInformation)" above the line #
|
||||
# #
|
||||
#====================================================================#
|
||||
project(Marlin C CXX)
|
||||
|
@@ -1,69 +1,69 @@
|
||||
/*
|
||||
general font collections
|
||||
http://www.smashingmagazine.com/2007/11/08/40-excellent-freefonts-for-professional-design/
|
||||
http://techmagazine.ws/most-popular-free-quality-fonts/
|
||||
http://openfontlibrary.org/
|
||||
https://www.smashingmagazine.com/2007/11/08/40-excellent-freefonts-for-professional-design/
|
||||
https://techmagazine.ws/most-popular-free-quality-fonts/
|
||||
https://openfontlibrary.org/
|
||||
bitmap font collections
|
||||
http://www.orgdot.com/aliasfonts/ (includes links)
|
||||
http://www.04.jp.org/
|
||||
http://www.miniml.com
|
||||
http://www.fontspace.com/010bus
|
||||
https://www.orgdot.com/aliasfonts/ (includes links)
|
||||
https://www.04.jp.org/
|
||||
https://www.miniml.com
|
||||
https://www.fontspace.com/010bus
|
||||
|
||||
http://en.wikipedia.org/wiki/Unicode_typeface
|
||||
https://en.wikipedia.org/wiki/Unicode_typeface
|
||||
da könnten auch ein paar fonts dabei sein, die die m2tklib sonderzeichen beinhalten:
|
||||
Caslon Roman http://en.wikipedia.org/wiki/Caslon_Roman
|
||||
Charis Sil http://en.wikipedia.org/wiki/Charis_SIL
|
||||
DejaVu Sans http://en.wikipedia.org/wiki/DejaVu_fonts
|
||||
Doulos http://en.wikipedia.org/wiki/Doulos_SIL
|
||||
Free Serif http://en.wikipedia.org/wiki/FreeSerif http://ftp.gnu.org/gnu/freefont/
|
||||
Caslon Roman https://en.wikipedia.org/wiki/Caslon_Roman
|
||||
Charis Sil https://en.wikipedia.org/wiki/Charis_SIL
|
||||
DejaVu Sans https://en.wikipedia.org/wiki/DejaVu_fonts
|
||||
Doulos https://en.wikipedia.org/wiki/Doulos_SIL
|
||||
Free Serif https://en.wikipedia.org/wiki/FreeSerif https://ftp.gnu.org/gnu/freefont/
|
||||
--> keine box, aber es gibt pfeile/invertierte pfeile und kreise für m2tklib
|
||||
Gentium Plus ???? http://scripts.sil.org/cms/scripts/page.php?site_id=nrsi&id=Gentium_download#02b091ae
|
||||
Gentium Plus ???? https://scripts.sil.org/cms/scripts/page.php?site_id=nrsi&id=Gentium_download#02b091ae
|
||||
--> keine graphic
|
||||
GNU Unifont http://en.wikipedia.org/wiki/GNU_Unifont, http://unifoundry.com/unifont.html
|
||||
GNU Unifont https://en.wikipedia.org/wiki/GNU_Unifont, https://unifoundry.com/unifont.html
|
||||
|
||||
Titus cyberbit Basic http://en.wikipedia.org/wiki/TITUS_Cyberbit_Basic
|
||||
Titus cyberbit Basic https://en.wikipedia.org/wiki/TITUS_Cyberbit_Basic
|
||||
|
||||
fonts
|
||||
Gentium
|
||||
http://openfontlibrary.org/font/gentium
|
||||
https://openfontlibrary.org/font/gentium
|
||||
license: OFL
|
||||
Old-Standard
|
||||
http://openfontlibrary.org/font/old-standard
|
||||
https://openfontlibrary.org/font/old-standard
|
||||
license: OFL
|
||||
Hanuman
|
||||
http://openfontlibrary.org/font/hanumanb
|
||||
https://openfontlibrary.org/font/hanumanb
|
||||
license: OFL
|
||||
FreeUniversal
|
||||
http://openfontlibrary.org/font/freeuniversal
|
||||
https://openfontlibrary.org/font/freeuniversal
|
||||
license: OFL
|
||||
FriendShip-Code <--- nicht so sicher...
|
||||
http://openfontlibrary.org/font/friendship-code
|
||||
https://openfontlibrary.org/font/friendship-code
|
||||
license: CC-BY-SA
|
||||
LinuxLibertine
|
||||
http://de.wikipedia.org/wiki/Linux_Libertine
|
||||
http://sourceforge.net/projects/linuxlibertine/files/linuxlibertine/5.1.3-2/
|
||||
https://de.wikipedia.org/wiki/Linux_Libertine
|
||||
https://sourceforge.net/projects/linuxlibertine/files/linuxlibertine/5.1.3-2/
|
||||
license: OFL
|
||||
DidactGothic
|
||||
source: http://openfontlibrary.org/
|
||||
source: https://openfontlibrary.org/
|
||||
judson
|
||||
source: http://openfontlibrary.org/
|
||||
source: https://openfontlibrary.org/
|
||||
unicons
|
||||
source: http://openfontlibrary.org/
|
||||
source: https://openfontlibrary.org/
|
||||
license: OFL
|
||||
suggested pt: 26, 30
|
||||
org_V01, fixed_V0
|
||||
source: http://www.orgdot.com/aliasfonts/
|
||||
source: https://www.orgdot.com/aliasfonts/
|
||||
license: open source, individual, cite required
|
||||
suggested pt: 8
|
||||
04b_03b.zip 04b_03.zip 04b_09.zip 04b_11.zip 04b_19.zip 04b_21.zip 04b_25.zip 04b_30.zip
|
||||
source: http://www.04.jp.org/
|
||||
source: https://www.04.jp.org/
|
||||
license: "Freeware: You may use them as you like"
|
||||
7px4bus
|
||||
source: http://www.fontspace.com/010bus
|
||||
source: https://www.fontspace.com/010bus
|
||||
license: Licensed as: Freeware, Commercial use allowed!
|
||||
suggested 7pt
|
||||
8pxbus
|
||||
source: http://www.fontspace.com/010bus
|
||||
source: https://www.fontspace.com/010bus
|
||||
license: Licensed as: Freeware, Commercial use allowed!
|
||||
suggested 8pt
|
||||
|
||||
@@ -1090,23 +1090,23 @@ void bdf_WriteC(const char *outname, const char *fontname) {
|
||||
|
||||
capital_ascent = bdf_capital_A_height > 0 ? bdf_capital_A_height : bdf_capital_1_height;
|
||||
|
||||
fprintf(out_fp, "/*\n");
|
||||
fprintf(out_fp, " Fontname: %s\n", bdf_font);
|
||||
fprintf(out_fp, " Copyright: %s\n", bdf_copyright);
|
||||
fprintf(out_fp, " Capital A Height: %d, '1' Height: %d\n", bdf_capital_A_height, bdf_capital_1_height);
|
||||
fprintf(out_fp, " Calculated Max Values w=%2d h=%2d x=%2d y=%2d dx=%2d dy=%2d ascent=%2d len=%2d\n",
|
||||
fprintf(out_fp, "/**\n");
|
||||
fprintf(out_fp, " * Fontname: %s\n", bdf_font);
|
||||
fprintf(out_fp, " * Copyright: %s\n", bdf_copyright);
|
||||
fprintf(out_fp, " * Capital A Height: %d, '1' Height: %d\n", bdf_capital_A_height, bdf_capital_1_height);
|
||||
fprintf(out_fp, " * Calculated Max Values w=%2d h=%2d x=%2d y=%2d dx=%2d dy=%2d ascent=%2d len=%2d\n",
|
||||
bdf_char_max_width, bdf_char_max_height, bdf_char_max_x, bdf_char_max_y, bdf_delta_max_x, bdf_delta_max_y,
|
||||
bdf_char_max_ascent, bdf_glyph_data_max_len);
|
||||
fprintf(out_fp, " Font Bounding box w=%2d h=%2d x=%2d y=%2d\n",
|
||||
fprintf(out_fp, " * Font Bounding box w=%2d h=%2d x=%2d y=%2d\n",
|
||||
bdf_font_width, bdf_font_height, bdf_font_x, bdf_font_y);
|
||||
fprintf(out_fp, " Calculated Min Values x=%2d y=%2d dx=%2d dy=%2d\n",
|
||||
fprintf(out_fp, " * Calculated Min Values x=%2d y=%2d dx=%2d dy=%2d\n",
|
||||
bdf_char_min_x, bdf_char_min_y, bdf_delta_min_x, bdf_delta_min_y);
|
||||
|
||||
fprintf(out_fp, " Pure Font ascent =%2d descent=%2d\n", capital_ascent, bdf_lower_g_descent);
|
||||
fprintf(out_fp, " X Font ascent =%2d descent=%2d\n", bdf_char_xascent, bdf_char_xdescent);
|
||||
fprintf(out_fp, " Max Font ascent =%2d descent=%2d\n", bdf_char_max_ascent, bdf_char_min_y);
|
||||
fprintf(out_fp, " * Pure Font ascent =%2d descent=%2d\n", capital_ascent, bdf_lower_g_descent);
|
||||
fprintf(out_fp, " * X Font ascent =%2d descent=%2d\n", bdf_char_xascent, bdf_char_xdescent);
|
||||
fprintf(out_fp, " * Max Font ascent =%2d descent=%2d\n", bdf_char_max_ascent, bdf_char_min_y);
|
||||
|
||||
fprintf(out_fp, "*/\n");
|
||||
fprintf(out_fp, " */\n");
|
||||
fprintf(out_fp, "const u8g_fntpgm_uint8_t %s[%d] U8G_FONT_SECTION(\"%s\") = {\n", fontname, data_pos, fontname);
|
||||
fprintf(out_fp, " ");
|
||||
data_Write(out_fp, " ");
|
||||
|
@@ -103,7 +103,7 @@ At this time, the font file `marlin-6x12-3.bdf` is used to generate the font dat
|
||||
|
||||
Documents related to the old version of the language engine:
|
||||
|
||||
- [Marlin Fonts Documentation](https://www.marlinfw.org/docs/development/fonts.html)
|
||||
- [Marlin Fonts Documentation](https://marlinfw.org/docs/development/fonts.html)
|
||||
- [Marlin LCD Language](https://marlinfw.org/docs/development/lcd_language.html)
|
||||
- [U8GLIB](https://github.com/olikraus/u8glib.git)
|
||||
- [UTF-8 for U8GLIB](https://github.com/yhfudev/u8glib-fontutf8.git)
|
||||
|
@@ -1,173 +0,0 @@
|
||||
#!/usr/bin/env bash
|
||||
#
|
||||
# mfconfig init source dest
|
||||
# mfconfig manual source dest
|
||||
#
|
||||
# The MarlinFirmware/Configurations layout could be broken up into branches,
|
||||
# but this makes management more complicated and requires more commits to
|
||||
# perform the same operation, so this uses a single branch with subfolders.
|
||||
#
|
||||
# init - Initialize the repo with a base commit and changes:
|
||||
# - Source will be an 'import' branch containing all current configs.
|
||||
# - Create an empty 'BASE' branch from 'init-repo'.
|
||||
# - Add Marlin config files, but reset all to defaults.
|
||||
# - Commit this so changes will be clear in following commits.
|
||||
# - Add changed Marlin config files and commit.
|
||||
#
|
||||
# manual - Manually import changes from the Marlin repo
|
||||
# - Replace 'default' configs with those from the Marlin repo.
|
||||
# - Wait for manual propagation to the rest of the configs.
|
||||
# - Run init with the given 'source' and 'dest'
|
||||
#
|
||||
|
||||
REPOHOME="`dirname ~/Projects/Maker/Firmware/.`"
|
||||
MARLINREPO="$REPOHOME/MarlinFirmware"
|
||||
CONFIGREPO="$REPOHOME/Configurations"
|
||||
|
||||
CEXA=config/examples
|
||||
CDEF=config/default
|
||||
BC=Configuration.h
|
||||
AC=Configuration_adv.h
|
||||
|
||||
COMMIT_STEPS=0
|
||||
|
||||
#cd "$CONFIGREPO" 2>/dev/null || { echo "Can't find Configurations repo!" ; exit 1; }
|
||||
|
||||
ACTION=${1:-init}
|
||||
IMPORT=${2:-"import-2.1.x"}
|
||||
EXPORT=${3:-"bugfix-2.1.x"}
|
||||
|
||||
echo -n "Doing grhh ... " ; grhh ; echo
|
||||
|
||||
if [[ $ACTION == "manual" ]]; then
|
||||
|
||||
#
|
||||
# Copy the latest default configs from MarlinFirmware/Marlin
|
||||
# or one of the import branches here, then use them to construct
|
||||
# a 'BASE' branch with only defaults as a starting point.
|
||||
#
|
||||
|
||||
echo "- Updating '$IMPORT' from Marlin..."
|
||||
|
||||
git checkout $IMPORT || exit
|
||||
|
||||
# Reset from the latest complete state
|
||||
#git reset --hard bugfix-2.1.x
|
||||
|
||||
cp "$MARLINREPO/Marlin/"Configuration*.h "$CDEF/"
|
||||
#git add . && git commit -m "Changes from Marlin ($(date '+%Y-%m-%d %H:%M'))."
|
||||
|
||||
echo "- Fix up the import branch and come back."
|
||||
|
||||
read -p "- Ready to init [y/N] ?" INIT_YES
|
||||
echo
|
||||
|
||||
[[ $INIT_YES == 'Y' || $INIT_YES == 'y' ]] || { echo "Done." ; exit ; }
|
||||
|
||||
ACTION='init'
|
||||
fi
|
||||
|
||||
if [[ $ACTION == "init" ]]; then
|
||||
#
|
||||
# Copy all configs from a source such as MarlinFirmware/Marlin
|
||||
# or one of the import branches here, then use them to construct
|
||||
# a 'BASE' branch with only defaults as a starting point.
|
||||
#
|
||||
|
||||
SED=$(which gsed sed | head -n1)
|
||||
|
||||
echo "- Initializing BASE branch..."
|
||||
|
||||
# Use the import branch as the source
|
||||
git checkout $IMPORT || exit
|
||||
|
||||
# Copy to a temporary location
|
||||
TEMP=$( mktemp -d ) ; cp -R config $TEMP
|
||||
|
||||
# Strip all #error lines
|
||||
IFS=$'\n'; set -f
|
||||
for fn in $( find $TEMP/config -type f -name "Configuration.h" ); do
|
||||
$SED -i~ -e "20,30{/#error/d}" "$fn"
|
||||
rm "$fn~"
|
||||
done
|
||||
unset IFS; set +f
|
||||
|
||||
# Make sure we're not on the 'BASE' branch...
|
||||
git checkout init-repo >/dev/null 2>&1 || exit
|
||||
|
||||
# Create 'BASE' as a copy of 'init-repo' (README, LICENSE, etc.)
|
||||
git branch -D BASE 2>/dev/null
|
||||
git checkout init-repo -b BASE || exit
|
||||
|
||||
# Copy all config files into place
|
||||
echo "- Copying all configs from fresh $IMPORT..."
|
||||
cp -R "$TEMP/config" .
|
||||
|
||||
# Delete anything that's not a Configuration file
|
||||
find config -type f \! -name "Configuration*" -exec rm "{}" \;
|
||||
|
||||
# DEBUG: Commit the original config files for comparison
|
||||
((COMMIT_STEPS)) && git add . >/dev/null && git commit -m "Commit for comparison" >/dev/null
|
||||
|
||||
# Init Cartesian/SCARA/TPARA configurations to default
|
||||
echo "- Initializing configs to default state..."
|
||||
|
||||
find "$CEXA" -name $BC -print0 \
|
||||
| while read -d $'\0' F ; do cp "$CDEF/$BC" "$F" ; done
|
||||
find "$CEXA" -name $AC -print0 \
|
||||
| while read -d $'\0' F ; do cp "$CDEF/$AC" "$F" ; done
|
||||
|
||||
# DEBUG: Commit the reset for review
|
||||
((COMMIT_STEPS)) && git add . >/dev/null && git commit -m "Reset configs..." >/dev/null
|
||||
|
||||
# Update the %VERSION% in the README.md file
|
||||
VERS=$( echo $EXPORT | $SED 's/release-//' )
|
||||
eval "${SED} -E -i~ -e 's/%VERSION%/$VERS/g' README.md"
|
||||
rm -f README.md~
|
||||
|
||||
# NOT DEBUGGING: Commit the 'BASE', ready for customizations
|
||||
((COMMIT_STEPS)) || git add . >/dev/null && git commit --amend --no-edit >/dev/null
|
||||
|
||||
# Create a new branch from 'BASE' for the final result
|
||||
echo "- Creating '$EXPORT' branch for the result..."
|
||||
git branch -D $EXPORT 2>/dev/null
|
||||
git checkout -b $EXPORT || exit
|
||||
|
||||
# Delete temporary branch
|
||||
git branch -D BASE 2>/dev/null
|
||||
|
||||
echo "- Applying example config customizations..."
|
||||
cp -R "$TEMP/config" .
|
||||
find config -type f \! -name "Configuration*" -exec rm "{}" \;
|
||||
|
||||
addpathlabels() {
|
||||
find config -name "Conf*.h" -print0 | while read -d $'\0' fn ; do
|
||||
fldr=$(dirname "$fn")
|
||||
blank_line=$(awk '/^\s*$/ {print NR; exit}' "$fn")
|
||||
$SED -i~ "${blank_line}i\\\n#define CONFIG_EXAMPLES_DIR \"$fldr\"" "$fn"
|
||||
rm -f "$fn~"
|
||||
done
|
||||
}
|
||||
|
||||
echo "- Adding path labels to all configs..."
|
||||
addpathlabels
|
||||
|
||||
git add . >/dev/null && git commit -m "Examples Customizations" >/dev/null
|
||||
|
||||
echo "- Copying extras from Marlin..."
|
||||
cp -R "$TEMP/config" .
|
||||
|
||||
# Apply labels again!
|
||||
addpathlabels
|
||||
|
||||
git add . >/dev/null && git commit -m "Examples Extras" >/dev/null
|
||||
|
||||
rm -rf $TEMP
|
||||
|
||||
git push -f --set-upstream upstream "$EXPORT"
|
||||
|
||||
else
|
||||
|
||||
echo "Usage: mfconfig init|manual|rebase"
|
||||
|
||||
fi
|
@@ -40,7 +40,6 @@ Modify Configuration.h / Configuration_adv.h:
|
||||
|
||||
Modify pins files:
|
||||
|
||||
pins_set ............. Set the value of a pin in a pins file
|
||||
pinsformat.js ........ Node.js script to format pins files
|
||||
pinsformat.py ........ Python script to format pins files
|
||||
|
||||
THIS
|
||||
|
@@ -9,7 +9,6 @@
|
||||
# so at every release be sure to create a dev- tag and publish it to origin.
|
||||
#
|
||||
|
||||
SED=$(which gsed sed | head -n1)
|
||||
SELF=`basename "$0"`
|
||||
DRYRUN=0
|
||||
|
||||
@@ -36,10 +35,10 @@ TMPF="$TMPDIR/tmp.txt"
|
||||
SCRF="$TMPDIR/update-$DEST.sh"
|
||||
|
||||
git checkout bugfix-2.1.x
|
||||
git log --pretty="[%h] %s" dev-$TAG1..$TAG2 | grep -v '\[cron\]' | $SED '1!G;h;$!d' >"$LOGB"
|
||||
git log --pretty="[%h] %s" dev-$TAG1..$TAG2 | grep -v '\[cron\]' | sed '1!G;h;$!d' >"$LOGB"
|
||||
|
||||
git checkout $DEST
|
||||
git log --pretty="[%h] %s" $TAG1..$TAG2 | $SED '1!G;h;$!d' >"$LOG2" || { echo "Can't find tag dev-$TAG1" ; exit 1 ; }
|
||||
git log --pretty="[%h] %s" $TAG1..$TAG2 | sed '1!G;h;$!d' >"$LOG2" || { echo "Can't find tag dev-$TAG1" ; exit 1 ; }
|
||||
|
||||
# Go through commit text from DEST removing all matches from the bugfix log
|
||||
|
||||
@@ -57,7 +56,7 @@ cat "$LOG2" | while read line; do
|
||||
#echo "... $PATT"
|
||||
[[ -n "$PATT" ]] && { grep -vE "$PATT" "$LOGB" >"$TMPF" ; cp "$TMPF" "$LOGB" ; }
|
||||
else
|
||||
PATT=$( $SED -E 's/^\[[0-9a-f]{10}\]( . )?(.+)$/\2/' <<<"$line" )
|
||||
PATT=$( sed -E 's/^\[[0-9a-f]{10}\]( . )?(.+)$/\2/' <<<"$line" )
|
||||
[[ -n "$PATT" ]] && { grep -v "$PATT" "$LOGB" >"$TMPF" ; cp "$TMPF" "$LOGB" ; }
|
||||
fi
|
||||
done
|
||||
|
@@ -1,6 +1,9 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<!-- Created with Inkscape (http://www.inkscape.org/) -->
|
||||
|
||||
<!--
|
||||
Graphic designed by Ahmnet Cem TURAN
|
||||
URL: https://github.com/ahmetcemturan
|
||||
License: CC-BY-NC-SA
|
||||
-->
|
||||
<svg
|
||||
xmlns:dc="http://purl.org/dc/elements/1.1/"
|
||||
xmlns:cc="http://creativecommons.org/ns#"
|
||||
@@ -19,10 +22,8 @@
|
||||
inkscape:export-filename="C:\Users\jbrazio\Desktop\marlin-old.png"
|
||||
inkscape:export-xdpi="27"
|
||||
inkscape:export-ydpi="27">
|
||||
<title
|
||||
id="title3362">Marlin Firmware</title>
|
||||
<defs
|
||||
id="defs3361" />
|
||||
<title id="title3362">Marlin Firmware</title>
|
||||
<defs id="defs3361" />
|
||||
<sodipodi:namedview
|
||||
id="base"
|
||||
pagecolor="#ffffff"
|
||||
@@ -41,66 +42,64 @@
|
||||
inkscape:window-x="365"
|
||||
inkscape:window-y="46"
|
||||
inkscape:window-maximized="0" />
|
||||
<metadata
|
||||
id="metadata3364">
|
||||
<rdf:RDF>
|
||||
<cc:Work
|
||||
rdf:about="">
|
||||
<dc:format>image/svg+xml</dc:format>
|
||||
<dc:type
|
||||
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
|
||||
<dc:title>Marlin Firmware</dc:title>
|
||||
<dc:creator>
|
||||
<cc:Agent>
|
||||
<dc:title>Ahmet Cem TURAN</dc:title>
|
||||
</cc:Agent>
|
||||
</dc:creator>
|
||||
<dc:rights>
|
||||
<cc:Agent>
|
||||
<dc:title>MarlinFirmware</dc:title>
|
||||
</cc:Agent>
|
||||
</dc:rights>
|
||||
<dc:publisher>
|
||||
<cc:Agent>
|
||||
<dc:title>João Brázio</dc:title>
|
||||
</cc:Agent>
|
||||
</dc:publisher>
|
||||
<dc:identifier>marlin-logo-old</dc:identifier>
|
||||
</cc:Work>
|
||||
</rdf:RDF>
|
||||
<metadata>
|
||||
<creator>Ahmnet Cem TURAN</creator>
|
||||
<url>https://github.com/ahmetcemturan</url>
|
||||
<license>CC-BY-NC-SA</license>
|
||||
</metadata>
|
||||
<g
|
||||
inkscape:label="Layer 1"
|
||||
inkscape:groupmode="layer"
|
||||
id="layer1"
|
||||
transform="translate(0,-308.26772)">
|
||||
<g
|
||||
id="g3335"
|
||||
transform="matrix(1.2688266,0,0,1.2688266,0.33525798,503.35041)">
|
||||
<path
|
||||
id="path3337"
|
||||
d="m 364.271,4.24 -312.9,0.26 -7,2.33 c -21.42,7.13 -38.03,25.09 -42.99,46.47 -1.37,5.89 -1.53,17.24 -1.29,88.98 0.28,81.931 0.29,82.24 2.5,88.74 6.46,18.97 21.811,34.33 40.7,40.74 l 8.08,2.739 360,0.28 c 330.609,0.25 360.609,0.14 367.5,-1.37 24.069,-5.26 42.26,-22.859 48.46,-46.869 1.22,-4.74 1.54,-12.301 1.54,-36.91 0,-30.881 -0.006,-185.553 -0.006,-185.553 0,0 -152.264,-0.097 -464.594,0.163 z m 388.85,76.75 68.75,69.771 -0.011,33.87 c -0.02,37.899 -0.5,41.85 -6.529,53.32 -6.57,12.51 -19.25,23.039 -32.92,27.329 l -7.04,2.22 -361.5,0 -361.5,0 -6.5,-2.34 c -17.34,-6.229 -30.4,-19.24 -36.22,-36.05 l -2.28,-6.61 0,-83 0,-83 2.31,-6.69 c 6.78,-19.62 24.62,-34.88 44.13,-37.75 3.061,-0.45 146.19,-0.82 318.061,-0.82 l 312.5,-0.01 68.749,69.76 z"
|
||||
inkscape:connector-curvature="0" />
|
||||
<path
|
||||
id="path3339"
|
||||
d="m 540.871,119.04 c 0,57.4 0.229,68.15 1.59,74.75 4.97,24.069 21.26,37.209 46.149,37.209 l 8.311,0 -0.271,-14.629 -0.279,-14.631 -5.421,-0.439 c -6.039,-0.48 -9.51,-1.961 -12.76,-5.45 -4.87,-5.229 -4.8,-4.19 -5.109,-76.1 l -0.3,-67.75 -15.96,0 -15.949,0 0,67.04 z"
|
||||
inkscape:connector-curvature="0" />
|
||||
<path
|
||||
id="path3341"
|
||||
d="m 96.871,61.58 c -16.21,4.25 -30.58,15.65 -37.42,29.66 -6.641,13.59 -6.58,12.86 -6.58,77.82 0,55.529 0.1,58.72 1.83,60.29 1.52,1.37 4.22,1.649 16,1.649 l 14.17,0 0.01,-58.75 c 0,-37.39 0.38,-60.1 1.04,-62.47 2.66,-9.58 13.22,-17.63 24.31,-18.52 12.82,-1.03 23.841,5.09 28.75,15.95 l 2.391,5.29 0.29,59.25 0.3,59.25 15.95,0 15.96,0 0,-57.819 c 0,-63.17 0.05,-63.81 5.819,-71.77 3.94,-5.44 11.851,-9.53 19.62,-10.16 12.36,-0.99 22.79,4.57 28.351,15.11 l 2.71,5.14 0.29,59.75 0.279,59.75 15.971,0 15.96,0 0,-59.34 c 0,-55.37 -0.13,-59.85 -1.931,-66.89 C 257.952,93.08 253.622,85.52 244.981,76.9 233.152,65.1 220.402,60 202.691,60 c -16.14,0 -27.949,4.52 -39.109,14.95 l -6.391,5.98 -2.18,-2.96 c -3.8,-5.14 -15.83,-12.79 -24.359,-15.48 -6.351,-2.01 -9.86,-2.479 -18.08,-2.42 -5.611,0.03 -12.67,0.71 -15.701,1.51 z"
|
||||
inkscape:connector-curvature="0" />
|
||||
<path
|
||||
id="path3343"
|
||||
d="m 612.891,61.7 c -1.91,0.99 -4.5,3.33 -5.75,5.2 -2.04,3.05 -2.27,4.59 -2.27,15.25 l 0,11.85 16,0 16,0 0,-10.53 c 0,-11.8 -1.051,-15.37 -5.881,-19.91 -4.029,-3.79 -12.659,-4.68 -18.099,-1.86 z"
|
||||
inkscape:connector-curvature="0" />
|
||||
<path
|
||||
id="path3345"
|
||||
d="m 314.871,106.34 c -10.95,3.26 -17.54,7.22 -26.09,15.66 -8.91,8.79 -14.74,19.339 -17.471,31.621 -2.46,11.06 -1.59,26.26 2.07,36.379 5.53,15.24 16.53,27.931 29.99,34.57 9.78,4.83 18.38,6.391 35.25,6.41 l 14.25,0.02 0,-15.379 0,-15.391 -13.25,-0.4 c -11.601,-0.359 -13.94,-0.729 -18.8,-2.97 -7.62,-3.521 -12.37,-7.97 -15.66,-14.68 -2.391,-4.86 -2.79,-6.9 -2.79,-14.181 0,-7.27 0.399,-9.319 2.78,-14.16 3.38,-6.889 9.229,-12.93 15.529,-16.029 6.66,-3.28 19.771,-3.28 25.98,0 6.12,3.24 11.99,9.49 15.06,16.04 l 2.65,5.649 0.3,35.75 0.29,35.75 44.96,0 44.95,0 0.02,-39.25 c 0.03,-44.39 -0.01,-44.18 7.84,-50.899 11.42,-9.78 29.91,-7.05 36.24,5.34 1.27,2.5 2.29,6.92 2.63,11.44 l 0.561,7.369 15.85,0 15.86,0 0,-6.84 c 0,-8.149 -2.98,-20.56 -6.771,-28.14 -5.63,-11.29 -18.86,-21.31 -32.32,-24.48 -7.54,-1.78 -22.6,-2 -30.109,-0.44 -14.79,3.06 -29.391,14.09 -35.601,26.9 -5.58,11.49 -6.199,15.83 -6.199,43.21 l 0,24.791 -13,0 -13,0 0,-20.34 c 0,-16.97 -0.33,-21.619 -1.97,-28.05 -5.82,-22.75 -23.29,-40.45 -45.49,-46.09 -9.088,-2.32 -25.309,-1.93 -34.539,0.82 z"
|
||||
inkscape:connector-curvature="0" />
|
||||
<path
|
||||
id="path3347"
|
||||
d="m 705.081,105.56 c -18.091,4.86 -31.98,18.26 -37.771,36.439 -1.439,4.5 -1.84,10.381 -2.189,32.25 l -0.44,26.75 -13.91,0 -13.899,0 0,-47 0,-47 -16,0 -16,0 0,62 0,62 46,0 46,0 0,-36.449 c 0,-22.16 0.42,-38.41 1.069,-41.45 1.38,-6.431 5.771,-12.45 11.17,-15.31 3.391,-1.79 5.9,-2.26 12.261,-2.27 10.569,-0.03 16.04,2.91 19.899,10.66 l 2.601,5.21 0,39.811 0,39.799 13.89,0 c 12.189,0 14.18,-0.229 16.25,-1.91 l 2.36,-1.92 -0.011,-38.83 c 0,-33.729 -0.229,-39.67 -1.739,-45.129 -2.94,-10.681 -6.641,-17.25 -13.671,-24.28 -10.8,-10.79 -22.069,-14.98 -40.039,-14.86 -5.801,0.029 -12.922,0.699 -15.831,1.489 z"
|
||||
inkscape:connector-curvature="0" />
|
||||
</g>
|
||||
<metadata id="metadata3364">
|
||||
<rdf:RDF>
|
||||
<cc:Work
|
||||
rdf:about="">
|
||||
<dc:format>image/svg+xml</dc:format>
|
||||
<dc:type
|
||||
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
|
||||
<dc:title>Marlin Firmware</dc:title>
|
||||
<dc:creator>
|
||||
<cc:Agent>
|
||||
<dc:title>Ahmet Cem TURAN</dc:title>
|
||||
</cc:Agent>
|
||||
</dc:creator>
|
||||
<dc:rights>
|
||||
<cc:Agent>
|
||||
<dc:title>MarlinFirmware</dc:title>
|
||||
</cc:Agent>
|
||||
</dc:rights>
|
||||
<dc:publisher>
|
||||
<cc:Agent>
|
||||
<dc:title>João Brázio</dc:title>
|
||||
</cc:Agent>
|
||||
</dc:publisher>
|
||||
<dc:identifier>marlin-logo-old</dc:identifier>
|
||||
</cc:Work>
|
||||
</rdf:RDF>
|
||||
</metadata>
|
||||
<g inkscape:label="Layer 1" inkscape:groupmode="layer" id="layer1" transform="translate(0,-308.26772)">
|
||||
<g id="g3335" transform="matrix(1.2688266,0,0,1.2688266,0.33525798,503.35041)">
|
||||
<path
|
||||
id="path3337"
|
||||
d="m 364.271,4.24 -312.9,0.26 -7,2.33 c -21.42,7.13 -38.03,25.09 -42.99,46.47 -1.37,5.89 -1.53,17.24 -1.29,88.98 0.28,81.931 0.29,82.24 2.5,88.74 6.46,18.97 21.811,34.33 40.7,40.74 l 8.08,2.739 360,0.28 c 330.609,0.25 360.609,0.14 367.5,-1.37 24.069,-5.26 42.26,-22.859 48.46,-46.869 1.22,-4.74 1.54,-12.301 1.54,-36.91 0,-30.881 -0.006,-185.553 -0.006,-185.553 0,0 -152.264,-0.097 -464.594,0.163 z m 388.85,76.75 68.75,69.771 -0.011,33.87 c -0.02,37.899 -0.5,41.85 -6.529,53.32 -6.57,12.51 -19.25,23.039 -32.92,27.329 l -7.04,2.22 -361.5,0 -361.5,0 -6.5,-2.34 c -17.34,-6.229 -30.4,-19.24 -36.22,-36.05 l -2.28,-6.61 0,-83 0,-83 2.31,-6.69 c 6.78,-19.62 24.62,-34.88 44.13,-37.75 3.061,-0.45 146.19,-0.82 318.061,-0.82 l 312.5,-0.01 68.749,69.76 z"
|
||||
inkscape:connector-curvature="0" />
|
||||
<path
|
||||
id="path3339"
|
||||
d="m 540.871,119.04 c 0,57.4 0.229,68.15 1.59,74.75 4.97,24.069 21.26,37.209 46.149,37.209 l 8.311,0 -0.271,-14.629 -0.279,-14.631 -5.421,-0.439 c -6.039,-0.48 -9.51,-1.961 -12.76,-5.45 -4.87,-5.229 -4.8,-4.19 -5.109,-76.1 l -0.3,-67.75 -15.96,0 -15.949,0 0,67.04 z"
|
||||
inkscape:connector-curvature="0" />
|
||||
<path
|
||||
id="path3341"
|
||||
d="m 96.871,61.58 c -16.21,4.25 -30.58,15.65 -37.42,29.66 -6.641,13.59 -6.58,12.86 -6.58,77.82 0,55.529 0.1,58.72 1.83,60.29 1.52,1.37 4.22,1.649 16,1.649 l 14.17,0 0.01,-58.75 c 0,-37.39 0.38,-60.1 1.04,-62.47 2.66,-9.58 13.22,-17.63 24.31,-18.52 12.82,-1.03 23.841,5.09 28.75,15.95 l 2.391,5.29 0.29,59.25 0.3,59.25 15.95,0 15.96,0 0,-57.819 c 0,-63.17 0.05,-63.81 5.819,-71.77 3.94,-5.44 11.851,-9.53 19.62,-10.16 12.36,-0.99 22.79,4.57 28.351,15.11 l 2.71,5.14 0.29,59.75 0.279,59.75 15.971,0 15.96,0 0,-59.34 c 0,-55.37 -0.13,-59.85 -1.931,-66.89 C 257.952,93.08 253.622,85.52 244.981,76.9 233.152,65.1 220.402,60 202.691,60 c -16.14,0 -27.949,4.52 -39.109,14.95 l -6.391,5.98 -2.18,-2.96 c -3.8,-5.14 -15.83,-12.79 -24.359,-15.48 -6.351,-2.01 -9.86,-2.479 -18.08,-2.42 -5.611,0.03 -12.67,0.71 -15.701,1.51 z"
|
||||
inkscape:connector-curvature="0" />
|
||||
<path
|
||||
id="path3343"
|
||||
d="m 612.891,61.7 c -1.91,0.99 -4.5,3.33 -5.75,5.2 -2.04,3.05 -2.27,4.59 -2.27,15.25 l 0,11.85 16,0 16,0 0,-10.53 c 0,-11.8 -1.051,-15.37 -5.881,-19.91 -4.029,-3.79 -12.659,-4.68 -18.099,-1.86 z"
|
||||
inkscape:connector-curvature="0" />
|
||||
<path
|
||||
id="path3345"
|
||||
d="m 314.871,106.34 c -10.95,3.26 -17.54,7.22 -26.09,15.66 -8.91,8.79 -14.74,19.339 -17.471,31.621 -2.46,11.06 -1.59,26.26 2.07,36.379 5.53,15.24 16.53,27.931 29.99,34.57 9.78,4.83 18.38,6.391 35.25,6.41 l 14.25,0.02 0,-15.379 0,-15.391 -13.25,-0.4 c -11.601,-0.359 -13.94,-0.729 -18.8,-2.97 -7.62,-3.521 -12.37,-7.97 -15.66,-14.68 -2.391,-4.86 -2.79,-6.9 -2.79,-14.181 0,-7.27 0.399,-9.319 2.78,-14.16 3.38,-6.889 9.229,-12.93 15.529,-16.029 6.66,-3.28 19.771,-3.28 25.98,0 6.12,3.24 11.99,9.49 15.06,16.04 l 2.65,5.649 0.3,35.75 0.29,35.75 44.96,0 44.95,0 0.02,-39.25 c 0.03,-44.39 -0.01,-44.18 7.84,-50.899 11.42,-9.78 29.91,-7.05 36.24,5.34 1.27,2.5 2.29,6.92 2.63,11.44 l 0.561,7.369 15.85,0 15.86,0 0,-6.84 c 0,-8.149 -2.98,-20.56 -6.771,-28.14 -5.63,-11.29 -18.86,-21.31 -32.32,-24.48 -7.54,-1.78 -22.6,-2 -30.109,-0.44 -14.79,3.06 -29.391,14.09 -35.601,26.9 -5.58,11.49 -6.199,15.83 -6.199,43.21 l 0,24.791 -13,0 -13,0 0,-20.34 c 0,-16.97 -0.33,-21.619 -1.97,-28.05 -5.82,-22.75 -23.29,-40.45 -45.49,-46.09 -9.088,-2.32 -25.309,-1.93 -34.539,0.82 z"
|
||||
inkscape:connector-curvature="0" />
|
||||
<path
|
||||
id="path3347"
|
||||
d="m 705.081,105.56 c -18.091,4.86 -31.98,18.26 -37.771,36.439 -1.439,4.5 -1.84,10.381 -2.189,32.25 l -0.44,26.75 -13.91,0 -13.899,0 0,-47 0,-47 -16,0 -16,0 0,62 0,62 46,0 46,0 0,-36.449 c 0,-22.16 0.42,-38.41 1.069,-41.45 1.38,-6.431 5.771,-12.45 11.17,-15.31 3.391,-1.79 5.9,-2.26 12.261,-2.27 10.569,-0.03 16.04,2.91 19.899,10.66 l 2.601,5.21 0,39.811 0,39.799 13.89,0 c 12.189,0 14.18,-0.229 16.25,-1.91 l 2.36,-1.92 -0.011,-38.83 c 0,-33.729 -0.229,-39.67 -1.739,-45.129 -2.94,-10.681 -6.641,-17.25 -13.671,-24.28 -10.8,-10.79 -22.069,-14.98 -40.039,-14.86 -5.801,0.029 -12.922,0.699 -15.831,1.489 z"
|
||||
inkscape:connector-curvature="0" />
|
||||
</g>
|
||||
</g>
|
||||
</svg>
|
||||
|
Before Width: | Height: | Size: 6.5 KiB After Width: | Height: | Size: 6.5 KiB |
@@ -1,6 +1,9 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<!-- Generator: Adobe Illustrator 16.0.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
|
||||
|
||||
<!--
|
||||
Graphic designed by Ahmnet Cem TURAN
|
||||
URL: https://github.com/ahmetcemturan
|
||||
License: CC-BY-NC-SA
|
||||
-->
|
||||
<svg
|
||||
xmlns:dc="http://purl.org/dc/elements/1.1/"
|
||||
xmlns:cc="http://creativecommons.org/ns#"
|
||||
@@ -22,11 +25,18 @@
|
||||
sodipodi:docname="marlin.svg"
|
||||
inkscape:export-filename="C:\Users\jbrazio\Desktop\marlin.png"
|
||||
inkscape:export-xdpi="27.424898"
|
||||
inkscape:export-ydpi="27.424898"><title
|
||||
id="title3357">Marlin Firmware </title><metadata
|
||||
id="metadata55"><rdf:RDF><cc:Work
|
||||
inkscape:export-ydpi="27.424898">
|
||||
<title id="title3357">Marlin Firmware </title>
|
||||
<metadata>
|
||||
<creator>Ahmnet Cem TURAN</creator>
|
||||
<url>https://github.com/ahmetcemturan</url>
|
||||
<license>CC-BY-NC-SA</license>
|
||||
</metadata>
|
||||
<metadata id="metadata55"><rdf:RDF><cc:Work
|
||||
rdf:about=""><dc:format>image/svg+xml</dc:format><dc:type
|
||||
rdf:resource="http://purl.org/dc/dcmitype/StillImage" /><dc:title>Marlin Firmware </dc:title><dc:creator><cc:Agent><dc:title>Ahmet Cem TURAN</dc:title></cc:Agent></dc:creator><dc:publisher><cc:Agent><dc:title>João Brázio</dc:title></cc:Agent></dc:publisher><dc:rights><cc:Agent><dc:title>MarlinFirmware</dc:title></cc:Agent></dc:rights><dc:identifier>marlin-logo-new</dc:identifier></cc:Work></rdf:RDF></metadata><defs
|
||||
rdf:resource="http://purl.org/dc/dcmitype/StillImage" /><dc:title>Marlin Firmware </dc:title><dc:creator><cc:Agent><dc:title>Ahmet Cem TURAN</dc:title></cc:Agent></dc:creator><dc:publisher><cc:Agent><dc:title>João Brázio</dc:title></cc:Agent></dc:publisher><dc:rights><cc:Agent><dc:title>MarlinFirmware</dc:title></cc:Agent></dc:rights><dc:identifier>marlin-logo-new</dc:identifier></cc:Work></rdf:RDF>
|
||||
</metadata>
|
||||
<defs
|
||||
id="defs53" /><sodipodi:namedview
|
||||
pagecolor="#ffffff"
|
||||
bordercolor="#666666"
|
||||
@@ -128,4 +138,5 @@
|
||||
d="M 5.34,951.549 C 5.203,951.512 5.098,951.411 5.054,951.273 5.043,951.239 5.04,951.194 5.037,951.029 l -0.003,-0.203 -0.105,0 -0.106,0 0,0.356 0,0.356 -0.121,0 -0.121,0 0,-0.469 0,-0.469 0.348,0 0.348,0 0,0.276 c 0,0.168 0.003,0.291 0.008,0.314 0.01,0.049 0.044,0.094 0.085,0.116 0.026,0.014 0.045,0.017 0.093,0.017 0.08,0 0.121,-0.022 0.151,-0.081 l 0.02,-0.039 0,-0.301 0,-0.302 0.105,0 c 0.092,0 0.107,0.002 0.123,0.014 l 0.018,0.015 0,0.294 c 0,0.255 -0.002,0.3 -0.013,0.342 -0.022,0.081 -0.05,0.131 -0.103,0.184 -0.082,0.082 -0.167,0.113 -0.303,0.112 -0.045,0 -0.099,-0.006 -0.121,-0.012 z" /></g><path
|
||||
inkscape:connector-curvature="0"
|
||||
id="path49"
|
||||
d="M 403.52901,561.50203" /></g></svg>
|
||||
d="M 403.52901,561.50203" /></g>
|
||||
</svg>
|
||||
|
Before Width: | Height: | Size: 21 KiB After Width: | Height: | Size: 21 KiB |
@@ -181,7 +181,7 @@ class Protocol(object):
|
||||
except ReadTimeout:
|
||||
self.errors += 1
|
||||
#print("Packetloss detected..")
|
||||
except serial.serialutil.SerialException:
|
||||
except serial.SerialException:
|
||||
return
|
||||
self.packet_transit = None
|
||||
|
||||
@@ -201,7 +201,7 @@ class Protocol(object):
|
||||
|
||||
def transmit_packet(self, packet):
|
||||
packet = bytearray(packet)
|
||||
if(self.simulate_errors > 0 and random.random() > (1.0 - self.simulate_errors)):
|
||||
if (self.simulate_errors > 0 and random.random() > (1.0 - self.simulate_errors)):
|
||||
if random.random() > 0.9:
|
||||
#random data drop
|
||||
start = random.randint(0, len(packet))
|
||||
|
@@ -22,7 +22,7 @@ from __future__ import print_function
|
||||
from __future__ import division
|
||||
|
||||
from math import *
|
||||
import sys,getopt
|
||||
import sys, getopt
|
||||
|
||||
"Constants"
|
||||
ZERO = 273.15 # zero point of Kelvin scale
|
||||
|
@@ -5,7 +5,7 @@ Extract the builds used in Github CI, so that we can run them locally
|
||||
import yaml
|
||||
|
||||
# Set the yaml file to parse
|
||||
yaml_file = '.github/workflows/test-builds.yml'
|
||||
yaml_file = '.github/workflows/ci-build-tests.yml'
|
||||
|
||||
# Parse the yaml file, and load it into a dictionary (github_configuration)
|
||||
with open(yaml_file) as f:
|
||||
|
41
buildroot/share/scripts/gen-tft-image.py → buildroot/share/scripts/image_to_tft.py
Normal file → Executable file
41
buildroot/share/scripts/gen-tft-image.py → buildroot/share/scripts/image_to_tft.py
Normal file → Executable file
@@ -22,43 +22,54 @@
|
||||
|
||||
# Generate Marlin TFT Images from bitmaps/PNG/JPG
|
||||
|
||||
import sys,struct
|
||||
import sys, struct
|
||||
from PIL import Image
|
||||
|
||||
def image2bin(image, output_file):
|
||||
def image2bin(image, output_file, transparency):
|
||||
w, h = image.size[0], image.size[1]
|
||||
print(f"Converting image with dimensions {w}x{h}...")
|
||||
if output_file.endswith(('.c', '.cpp')):
|
||||
f = open(output_file, 'wt')
|
||||
is_cpp = True
|
||||
f.write("const uint16_t image[%d] = {\n" % (image.size[1] * image.size[0]))
|
||||
row_sp, item_sp = (" ", "") if w >= 480 else (" ", " ")
|
||||
row_end, data_end = "\n", "};\n"
|
||||
f = open(output_file, 'wt')
|
||||
f.write("const uint16_t image[%d] = {\n" % (h * w))
|
||||
else:
|
||||
f = open(output_file, 'wb')
|
||||
is_cpp = False
|
||||
row_sp, row_end, data_end = b"", b"", b""
|
||||
f = open(output_file, 'wb')
|
||||
tcolor, got_tcolor = 0, False
|
||||
pixs = image.load()
|
||||
for y in range(image.size[1]):
|
||||
for x in range(image.size[0]):
|
||||
for y in range(h):
|
||||
f.write(row_sp)
|
||||
for x in range(w):
|
||||
R = pixs[x, y][0] >> 3
|
||||
G = pixs[x, y][1] >> 2
|
||||
B = pixs[x, y][2] >> 3
|
||||
rgb = (R << 11) | (G << 5) | B
|
||||
if transparency:
|
||||
if not got_tcolor:
|
||||
got_tcolor = True
|
||||
tcolor = rgb # First pixel color is transparent
|
||||
if rgb == tcolor: rgb = 1 # "color 1" is transparent
|
||||
if is_cpp:
|
||||
strHex = '0x{0:04X}, '.format(rgb)
|
||||
strHex = item_sp + "0x{0:04X},".format(rgb)
|
||||
f.write(strHex)
|
||||
else:
|
||||
f.write(struct.pack("B", (rgb & 0xFF)))
|
||||
f.write(struct.pack("B", (rgb >> 8) & 0xFF))
|
||||
if is_cpp:
|
||||
f.write("\n")
|
||||
if is_cpp:
|
||||
f.write("};\n")
|
||||
f.write(row_end)
|
||||
f.write(data_end)
|
||||
f.close()
|
||||
|
||||
if len(sys.argv) <= 2:
|
||||
print("Utility to export a image in Marlin TFT friendly format.")
|
||||
print("It will dump a raw bin RGB565 image or create a CPP file with an array of 16 bit image pixels.")
|
||||
print("Usage: gen-tft-image.py INPUT_IMAGE.(png|bmp|jpg) OUTPUT_FILE.(cpp|bin)")
|
||||
print("Author: rhapsodyv")
|
||||
print("Usage: gen-tft-image.py INPUT_IMAGE.(png|bmp|jpg) OUTPUT_FILE.(cpp|bin) [--transparency]")
|
||||
print("Authors: rhapsodyv, thinkyhead")
|
||||
exit(1)
|
||||
|
||||
transparency = len(sys.argv) > 3 and sys.argv[3] == "--transparency"
|
||||
output_img = sys.argv[2]
|
||||
img = Image.open(sys.argv[1])
|
||||
image2bin(img, output_img)
|
||||
image2bin(img, output_img, transparency)
|
@@ -1,20 +1,22 @@
|
||||
#!/usr/bin/env python3
|
||||
'''
|
||||
languageExport.py
|
||||
languageExport.py [--single]
|
||||
|
||||
Export LCD language strings to CSV files for easier translation.
|
||||
Use importTranslations.py to import CSV into the language files.
|
||||
Use languageImport.py to import CSV into the language files.
|
||||
|
||||
Use --single to export all languages to a single CSV file.
|
||||
'''
|
||||
|
||||
import re
|
||||
from pathlib import Path
|
||||
from sys import argv
|
||||
from languageUtil import namebyid
|
||||
|
||||
LANGHOME = "Marlin/src/lcd/language"
|
||||
|
||||
# Write multiple sheets if true, otherwise write one giant sheet
|
||||
MULTISHEET = True
|
||||
MULTISHEET = '--single' not in argv[1:]
|
||||
OUTDIR = 'out-csv'
|
||||
|
||||
# Check for the path to the language files
|
||||
@@ -28,7 +30,7 @@ LIMIT = 0
|
||||
|
||||
# A dictionary to contain strings for each language.
|
||||
# Init with 'en' so English will always be first.
|
||||
language_strings = { 'en': 0 }
|
||||
language_strings = { 'en': {} }
|
||||
|
||||
# A dictionary to contain all distinct LCD string names
|
||||
names = {}
|
||||
|
@@ -17,7 +17,7 @@ TODO: Use the defines and comments above the namespace from existing language fi
|
||||
"""
|
||||
|
||||
import sys, re, requests, csv, datetime
|
||||
from languageUtil import namebyid
|
||||
#from languageUtil import namebyid
|
||||
|
||||
LANGHOME = "Marlin/src/lcd/language"
|
||||
OUTDIR = 'out-language'
|
||||
@@ -76,10 +76,10 @@ for row in reader:
|
||||
# Add the named string for all the included languages
|
||||
name = row[0]
|
||||
for i in range(1, numcols):
|
||||
str = row[i]
|
||||
if str:
|
||||
str_key = row[i]
|
||||
if str_key:
|
||||
col = columns[i]
|
||||
strings_per_lang[col['lang']][col['style']][name] = str
|
||||
strings_per_lang[col['lang']][col['style']][name] = str_key
|
||||
|
||||
# Create a folder for the imported language outfiles
|
||||
from pathlib import Path
|
||||
@@ -199,11 +199,11 @@ for i in range(1, numcols):
|
||||
comm = ''
|
||||
if lang != 'en' and 'en' in strings_per_lang:
|
||||
en = strings_per_lang['en']
|
||||
if name in en[style]: str = en[style][name]
|
||||
elif name in en['Narrow']: str = en['Narrow'][name]
|
||||
if str:
|
||||
if name in en[style]: str_key = en[style][name]
|
||||
elif name in en['Narrow']: str_key = en['Narrow'][name]
|
||||
if str_key:
|
||||
cfmt = '%%%ss// %%s' % (50 - len(val) if len(val) < 50 else 1)
|
||||
comm = cfmt % (' ', str)
|
||||
comm = cfmt % (' ', str_key)
|
||||
|
||||
# Write out the string definition
|
||||
f.write(lstr_fmt % (name, val, comm))
|
||||
|
@@ -1,6 +1,6 @@
|
||||
#!/usr/bin/env python3
|
||||
#
|
||||
# marlang.py
|
||||
# languageUtil.py
|
||||
#
|
||||
|
||||
# A dictionary to contain language names
|
||||
|
@@ -1,197 +0,0 @@
|
||||
#!/usr/bin/env node
|
||||
|
||||
//
|
||||
// Formatter script for pins_MYPINS.h files
|
||||
//
|
||||
// Usage: mffmt [infile] [outfile]
|
||||
//
|
||||
// With no parameters convert STDIN to STDOUT
|
||||
//
|
||||
|
||||
const fs = require("fs");
|
||||
|
||||
var do_log = false
|
||||
function logmsg(msg, line='') {
|
||||
if (do_log) console.log(msg, line);
|
||||
}
|
||||
|
||||
// String lpad / rpad
|
||||
String.prototype.lpad = function(len, chr) {
|
||||
if (!len) return this;
|
||||
if (chr === undefined) chr = ' ';
|
||||
var s = this+'', need = len - s.length;
|
||||
if (need > 0) s = new Array(need+1).join(chr) + s;
|
||||
return s;
|
||||
};
|
||||
|
||||
String.prototype.rpad = function(len, chr) {
|
||||
if (!len) return this;
|
||||
if (chr === undefined) chr = ' ';
|
||||
var s = this+'', need = len - s.length;
|
||||
if (need > 0) s += new Array(need+1).join(chr);
|
||||
return s;
|
||||
};
|
||||
|
||||
// Concatenate a string, adding a space if necessary
|
||||
// to avoid merging two words
|
||||
String.prototype.concat_with_space = function(str) {
|
||||
const c = this.substr(-1), d = str.charAt(0);
|
||||
if (c !== ' ' && c !== '' && d !== ' ' && d !== '')
|
||||
str = ' ' + str;
|
||||
return this + str;
|
||||
};
|
||||
|
||||
const mpatt = [ '-?\\d{1,3}', 'P[A-I]\\d+', 'P\\d_\\d+', 'Pin[A-Z]\\d\\b' ],
|
||||
definePatt = new RegExp(`^\\s*(//)?#define\\s+[A-Z_][A-Z0-9_]+\\s+(${mpatt.join('|')})\\s*(//.*)?$`, 'gm'),
|
||||
ppad = [ 3, 4, 5, 5 ],
|
||||
col_comment = 50,
|
||||
col_value_rj = col_comment - 3;
|
||||
|
||||
var mexpr = [];
|
||||
for (let m of mpatt) mexpr.push(new RegExp('^' + m + '$'));
|
||||
|
||||
const argv = process.argv.slice(2), argc = argv.length;
|
||||
|
||||
var src_file = 0, dst_file;
|
||||
if (argc > 0) {
|
||||
let ind = 0;
|
||||
if (argv[0] == '-v') { do_log = true; ind++; }
|
||||
dst_file = src_file = argv[ind++];
|
||||
if (ind < argc) dst_file = argv[ind];
|
||||
}
|
||||
|
||||
// Read from file or STDIN until it terminates
|
||||
const filtered = process_text(fs.readFileSync(src_file).toString());
|
||||
if (dst_file)
|
||||
fs.writeFileSync(dst_file, filtered);
|
||||
else
|
||||
console.log(filtered);
|
||||
|
||||
// Find the pin pattern so non-pin defines can be skipped
|
||||
function get_pin_pattern(txt) {
|
||||
var r, m = 0, match_count = [ 0, 0, 0, 0 ];
|
||||
var max_match_count = 0, max_match_index = -1;
|
||||
definePatt.lastIndex = 0;
|
||||
while ((r = definePatt.exec(txt)) !== null) {
|
||||
let ind = -1;
|
||||
if (mexpr.some((p) => {
|
||||
ind++;
|
||||
const didmatch = r[2].match(p);
|
||||
return r[2].match(p);
|
||||
}) ) {
|
||||
const m = ++match_count[ind];
|
||||
if (m > max_match_count) {
|
||||
max_match_count = m;
|
||||
max_match_index = ind;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (max_match_index === -1) return null;
|
||||
|
||||
return { match:mpatt[max_match_index], pad:ppad[max_match_index] };
|
||||
}
|
||||
|
||||
function process_text(txt) {
|
||||
if (!txt.length) return '(no text)';
|
||||
const patt = get_pin_pattern(txt);
|
||||
if (!patt) return txt;
|
||||
const pindefPatt = new RegExp(`^(\\s*(//)?#define)\\s+([A-Z_][A-Z0-9_]+)\\s+(${patt.match})\\s*(//.*)?$`),
|
||||
noPinPatt = new RegExp(`^(\\s*(//)?#define)\\s+([A-Z_][A-Z0-9_]+)\\s+(-1)\\s*(//.*)?$`),
|
||||
skipPatt1 = new RegExp('^(\\s*(//)?#define)\\s+(AT90USB|USBCON|(BOARD|DAC|FLASH|HAS|IS|USE)_.+|.+_(ADDRESS|AVAILABLE|BAUDRATE|CLOCK|CONNECTION|DEFAULT|ERROR|EXTRUDERS|FREQ|ITEM|MKS_BASE_VERSION|MODULE|NAME|ONLY|ORIENTATION|PERIOD|RANGE|RATE|READ_RETRIES|SERIAL|SIZE|SPI|STATE|STEP|TIMER|VERSION))\\s+(.+)\\s*(//.*)?$'),
|
||||
skipPatt2 = new RegExp('^(\\s*(//)?#define)\\s+([A-Z_][A-Z0-9_]+)\\s+(0x[0-9A-Fa-f]+|\d+|.+[a-z].+)\\s*(//.*)?$'),
|
||||
skipPatt3 = /^\s*#e(lse|ndif)\b.*$/,
|
||||
aliasPatt = new RegExp('^(\\s*(//)?#define)\\s+([A-Z_][A-Z0-9_]+)\\s+([A-Z_][A-Z0-9_()]+)\\s*(//.*)?$'),
|
||||
switchPatt = new RegExp('^(\\s*(//)?#define)\\s+([A-Z_][A-Z0-9_]+)\\s*(//.*)?$'),
|
||||
undefPatt = new RegExp('^(\\s*(//)?#undef)\\s+([A-Z_][A-Z0-9_]+)\\s*(//.*)?$'),
|
||||
defPatt = new RegExp('^(\\s*(//)?#define)\\s+([A-Z_][A-Z0-9_]+)\\s+([-_\\w]+)\\s*(//.*)?$'),
|
||||
condPatt = new RegExp('^(\\s*(//)?#(if|ifn?def|elif)(\\s+\\S+)*)\\s+(//.*)$'),
|
||||
commPatt = new RegExp('^\\s{20,}(//.*)?$');
|
||||
const col_value_lj = col_comment - patt.pad - 2;
|
||||
var r, out = '', check_comment_next = false;
|
||||
txt.split('\n').forEach((line) => {
|
||||
if (check_comment_next)
|
||||
check_comment_next = ((r = commPatt.exec(line)) !== null);
|
||||
|
||||
if (check_comment_next)
|
||||
// Comments in column 45
|
||||
line = ''.rpad(col_comment) + r[1];
|
||||
|
||||
else if (skipPatt1.exec(line) !== null) {
|
||||
//
|
||||
// #define SKIP_ME
|
||||
//
|
||||
logmsg("skip:", line);
|
||||
}
|
||||
else if ((r = pindefPatt.exec(line)) !== null) {
|
||||
//
|
||||
// #define MY_PIN [pin]
|
||||
//
|
||||
logmsg("pin:", line);
|
||||
const pinnum = r[4].charAt(0) == 'P' ? r[4] : r[4].lpad(patt.pad);
|
||||
line = r[1] + ' ' + r[3];
|
||||
line = line.rpad(col_value_lj).concat_with_space(pinnum);
|
||||
if (r[5]) line = line.rpad(col_comment).concat_with_space(r[5]);
|
||||
}
|
||||
else if ((r = noPinPatt.exec(line)) !== null) {
|
||||
//
|
||||
// #define MY_PIN -1
|
||||
//
|
||||
logmsg("pin -1:", line);
|
||||
line = r[1] + ' ' + r[3];
|
||||
line = line.rpad(col_value_lj).concat_with_space('-1');
|
||||
if (r[5]) line = line.rpad(col_comment).concat_with_space(r[5]);
|
||||
}
|
||||
else if (skipPatt2.exec(line) !== null || skipPatt3.exec(line) !== null) {
|
||||
//
|
||||
// #define SKIP_ME
|
||||
// #else, #endif
|
||||
//
|
||||
logmsg("skip:", line);
|
||||
}
|
||||
else if ((r = aliasPatt.exec(line)) !== null) {
|
||||
//
|
||||
// #define ALIAS OTHER
|
||||
//
|
||||
logmsg("alias:", line);
|
||||
line = r[1] + ' ' + r[3];
|
||||
line = line.concat_with_space(r[4].lpad(col_value_rj + 1 - line.length));
|
||||
if (r[5]) line = line.rpad(col_comment).concat_with_space(r[5]);
|
||||
}
|
||||
else if ((r = switchPatt.exec(line)) !== null) {
|
||||
//
|
||||
// #define SWITCH
|
||||
//
|
||||
logmsg("switch:", line);
|
||||
line = r[1] + ' ' + r[3];
|
||||
if (r[4]) line = line.rpad(col_comment).concat_with_space(r[4]);
|
||||
check_comment_next = true;
|
||||
}
|
||||
else if ((r = defPatt.exec(line)) !== null) {
|
||||
//
|
||||
// #define ...
|
||||
//
|
||||
logmsg("def:", line);
|
||||
line = r[1] + ' ' + r[3] + ' ';
|
||||
line = line.concat_with_space(r[4].lpad(col_value_rj + 1 - line.length));
|
||||
if (r[5]) line = line.rpad(col_comment - 1) + ' ' + r[5];
|
||||
}
|
||||
else if ((r = undefPatt.exec(line)) !== null) {
|
||||
//
|
||||
// #undef ...
|
||||
//
|
||||
logmsg("undef:", line);
|
||||
line = r[1] + ' ' + r[3];
|
||||
if (r[4]) line = line.rpad(col_comment).concat_with_space(r[4]);
|
||||
}
|
||||
else if ((r = condPatt.exec(line)) !== null) {
|
||||
//
|
||||
// #if, #ifdef, #ifndef, #elif ...
|
||||
//
|
||||
logmsg("cond:", line);
|
||||
line = r[1].rpad(col_comment).concat_with_space(r[5]);
|
||||
check_comment_next = true;
|
||||
}
|
||||
out += line + '\n';
|
||||
});
|
||||
return out.replace(/\n\n+/g, '\n\n').replace(/\n\n$/g, '\n');
|
||||
}
|
@@ -27,6 +27,13 @@ def rpad(astr, fill, c=' '):
|
||||
need = fill - len(astr)
|
||||
return astr if need <= 0 else astr + (need * c)
|
||||
|
||||
# Concatenate a string, adding a space if necessary
|
||||
# to avoid merging two words
|
||||
def concat_with_space(s1, s2):
|
||||
if not s1.endswith(' ') and not s2.startswith(' '):
|
||||
s1 += ' '
|
||||
return s1 + s2
|
||||
|
||||
# Pin patterns
|
||||
mpatt = [ r'-?\d{1,3}', r'P[A-I]\d+', r'P\d_\d+', r'Pin[A-Z]\d\b' ]
|
||||
mstr = '|'.join(mpatt)
|
||||
@@ -36,7 +43,7 @@ mexpr = [ re.compile(f'^{m}$') for m in mpatt ]
|
||||
ppad = [ 3, 4, 5, 5 ]
|
||||
|
||||
# Match a define line
|
||||
definePatt = re.compile(rf'^\s*(//)?#define\s+[A-Z_][A-Z0-9_]+\s+({mstr})\s*(//.*)?$')
|
||||
definePinPatt = re.compile(rf'^\s*(//)?#define\s+[A-Z_][A-Z0-9_]+?_PIN\s+({mstr})\s*(//.*)?$')
|
||||
|
||||
def format_pins(argv):
|
||||
src_file = 'stdin'
|
||||
@@ -45,6 +52,7 @@ def format_pins(argv):
|
||||
scnt = 0
|
||||
for arg in argv:
|
||||
if arg == '-v':
|
||||
global do_log
|
||||
do_log = True
|
||||
elif scnt == 0:
|
||||
# Get a source file if specified. Default destination is the same file
|
||||
@@ -85,7 +93,7 @@ def get_pin_pattern(txt):
|
||||
# Find the most common matching pattern
|
||||
match_threshold = 5
|
||||
for line in txt.split('\n'):
|
||||
r = definePatt.match(line)
|
||||
r = definePinPatt.match(line)
|
||||
if r == None: continue
|
||||
ind = -1
|
||||
for p in mexpr:
|
||||
@@ -135,7 +143,7 @@ def process_text(txt):
|
||||
logmsg("pin:", line)
|
||||
pinnum = r[4] if r[4][0] == 'P' else lpad(r[4], patt['pad'])
|
||||
line = f'{r[1]} {r[3]}'
|
||||
line = rpad(line, col_value_lj) + pinnum
|
||||
line = concat_with_space(rpad(line, col_value_lj), pinnum)
|
||||
if r[5]: line = rpad(line, col_comment) + r[5]
|
||||
d['line'] = line
|
||||
return True
|
||||
@@ -149,7 +157,7 @@ def process_text(txt):
|
||||
if r == None: return False
|
||||
logmsg("pin -1:", line)
|
||||
line = f'{r[1]} {r[3]}'
|
||||
line = rpad(line, col_value_lj) + '-1'
|
||||
line = concat_with_space(rpad(line, col_value_lj), '-1')
|
||||
if r[5]: line = rpad(line, col_comment) + r[5]
|
||||
d['line'] = line
|
||||
return True
|
||||
@@ -179,8 +187,8 @@ def process_text(txt):
|
||||
if r == None: return False
|
||||
logmsg("alias:", line)
|
||||
line = f'{r[1]} {r[3]}'
|
||||
line += lpad(r[4], col_value_rj + 1 - len(line))
|
||||
if r[5]: line = rpad(line, col_comment) + r[5]
|
||||
line = concat_with_space(line, lpad(r[4], col_value_rj + 1 - len(line)))
|
||||
if r[5]: line = concat_with_space(rpad(line, col_comment), r[5])
|
||||
d['line'] = line
|
||||
return True
|
||||
|
||||
@@ -193,7 +201,7 @@ def process_text(txt):
|
||||
if r == None: return False
|
||||
logmsg("switch:", line)
|
||||
line = f'{r[1]} {r[3]}'
|
||||
if r[4]: line = rpad(line, col_comment) + r[4]
|
||||
if r[4]: line = concat_with_space(rpad(line, col_comment), r[4])
|
||||
d['line'] = line
|
||||
d['check_comment_next'] = True
|
||||
return True
|
||||
@@ -207,7 +215,7 @@ def process_text(txt):
|
||||
if r == None: return False
|
||||
logmsg("def:", line)
|
||||
line = f'{r[1]} {r[3]} '
|
||||
line += lpad(r[4], col_value_rj + 1 - len(line))
|
||||
line = concat_with_space(line, lpad(r[4], col_value_rj + 1 - len(line)))
|
||||
if r[5]: line = rpad(line, col_comment - 1) + ' ' + r[5]
|
||||
d['line'] = line
|
||||
return True
|
||||
@@ -221,7 +229,7 @@ def process_text(txt):
|
||||
if r == None: return False
|
||||
logmsg("undef:", line)
|
||||
line = f'{r[1]} {r[3]}'
|
||||
if r[4]: line = rpad(line, col_comment) + r[4]
|
||||
if r[4]: line = concat_with_space(rpad(line, col_comment), r[4])
|
||||
d['line'] = line
|
||||
return True
|
||||
|
||||
@@ -233,7 +241,7 @@ def process_text(txt):
|
||||
r = condPatt.match(line)
|
||||
if r == None: return False
|
||||
logmsg("cond:", line)
|
||||
line = rpad(r[1], col_comment) + r[5]
|
||||
line = concat_with_space(rpad(r[1], col_comment), r[5])
|
||||
d['line'] = line
|
||||
d['check_comment_next'] = True
|
||||
return True
|
||||
@@ -263,7 +271,7 @@ def process_text(txt):
|
||||
elif tryUndef(wDict): pass #undef ...
|
||||
elif tryCond(wDict): pass #if|ifdef|ifndef|elif ...
|
||||
|
||||
out += wDict['line'] + '\n'
|
||||
out += wDict['line'].rstrip() + '\n'
|
||||
|
||||
return re.sub('\n\n$', '\n', re.sub(r'\n\n+', '\n\n', out))
|
||||
|
||||
|
@@ -1,11 +1,6 @@
|
||||
import argparse
|
||||
import sys
|
||||
import os
|
||||
import time
|
||||
import random
|
||||
import serial
|
||||
|
||||
Import("env")
|
||||
import argparse, sys, os, time, random, serial
|
||||
from SCons.Script import DefaultEnvironment
|
||||
env = DefaultEnvironment()
|
||||
|
||||
import MarlinBinaryProtocol
|
||||
|
||||
|
@@ -1,6 +1,6 @@
|
||||
/**
|
||||
* Marlin 3D Printer Firmware
|
||||
* Copyright (c) 2023 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
|
||||
* Copyright (c) 2024 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
|
||||
*
|
||||
* Based on Sprinter and grbl.
|
||||
* Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
|
@@ -3055,7 +3055,7 @@ cmt_multi_first_len_minimum = 4 # unsigned number
|
||||
# Path to a file that contains text to insert at the beginning of a file if
|
||||
# the file doesn't start with a C/C++ comment. If the inserted text contains
|
||||
# '$(filename)', that will be replaced with the current file's name.
|
||||
cmt_insert_file_header = "./buildroot/share/extras/file_header.h" # string
|
||||
cmt_insert_file_header = "./buildroot/share/uncrustify/file_header.h" # string
|
||||
|
||||
# Path to a file that contains text to insert at the end of a file if the
|
||||
# file doesn't end with a C/C++ comment. If the inserted text contains
|
@@ -72,7 +72,7 @@
|
||||
from __future__ import print_function
|
||||
from __future__ import division
|
||||
|
||||
import sys,os,re
|
||||
import sys, os, re
|
||||
|
||||
pwd = os.getcwd() # make sure we're executing from the correct directory level
|
||||
pwd = pwd.replace('\\', '/')
|
||||
@@ -103,7 +103,7 @@ current_OS = platform.system()
|
||||
target_env = ''
|
||||
board_name = ''
|
||||
|
||||
from datetime import datetime, date, time
|
||||
from datetime import datetime
|
||||
|
||||
#########
|
||||
# Python 2 error messages:
|
||||
@@ -151,8 +151,6 @@ def get_answer(board_name, question_txt, options, default_value=1):
|
||||
root_get_answer.protocol("WM_DELETE_WINDOW", disable_event)
|
||||
root_get_answer.resizable(False, False)
|
||||
|
||||
root_get_answer.radio_state = default_value # declare variables used by TK and enable
|
||||
|
||||
global get_answer_val
|
||||
get_answer_val = default_value # return get_answer_val, set default to match radio_state default
|
||||
|
||||
@@ -880,7 +878,6 @@ def run_PIO(dummy):
|
||||
print('build_type: ', build_type)
|
||||
|
||||
import subprocess
|
||||
import sys
|
||||
|
||||
print('starting platformio')
|
||||
|
||||
@@ -965,7 +962,6 @@ def run_PIO(dummy):
|
||||
|
||||
########################################################################
|
||||
|
||||
import time
|
||||
import threading
|
||||
if python_ver == 2:
|
||||
import Tkinter as tk
|
||||
@@ -978,7 +974,6 @@ else:
|
||||
import tkinter as tk
|
||||
import queue as queue
|
||||
from tkinter import ttk, Tk, Frame, Text, Menu
|
||||
import subprocess
|
||||
import sys
|
||||
que = queue.Queue()
|
||||
#IO_queue = queue.Queue()
|
||||
|
@@ -184,7 +184,7 @@
|
||||
# section avr061.zip which accompanies the application note
|
||||
# AVR061 available from:
|
||||
#
|
||||
# http://www.atmel.com/atmel/acrobat/doc2525.pdf
|
||||
# https://www.microchip.com/en-us/application-notes/an2525
|
||||
#
|
||||
|
||||
#define ATTINY10 0x10 /* the _old_ one that never existed! */
|
||||
|
@@ -184,7 +184,7 @@
|
||||
# section avr061.zip which accompanies the application note
|
||||
# AVR061 available from:
|
||||
#
|
||||
# http://www.atmel.com/atmel/acrobat/doc2525.pdf
|
||||
# https://www.microchip.com/en-us/application-notes/an2525
|
||||
#
|
||||
|
||||
#define ATTINY10 0x10 /* the _old_ one that never existed! */
|
||||
|
@@ -184,7 +184,7 @@
|
||||
# section avr061.zip which accompanies the application note
|
||||
# AVR061 available from:
|
||||
#
|
||||
# http://www.atmel.com/atmel/acrobat/doc2525.pdf
|
||||
# https://www.microchip.com/en-us/application-notes/an2525
|
||||
#
|
||||
|
||||
#define ATTINY10 0x10 /* the _old_ one that never existed! */
|
||||
|
@@ -13,7 +13,7 @@
|
||||
from __future__ import print_function
|
||||
from __future__ import division
|
||||
|
||||
import subprocess,os,platform
|
||||
import subprocess, os, platform
|
||||
from SCons.Script import DefaultEnvironment
|
||||
|
||||
current_OS = platform.system()
|
||||
|
@@ -9,9 +9,9 @@
|
||||
# Will continue on if a COM port isn't found so that the compilation can be done.
|
||||
#
|
||||
|
||||
import os
|
||||
import os, platform
|
||||
from SCons.Script import DefaultEnvironment
|
||||
import platform
|
||||
|
||||
current_OS = platform.system()
|
||||
|
||||
env = DefaultEnvironment()
|
||||
|
Reference in New Issue
Block a user