-
-
Notifications
You must be signed in to change notification settings - Fork 4.2k
TTGO-T-Display usermod fixup #5479
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from 15 commits
d20713d
e5abc46
ef7c807
76a08c7
64d5d07
5502d37
987bf1f
c7a35a7
5e6f243
3338efc
d6dcb96
4bf6409
e37db43
2f6723a
c0dbe63
18d4a41
2f888ec
b084bb3
f2cff53
a0a472d
64252ff
a9f5d25
68808f4
454a409
fd2c84f
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,10 @@ | ||
| { | ||
| "name:": "TTGO-T-Display", | ||
|
coderabbitai[bot] marked this conversation as resolved.
Outdated
|
||
| "dependencies": { | ||
| "TFT_eSPI" : "https://github.com/Bodmer/TFT_eSPI.git#5793878" | ||
| }, | ||
| "build": { | ||
| "extraScript": "set_build_flags.py", | ||
| "libArchive": false | ||
| } | ||
| } | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,8 +1,39 @@ | ||
| [env:esp32dev] | ||
| build_flags = ${common.build_flags_esp32} | ||
| ; PIN defines - uncomment and change, if needed: | ||
| ; -D LEDPIN=2 | ||
| -D BTNPIN=35 | ||
| # Example PlatformIO Project Configuration Override | ||
| # ------------------------------------------------------------------------------ | ||
| # Copy to platformio_override.ini to activate overrides | ||
| # ------------------------------------------------------------------------------ | ||
| # Please visit documentation: https://docs.platformio.org/page/projectconf.html | ||
|
|
||
| [platformio] | ||
| #default_envs = WLED_tasmota_1M # define as many as you need | ||
| default_envs = WLED_T-Display # define as many as you need | ||
| #---------- | ||
| # SAMPLE | ||
| #---------- | ||
| [env:WLED_T-Display] | ||
|
|
||
| board = esp32dev | ||
| upload_speed = 921600 | ||
| monitor_speed = 115200 | ||
| platform = ${esp32.platform} | ||
| platform_packages = ${esp32.platform_packages} | ||
| build_unflags = ${common.build_unflags} | ||
| build_flags = ${common.build_flags} ${esp32.build_flags} -D WLED_RELEASE_NAME=\"WLED_T-Display\" | ||
| ; -D IRPIN=4 | ||
| ; -D RLYPIN=12 | ||
| ; -D RLYMDE=1 | ||
| ; -D WLED_DISABLE_BROWNOUT_DET | ||
| ;PIN defines - uncomment and change, if needed: | ||
| -D DATA_PINS=2 | ||
| ;or use this for multiple outputs | ||
| ; -D DATA_PINS=1,3 | ||
| -D BTNPIN=35 | ||
| ; -D IRPIN=4 | ||
| ; -D RLYPIN=12 | ||
| ; -D RLYMDE=1 | ||
| ; -D RLYODRAIN=0 | ||
| ; -D LED_BUILTIN=2 # GPIO of built-in LED | ||
| lib_deps = ${esp32.lib_deps} | ||
| custom_usermods = audioreactive TTGO-T-Display | ||
|
coderabbitai[bot] marked this conversation as resolved.
Outdated
|
||
| monitor_filters = esp32_exception_decoder | ||
| board_build.partitions = ${esp32.default_partitions} | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,50 @@ | ||
| # Select target board | ||
| # Ref: https://github.com/Bodmer/TFT_eSPI/wiki/Installing-on-PlatformIO#4-configure-library | ||
| # These flags are passed to this library and the TFT_eSPI library only | ||
|
|
||
| Import("env") | ||
| import os | ||
|
|
||
|
|
||
| # Add pin definitions to whole project environment if they haven't otherwise been specified | ||
| # WM: This is a feature of the original usermod; I'm not sure if it's globally applicable.. | ||
| global_env = DefaultEnvironment() | ||
| global_defines = global_env.get("CPPDEFINES", []) | ||
| if "BTNPIN" not in [v[0] for v in global_defines if isinstance(v, tuple)]: | ||
| global_env.Append(CPPDEFINES=[("BTNPIN", "35")]) | ||
|
|
||
| # Select display setup | ||
| display_setup = global_env.GetProjectOption("custom_display_setup","User_Setups/Setup25_TTGO_T_Display.h") | ||
|
|
||
| # Resolve this file's path | ||
| def find_in_paths(filename, paths): | ||
| for path in paths: | ||
| fullpath = os.path.join(str(path), filename) | ||
| if os.path.isfile(fullpath): | ||
| return fullpath | ||
| return None | ||
|
|
||
| lib_builders = env.GetLibBuilders() | ||
| if os.path.isfile(display_setup): | ||
| display_setup_path = display_setup | ||
| else: | ||
| search_paths = [global_env["PROJECT_SRC_DIR"], | ||
| global_env["PROJECT_INCLUDE_DIR"], | ||
| *[incdir for lb in lib_builders for incdir in lb.get_include_dirs()]] | ||
|
|
||
| display_setup_path = find_in_paths(display_setup, search_paths) | ||
|
|
||
| if display_setup_path is None: | ||
| print(f"Unable to find {display_setup} in any include path - {[str(path) for path in search_paths]}!") | ||
| raise RuntimeError("Missing display setup; use 'User_Setups/something.h' for setups out of TFT_eSPI, or put your setup in wled00") | ||
|
|
||
| def add_display_setup(tgt_env): | ||
| tgt_env.Append(CPPDEFINES=[("USER_SETUP_LOADED", "1")]) | ||
| tgt_env.Append(CCFLAGS=f"-include {display_setup_path}") | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🧩 Analysis chain🏁 Script executed: # First, locate and examine the file
find . -name "set_build_flags.py" -path "*/usermods/*" 2>/dev/nullRepository: wled/WLED Length of output: 97 🏁 Script executed: # Check if the file exists and read the relevant section
if [ -f "./usermods/TTGO-T-Display/set_build_flags.py" ]; then
echo "=== File found, reading lines 35-50 ===";
sed -n '35,50p' "./usermods/TTGO-T-Display/set_build_flags.py" | cat -n;
else
echo "File not found at expected path. Searching for any set_build_flags.py...";
find . -name "set_build_flags.py" 2>/dev/null;
fiRepository: wled/WLED Length of output: 884 🌐 Web query:
💡 Result: In PlatformIO’s SCons environment,
Rule of thumb:
Citations:
Pass the forced include as separate argv entries.
Suggested fix def add_display_setup(tgt_env):
tgt_env.Append(CPPDEFINES=[("USER_SETUP_LOADED", "1")])
- tgt_env.Append(CCFLAGS=f"-include {display_setup_path}")
+ tgt_env.Append(CCFLAGS=["-include", display_setup_path])🤖 Prompt for AI Agents |
||
|
|
||
| # Add it for this library and the TFT_eSPI dependency | ||
| add_display_setup(env) | ||
| for lb in lib_builders: | ||
| if lb.name == "TFT_eSPI": | ||
| add_display_setup(lb.env) | ||
| break | ||
Uh oh!
There was an error while loading. Please reload this page.