Move extra IDE data to "extra" section

This commit is contained in:
Ivan Kravets
2020-10-26 18:23:28 +02:00
parent afd79f4655
commit 7230556d1b
3 changed files with 16 additions and 9 deletions

View File

@ -78,6 +78,7 @@ DEFAULT_ENV_OPTIONS = dict(
PROGNAME="program", PROGNAME="program",
PROG_PATH=join("$BUILD_DIR", "$PROGNAME$PROGSUFFIX"), PROG_PATH=join("$BUILD_DIR", "$PROGNAME$PROGSUFFIX"),
PYTHONEXE=get_pythonexe_path(), PYTHONEXE=get_pythonexe_path(),
IDE_EXTRA_DATA={},
) )
if not int(ARGUMENTS.get("PIOVERBOSE", 0)): if not int(ARGUMENTS.get("PIOVERBOSE", 0)):

View File

@ -164,14 +164,17 @@ def DumpIDEData(env, globalenv):
"cxx_path": where_is_program(env.subst("$CXX"), env.subst("${ENV['PATH']}")), "cxx_path": where_is_program(env.subst("$CXX"), env.subst("${ENV['PATH']}")),
"gdb_path": where_is_program(env.subst("$GDB"), env.subst("${ENV['PATH']}")), "gdb_path": where_is_program(env.subst("$GDB"), env.subst("${ENV['PATH']}")),
"prog_path": env.subst("$PROG_PATH"), "prog_path": env.subst("$PROG_PATH"),
"flash_extra_images": [
{"offset": item[0], "path": env.subst(item[1])}
for item in env.get("FLASH_EXTRA_IMAGES", [])
],
"svd_path": _get_svd_path(env), "svd_path": _get_svd_path(env),
"compiler_type": env.GetCompilerType(), "compiler_type": env.GetCompilerType(),
"targets": globalenv.DumpTargets(), "targets": globalenv.DumpTargets(),
"extra": dict(
flash_images=[
{"offset": item[0], "path": env.subst(item[1])}
for item in env.get("FLASH_EXTRA_IMAGES", [])
]
),
} }
data["extra"].update(env.get("IDE_EXTRA_DATA", {}))
env_ = env.Clone() env_ = env.Clone()
# https://github.com/platformio/platformio-atom-ide/issues/34 # https://github.com/platformio/platformio-atom-ide/issues/34

View File

@ -195,13 +195,16 @@ def validate_debug_options(cmd_ctx, env_options):
def configure_esp32_load_cmds(debug_options, configuration): def configure_esp32_load_cmds(debug_options, configuration):
"""
DEPRECATED: Moved to ESP32 dev-platform
See platform.py::configure_debug_options
"""
flash_images = configuration.get("extra", {}).get("flash_images")
ignore_conds = [ ignore_conds = [
debug_options["load_cmds"] != ["load"], debug_options["load_cmds"] != ["load"],
"xtensa-esp32" not in configuration.get("cc_path", ""), "xtensa-esp32" not in configuration.get("cc_path", ""),
not configuration.get("flash_extra_images"), not flash_images,
not all( not all([isfile(item["path"]) for item in flash_images]),
[isfile(item["path"]) for item in configuration.get("flash_extra_images")]
),
] ]
if any(ignore_conds): if any(ignore_conds):
return debug_options["load_cmds"] return debug_options["load_cmds"]
@ -210,7 +213,7 @@ def configure_esp32_load_cmds(debug_options, configuration):
'monitor program_esp32 "{{{path}}}" {offset} verify'.format( 'monitor program_esp32 "{{{path}}}" {offset} verify'.format(
path=fs.to_unix_path(item["path"]), offset=item["offset"] path=fs.to_unix_path(item["path"]), offset=item["offset"]
) )
for item in configuration.get("flash_extra_images") for item in flash_images
] ]
mon_cmds.append( mon_cmds.append(
'monitor program_esp32 "{%s.bin}" 0x10000 verify' 'monitor program_esp32 "{%s.bin}" 0x10000 verify'