0.4.3 Fix #92: omg - for the last couple of weeks the official builds were

all using US frequencies.  This build fixes this (and makes the build
system cleaner in general).

If you are building your own builds in the IDE you'll need to start
setting an environment variable called COUNTRY to your two letter
country code (or leave unset to get US frequencies).  See new comment
in platformio.ini.
1.2-legacy
geeksville 2020-04-19 08:33:59 -07:00
rodzic 88c576798b
commit 2419ebb04e
5 zmienionych plików z 34 dodań i 19 usunięć

Wyświetl plik

@ -6,6 +6,10 @@ source bin/version.sh
COUNTRIES="US EU433 EU865 CN JP" COUNTRIES="US EU433 EU865 CN JP"
#COUNTRIES=US #COUNTRIES=US
#COUNTRIES=CN
BOARDS="ttgo-lora32-v2 ttgo-lora32-v1 tbeam heltec"
#BOARDS=tbeam
OUTDIR=release/latest OUTDIR=release/latest
@ -24,23 +28,21 @@ function do_build {
SRCBIN=.pio/build/$ENV_NAME/firmware.bin SRCBIN=.pio/build/$ENV_NAME/firmware.bin
SRCELF=.pio/build/$ENV_NAME/firmware.elf SRCELF=.pio/build/$ENV_NAME/firmware.elf
rm -f $SRCBIN rm -f $SRCBIN
pio run --environment $ENV_NAME # -v
# The shell vars the build tool expects to find
export HW_VERSION="1.0-$COUNTRY"
export APP_VERSION=$VERSION
export COUNTRY
pio run --jobs 4 --environment $ENV_NAME # -v
cp $SRCBIN $OUTDIR/bins/firmware-$ENV_NAME-$COUNTRY-$VERSION.bin cp $SRCBIN $OUTDIR/bins/firmware-$ENV_NAME-$COUNTRY-$VERSION.bin
cp $SRCELF $OUTDIR/elfs/firmware-$ENV_NAME-$COUNTRY-$VERSION.elf cp $SRCELF $OUTDIR/elfs/firmware-$ENV_NAME-$COUNTRY-$VERSION.elf
} }
for COUNTRY in $COUNTRIES; do for COUNTRY in $COUNTRIES; do
for BOARD in $BOARDS; do
HWVERSTR="1.0-$COUNTRY" do_build $BOARD
COMMONOPTS="-DAPP_VERSION=$VERSION -DHW_VERSION_$COUNTRY -DHW_VERSION=$HWVERSTR -Wall -Wextra -Wno-missing-field-initializers -Isrc -Os -DAXP_DEBUG_PORT=Serial" done
export PLATFORMIO_BUILD_FLAGS="$COMMONOPTS"
#do_build "tbeam0.7"
do_build "ttgo-lora32-v2"
do_build "ttgo-lora32-v1"
do_build "tbeam"
do_build "heltec"
done done
# keep the bins in archive also # keep the bins in archive also

Wyświetl plik

@ -1,3 +1,3 @@
export VERSION=0.4.2 export VERSION=0.4.3

Wyświetl plik

@ -12,9 +12,14 @@
default_envs = tbeam default_envs = tbeam
[common] [common]
; default to a US frequency range, change it as needed for your region and hardware (CN, JP, EU433, EU865) ; common is not currently used
hw_version = US
; REQUIRED environment variables - if not set the specified default will be sued
; The following environment variables must be set in the shell if you'd like to override them.
; They are used in this ini file as systenv.VARNAME, so in your shell do export "VARNAME=fish"
; HW_VERSION (default US)
; APP_VERSION (default emptystring)
; HW_VERSION (default emptystring)
[env] [env]
platform = espressif32 platform = espressif32
@ -26,7 +31,11 @@ board_build.partitions = partition-table.csv
; note: we add src to our include search path so that lmic_project_config can override ; note: we add src to our include search path so that lmic_project_config can override
; FIXME: fix lib/BluetoothOTA dependency back on src/ so we can remove -Isrc ; FIXME: fix lib/BluetoothOTA dependency back on src/ so we can remove -Isrc
build_flags = -Wno-missing-field-initializers -Isrc -Isrc/rf95 -Os -Wl,-Map,.pio/build/output.map -DAXP_DEBUG_PORT=Serial -DHW_VERSION_${common.hw_version} build_flags = -Wno-missing-field-initializers -Isrc -Isrc/rf95 -Os -Wl,-Map,.pio/build/output.map
-DAXP_DEBUG_PORT=Serial
-DHW_VERSION_${sysenv.COUNTRY}
-DAPP_VERSION=${sysenv.APP_VERSION}
-DHW_VERSION=${sysenv.HW_VERSION}
; not needed included in ttgo-t-beam board file ; not needed included in ttgo-t-beam board file
; also to use PSRAM https://docs.platformio.org/en/latest/platforms/espressif32.html#external-ram-psram ; also to use PSRAM https://docs.platformio.org/en/latest/platforms/espressif32.html#external-ram-psram

Wyświetl plik

@ -55,7 +55,10 @@
#define CH_SPACING CH_SPACING_JP #define CH_SPACING CH_SPACING_JP
#define NUM_CHANNELS NUM_CHANNELS_JP #define NUM_CHANNELS NUM_CHANNELS_JP
#else #else
#error "HW_VERSION not set" // HW version not set - assume US
#define CH0 CH0_US
#define CH_SPACING CH_SPACING_US
#define NUM_CHANNELS NUM_CHANNELS_US
#endif #endif
/** /**

Wyświetl plik

@ -31,8 +31,9 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
// If app version is not specified we assume we are not being invoked by the build script // If app version is not specified we assume we are not being invoked by the build script
#ifndef APP_VERSION #ifndef APP_VERSION
#define APP_VERSION 0.0.0 // this def normally comes from build-all.sh #error APP_VERSION, HW_VERSION, and HW_VERSION_countryname must be set by the build environment
#define HW_VERSION 1.0 - US // normally comes from build-all.sh and contains the region code //#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 #endif
// ----------------------------------------------------------------------------- // -----------------------------------------------------------------------------