2022-12-22 16:50:40 +00:00
|
|
|
Import("env")
|
|
|
|
|
2022-06-01 13:43:23 +01:00
|
|
|
import glob
|
|
|
|
import os
|
|
|
|
|
|
|
|
def FindInoNodes(env):
|
|
|
|
src_dir = glob.escape(env.subst("$PROJECT_SRC_DIR"))
|
|
|
|
return env.Glob(os.path.join(src_dir, "*.ino")) + env.Glob(
|
2022-06-02 13:17:39 +01:00
|
|
|
os.path.join(src_dir, "tasmota_*", "*.ino")
|
2022-06-01 13:43:23 +01:00
|
|
|
)
|
|
|
|
|
|
|
|
env.AddMethod(FindInoNodes)
|
2023-08-12 10:31:06 +01:00
|
|
|
|
|
|
|
# Pass flashmode at build time to macro
|
2023-10-30 17:27:25 +00:00
|
|
|
memory_type = env.BoardConfig().get("build.arduino.memory_type", "").upper()
|
|
|
|
flash_mode = env.BoardConfig().get("build.flash_mode", "dio").upper()
|
|
|
|
if "OPI_" in memory_type:
|
|
|
|
flash_mode = "OPI"
|
|
|
|
|
|
|
|
tasmota_flash_mode = "-DCONFIG_TASMOTA_FLASHMODE_" + flash_mode
|
2023-08-12 10:31:06 +01:00
|
|
|
env.Append(CXXFLAGS=[tasmota_flash_mode])
|
|
|
|
print(tasmota_flash_mode)
|