mirror of
https://github.com/bdring/Grbl_Esp32.git
synced 2025-08-06 14:46:50 +02:00
Removed add-on configurations
The new Spindle Class is a much better solution to the problem that add-on's were intended to address.
This commit is contained in:
@@ -14,12 +14,6 @@
|
|||||||
// from Machines/, for example:
|
// from Machines/, for example:
|
||||||
// #include "Machines/3axis_v4.h"
|
// #include "Machines/3axis_v4.h"
|
||||||
|
|
||||||
// Some configurations use two files, the first establishing a base
|
|
||||||
// configuration and the second providing additional customization,
|
|
||||||
// for example:
|
|
||||||
// #include "Machines/3axis_v4.h"
|
|
||||||
// #include "Machines/add_esc_spindle.h"
|
|
||||||
|
|
||||||
// === OEM Single File Configuration Option
|
// === OEM Single File Configuration Option
|
||||||
// OEMs that wish to publish source code that is configured for a
|
// OEMs that wish to publish source code that is configured for a
|
||||||
// specific machine may put all of their configuration definitions
|
// specific machine may put all of their configuration definitions
|
||||||
@@ -49,14 +43,6 @@
|
|||||||
|
|
||||||
#include MACHINE_PATHNAME_QUOTED(MACHINE_FILENAME)
|
#include MACHINE_PATHNAME_QUOTED(MACHINE_FILENAME)
|
||||||
|
|
||||||
// You can choose two-file configurations by also defining MACHINE_FILENAME2,
|
|
||||||
// for example:
|
|
||||||
// $env:PLATFORMIO_BUILD_FLAGS='-DMACHINE_FILENAME=3axis_v4.h -DMACHINE_FILENAME2=add_esc_spindle.h'; platformio run
|
|
||||||
|
|
||||||
#ifdef MACHINE_FILENAME2
|
|
||||||
#include MACHINE_PATHNAME_QUOTED(MACHINE_FILENAME2)
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#endif // MACHINE_FILENAME
|
#endif // MACHINE_FILENAME
|
||||||
|
|
||||||
#endif // _machine_h
|
#endif // _machine_h
|
||||||
|
@@ -7,26 +7,16 @@ $env:PYTHONIOENCODING="utf-8"
|
|||||||
|
|
||||||
Function BuildMachine($names) {
|
Function BuildMachine($names) {
|
||||||
$basename = $names[0]
|
$basename = $names[0]
|
||||||
$addname = $names[1]
|
|
||||||
$env:PLATFORMIO_BUILD_FLAGS = "-DMACHINE_FILENAME=$basename"
|
$env:PLATFORMIO_BUILD_FLAGS = "-DMACHINE_FILENAME=$basename"
|
||||||
$displayname = $basename
|
$displayname = $basename
|
||||||
if ($addname -ne "") {
|
|
||||||
$env:PLATFORMIO_BUILD_FLAGS += " -DMACHINE_FILENAME2=$addname"
|
|
||||||
$displayname += " + $addname"
|
|
||||||
}
|
|
||||||
Write-Output "Building machine $displayname"
|
Write-Output "Building machine $displayname"
|
||||||
platformio run 2>&1 | Select-String error,Took
|
platformio run 2>&1 | Select-String error,Took
|
||||||
Write-Output " "
|
Write-Output " "
|
||||||
}
|
}
|
||||||
|
|
||||||
# First build all the base configurations with names that do not start with add_
|
# Build all the machines
|
||||||
foreach ($filepath in Get-ChildItem -file .\Grbl_Esp32\Machines\* -Exclude add_*) {
|
foreach ($filepath in Get-ChildItem -file .\Grbl_Esp32\Machines\*) {
|
||||||
BuildMachine($filepath.name, "")
|
BuildMachine($filepath.name, "")
|
||||||
}
|
}
|
||||||
|
|
||||||
# Then build all of the add-ons on top of a single base
|
|
||||||
$base="3axis_v4.h"
|
|
||||||
foreach ($filepath in Get-ChildItem -file .\Grbl_Esp32\Machines\add_*) {
|
|
||||||
BuildMachine($base, $filepath.name)
|
|
||||||
}
|
|
||||||
Remove-Item env:PLATFORMIO_BUILD_FLAGS
|
Remove-Item env:PLATFORMIO_BUILD_FLAGS
|
||||||
|
@@ -22,12 +22,8 @@ cmd = ['platformio','run']
|
|||||||
verbose = '-v' in sys.argv
|
verbose = '-v' in sys.argv
|
||||||
|
|
||||||
numErrors = 0
|
numErrors = 0
|
||||||
adderBase = '3axis_v4.h'
|
|
||||||
for name in os.listdir('Grbl_Esp32/Machines'):
|
for name in os.listdir('Grbl_Esp32/Machines'):
|
||||||
if name.startswith('add_'):
|
exitCode = buildMachine(name, verbose=verbose)
|
||||||
exitCode = buildMachine(adderBase, addName=name, verbose=verbose)
|
|
||||||
else:
|
|
||||||
exitCode = buildMachine(name, verbose=verbose)
|
|
||||||
if exitCode != 0:
|
if exitCode != 0:
|
||||||
numErrors += 1
|
numErrors += 1
|
||||||
|
|
||||||
|
18
build-all.sh
18
build-all.sh
@@ -17,14 +17,8 @@ NUM_ERRORS=0
|
|||||||
|
|
||||||
BuildMachine () {
|
BuildMachine () {
|
||||||
basename=$1
|
basename=$1
|
||||||
addname=$2
|
|
||||||
BF="\"-DMACHINE_FILENAME=$basename\""
|
BF="\"-DMACHINE_FILENAME=$basename\""
|
||||||
displayname=$basename
|
displayname=$basename
|
||||||
if [ "$addname" != "" ]
|
|
||||||
then
|
|
||||||
BF="$BF \"-DMACHINE_FILENAME2=$addname\""
|
|
||||||
displayname="$basename + $addname"
|
|
||||||
fi
|
|
||||||
echo "Building machine $displayname"
|
echo "Building machine $displayname"
|
||||||
PLATFORMIO_BUILD_FLAGS=$BF platformio run 2>&1 | $FILTER
|
PLATFORMIO_BUILD_FLAGS=$BF platformio run 2>&1 | $FILTER
|
||||||
local re=$?
|
local re=$?
|
||||||
@@ -38,18 +32,10 @@ BuildMachine () {
|
|||||||
echo
|
echo
|
||||||
}
|
}
|
||||||
|
|
||||||
# First build all the base configurations with names that do not start with add_
|
# Build all the machines
|
||||||
for file in `ls ./Grbl_Esp32/Machines/* | grep -v add_\*`; do
|
for file in `ls ./Grbl_Esp32/Machines/*`; do
|
||||||
base=`basename $file`
|
base=`basename $file`
|
||||||
BuildMachine $base ""
|
BuildMachine $base ""
|
||||||
done
|
done
|
||||||
|
|
||||||
# Then build all of the add-ons on top of a single base
|
|
||||||
base="3axis_v4.h"
|
|
||||||
for file in `ls ./Grbl_Esp32/Machines/add_*`
|
|
||||||
do
|
|
||||||
adder=`basename $file`
|
|
||||||
BuildMachine $base $adder
|
|
||||||
done
|
|
||||||
|
|
||||||
exit $NUM_ERRORS
|
exit $NUM_ERRORS
|
||||||
|
@@ -26,13 +26,11 @@ if '-u' in sys.argv:
|
|||||||
|
|
||||||
exitCode = 255
|
exitCode = 255
|
||||||
if len(sys.argv) == 2:
|
if len(sys.argv) == 2:
|
||||||
exitCode = buildMachine(sys.argv[1], addName=None, verbose=verbose, extraArgs=extraArgs)
|
exitCode = buildMachine(sys.argv[1], verbose=verbose, extraArgs=extraArgs)
|
||||||
elif len(sys.argv) == 3:
|
|
||||||
exitCode = buildMachine(sys.argv[1], addName=sys.argv[2], verbose=verbose, extraArgs=extraArgs)
|
|
||||||
else:
|
else:
|
||||||
print("Usage: ./build-machine.py [-q] [-u] machine_name.h [add_name.h]")
|
print("Usage: ./build-machine.py [-q] [-u] machine_name.h")
|
||||||
print(' Build for the given machine and optional add-on regardless of machine.h')
|
print(' Build for the given machine regardless of machine.h')
|
||||||
print(' -q suppresses most messages')
|
print(' -q suppresses most messages')
|
||||||
print(' -u uploads to the target after compilation')
|
print(' -u uploads to the target after compilation')
|
||||||
|
|
||||||
sys.exit(exitCode)
|
sys.exit(exitCode)
|
||||||
|
16
builder.py
16
builder.py
@@ -1,24 +1,20 @@
|
|||||||
# This script is imported by build-machine.py and build-all.py
|
# This script is imported by build-machine.py and build-all.py
|
||||||
# It performs a platformio build with a given base machine file
|
# It performs a platformio build with a given machine file.
|
||||||
# and an optional add-on file. The verbose argument controls
|
# The verbose argument controls whether the full output is
|
||||||
# whether the full output is displayed, or filtered to show
|
# displayed, or filtered to show only summary information.
|
||||||
# only summary information. extraArgs can be used to perform
|
# extraArgs can be used to perform uploading after compilation.
|
||||||
# uploading after compilation.
|
|
||||||
|
|
||||||
from __future__ import print_function
|
from __future__ import print_function
|
||||||
import subprocess, os
|
import subprocess, os
|
||||||
|
|
||||||
env = dict(os.environ)
|
env = dict(os.environ)
|
||||||
|
|
||||||
def buildMachine(baseName, addName=None, verbose=True, extraArgs=None):
|
def buildMachine(baseName, verbose=True, extraArgs=None):
|
||||||
cmd = ['platformio','run']
|
cmd = ['platformio','run']
|
||||||
if extraArgs:
|
if extraArgs:
|
||||||
cmd.append(extraArgs)
|
cmd.append(extraArgs)
|
||||||
displayName = baseName
|
displayName = baseName
|
||||||
flags = '-DMACHINE_FILENAME=' + baseName
|
flags = '-DMACHINE_FILENAME=' + baseName
|
||||||
if addName:
|
|
||||||
displayName += ' + ' + addName
|
|
||||||
flags += ' -DMACHINE_FILENAME2=' + addName
|
|
||||||
print('Building machine ' + displayName)
|
print('Building machine ' + displayName)
|
||||||
env['PLATFORMIO_BUILD_FLAGS'] = flags
|
env['PLATFORMIO_BUILD_FLAGS'] = flags
|
||||||
if verbose:
|
if verbose:
|
||||||
@@ -30,4 +26,4 @@ def buildMachine(baseName, addName=None, verbose=True, extraArgs=None):
|
|||||||
print(line, end='')
|
print(line, end='')
|
||||||
app.wait()
|
app.wait()
|
||||||
print()
|
print()
|
||||||
return app.returncode
|
return app.returncode
|
||||||
|
Reference in New Issue
Block a user