diff --git a/local_build.sh b/local_build.sh index d70d65408..5f0987a0d 100755 --- a/local_build.sh +++ b/local_build.sh @@ -8,7 +8,7 @@ # Defaults baked in (edit the list below to change them): # Radio 919.5 MHz / BW500 / SF10 / CR5 (matches the local mesh; # Hazelwood KM-Test repeater) -# BLE PIN code macro 123456 (on display boards such as Heltec V3 the +# BLE PIN code macro 123456, companion targets only (on display boards such as Heltec V3 the # firmware treats 123456 as "show a random PIN on screen each # session"; set a fixed PIN at runtime from the app/CLI instead) # Settings profile: target defaults (--profile default), not Cascade @@ -29,7 +29,13 @@ set -e -LOCAL_BUILD_FLAGS="-DLORA_FREQ=919.5 -DLORA_BW=500 -DLORA_SF=10 -DLORA_CR=5 -DBLE_PIN_CODE=123456" +LOCAL_BUILD_FLAGS="-DLORA_FREQ=919.5 -DLORA_BW=500 -DLORA_SF=10 -DLORA_CR=5" +# BLE_PIN_CODE only matters to companions. scripts/check_firmware_ram.py +# reserves 5,920 bytes of Bluetooth worker stacks on nRF52 whenever it is +# defined, which pushes the RAK4631 repeater over its runtime RAM budget. +case "${2:-}" in + *companion*) LOCAL_BUILD_FLAGS="${LOCAL_BUILD_FLAGS} -DBLE_PIN_CODE=123456" ;; +esac export PLATFORMIO_BUILD_FLAGS="${PLATFORMIO_BUILD_FLAGS:+${PLATFORMIO_BUILD_FLAGS} }${LOCAL_BUILD_FLAGS}"