Files
WLED/usermods/PWM_fan/setup_deps.py
Will Miles 7a40ef74c6 Fix up PWM_fan
Use a custom setup script to check for the dependencies and pass along
the required compile flags to the module; also split the object
definitions for the target modules from their source so as to allow
#including them.
2025-01-31 23:59:37 +00:00

13 lines
359 B
Python

Import('env')
usermods = env.GetProjectOption("custom_usermods","").split(" ")
# Check for dependencies
if "Temperature" in usermods:
env.Append(CPPDEFINES=[("USERMOD_DALLASTEMPERATURE")])
elif "sht" in usermods:
env.Append(CPPDEFINES=[("USERMOD_SHT")])
else:
raise RuntimeError("PWM_fan usermod requires Temperature or sht to be enabled")