Author |
Message |
22/08/2021 18:48:49
|
#1
|
pruttelherrie
Joined: Oct 21, 2020
Messages: 24
Offline
|
Hi Dave,
Was browsing the MenuLib gihub the other day. I saw that a number of commits have been tagged 2.2. Also, in the Releases page there's a full 2.0 release, and an RC for the 2.1 release. However, on the tcMenu page I cannot find any info on 2.0+ [edit] I mean anything directly about Lib 2.0+, there's info about the designer being default 2.0+ [/edit]
So what's the actual status of the menu Lib?
I saw that TFT_eSPI support is going to be in 2.0+, I'm especially interested in that since in my main project I'm on an STM32F401CC with an ST7789 display which is ridiculously slow with stock Adafruit_GFX...
[edit] I think I posted a bit to soon, after a bit more reading the tcMenu github (especially the releases page https://github.com/davetcc/tcMenu/releases ) it's a lot clearer now! Tinkering with the TFT_ePSI driver using 2.1.3 as we speak.
|
|
|
22/08/2021 19:41:04
|
#2
|
davetcc
Joined: Jan 19, 2019
Messages: 686
Offline
|
1.7 is the previous release.
2.1 is the current release.
2.2 is currently being beta tested.
Current releases:
https://github.com/davetcc/tcMenuLib/releases/tag/2.1.3
https://github.com/davetcc/tcMenu/releases/tag/2.1.2
|
|
|
22/08/2021 19:42:49
|
#3
|
davetcc
Joined: Jan 19, 2019
Messages: 686
Offline
|
2.1 lib should be in all the repositories, the designer can be downloaded from the above link.
|
|
|
22/08/2021 19:55:37
|
#4
|
pruttelherrie
Joined: Oct 21, 2020
Messages: 24
Offline
|
Ok, thanks for your quick response!
|
|
|
22/08/2021 20:51:25
|
#5
|
pruttelherrie
Joined: Oct 21, 2020
Messages: 24
Offline
|
By the way, there's a typo in
tcMenu/xmlPlugins/core-display/tfteSpi/tcMenuTfteSpi.cpp : it includes #include <TfT_eSPI.h> in line 17; the f should be uppercase.
I found out since the generator generated this file including the typo, it's in resources/packaged plugins/initialPlugins.zip
|
|
|
23/08/2021 08:40:18
|
#6
|
davetcc
Joined: Jan 19, 2019
Messages: 686
Offline
|
Ah, the joy of case-insensitive file systems!
Thanks for pointing out, I've fixed that now so it will be in 2.2 when it's released. The plugins are actually fully open too https://github.com/davetcc/tcMenu/tree/master/xmlPlugins/core-display/tfteSpi
We are currently spending time on the tutorials and documentation trying to tidy it up a bit. Every release we do will include new tutorials and documentation improvements.
|
|
|
23/08/2021 09:27:07
|
#7
|
pruttelherrie
Joined: Oct 21, 2020
Messages: 24
Offline
|
In the meantime I have a basic menu running on the STM32F103 + ST7789 (240x240), using tcMenuLib 2.1.3. (Using TFT_eSPI, of course). The menu runs MUCH smoother than the 1.7 + Adafruit_GFX!
Trying to figure out some things with the fonts, will keep you posted.
|
|
|
23/08/2021 12:19:58
|
#8
|
pruttelherrie
Joined: Oct 21, 2020
Messages: 24
Offline
|
I'm struggling with understanding the font handling when using the TFT_eSPI driver. I found this so far:
* The generator lets you set numbered fonts for title and items when using the TFT_eSPI driver. I chose '4' which is a nice size, sharp and proportional.
* These numbers are passed like so: installCoolBlueTraditionalTheme(renderer, MenuFontDef(nullptr, 4), MenuFontDef(nullptr, 4), true);
This stores the font-data (nullptr) and the font-magnification (4) in the renderer.
* From here on, drawText() calls fontPtrToNum(font, mag); [in tcMenuTfteSpi.cpp]
* fontPtrToNum() is defined in tcMenuTfteSpi.cpp as:
void TfteSpiDrawable::fontPtrToNum(const void* font, int mag) {
if(font == nullptr) {
tft->setTextFont((uint8_t) mag);
}
else {
tft->setFreeFont(static_cast<const GFXfont *>(font));
}
}
... so I assumed there's only a tft->setTextFont(mag); involved, no FreeFont.
However, when I comment out either
#define LOAD_FONT4
or
#define LOAD_GFXFF
in the User_Setup.h from TFT_eSPI, it either shows no letters on the display (first #define) or it won't compile (second #define, compilation error at the <cntst GFXfont*> in fontPtrToNum ).
What is going on here? Is it using the FreeFont, the TFT_eSPI numbered font, or a scaled font?
|
|
|
23/08/2021 16:41:27
|
#9
|
davetcc
Joined: Jan 19, 2019
Messages: 686
Offline
|
I think the original intention for this plugin was to be able to handle either numbered or GFXfont fonts based on how they were defined. So I think the code needs both options defined as it stands. We've only really tested numbered fonts so far though.
As we are quite new to TFT_eSPI ourselves we'd take any feedback you have around its setup and incorporate it in the next release.
|
|
|
23/08/2021 18:18:55
|
#10
|
pruttelherrie
Joined: Oct 21, 2020
Messages: 24
Offline
|
No worries! I'm pretty new to TFT_eSPI as well, but I found the following: in order to differentiate, it is checking for the defines, see line #4750 of https://github.com/Bodmer/TFT_eSPI/blob/master/TFT_eSPI.cpp
I was able to get it working using either numbered fonts or freefonts, but I don't think you can combine them in one project. Also, when using a freefont the magnification cannot be set.
I had to change tcMenuTfteSpi.cpp as follows, in the same vein as TFT_eSPI.cpp:
void TfteSpiDrawable::fontPtrToNum(const void* font, int mag) {
#ifdef LOAD_GFXFF
if(font == nullptr) {
tft->setTextFont((uint8_t) mag); // <= does not work, for some reason GLCD data structure is not found
}
else {
tft->setFreeFont(static_cast<const GFXfont *>(font));
}
#else
tft->setTextFont((uint8_t) mag); // numbered font does not take font data, just a number
#endif
}
Then you have to either, using numbered fonts:
User_Setup.h
#define LOAD_FONT4
Arduino_menu.cpp
installCoolBlueTraditionalTheme(renderer, MenuFontDef(&FreeMono12pt7b, 1), MenuFontDef(&FreeMono12pt7b, 1), true);
or, using freefonts:
User_Setup.h
#define GFXFF
Arduino_menu.cpp
installCoolBlueTraditionalTheme(renderer, MenuFontDef(nullptr, 4), MenuFontDef(nullptr, 4), true);
I didn't get setTextFont(int) to work in the case of freefonts, this should default to glcd font.
I'm not sure this is the correct way to do it, review by someone more knowledgeable is advised
|
|
|
24/08/2021 17:47:58
|
#11
|
davetcc
Joined: Jan 19, 2019
Messages: 686
Offline
|
Thanks for the investigation, I'll take a look through this and try and integrate something into the 2.2 release.
|
|
|
27/08/2021 15:04:17
|
#12
|
davetcc
Joined: Jan 19, 2019
Messages: 686
Offline
|
Also, I've tidied up all the release documentation today, so going forward it will be far easier to work out what's current, and what is going to be next.
|
|
|
|