Skip to content

Commit 016499f

Browse files
committed
wledmm_print_all_defines (optional)
for pio.ini debugging
1 parent d9247fc commit 016499f

File tree

1 file changed

+13
-2
lines changed

1 file changed

+13
-2
lines changed

pio-scripts/output_bins.py

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,9 @@ def _create_dirs(dirs=["firmware", "map"]):
2828
basestring = str
2929

3030
# WLEDMM : custom print function
31-
def print_my_item(items):
32-
print(" ", end='')
31+
def print_my_item(items, flag = False):
32+
if flag: print(" -D", end='')
33+
else: print(" ", end='')
3334
if isinstance(items, basestring):
3435
# print a single string
3536
print(items, end='')
@@ -93,6 +94,15 @@ def wledmm_print_build_info(env):
9394
found = True
9495
if found: print("\n")
9596

97+
def wledmm_print_all_defines(env):
98+
all_flags = env["CPPDEFINES"]
99+
found = False
100+
for item in all_flags:
101+
if not found: print("\nBuild Flags:")
102+
print_my_item(item, True)
103+
found = True
104+
if found: print("\n")
105+
96106

97107
def bin_rename_copy(source, target, env):
98108
_create_dirs()
@@ -128,6 +138,7 @@ def bin_rename_copy(source, target, env):
128138
print(f"Found linker mapfile {source_map}")
129139
shutil.copy(source_map, map_file)
130140

141+
# wledmm_print_all_defines(env)
131142
wledmm_print_build_info(env)
132143

133144
def bin_gzip(source, target, env):

0 commit comments

Comments
 (0)