Added switch to build tool to dump out configs.

Added "--config" option to build-lulzbot-firmware.sh to save out
values in "Configuration.h" and "Configuration_adv.h" for chosen
printer and toolhead. This is useful when submitting issues to
Marlin devs.

Fixed incorrect name of LULZBOT_PRINTCOUNTER
master
Marcio Teixeira 7 years ago
parent 0cbe9d41d6
commit 8ddf7ee961

@ -39,7 +39,7 @@
#error Must specify model and toolhead. Please see "Configuration_LulzBot.h" for directions. #error Must specify model and toolhead. Please see "Configuration_LulzBot.h" for directions.
#endif #endif
#define LULZBOT_FW_VERSION ".3" #define LULZBOT_FW_VERSION ".4"
// Select options based on printer model // Select options based on printer model
@ -62,7 +62,7 @@
#define LULZBOT_USE_MAX_ENDSTOPS #define LULZBOT_USE_MAX_ENDSTOPS
#define LULZBOT_USE_NORMALLY_CLOSED_ENDSTOPS #define LULZBOT_USE_NORMALLY_CLOSED_ENDSTOPS
#define LULZBOT_BAUDRATE 250000 #define LULZBOT_BAUDRATE 250000
#define LULZBOT_PRINTERCOUNTER #define LULZBOT_PRINTCOUNTER
#endif #endif
#if defined(LULZBOT_Gladiola_MiniLCD) #if defined(LULZBOT_Gladiola_MiniLCD)
@ -86,7 +86,7 @@
#define LULZBOT_USE_MAX_ENDSTOPS #define LULZBOT_USE_MAX_ENDSTOPS
#define LULZBOT_USE_NORMALLY_CLOSED_ENDSTOPS #define LULZBOT_USE_NORMALLY_CLOSED_ENDSTOPS
#define LULZBOT_BAUDRATE 250000 #define LULZBOT_BAUDRATE 250000
#define LULZBOT_PRINTERCOUNTER #define LULZBOT_PRINTCOUNTER
#endif #endif
#if defined(LULZBOT_Juniper_TAZ5) #if defined(LULZBOT_Juniper_TAZ5)
@ -120,7 +120,7 @@
#define LULZBOT_USE_MAX_ENDSTOPS #define LULZBOT_USE_MAX_ENDSTOPS
#define LULZBOT_USE_NORMALLY_CLOSED_ENDSTOPS #define LULZBOT_USE_NORMALLY_CLOSED_ENDSTOPS
#define LULZBOT_BAUDRATE 250000 #define LULZBOT_BAUDRATE 250000
#define LULZBOT_PRINTERCOUNTER #define LULZBOT_PRINTCOUNTER
#endif #endif
// Shared values // Shared values

@ -1192,7 +1192,7 @@
* *
* View the current statistics with M78. * View the current statistics with M78.
*/ */
#define PRINTCOUNTER LULZBOT_PRINTERCOUNTER #define PRINTCOUNTER LULZBOT_PRINTCOUNTER
//============================================================================= //=============================================================================
//============================= LCD and SD support ============================ //============================= LCD and SD support ============================

@ -457,6 +457,26 @@ endif
# Default target. # Default target.
all: sizeafter all: sizeafter
config:
# This build target uses the C preprocessor to output a snapshot of the
# "Configuration.h" and "Configuration_adv.h" for the current printer
# and toolhead. This is useful for when Marlin developers ask for a copy
# of your config files when you submit an issue.
# Dump the values defined in "Configuration.h"
echo '#include "Marlin.h"' > /tmp/macros.cpp
cat Configuration.h >> /tmp/macros.cpp
sed -i 's/#define *\(\w*\)/pound_defined_\1/g; s/#ifndef CONFIGURATION_H/#ifndef FOO/g' /tmp/macros.cpp
$(CXX) $(ALL_CXXFLAGS) -E /tmp/macros.cpp -o /tmp/preprocessed.h
grep pound_defined /tmp/preprocessed.h | sed 's/ *pound_defined_\(\w*\)/#define \1/g' > ../build/Configuration.h
# Dump the values defined in "Configuration_adv.h"
echo '#include "Marlin.h"' > /tmp/macros.cpp
cat Configuration_adv.h >> /tmp/macros.cpp
sed -i 's/#define *\(\w*\)/pound_defined_\1/g; s/#ifndef CONFIGURATION_ADV_H/#ifndef FOO/g' /tmp/macros.cpp
$(CXX) $(ALL_CXXFLAGS) -E /tmp/macros.cpp -o /tmp/preprocessed.h
grep pound_defined /tmp/preprocessed.h | sed 's/ *pound_defined_\(\w*\)/#define \1/g' > ../build/Configuration_adv.h
build: $(BUILD_DIR) elf hex $(BUILD_DIR)/$(HEX_FILENAME).hex build: $(BUILD_DIR) elf hex $(BUILD_DIR)/$(HEX_FILENAME).hex
$(BUILD_DIR)/$(HEX_FILENAME).hex: $(BUILD_DIR)/$(TARGET).hex $(BUILD_DIR)/$(HEX_FILENAME).hex: $(BUILD_DIR)/$(TARGET).hex

@ -28,7 +28,17 @@ TAZ_TOOLHEADS="Tilapia_SingleExtruder Kanyu_Flexystruder Opah_Moarstruder Javeli
# Prints out a usage summary # Prints out a usage summary
# #
usage() { usage() {
echo "Usage: $0 [-s|--short-names] [--no-timestamps] [printer_model toolhead_name]" echo
echo "Usage: $0 [-s|--short-names] [--no-timestamps] [-c|--config] [printer_model toolhead_name]"
echo
echo " -s|--short-names Omits LulzBot code names from generated .hex files"
echo
echo " --no-timestamps Does not embed a timestamp in the .hex file."
echo
echo " -c|--config Rather than compiling a .hex file, dump out the values"
echo " in 'Configuration.h' and 'Configuration_adv.h' that are"
echo " to be used for the specified printer and toolhead."
echo
exit exit
} }
@ -47,6 +57,20 @@ build_firmware() {
mv Marlin/applet/*.hex build mv Marlin/applet/*.hex build
} }
####
# build_config <printer> <toolhead>
#
# Compiles Configuration.h and Configuration_adv.h for the specified printer and toolhead
#
build_config() {
printer=$1
toolhead=$2
echo
echo Generating config for ${printer} and ${toolhead}
echo
(cd Marlin; make clean; make $MAKEOPTS AVR_TOOLS_PATH=${AVR_TOOLS_PATH}/ MODEL=${printer} TOOLHEAD=${toolhead} config) || exit
}
#### ####
# check_tool <exec_name> # check_tool <exec_name>
# #
@ -141,7 +165,7 @@ build_summary() {
echo echo
echo echo
echo echo
echo Firmware hex files built in "`pwd`/build": echo Generated files stored in "`pwd`/build":
echo echo
ls build ls build
echo echo
@ -162,6 +186,10 @@ do
SHORTNAMES=1 SHORTNAMES=1
shift shift
;; ;;
--config|-c)
GENERATE_CONFIG=1
shift
;;
--*) --*)
usage usage
;; ;;
@ -179,7 +207,11 @@ mkdir build
if [ $# -eq 2 ] if [ $# -eq 2 ]
then then
if [ $GENERATE_CONFIG ]; then
build_config $1 $2
else
build_firmware $1 $2 build_firmware $1 $2
fi
else else
build_for_mini build_for_mini
build_for_taz build_for_taz

Loading…
Cancel
Save