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;
|
exit;
|
||||||
fi;
|
fi;
|
||||||
|
|
||||||
function is_truthy() {
|
|
||||||
local value;
|
|
||||||
value="$1";
|
|
||||||
|
|
||||||
[ ! -z "$value" ] &&
|
|
||||||
[ "$value" != "0" ] &&
|
|
||||||
[ "$value" != "false" ] &&
|
|
||||||
[ "$value" != "n" ] &&
|
|
||||||
[ "$value" != "no" ];
|
|
||||||
}
|
|
||||||
|
|
||||||
function handle_status() {
|
function handle_status() {
|
||||||
if [ $1 -ne 0 ]; then
|
if [ $1 -ne 0 ]; then
|
||||||
|
@ -187,7 +178,6 @@ fi
|
||||||
|
|
||||||
if [ ! -z "$projectFile" ];
|
if [ ! -z "$projectFile" ];
|
||||||
then
|
then
|
||||||
echo "Project File Found: \"$projectFile\"";
|
|
||||||
projectRoot="$(dirname "$projectFile")";
|
projectRoot="$(dirname "$projectFile")";
|
||||||
cd "$projectRoot";
|
cd "$projectRoot";
|
||||||
tempFile="$(mktemp)";
|
tempFile="$(mktemp)";
|
||||||
|
@ -219,34 +209,20 @@ then
|
||||||
|
|
||||||
logFile="$(mktemp)";
|
logFile="$(mktemp)";
|
||||||
|
|
||||||
if is_truthy "${NATIVE_WINDOWS}"
|
xvfb-run bash -c "dwm & wine \"C:\Keil_v5\UV4\UV4.exe\" -j0 -b \"$projectFile\" -t \"$targetName\" -l \"$logFile\"" > /dev/null 2>&1;
|
||||||
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;
|
|
||||||
|
|
||||||
mv -f "$tempFile" "$projectFile";
|
mv -f "$tempFile" "$projectFile";
|
||||||
|
|
||||||
errorPatterns=()
|
errorPatterns=()
|
||||||
errorPatterns+=("\(\)\(.*\)\(([[:digit:]]\+): \(warning\|note\|error\): \([A-Z0-9]\+: \)\?.*\)$")
|
errorPatterns+=("\(\)\(.*\)\(([[:digit:]]\+): \(warning\|note\|error\): \([A-Z0-9]\+: \)\?.*\)$")
|
||||||
errorPatterns+=("\(\"\)\(.*\)\(\", line [[:digit:]]\+\( (column [[:digit:]]\+)\)\?: \(Warning\|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[@]}"
|
for errorPattern in "${errorPatterns[@]}"
|
||||||
do
|
do
|
||||||
sed -i \
|
sed -i \
|
||||||
-e "/$errorPattern/{" \
|
-e "/$errorPattern/{" \
|
||||||
-e "h;" \
|
-e "h;" \
|
||||||
-e "s/$errorPattern/\1\n\3/" \
|
-e "s/$errorPattern/\1\n\3/" \
|
||||||
-e "x; s/$errorPattern/$fixCommand \"\2\"/" \
|
-e "x; s/$errorPattern/realpath \"\2\"/" \
|
||||||
-e "e" \
|
-e "e" \
|
||||||
-e "x; G; h;" \
|
-e "x; G; h;" \
|
||||||
-e "s/\([^\n]*\)\n//" \
|
-e "s/\([^\n]*\)\n//" \
|
||||||
|
@ -262,15 +238,15 @@ then
|
||||||
then
|
then
|
||||||
outputName="$(realpath "$projectRoot/$buildPath/$outputName")";
|
outputName="$(realpath "$projectRoot/$buildPath/$outputName")";
|
||||||
outputFile="$outputName.axf";
|
outputFile="$outputName.axf";
|
||||||
echo "Target Built: \"$outputFile\".";
|
echo "The File Has Been Built to \"$outputFile\".";
|
||||||
pyocd list | {
|
pyocd list | {
|
||||||
grep '^No available' &&
|
grep '^No available' &&
|
||||||
{
|
{
|
||||||
echo "Skpping Flash."
|
echo "Skpping flash."
|
||||||
} ||
|
} ||
|
||||||
{
|
{
|
||||||
pyocd flash --target stm32f439xi "$outputFile";
|
pyocd flash --target stm32f439xi "$outputFile";
|
||||||
handle_status $? "Flashing Failed";
|
handle_status $? "Flashing failed";
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
else
|
else
|
||||||
|
|
Loading…
Reference in a new issue