Compare commits
No commits in common. "1bd405d10fee69a5110ad0332bba3ce66487ee4c" and "140f1296f2cf59dabfa116e0d002fb41baf94afc" have entirely different histories.
1bd405d10f
...
140f1296f2
2 changed files with 5 additions and 30 deletions
1
.gitattributes
vendored
1
.gitattributes
vendored
|
@ -1 +0,0 @@
|
|||
*.sh text=auto eol=lf
|
34
compile.sh
34
compile.sh
|
@ -12,16 +12,7 @@ then
|
|||
exit;
|
||||
fi;
|
||||
|
||||
function is_truthy() {
|
||||
local value;
|
||||
value="$1";
|
||||
|
||||
[ ! -z "$value" ] &&
|
||||
[ "$value" != "0" ] &&
|
||||
[ "$value" != "false" ] &&
|
||||
[ "$value" != "n" ] &&
|
||||
[ "$value" != "no" ];
|
||||
}
|
||||
|
||||
function handle_status() {
|
||||
if [ $1 -ne 0 ]; then
|
||||
|
@ -187,7 +178,6 @@ fi
|
|||
|
||||
if [ ! -z "$projectFile" ];
|
||||
then
|
||||
echo "Project File Found: \"$projectFile\"";
|
||||
projectRoot="$(dirname "$projectFile")";
|
||||
cd "$projectRoot";
|
||||
tempFile="$(mktemp)";
|
||||
|
@ -219,34 +209,20 @@ then
|
|||
|
||||
logFile="$(mktemp)";
|
||||
|
||||
if is_truthy "${NATIVE_WINDOWS}"
|
||||
then
|
||||
winFile="$(PROJECT_FILE="$projectFile" WSLENV="PROJECT_FILE/p" cmd.exe /c echo "%PROJECT_FILE%")";
|
||||
LOG_FILE="$logFile" WSLENV="LOG_FILE/p" cmd.exe /c @ "C:\Keil_v5\UV4\UV4.exe" -j0 -b "$winFile" -t "$targetName" -l "%LOG_FILE%";
|
||||
else
|
||||
WINEDEBUG=-all,fixme+event xvfb-run bash -c "dwm & wine \"C:\Keil_v5\UV4\UV4.exe\" -j0 -b \"$projectFile\" -t \"$targetName\" -l \"$logFile\"";
|
||||
fi;
|
||||
|
||||
xvfb-run bash -c "dwm & wine \"C:\Keil_v5\UV4\UV4.exe\" -j0 -b \"$projectFile\" -t \"$targetName\" -l \"$logFile\"" > /dev/null 2>&1;
|
||||
mv -f "$tempFile" "$projectFile";
|
||||
|
||||
errorPatterns=()
|
||||
errorPatterns+=("\(\)\(.*\)\(([[:digit:]]\+): \(warning\|note\|error\): \([A-Z0-9]\+: \)\?.*\)$")
|
||||
errorPatterns+=("\(\"\)\(.*\)\(\", line [[:digit:]]\+\( (column [[:digit:]]\+)\)\?: \(Warning\|Error\): [A-Z0-9]\+: .*\)$");
|
||||
|
||||
if is_truthy "${USE_WINDOWS_PATHS}"
|
||||
then
|
||||
fixCommand="wslpath -m";
|
||||
else
|
||||
fixCommand="realpath";
|
||||
fi;
|
||||
|
||||
for errorPattern in "${errorPatterns[@]}"
|
||||
do
|
||||
sed -i \
|
||||
-e "/$errorPattern/{" \
|
||||
-e "h;" \
|
||||
-e "s/$errorPattern/\1\n\3/" \
|
||||
-e "x; s/$errorPattern/$fixCommand \"\2\"/" \
|
||||
-e "x; s/$errorPattern/realpath \"\2\"/" \
|
||||
-e "e" \
|
||||
-e "x; G; h;" \
|
||||
-e "s/\([^\n]*\)\n//" \
|
||||
|
@ -262,15 +238,15 @@ then
|
|||
then
|
||||
outputName="$(realpath "$projectRoot/$buildPath/$outputName")";
|
||||
outputFile="$outputName.axf";
|
||||
echo "Target Built: \"$outputFile\".";
|
||||
echo "The File Has Been Built to \"$outputFile\".";
|
||||
pyocd list | {
|
||||
grep '^No available' &&
|
||||
{
|
||||
echo "Skpping Flash."
|
||||
echo "Skpping flash."
|
||||
} ||
|
||||
{
|
||||
pyocd flash --target stm32f439xi "$outputFile";
|
||||
handle_status $? "Flashing Failed";
|
||||
handle_status $? "Flashing failed";
|
||||
};
|
||||
};
|
||||
else
|
||||
|
|
Loading…
Reference in a new issue