diff --git a/bin/build-all.sh b/bin/build-all.sh index 17de9d39..7e0be8e2 100755 --- a/bin/build-all.sh +++ b/bin/build-all.sh @@ -2,7 +2,7 @@ set -e -VERSION=0.0.4 +source bin/version.sh COUNTRIES="US EU CN JP" @@ -11,7 +11,8 @@ SRCBIN=.pio/build/esp32/firmware.bin for COUNTRY in $COUNTRIES; do - COMMONOPTS="-DAPP_VERSION=$VERSION -DHW_VERSION_$COUNTRY -Wall -Wextra -Wno-missing-field-initializers -Isrc -Os -Wl,-Map,.pio/build/esp32/output.map -DAXP_DEBUG_PORT=Serial" + HWVERSTR="1.0-$COUNTRY" + COMMONOPTS="-DAPP_VERSION=$VERSION -DHW_VERSION_$COUNTRY -DHW_VERSION=$HWVERSTR -Wall -Wextra -Wno-missing-field-initializers -Isrc -Os -Wl,-Map,.pio/build/esp32/output.map -DAXP_DEBUG_PORT=Serial" export PLATFORMIO_BUILD_FLAGS="-DT_BEAM_V10 $COMMONOPTS" echo "Building with $PLATFORMIO_BUILD_FLAGS" @@ -25,7 +26,6 @@ for COUNTRY in $COUNTRIES; do pio run # -v cp $SRCBIN release/firmware-HELTEC-$COUNTRY-$VERSION.bin cp $SRCMAP release/firmware-HELTEC-$COUNTRY-$VERSION.map - done zip release/firmware-$VERSION.zip release/firmware-*-$VERSION.bin diff --git a/src/configuration.h b/src/configuration.h index 049a6c4b..61067de6 100644 --- a/src/configuration.h +++ b/src/configuration.h @@ -29,11 +29,10 @@ along with this program. If not, see . // Version // ----------------------------------------------------------------------------- -#define APP_NAME "Meshtastic" - // If app version is not specified we assume we are not being invoked by the build script #ifndef APP_VERSION #define APP_VERSION 0.0.0 // this def normally comes from build-all.sh +#define HW_VERSION 1.0-US // normally comes from build-all.sh and contains the region code #endif diff --git a/src/main.ino b/src/main.ino index 3ab046ff..0cbdbe03 100644 --- a/src/main.ino +++ b/src/main.ino @@ -240,7 +240,7 @@ void setup() #endif // Hello - DEBUG_MSG("%s %s\n", str(APP_NAME), xstr(APP_VERSION)); + DEBUG_MSG("Meshtastic swver=%s, hwver=%s\n", xstr(APP_VERSION), xstr(HW_VERSION)); // Don't init display if we don't have one or we are waking headless due to a timer event if (wakeCause == ESP_SLEEP_WAKEUP_TIMER) @@ -270,7 +270,7 @@ void initBluetooth() // FIXME - we are leaking like crazy // AllocatorScope scope(btPool); - BLEServer *serve = initBLE(getDeviceName(), HW_VENDOR, xstr(APP_VERSION)); // FIXME, use a real name based on the macaddr + BLEServer *serve = initBLE(getDeviceName(), HW_VENDOR, xstr(APP_VERSION), xstr(HW_VERSION)); // FIXME, use a real name based on the macaddr createMeshBluetoothService(serve); // Start advertising - this must be done _after_ creating all services