Skip to content

Commit fe9a8cf

Browse files
committed
Fix PF-build.sh with new cmake
Same as MK3_3.13.2 branch
1 parent 323f9aa commit fe9a8cf

File tree

4 files changed

+22
-72
lines changed

4 files changed

+22
-72
lines changed

Firmware/Configuration.h

+3-2
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@ extern const char _sPrinterMmuName[] PROGMEM;
2121
#define FW_MAJOR 3
2222
#define FW_MINOR 13
2323
#define FW_REVISION 0
24-
#warning "** Not sure why I had to touch this, but it seems like v3.13.1 is not in the linear history of this branch yet?"
2524
#define FW_COMMITNR 6853
2625
#define FW_FLAVOR RC //uncomment if DEV, ALPHA, BETA or RC
2726
#define FW_FLAVERSION 1 //uncomment if FW_FLAVOR is defined and versioning is needed. Limited to max 8.
@@ -43,7 +42,9 @@ extern const char _sPrinterMmuName[] PROGMEM;
4342
#define FW_COMMIT_HASH_LENGTH 1
4443
#define FW_COMMIT_HASH "0"
4544
#define FW_REPOSITORY "Unknown"
46-
#define FW_VERSION_FULL FW_VERSION "-unknown"
45+
#ifndef FW_VERSION_FULL
46+
#define FW_VERSION_FULL FW_VERSION
47+
#endif //END FW_VERSION_FULL
4748
#endif
4849

4950
// G-code language level

Firmware/ultralcd.cpp

+4-2
Original file line numberDiff line numberDiff line change
@@ -1600,8 +1600,8 @@ static void lcd_support_menu()
16001600

16011601
MENU_ITEM_BACK_P(PSTR("Firmware:"));
16021602
MENU_ITEM_BACK_P(PSTR(" " FW_VERSION_FULL));
1603-
MENU_ITEM_BACK_P(PSTR(" repo " FW_REPOSITORY));
1604-
MENU_ITEM_BACK_P(PSTR(" date " SOURCE_DATE_EPOCH));
1603+
MENU_ITEM_BACK_P(PSTR(" Repo:" FW_REPOSITORY));
1604+
MENU_ITEM_BACK_P(PSTR(" Hash:" FW_COMMIT_HASH));
16051605
MENU_ITEM_BACK_P(_n("prusa3d.com"));////MSG_PRUSA3D c=18
16061606
MENU_ITEM_BACK_P(_n("forum.prusa3d.com"));////MSG_PRUSA3D_FORUM c=18
16071607
MENU_ITEM_BACK_P(_n("help.prusa3d.com"));////MSG_PRUSA3D_HELP c=18
@@ -1610,6 +1610,8 @@ static void lcd_support_menu()
16101610
MENU_ITEM_BACK_P(PSTR(ELECTRONICS));
16111611
MENU_ITEM_BACK_P(PSTR(NOZZLE_TYPE));
16121612
MENU_ITEM_BACK_P(STR_SEPARATOR);
1613+
MENU_ITEM_BACK_P(_i("Date:"));////MSG_DATE c=17
1614+
MENU_ITEM_BACK_P(PSTR(SOURCE_DATE_EPOCH));
16131615

16141616
#if defined(FILAMENT_SENSOR) && (FILAMENT_SENSOR_TYPE == FSENSOR_IR_ANALOG)
16151617
MENU_ITEM_BACK_P(STR_SEPARATOR);

PF-build.sh

+10-63
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@
5656
# Some may argue that this is only used by a script, BUT as soon someone accidentally or on purpose starts Arduino IDE
5757
# it will use the default Arduino IDE folders and so can corrupt the build environment.
5858
#
59-
# Version: 2.0.2-Build_80
59+
# Version: 2.0.3-Build_89
6060
# Change log:
6161
# 12 Jan 2019, 3d-gussner, Fixed "compiler.c.elf.flags=-w -Os -Wl,-u,vfprintf -lprintf_flt -lm -Wl,--gc-sections" in 'platform.txt'
6262
# 16 Jan 2019, 3d-gussner, Build_2, Added development check to modify 'Configuration.h' to prevent unwanted LCD messages that Firmware is unknown
@@ -183,6 +183,11 @@
183183
# 06 Jul 2022, 3d-gussner, Change to v1.0.8 and Ardunio_boards v1.0.5-2
184184
# 06 Jul 2022, 3d-gussner, Fix branch check
185185
# 12 Jul 2022, 3d-gussner, Check if FW_FLAVAVOR and FW_FLAVERSION are correct
186+
# 29 Sep 2022, 3d-gussner, Rename EN_ONLY to EN_FARM
187+
# 03 Oct 2022, 3d-gussner, Update to Arduino boards 1.0.6 and remove gawk
188+
# 17 Dec 2022, wavexx , Check for the coorect pyton version, improve depencies
189+
# 14 Mar 2023, 3d-gussner, Rename MMU2 to MMU
190+
# 11 Oct 2023, 3d-gussner, Fix issues with new cmake build, remove devel flag
186191

