User_Setup_Select.h and multiple projects #1969
-
So, I have followed TFT_eSPI for a long time now and went through the woes of having to finally create a separate folder with all of my custom user setups to prevent things from being deleted when updates occurred. It was not a big deal initially to change the User_Setup_Select.h file to point to the custom user setup (.h) file that I created for the project, but now that I have literally dozens of projects that I periodically update I find it a nightmare to have to remember to change the User_Setup_Select.h file to point to the correct custom user setup every time I go to compile a different project. Is there any way possible that we can just make some simple #include for that custom user file in our application code and no longer have to deal with changing the User_Setup_Select.h file every time before compiling? |
Beta Was this translation helpful? Give feedback.
Replies: 8 comments 4 replies
-
Does anyone have any ideas on how to accomplish this? It seems that we should be able to include the same file that User_Setup_Select.h file includes in our application code (along with the other normal includes that we use). This is something I would pitch in a bounty for. |
Beta Was this translation helpful? Give feedback.
-
See #1689 |
Beta Was this translation helpful? Give feedback.
-
I was excited to try this. I modified ALL of my projects, added the necessary changes and compiling worked! However, some functions do not provide the proper results. For example: tft.fillSmoothRoundRect(x1, y1, w, h, rad, TFT_CYAN, TFT_BLACK); This generates a rectangle that actually has the top most line about half-filled with the rest of the rectangle solid, but too short in height, and no rounded corners. I have seen some other oddities as well. I will have to go through all of my projects and see what works and what doesn't. I really appreciate the effort on this because it is going to save a TON of time in the future! NOTE It should be pointed out that I am using IDE 2.0.0-rc9.4, not the normal Arduino IDE. I will test that to see if this issue is related to the new IDE. |
Beta Was this translation helpful? Give feedback.
-
So, literally just having that platform.local.txt in place causes the errors. I can copy it there and get the above results, or delete it and everything works perfectly. Maybe this has to do with some other libraries now trying to use local build paths because of this flag? Here are the includes I use in this project that is failing to compile: //#include "tft_setup.h" // include for TFT_eSPI display definition I also notice that it now takes forever to compile the project when the platform.local.txt file is in place. |
Beta Was this translation helpful? Give feedback.
-
OK, after some experimenting I found that if leave the platform.local.txt file in place and comment out <SoftwareSerial.h> I only get a single compiler error at that point: c:/users/jim/appdata/local/arduino15/packages/esp32/tools/xtensa-esp32s2-elf-gcc/gcc8_4_0-esp-2021r2-patch3/bin/../lib/gcc/xtensa-esp32s2-elf/8.4.0/../../../../xtensa-esp32s2-elf/bin/ld.exe: C:\Users\Jim\AppData\Local\Temp\arduino-sketch-189BD29E0AAA298C7DCFBAF3833FEA00\libraries\TFT_eSPI\TFT_eSPI.cpp.o:(.literal._ZN8TFT_eSPIC2Ess+0x4): undefined reference to `SPIFFS' So, then I tried removing all of the includes (and associated code) except <SoftwareSerial.h> and that indeed causes the mass compiler errors when the platform.local.txt file is in place. It seems that some libraries do not like being forced to use local build paths. ACK! One other thing I neglected to point out in case it matters, I am using the ESP32-S2. I think that shows in the compile_errors.txt above. |
Beta Was this translation helpful? Give feedback.
-
I have done some experiments with some of my projects that use the ESP32 S2 and they compile OK with the platform.local.txt file in place. I do not know which Software Serial library you are using so have not been able to try that. Do you have a complete example sketch (with libraries or references to the exact ones used) for me to try? |
Beta Was this translation helpful? Give feedback.
-
I assumed the library is espSoftwareSerial and do get errors when the platform.local.txt is used. After all that the following compiled OK with and without the platform.local.txt:
I had to comment out the #include <SoftwareSerial.h> due to errors. So in conclusion there is something peculiar with that software serial library, it seems to be only partially modified for the later ESP32 variants. I don't intend to investigate further as all other support libraries I have tried so far seem to work fine with the platform.local.txt in place. In this case the only option at the moment is to user the library user_setup approach or avoid using that software serial library. |
Beta Was this translation helpful? Give feedback.
-
Thanks for following up. I am not sure which SoftwareSerial library is being used. I don't recall anything special being installed, but I will check. I have never had to use the software serial before, but the new project I am working on needs 6 UARTs so I had no choice. The <Adafruit_ADS1X15.h> include is correct, but I will look into the version that is ADS1015.h. EDIT: Yes, I am using EspSoftwareSerial, which is the default standard for the ESP32 and ESP8266, so this is going to be a problem: https://www.arduino.cc/reference/en/libraries/espsoftwareserial/ I have been using the ADS1X15 library for several years now. I am not sure where you got a version that is called ADS1015. Here is the standard/latest version from adafruit: |
Beta Was this translation helpful? Give feedback.
See #1689