Skip to content

Commit

Permalink
Core 2.0.9.2023.05.17
Browse files Browse the repository at this point in the history
* Better handling of macros exported from IDF
* esptool v4.5.2
* Update esp32s3camlcd.json
* core 2.0.9 from 2023.05.17
* Update README.md
  • Loading branch information
Jason2866 authored May 17, 2023
1 parent 2868305 commit 76080dc
Showing 1 changed file with 17 additions and 8 deletions.
25 changes: 17 additions & 8 deletions builder/frameworks/espidf.py
Original file line number Diff line number Diff line change
Expand Up @@ -302,16 +302,25 @@ def get_app_includes(app_config):


def extract_defines(compile_group):
result = []
result.extend(
[
d.get("define").replace('"', '\\"').strip()
for d in compile_group.get("defines", [])
]
)
def _normalize_define(define_string):
define_string = define_string.strip()
if "=" in define_string:
define, value = define_string.split("=", maxsplit=1)
if '"' in value and not value.startswith("\\"):
# Escape only raw values
value = value.replace('"', '\\"')
return (define, value)
return define_string

result = [
_normalize_define(d.get("define", ""))
for d in compile_group.get("defines", []) if d
]

for f in compile_group.get("compileCommandFragments", []):
if f.get("fragment", "").startswith("-D"):
result.append(f["fragment"][2:])
result.append(_normalize_define(f["fragment"][2:]))

return result


Expand Down

0 comments on commit 76080dc

Please sign in to comment.