187192
SCRIPT_PATH="$( cd "$(dirname "$0")" ; pwd -P )"
188193
export SRCDIR=$SCRIPT_PATH
@@ -219,7 +224,6 @@ while getopts b:c:d:g:h:i:j:l:m:n:o:p:v:x:y:?h flag
219224
case "${flag}" in
220225
b) build_flag=${OPTARG};;
221226
c) clean_flag=${OPTARG};;
222-
d) devel_flag=${OPTARG};;
223227
g) mk404_graphics_flag=${OPTARG};;
224228
h) help_flag=1;;
225229
i) IDE_flag=${OPTARG};;
@@ -245,7 +249,6 @@ echo "***************************************"
245249
echo "Arguments:"
246250
echo "$(tput setaf 2)-b$(tput sgr0) Build/commit number"
247251
echo "$(tput setaf 2)-c$(tput sgr0) Do not clean up lang build"
248-
echo "$(tput setaf 2)-d$(tput sgr0) Devel build"
249252
echo "$(tput setaf 2)-g$(tput sgr0) Start MK404 graphics"
250253
echo "$(tput setaf 2)-i$(tput sgr0) Arduino IDE version"
251254
echo "$(tput setaf 2)-j$(tput sgr0) Arduino IDE verbose output"
@@ -264,7 +267,6 @@ echo " $(tput setaf 2)./PF-build.sh$(tput sgr0) [-b] [-c] [-d] [-g] [-i] [-j] [
264267
echo
265268
echo " -b : '$(tput setaf 2)Auto$(tput sgr0)' needs git or a number"
266269
echo " -c : '$(tput setaf 2)0$(tput sgr0)' clean up, '$(tput setaf 2)1$(tput sgr0)' keep"
267-
echo " -d : '$(tput setaf 2)GOLD$(tput sgr0)', '$(tput setaf 2)RC$(tput sgr0)', '$(tput setaf 2)BETA$(tput sgr0)', '$(tput setaf 2)ALPHA$(tput sgr0)', '$(tput setaf 2)DEBUG$(tput sgr0)', '$(tput setaf 2)DEVEL$(tput sgr0)' and '$(tput setaf 2)UNKNOWN$(tput sgr0)'"
268270
echo " -g : '$(tput setaf 2)0$(tput sgr0)' no '$(tput setaf 2)1$(tput sgr0)' lite '$(tput setaf 2)2$(tput sgr0)' fancy '$(tput setaf 2)3$(tput sgr0)' lite with Quad_HR '$(tput setaf 2)4$(tput sgr0)' fancy with Quad_HR"
269271
echo " -i : '$(tput setaf 2)1.8.5$(tput sgr0)', '$(tput setaf 2)1.8.19$(tput sgr0)'"
270272
echo " -j : '$(tput setaf 2)0$(tput sgr0)' no, '$(tput setaf 2)1$(tput sgr0)' yes"
@@ -897,18 +899,6 @@ else
897899
failures 5
898900
fi
899901
fi
900-
#Check if DEV_STATUS is selected via argument '-d'
901-
if [ ! -z "$devel_flag" ] ; then
902-
if [[ "$devel_flag" == "GOLD" || "$devel_flag" == "RC" || "$devel_flag" == "BETA" || "$devel_flag" == "ALPHA" || "$devel_flag" == "DEVEL" || "$devel_flag" == "DEBUG" || "$devel_flag" == "UNKNOWN" ]] ; then
903-
DEV_STATUS_SELECTED=$devel_flag
904-
elif [[ "$devel_flag" == "atmega404" || "$devel_flag" == "atmega404_no_bootloader" ]] ; then
905-
MK404_DEBUG=$devel_flag
906-
else
907-
echo "$(tput setaf 1)Development argument is wrong!$(tput sgr0)"
908-
echo "Only $(tput setaf 2)'GOLD', 'RC', 'BETA', 'ALPHA', 'DEVEL', 'DEBUG' or 'UNKNOWN' $(tput sgr0) are allowed as devel '-d' argument!$(tput sgr0)"
909-
failures 5
910-
fi
911-
fi
912902

