diff --git a/PrepareProject.py b/PrepareProject.py index 7e8a495d..24bcdc5a 100644 --- a/PrepareProject.py +++ b/PrepareProject.py @@ -13,6 +13,8 @@ # python PrepareProject.py --profile <ИмяФайла> # python PrepareProject.py -p <ИмяФайла> # +# Используя параметры -b или --board можно уточнить для какой платы нужно подготовить проект +# # поддерживаемые контроллеры (профили): # esp8266_4mb # esp8266_16mb diff --git a/run.py b/run.py index 95808a19..44edf8f5 100644 --- a/run.py +++ b/run.py @@ -8,6 +8,7 @@ # где default_envs - это параметр default_envs из myProfile.json # # Если указан параметр -p или --profile <ИмяФайла>, то выполняется первая команда PrepareProject.py -p <ИмяФайла> +# Если указан параметр -b или --board , то выполняется первая команда PrepareProject.py -b # Если указан парамтер -l или --lite, то пропускаются команды 1, 2 и 5 с предварительной компиляцией # Если указан параметр -d или --debug, то выполняется только команда 4 с предварительной компиляцией @@ -74,8 +75,9 @@ def run_platformio(): profile_index = next((i for i, arg in enumerate(args) if arg in ('-p', '--profile')), None) profile_file = args[profile_index + 1] if profile_index is not None and len(args) > profile_index + 1 else "myProfile.json" - # Загружаем default_envs из myProfile.json - default_envs = load_default_envs(profile_path=profile_file) + # Загружаем default_envs из myProfile.json, если не указан параметр -b, который имеет больший приоритет + board_index = next((i for i, arg in enumerate(args) if arg in ('-b', '--board')), None) + default_envs = args[board_index + 1] if board_index is not None and len(args) > board_index + 1 else load_default_envs(profile_path=profile_file) print(f"Используем default_envs: {default_envs}") print(f"Режим Lite: {lite_mode}, Режим отладки: {debug_mode}")