firmware - change to set version in CanGrow_Version.h, build by cangrow.sh

This commit is contained in:
DeltaLima 2024-12-13 20:50:29 +01:00
parent c80ac2e6f6
commit abb79ebecc
4 changed files with 18 additions and 11 deletions

View file

@ -4,14 +4,6 @@
*/
// set CANGROW_VER and CANGROW_BUILD if not already done as Compiler Flag
#ifndef CANGROW_VER
#define CANGROW_VER "0.0.0-dev"
#endif
#ifndef CANGROW_BUILD
#define CANGROW_BUILD "1a2b3c4-0000000000000"
#endif
/*
* Includes
*

View file

@ -0,0 +1,13 @@
/*
*
*
* Version
*
*
*/
#define CANGROW_VER "0.1.4-dev"
// CANGROW_BUILD default dummy value if not set as Compiler Flag
#ifndef CANGROW_BUILD
#define CANGROW_BUILD "1a2b3c4-0000000000000"
#endif

View file

@ -383,7 +383,7 @@ void WEBroot() {
body += returnStrDateFromEpoch(GrowStart);
body += "<br>\n";
body += "<b>Harvest date (est.): &#x1F342; </b> ";
body += returnStrDateFromEpoch(GrowStart + (60 * 60 * 24 * (DaysVeg + DaysVeg) ) );
body += returnStrDateFromEpoch(GrowStart + (60 * 60 * 24 * (DaysVeg + DaysBloom) ) );
body += "<br>\n";
body += "<b>Day of Grow: </b> ";
if(DayNight == true) {

View file

@ -3,7 +3,8 @@
test -z $TTY && TTY="/dev/ttyUSB0"
test -z $IP && IP="192.168.4.20"
test -z $VER && VER="0.1.4-dev"
VER="$(grep "define CANGROW_VER" Arduino/CanGrow/CanGrow_Version.ino | cut -d \" -f2 |sed -e 's/\"//g')"
BUILD="$(git rev-parse --short HEAD)-$(date '+%Y%m%d%H%M%S')"
ACLI="$HOME/.local/bin/arduino-cli"
@ -74,7 +75,8 @@ case $1 in
check_acli
echo ":: Building firmware $VER $BUILD, target dir: $(pwd)/build/"
test -d build || mkdir build
${ACLI_CMD} --no-color compile -b ${BOARD} "Arduino/CanGrow/CanGrow.ino" --build-property "build.extra_flags=-DCANGROW_VER=\"${VER}\" -DCANGROW_BUILD=\"${BUILD}\"" --output-dir build/ || exit 1
${ACLI_CMD} --no-color compile -b ${BOARD} "Arduino/CanGrow/CanGrow.ino" --build-property "build.extra_flags=-DCANGROW_BUILD=\"${BUILD}\"" --output-dir build/ || exit 1
#${ACLI_CMD} --no-color compile -b ${BOARD} "Arduino/CanGrow/CanGrow.ino" --build-property "build.extra_flags=-DCANGROW_VER=\"${VER}\" -DCANGROW_BUILD=\"${BUILD}\"" --output-dir build/ || exit 1
cp build/CanGrow.ino.bin build/CanGrow_v${VER}_${BUILD}.bin
;;
u|upload)