[Logo] TCC discussion forum
  [Search] Search   [Recent Topics] Recent Topics   [Hottest Topics] Hottest Topics   [Top Downloads] Top Downloads   [Groups] Back to home page 
[Register] Register /  [Login] Login 

What's the status of all the different releases? RSS feed
Forum Index » tcMenu Arduinio library
Author Message
pruttelherrie


Joined: Oct 21, 2020
Messages: 18
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.
davetcc


Joined: Jan 19, 2019
Messages: 514
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
davetcc


Joined: Jan 19, 2019
Messages: 514
Offline
2.1 lib should be in all the repositories, the designer can be downloaded from the above link.
pruttelherrie


Joined: Oct 21, 2020
Messages: 18
Offline
Ok, thanks for your quick response!
pruttelherrie


Joined: Oct 21, 2020
Messages: 18
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
davetcc


Joined: Jan 19, 2019
Messages: 514
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.
pruttelherrie


Joined: Oct 21, 2020
Messages: 18
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.

pruttelherrie


Joined: Oct 21, 2020
Messages: 18
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?
davetcc


Joined: Jan 19, 2019
Messages: 514
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.
pruttelherrie


Joined: Oct 21, 2020
Messages: 18
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 smilie
davetcc


Joined: Jan 19, 2019
Messages: 514
Offline
Thanks for the investigation, I'll take a look through this and try and integrate something into the 2.2 release.
davetcc


Joined: Jan 19, 2019
Messages: 514
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.
 
Forum Index » tcMenu Arduinio library
Go to:   
Mobile view
Powered by JForum 2.7.0 © 2020 JForum Team • Maintained by Andowson Chang and Ulf Dittmer

This site uses cookies to analyse traffic, serve ads by Google AdSense (non-personalized in EEA/UK), and to record consent. We also embed Twitter, Youtube and Disqus content on some pages, these companies have their own privacy policies.

Our privacy policy applies to all pages on our site

Should you need further guidance on how to proceed: External link for information about cookie management.