Help porting code for ILI9341_t3_Menu to tft_espi

stumbled across this great seeming library and have been attempting to port it, which im going to just come out and say it, my skills aren't this good. im getting somewhere but i am stuck on the font thing.

the original code calls for;

ILI9341_t3_font_t &ItemFont

the espi library defines;

setFreeFont(const GFXfont *f = NULL), 

and i dont know how to satisfy this argument, i keep getting the error;

cannot convert 'const GFXfont' to 'const int&'

full calls from both old version and new version of library


// KrisKasprzak /Adafruit_ILI9341_Menu

void init(uint16_t TextColor, uint16_t BackgroundColor, 
		uint16_t HighlightTextColor, uint16_t HighlightColor,
		uint16_t SelectedTextColor, uint16_t SelectedColor,
		uint16_t MenuColumn, uint16_t ItemRowHeight,uint16_t MaxRow,
		const char *TitleText, const GFXfont &ItemFont, const GFXfont &TitleFont);

// KrisKasprzak /ILI9341_t3_Menu

	void init(uint16_t TextColor, uint16_t BackgroundColor, 
		uint16_t HighlightTextColor, uint16_t HighlightColor,
		uint16_t SelectedTextColor, uint16_t SelectedColor,
		uint16_t MenuColumn, uint16_t ItemRowHeight,uint16_t MaxRow,
		const char *TitleText, const ILI9341_t3_font_t &ItemFont, const ILI9341_t3_font_t &TitleFont);

i understand it is a variable type mismatch but i cant figure out where it stems from... there are 8million more errors too, which i can post but they aren't really relevant to the issue at hand currently .

GitHub - KrisKasprzak/ILI9341_t3_Menu: Menu system for non touch needs <<< library i am trying to port. using ili9341 driver

driver i am trying to use ;

some guidance on how to do this would be appreciated too like what would be the best way to go about it . most of the generic function calls from the menu library already match calls from tft_espi, the only thing that is a 180 is the handling of the fonts as well as the fonts themselves.

the earlier version of the menu library (GitHub - KrisKasprzak/Adafruit_ILI9341_Menu: Menu code for Adafruit_ILI9341-based displays) uses the gfx font method;

const GFXfont &ItemFont

i am aware i am probably missing something that is blatantly obvious to someone i just cant see it.

ili9341_t3_menu_tftespi_port.zip (42.0 KB)
so i did figure it out ... it has alot to do with the ampersand character and where you can and cannot put them, but i have no idea what the ampersand does (self taught, not a learning experiance i have needed until now) below is the corrected funtioning library and a funtioning example if anyone wanted to use them ... the formatting is messed up but they do work.

ILI9341_t3_Menu_PSX_input.zip (33.3 KB)
and now t has corrections to fit a 480x320 RM68140 screen and uses a playstation controller for the input.

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.