Skip to content

Commit 1b63530

Browse files
committed
TTGO-T-Display: Allow full path for display_setup
Check if the path is fully qualified before searching; this allows using files outside of the WLED folder.
1 parent f4907f0 commit 1b63530

File tree

1 file changed

+9
-5
lines changed

1 file changed

+9
-5
lines changed

usermods/TTGO-T-Display/set_build_flags.py

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -25,11 +25,15 @@ def find_in_paths(filename, paths):
2525
return None
2626

2727
lib_builders = env.GetLibBuilders()
28-
search_paths = [global_env["PROJECT_SRC_DIR"],
29-
global_env["PROJECT_INCLUDE_DIR"],
30-
*[incdir for lb in lib_builders for incdir in lb.get_include_dirs()]]
31-
32-
display_setup_path = find_in_paths(display_setup, search_paths)
28+
if os.path.isfile(display_setup):
29+
display_setup_path = display_setup
30+
else:
31+
search_paths = [global_env["PROJECT_SRC_DIR"],
32+
global_env["PROJECT_INCLUDE_DIR"],
33+
*[incdir for lb in lib_builders for incdir in lb.get_include_dirs()]]
34+
35+
display_setup_path = find_in_paths(display_setup, search_paths)
36+
3337
if display_setup_path is None:
3438
print(f"Unable to find {display_setup} in any include path - {[str(path) for path in search_paths]}!")
3539
raise RuntimeError("Missing display setup; use 'User_Setups/something.h' for setups out of TFT_eSPI, or put your setup in wled00")

0 commit comments

Comments
 (0)