913903
#Check if Build is selected via argument '-b'
914904
if [ ! -z "$build_flag" ] ; then
@@ -990,14 +980,14 @@ prepare_code_for_compiling()
990980
#FW=$(grep --max-count=1 "\bFW_VERSION\b" $SCRIPT_PATH/Firmware/Configuration.h | sed -e's/ */ /g'|cut -d '"' -f2|sed 's/\.//g')
991981
if [ -z "$BUILD" ] ; then
992982
# Find build version in Configuration.h file and use it to generate the hex filename
993-
BUILD=$(grep --max-count=1 "\bFW_COMMIT_NR\b" $SCRIPT_PATH/Firmware/Configuration.h | sed -e's/ */ /g'|cut -d ' ' -f3)
983+
BUILD=$(grep --max-count=1 "\bFW_COMMITNR\b" $SCRIPT_PATH/Firmware/Configuration.h | sed -e's/ */ /g'|cut -d ' ' -f3)
994984
else
995985
# Find and replace build version in Configuration.h file
996-
BUILD_ORG=$(grep --max-count=1 "\bFW_COMMIT_NR\b" $SCRIPT_PATH/Firmware/Configuration.h | sed -e's/ */ /g'|cut -d ' ' -f3)
986+
BUILD_ORG=$(grep --max-count=1 "\bFW_COMMITNR\b" $SCRIPT_PATH/Firmware/Configuration.h | sed -e's/ */ /g'|cut -d ' ' -f3)
997987
echo "Original build number: $BUILD_ORG"
998988
if [ "$BUILD_ORG" != "$BUILD" ]; then
999989
echo "New build number : $BUILD"
1000-
sed -i -- "s/^#define FW_COMMIT_NR.*/#define FW_COMMIT_NR $BUILD/g" $SCRIPT_PATH/Firmware/Configuration.h
990+
sed -i -- "s/^#define FW_COMMITNR.*/#define FW_COMMITNR $BUILD/g" $SCRIPT_PATH/Firmware/Configuration.h
1001991
fi
1002992
fi
1003993
# Check if the motherboard is an EINSY and if so only one hex file will generated
@@ -1024,44 +1014,6 @@ prepare_code_for_compiling()
10241014
failures 26
10251015
fi
10261016
fi
1027-
#DEV_CHECK=$(grep --max-count=1 "\bFW_VERSION\b" $SCRIPT_PATH/Firmware/Configuration.h | sed -e's/ */ /g'|cut -d '"' -f2|sed 's/\.//g'|cut -d '-' -f2)
1028-
if [ -z "$DEV_STATUS_SELECTED" ] ; then
1029-
if [[ "$DEV_CHECK" == *"RC"* ]] ; then
1030-
DEV_STATUS="RC"
1031-
elif [[ "$DEV_CHECK" == *"ALPHA"* ]]; then
1032-
DEV_STATUS="ALPHA"
1033-
elif [[ "$DEV_CHECK" == *"BETA"* ]]; then
1034-
DEV_STATUS="BETA"
1035-
elif [[ "$DEV_CHECK" == "DEVEL" ]]; then
1036-
DEV_STATUS="DEVEL"
1037-
elif [[ "$DEV_CHECK" == "DEBUG" ]]; then
1038-
DEV_STATUS="DEBUG"
1039-
else
1040-
DEV_STATUS="UNKNOWN"
1041-
echo
1042-
echo "$(tput setaf 5)DEV_STATUS is UNKNOWN. Do you wish to set DEV_STATUS to GOLD?$(tput sgr0)"
1043-
PS3="Select YES only if source code is tested and trusted: "
1044-
select yn in "Yes" "No"; do
1045-
case $yn in
1046-
Yes)
1047-
DEV_STATUS="GOLD"
1048-
DEV_STATUS_SELECTED="GOLD"
1049-
break
1050-
;;
1051-
No)
1052-
DEV_STATUS="UNKNOWN"
1053-
DEV_STATUS_SELECTED="UNKNOWN"
1054-
break
1055-
;;
1056-
*)
1057-
echo "$(tput setaf 1)This is not a valid DEV_STATUS$(tput sgr0)"
1058-
;;
1059-
esac
1060-
done
1061-
fi
1062-
else
1063-
DEV_STATUS=$DEV_STATUS_SELECTED
1064-
fi
10651017
}
10661018
#### End: Prepare code for compiling
10671019

