Fix up usermod dep checking scripts

This commit is contained in:
Will Miles 2025-03-28 20:15:36 -04:00
parent 1cd3a97c51
commit fab80f4e4e
2 changed files with 2 additions and 3 deletions

View File

@ -7,6 +7,5 @@ if "Temperature" in usermods:
env.Append(CPPDEFINES=[("USERMOD_DALLASTEMPERATURE")])
elif "sht" in usermods:
env.Append(CPPDEFINES=[("USERMOD_SHT")])
else:
elif "PWM_fan" in usermods: # The script can be run if this module was previously selected
raise RuntimeError("PWM_fan usermod requires Temperature or sht to be enabled")

View File

@ -5,5 +5,5 @@ usermods = env.GetProjectOption("custom_usermods","").split()
# Check for partner usermods
if "SN_Photoresistor" in usermods:
env.Append(CPPDEFINES=[("USERMOD_SN_PHOTORESISTOR")])
if "BH1750_v2" in usermods:
if any(mod in ("BH1750_v2", "BH1750") for mod in usermods):
env.Append(CPPDEFINES=[("USERMOD_BH1750")])