Skip to content

Commit

Permalink
Fix CPPDEFINES loop (#8744)
Browse files Browse the repository at this point in the history
Expect that (key, value) can be (key,)
  • Loading branch information
mcspr authored Dec 6, 2022
1 parent 93537f9 commit 3c62531
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions tools/platformio-build.py
Original file line number Diff line number Diff line change
Expand Up @@ -196,15 +196,15 @@ def scons_patched_match_splitext(path, suffixes=None):
NONOSDK_PREFIX = "PIO_FRAMEWORK_ARDUINO_ESPRESSIF_"
for define in env["CPPDEFINES"]:
if isinstance(define, (tuple, list)):
define, _ = define
define, *_ = define
if define.startswith(NONOSDK_PREFIX):
for version in NONOSDK_VERSIONS:
name, _ = version
if define.endswith(name):
nonosdk_version = version

NONOSDK_LIBPATH=join(FRAMEWORK_DIR, "tools", "sdk", "lib", nonosdk_version[1])
assert(isdir(NONOSDK_LIBPATH))
assert isdir(NONOSDK_LIBPATH)

env.Append(
CPPDEFINES=[(nonosdk_version[1], 1)],
Expand Down Expand Up @@ -336,7 +336,7 @@ def scons_patched_match_splitext(path, suffixes=None):
for flag in env["CPPDEFINES"]:
define = flag
if isinstance(flag, (tuple, list)):
define, _ = flag
define, *_ = flag
if define.startswith("MMU_"):
mmu_flags.append(flag)
# PIO_FRAMEWORK_ARDUINO_MMU_CACHE32_IRAM32 (default)
Expand Down

0 comments on commit 3c62531

Please sign in to comment.