ST7735_t3 broken with Teensyduino 1.51 install

DrGee

Member
Win 7 / Teensy LC

I installed the newest Arduino IDE 1.8.12 (probably from 1.8.10). Thereafter installing Teensy loader 1.51 (probably from 1.48). I left all of the library installs checked. Everything seemed to install without issues. I compiled and ran the Teensy blink program without any problem.

Several previously working programs using an 80 X 160 LCD [ST7735 controller], however, would no longer compile. Investigating further, it looks like several or all of the example programs in the 7335 folder will not compile giving the same error.

For example, trying to compile graphicstest.ino [Program Files (x86)\Arduino\hardware\teensy\avr\libraries\ST7735_t3\examples\graphicstest] will fail with the following:
__________________
C:\Program Files (x86)\Arduino\hardware\teensy\avr\libraries\ST7735_t3\ST7735_t3.cpp: In member function 'void ST7735_t3::readRect(int16_t, int16_t, int16_t, int16_t, uint16_t*)':

C:\Program Files (x86)\Arduino\hardware\teensy\avr\libraries\ST7735_t3\ST7735_t3.cpp:1238:6: error: '_use_fbtft' was not declared in this scope

if (_use_fbtft) {

^

C:\Program Files (x86)\Arduino\hardware\teensy\avr\libraries\ST7735_t3\ST7735_t3.cpp:1239:30: error: '_pfbtft' was not declared in this scope

uint16_t * pfbPixel_row = &_pfbtft[ y*_width + x];
_________________

The error from line 1238 in ST7735_t3.cpp is in this function:

Code:
void ST7735_t3::readRect(int16_t x, int16_t y, int16_t w, int16_t h, uint16_t *pcolors)
{
	// Use our Origin. 
	x+=_originx;
	y+=_originy;
	//BUGBUG:: Should add some validation of X and Y

	//#ifdef ENABLE_ST77XX_FRAMEBUFFER
	if (_use_fbtft) {
		uint16_t * pfbPixel_row = &_pfbtft[ y*_width + x];
		for (;h>0; h--) {
			uint16_t * pfbPixel = pfbPixel_row;
			for (int i = 0 ;i < w; i++) {
				*pcolors++ = *pfbPixel++;
			}
			pfbPixel_row += _width;
		}
		return;  
	}
	//#endif   
}


_use_fbtft is only declared here in ST7735_t3.h


Code:
#ifdef ENABLE_ST77XX_FRAMEBUFFER
    // Add support for optional frame buffer
  uint16_t  *_pfbtft;           // Optional Frame buffer 
  uint8_t   _use_fbtft;         // Are we in frame buffer mode?
  uint16_t  *_we_allocated_buffer;      // We allocated the buffer; 
  uint32_t  _count_pixels;       // How big is the display in total pixels...

Is anyone else getting this error?
 
Last edited:
Does not surprise me... With the name _t3, I at time assume minimum of 3.x and hopefully T4...

Put in fix: https://github.com/PaulStoffregen/ST7735_t3/pull/10

Simple go into the source file with the error and near those lines is a #if... which is commented out (line 1237) and likewise a #endif(line 1249) Simply uncomment those two lines
 
Yep - just fixed in my master as well then was going to do Paul's. As usual you are faster than me. I did verify there are no compile issues for the LC
 
Does not surprise me... With the name _t3, I at time assume minimum of 3.x and hopefully T4...

Put in fix: https://github.com/PaulStoffregen/ST7735_t3/pull/10

Simple go into the source file with the error and near those lines is a #if... which is commented out (line 1237) and likewise a #endif(line 1249) Simply uncomment those two lines

Thanks for the quick response. While the suffix is 't3' as you note, there is a section in the source code explicitly naming the LC. Moreover, code that *had* been running fine on the LC, no longer did. I had hoped that the solution would be that easy...and it is. I'm not sure the function readRect was even in the last version.

I am a bit frustrated because I am working with this ummm economical little screen and I needed to go into ST7735_t3 and fudge CASET and RASET and _colstart because it does not have a "recognized" init and then in the program, invert the screen and swap the RGB / BGR for accurate colors. So, I had it all working and then *poof* all gone. Naturally, I couldn't find all my notes, but I was able to rebuild it all (there are additional changes in the latest version - or I changed the way I modified things compared to the last time).

You can get some of these LCDs dirt cheap...and then you pay for it :)

Thanks again.
 
Back
Top