From c3a28e9ab8d0c3bcf2db4fb0ed2b8f4ea7293e5d Mon Sep 17 00:00:00 2001 From: mikecarper Date: Mon, 26 Oct 2026 19:59:56 -0700 Subject: [PATCH] Use the existing nRF52 layout for custom source builds --- tools/lora_ota/ota_wizard.py | 3 ++- tools/lora_ota/test_ota_wizard.py | 10 ++++++++-- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/tools/lora_ota/ota_wizard.py b/tools/lora_ota/ota_wizard.py index 08b10fc1a..7809be7c5 100644 --- a/tools/lora_ota/ota_wizard.py +++ b/tools/lora_ota/ota_wizard.py @@ -194,7 +194,8 @@ def custom_build(args, destination, target_env: str) -> Path: output.mkdir(parents=True, exist_ok=False) # build.sh holds the repository's build lock and runs one PlatformIO process. command = ["bash", "build.sh", "build-firmware", target_env, - "--build-profile", "full", "--radio-preset", "target", + "--build-profile", "full" if destination.platform == "esp32" else "auto", + "--radio-preset", "target", "--profile", "cascade", "--firmware-version", version] if destination.platform == "esp32": command += ["--full-exact"] diff --git a/tools/lora_ota/test_ota_wizard.py b/tools/lora_ota/test_ota_wizard.py index a9aa35456..44b6c490a 100644 --- a/tools/lora_ota/test_ota_wizard.py +++ b/tools/lora_ota/test_ota_wizard.py @@ -1,5 +1,6 @@ """User-facing choices, recovery identity, and compiler-free offline preparation.""" import asyncio +from dataclasses import replace from contextlib import redirect_stderr, redirect_stdout import io import json @@ -66,12 +67,17 @@ class WizardTests(unittest.TestCase): mock.patch.object(wizard.subprocess, 'run', side_effect=process), \ redirect_stdout(io.StringIO()): built = wizard.custom_build(args, destination(), 'ikoka_stick_nrf_33dbm_repeater') + wizard.custom_build(args, replace(destination(), platform='esp32'), 'heltec_v4_repeater') self.assertEqual(built.read_bytes(), image().image) - self.assertEqual(len(builds), 1) + self.assertEqual(len(builds), 2) command, kwargs = builds[0] self.assertEqual(command[:5], ['wsl.exe', '--cd', '/mnt/source checkout', '--exec', 'env']) self.assertIn('OUTPUT_DIR=/mnt/output cache', command) - self.assertIn('full', command) + self.assertEqual(command[command.index('--build-profile')+1], 'auto') + self.assertNotIn('--full-exact', command) + esp_command = builds[1][0] + self.assertEqual(esp_command[esp_command.index('--build-profile')+1], 'full') + self.assertIn('--full-exact', esp_command) self.assertNotIn('MESHCORE_ADMIN_PASSWORD', kwargs['env']) self.assertNotIn('MESHCORE_OTA_PASSWORD', kwargs['env']) self.assertNotIn('never inherit', repr(command))