"""
Waf tool for functions common to the esp32, Linux and ChibiOS builds.
AP_FLAKE8_CLEAN
"""
def process_hwdef_results(cfg, hwdef_obj):
env = cfg.env
for k, v in hwdef_obj.env_vars.items():
if k in env:
raise ValueError(f"hwdef redefines environment variable {k} "
f"with existing value {env[k]!r} to value {v!r}")
else:
env[k] = v
print("env set %s=%s" % (k, v))
bldnode = cfg.bldnode.make_node(cfg.variant)
for file in sorted(hwdef_obj.output_files):
env.append_value("cfg_files", bldnode.make_node(file).abspath())