@@ -1121,7 +1073,6 @@ list_usefull_data()
11211073
echo "Firmware :" $FW
11221074
echo "Build # :" $BUILD
11231075
echo "Dev Check :" $DEV_CHECK
1124-
echo "DEV Status :" $DEV_STATUS
11251076
echo "Motherboard :" $MOTHERBOARD
11261077
echo "Board flash :" $BOARD_FLASH
11271078
echo "Board mem :" $BOARD_MEM
@@ -1147,9 +1098,6 @@ prepare_variant_for_compiling()
11471098
cp -f $SCRIPT_PATH/Firmware/variants/$VARIANT.h $SCRIPT_PATH/Firmware/Configuration_prusa.h || failures 12
11481099
fi
11491100

1150-
#Prepare Configuration.h to use the correct FW_DEV_VERSION to prevent LCD messages when connecting with OctoPrint
1151-
sed -i -- "s/#define FW_DEV_VERSION FW_VERSION_.*/#define FW_DEV_VERSION FW_VERSION_$DEV_STATUS/g" $SCRIPT_PATH/Firmware/Configuration.h
1152-
11531101
# set FW_REPOSITORY
11541102
sed -i -- 's/#define FW_REPOSITORY "Unknown"/#define FW_REPOSITORY "Prusa3d"/g' $SCRIPT_PATH/Firmware/Configuration.h
11551103

@@ -1407,10 +1355,9 @@ cleanup_firmware()
14071355
fi
14081356

14091357
# Restore files to previous state
1410-
sed -i -- "s/^#define FW_DEV_VERSION FW_VERSION_.*/#define FW_DEV_VERSION FW_VERSION_UNKNOWN/g" $SCRIPT_PATH/Firmware/Configuration.h
14111358
sed -i -- 's/^#define FW_REPOSITORY.*/#define FW_REPOSITORY "Unknown"/g' $SCRIPT_PATH/Firmware/Configuration.h
14121359
if [ ! -z "$BUILD_ORG" ] ; then
1413-
sed -i -- "s/^#define FW_COMMIT_NR.*/#define FW_COMMIT_NR $BUILD_ORG/g" $SCRIPT_PATH/Firmware/Configuration.h
1360+
sed -i -- "s/^#define FW_COMMITNR.*/#define FW_COMMITNR $BUILD_ORG/g" $SCRIPT_PATH/Firmware/Configuration.h
14141361
fi
14151362
echo $MULTI_LANGUAGE_CHECK
14161363
#sed -i -- "s/^#define LANG_MODE * /#define LANG_MODE $MULTI_LANGUAGE_CHECK/g" $SCRIPT_PATH/Firmware/config.h

cmake/ProjectVersion.cmake

+5-5
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,11 @@
22
# This file is responsible for setting the following variables:
33
#
44
# ~~~
5-
# PROJECT_VERSION_MAJOR (4)
6-
# PROJECT_VERSION_MINOR (0)
7-
# PROJECT_VERSION_REV (3)
8-
# PROJECT_VERSION (4.0.3)
9-
# FW_COMMIT_DSC ("v4.0.3-deadbeef")
5+
# PROJECT_VERSION_MAJOR (3)
6+
# PROJECT_VERSION_MINOR (13)
7+
# PROJECT_VERSION_REV (2)
8+
# PROJECT_VERSION (3.13.2)
9+
# FW_COMMIT_DSC ("v3.13.2-deadbeef")
1010
# FW_COMMIT_HASH (deadbeef)
1111
# FW_COMMIT_DATE (1665051856)
1212
#

0 commit comments

Comments
 (0)