fillTriange issue with screen or buffer size?

Status
Not open for further replies.

PPGFlyer

Member
In the code below, the fillTriangle() stops filling about halfway down the screen. drawTriangle() and it seems any other fill/draw call seems to work just fine. What could be causing this?
I'm using stock Adafruit GFX and ILI9341 libraries.

Thanks for any help.

I'm using a Teensy 4.1 with a 320x240 TFT https://www.pjrc.com/store/display_ili9341_touch.html

output: 0xEkWCv.jpg

Code:
#include <Arduino.h>
#include <Adafruit_GFX.h>
#include <Adafruit_ILI9341.h>
#include <SPI.h>

const uint16_t  tft_Color_Black        = 0x0000;
const uint16_t  tft_Color_Blue         = 0x001F;
const uint16_t  tft_Color_Red          = 0xF800;

#define TFT_CS 10
#define TFT_DC  9

Adafruit_ILI9341 tft = Adafruit_ILI9341(TFT_CS, TFT_DC);

void setup() {

  delay(250);

  tft.begin();
  tft.setFont();
  tft.fillScreen(tft_Color_Black);
  tft.setRotation(0);

}

GFXcanvas16 *canvas = new GFXcanvas16 (240, 320);  //

void loop() {

  canvas -> drawTriangle(0, 0, 240, 0, 120, 320, tft_Color_Red);  // This works fine
  canvas -> fillTriangle(0, 0, 240, 0, 120, 272, tft_Color_Blue);  // This is what stops halfway down screen.
  // tft.fillTriangle(0, 0, 240, 0, 120, 272, tft_Color_Blue);    // <- This would work fine.
  tft.drawRGBBitmap(0 , 0 , canvas -> getBuffer () , 240 , 320);

}
 
On the fillTriangle, change 272 to 320 and see if that helps.

Interesting you laser focused on the number, I forgot to mention in my post above, if I change that number which is y2, to anything between 273-320, it completely breaks the triangle as shown below:

pU4jW5L.jpg
 
Hmmm... So the fillTriangle without the canvas works? I am unfamiliar with the canvas, but maybe that is the place to look. Could the x and y parms be backwards in the canvas?
 
Hmmm... So the fillTriangle without the canvas works?

yes, the commented line works perfectly. And with the canvas, every other type of draw and fill command, writing text, anything else works perfectly except fillTriangle below that line. I can draw a small triangle perfectly above that line, and slowly moving the Y numbers down in value, it will just start cropping as it moves through that line.
 
You might report it to Adafruit to see if the need to fix. Or you might try one of our Teensy specific libraries like ili9341_t3
 
Or you might try one of our Teensy specific libraries like ili9341_t3

I can't get ILI9341_t3 to compile for Teensy 4.1. Compiles fine with board set to 3.5.

Code:
Arduino: 1.8.13 (Mac OS X), TD: 1.53, Board: "Teensy 4.1, Serial, 600 MHz, Faster, US English"











/Applications/Teensyduino.app/Contents/Java/arduino-builder -dump-prefs -logger=machine -hardware /Applications/Teensyduino.app/Contents/Java/hardware -tools /Applications/Teensyduino.app/Contents/Java/tools-builder -tools /Applications/Teensyduino.app/Contents/Java/hardware/tools/avr -built-in-libraries /Applications/Teensyduino.app/Contents/Java/libraries -libraries /Users/mike/Documents/Arduino/libraries -fqbn=teensy:avr:teensy41:usb=serial,speed=600,opt=o2std,keys=en-us -ide-version=10813 -build-path /var/folders/n1/2fz1ks3j52g3hd8zlb855mvr0000gn/T/arduino_build_623455 -warnings=none -build-cache /var/folders/n1/2fz1ks3j52g3hd8zlb855mvr0000gn/T/arduino_cache_177554 -verbose /Users/mike/Documents/Arduino/ECU_MultiScreen_TriangleTest_t3/ECU_MultiScreen_TriangleTest_t3.ino
/Applications/Teensyduino.app/Contents/Java/arduino-builder -compile -logger=machine -hardware /Applications/Teensyduino.app/Contents/Java/hardware -tools /Applications/Teensyduino.app/Contents/Java/tools-builder -tools /Applications/Teensyduino.app/Contents/Java/hardware/tools/avr -built-in-libraries /Applications/Teensyduino.app/Contents/Java/libraries -libraries /Users/mike/Documents/Arduino/libraries -fqbn=teensy:avr:teensy41:usb=serial,speed=600,opt=o2std,keys=en-us -ide-version=10813 -build-path /var/folders/n1/2fz1ks3j52g3hd8zlb855mvr0000gn/T/arduino_build_623455 -warnings=none -build-cache /var/folders/n1/2fz1ks3j52g3hd8zlb855mvr0000gn/T/arduino_cache_177554 -verbose /Users/mike/Documents/Arduino/ECU_MultiScreen_TriangleTest_t3/ECU_MultiScreen_TriangleTest_t3.ino
Using board 'teensy41' from platform in folder: /Applications/Teensyduino.app/Contents/Java/hardware/teensy/avr
Using core 'teensy4' from platform in folder: /Applications/Teensyduino.app/Contents/Java/hardware/teensy/avr
Detecting libraries used...
/Applications/Teensyduino.app/Contents/Java/hardware/teensy/../tools/arm/bin/arm-none-eabi-g++ -E -CC -x c++ -w -g -Wall -ffunction-sections -fdata-sections -nostdlib -std=gnu++14 -fno-exceptions -fpermissive -fno-rtti -fno-threadsafe-statics -felide-constructors -Wno-error=narrowing -mthumb -mcpu=cortex-m7 -mfloat-abi=hard -mfpu=fpv5-d16 -D__IMXRT1062__ -DTEENSYDUINO=153 -DARDUINO=10813 -DARDUINO_TEENSY41 -DF_CPU=600000000 -DUSB_SERIAL -DLAYOUT_US_ENGLISH -I/Applications/Teensyduino.app/Contents/Java/hardware/teensy/avr/cores/teensy4 /var/folders/n1/2fz1ks3j52g3hd8zlb855mvr0000gn/T/arduino_build_623455/sketch/ECU_MultiScreen_TriangleTest_t3.ino.cpp -o /dev/null -DARDUINO_LIB_DISCOVERY_PHASE
Alternatives for Adafruit_GFX.h: [Adafruit_GFX_Library@1.10.2]
ResolveLibrary(Adafruit_GFX.h)
  -> candidates: [Adafruit_GFX_Library@1.10.2]
/Applications/Teensyduino.app/Contents/Java/hardware/teensy/../tools/arm/bin/arm-none-eabi-g++ -E -CC -x c++ -w -g -Wall -ffunction-sections -fdata-sections -nostdlib -std=gnu++14 -fno-exceptions -fpermissive -fno-rtti -fno-threadsafe-statics -felide-constructors -Wno-error=narrowing -mthumb -mcpu=cortex-m7 -mfloat-abi=hard -mfpu=fpv5-d16 -D__IMXRT1062__ -DTEENSYDUINO=153 -DARDUINO=10813 -DARDUINO_TEENSY41 -DF_CPU=600000000 -DUSB_SERIAL -DLAYOUT_US_ENGLISH -I/Applications/Teensyduino.app/Contents/Java/hardware/teensy/avr/cores/teensy4 -I/Users/mike/Documents/Arduino/libraries/Adafruit_GFX_Library /var/folders/n1/2fz1ks3j52g3hd8zlb855mvr0000gn/T/arduino_build_623455/sketch/ECU_MultiScreen_TriangleTest_t3.ino.cpp -o /dev/null -DARDUINO_LIB_DISCOVERY_PHASE
Alternatives for ILI9341_t3.h: [Adafruit_ILI9341@1.0]
ResolveLibrary(ILI9341_t3.h)
  -> candidates: [Adafruit_ILI9341@1.0]
/Applications/Teensyduino.app/Contents/Java/hardware/teensy/../tools/arm/bin/arm-none-eabi-g++ -E -CC -x c++ -w -g -Wall -ffunction-sections -fdata-sections -nostdlib -std=gnu++14 -fno-exceptions -fpermissive -fno-rtti -fno-threadsafe-statics -felide-constructors -Wno-error=narrowing -mthumb -mcpu=cortex-m7 -mfloat-abi=hard -mfpu=fpv5-d16 -D__IMXRT1062__ -DTEENSYDUINO=153 -DARDUINO=10813 -DARDUINO_TEENSY41 -DF_CPU=600000000 -DUSB_SERIAL -DLAYOUT_US_ENGLISH -I/Applications/Teensyduino.app/Contents/Java/hardware/teensy/avr/cores/teensy4 -I/Users/mike/Documents/Arduino/libraries/Adafruit_GFX_Library -I/Users/mike/Documents/Arduino/libraries/Adafruit_ILI9341 /var/folders/n1/2fz1ks3j52g3hd8zlb855mvr0000gn/T/arduino_build_623455/sketch/ECU_MultiScreen_TriangleTest_t3.ino.cpp -o /dev/null -DARDUINO_LIB_DISCOVERY_PHASE
Alternatives for SPI.h: [SPI@1.0]
ResolveLibrary(SPI.h)
  -> candidates: [SPI@1.0]
/Applications/Teensyduino.app/Contents/Java/hardware/teensy/../tools/arm/bin/arm-none-eabi-g++ -E -CC -x c++ -w -g -Wall -ffunction-sections -fdata-sections -nostdlib -std=gnu++14 -fno-exceptions -fpermissive -fno-rtti -fno-threadsafe-statics -felide-constructors -Wno-error=narrowing -mthumb -mcpu=cortex-m7 -mfloat-abi=hard -mfpu=fpv5-d16 -D__IMXRT1062__ -DTEENSYDUINO=153 -DARDUINO=10813 -DARDUINO_TEENSY41 -DF_CPU=600000000 -DUSB_SERIAL -DLAYOUT_US_ENGLISH -I/Applications/Teensyduino.app/Contents/Java/hardware/teensy/avr/cores/teensy4 -I/Users/mike/Documents/Arduino/libraries/Adafruit_GFX_Library -I/Users/mike/Documents/Arduino/libraries/Adafruit_ILI9341 -I/Applications/Teensyduino.app/Contents/Java/hardware/teensy/avr/libraries/SPI /var/folders/n1/2fz1ks3j52g3hd8zlb855mvr0000gn/T/arduino_build_623455/sketch/ECU_MultiScreen_TriangleTest_t3.ino.cpp -o /dev/null -DARDUINO_LIB_DISCOVERY_PHASE
/Applications/Teensyduino.app/Contents/Java/hardware/teensy/../tools/arm/bin/arm-none-eabi-g++ -E -CC -x c++ -w -g -Wall -ffunction-sections -fdata-sections -nostdlib -std=gnu++14 -fno-exceptions -fpermissive -fno-rtti -fno-threadsafe-statics -felide-constructors -Wno-error=narrowing -mthumb -mcpu=cortex-m7 -mfloat-abi=hard -mfpu=fpv5-d16 -D__IMXRT1062__ -DTEENSYDUINO=153 -DARDUINO=10813 -DARDUINO_TEENSY41 -DF_CPU=600000000 -DUSB_SERIAL -DLAYOUT_US_ENGLISH -I/Applications/Teensyduino.app/Contents/Java/hardware/teensy/avr/cores/teensy4 -I/Users/mike/Documents/Arduino/libraries/Adafruit_GFX_Library -I/Users/mike/Documents/Arduino/libraries/Adafruit_ILI9341 -I/Applications/Teensyduino.app/Contents/Java/hardware/teensy/avr/libraries/SPI /Users/mike/Documents/Arduino/libraries/Adafruit_GFX_Library/Adafruit_GFX.cpp -o /dev/null -DARDUINO_LIB_DISCOVERY_PHASE
/Applications/Teensyduino.app/Contents/Java/hardware/teensy/../tools/arm/bin/arm-none-eabi-g++ -E -CC -x c++ -w -g -Wall -ffunction-sections -fdata-sections -nostdlib -std=gnu++14 -fno-exceptions -fpermissive -fno-rtti -fno-threadsafe-statics -felide-constructors -Wno-error=narrowing -mthumb -mcpu=cortex-m7 -mfloat-abi=hard -mfpu=fpv5-d16 -D__IMXRT1062__ -DTEENSYDUINO=153 -DARDUINO=10813 -DARDUINO_TEENSY41 -DF_CPU=600000000 -DUSB_SERIAL -DLAYOUT_US_ENGLISH -I/Applications/Teensyduino.app/Contents/Java/hardware/teensy/avr/cores/teensy4 -I/Users/mike/Documents/Arduino/libraries/Adafruit_GFX_Library -I/Users/mike/Documents/Arduino/libraries/Adafruit_ILI9341 -I/Applications/Teensyduino.app/Contents/Java/hardware/teensy/avr/libraries/SPI /Users/mike/Documents/Arduino/libraries/Adafruit_GFX_Library/Adafruit_GrayOLED.cpp -o /dev/null -DARDUINO_LIB_DISCOVERY_PHASE
Alternatives for Adafruit_I2CDevice.h: [Adafruit_BusIO@1.6.0]
ResolveLibrary(Adafruit_I2CDevice.h)
  -> candidates: [Adafruit_BusIO@1.6.0]
/Applications/Teensyduino.app/Contents/Java/hardware/teensy/../tools/arm/bin/arm-none-eabi-g++ -E -CC -x c++ -w -g -Wall -ffunction-sections -fdata-sections -nostdlib -std=gnu++14 -fno-exceptions -fpermissive -fno-rtti -fno-threadsafe-statics -felide-constructors -Wno-error=narrowing -mthumb -mcpu=cortex-m7 -mfloat-abi=hard -mfpu=fpv5-d16 -D__IMXRT1062__ -DTEENSYDUINO=153 -DARDUINO=10813 -DARDUINO_TEENSY41 -DF_CPU=600000000 -DUSB_SERIAL -DLAYOUT_US_ENGLISH -I/Applications/Teensyduino.app/Contents/Java/hardware/teensy/avr/cores/teensy4 -I/Users/mike/Documents/Arduino/libraries/Adafruit_GFX_Library -I/Users/mike/Documents/Arduino/libraries/Adafruit_ILI9341 -I/Applications/Teensyduino.app/Contents/Java/hardware/teensy/avr/libraries/SPI -I/Users/mike/Documents/Arduino/libraries/Adafruit_BusIO /Users/mike/Documents/Arduino/libraries/Adafruit_GFX_Library/Adafruit_GrayOLED.cpp -o /dev/null -DARDUINO_LIB_DISCOVERY_PHASE
Alternatives for Wire.h: [Wire@1.0]
ResolveLibrary(Wire.h)
  -> candidates: [Wire@1.0]
/Applications/Teensyduino.app/Contents/Java/hardware/teensy/../tools/arm/bin/arm-none-eabi-g++ -E -CC -x c++ -w -g -Wall -ffunction-sections -fdata-sections -nostdlib -std=gnu++14 -fno-exceptions -fpermissive -fno-rtti -fno-threadsafe-statics -felide-constructors -Wno-error=narrowing -mthumb -mcpu=cortex-m7 -mfloat-abi=hard -mfpu=fpv5-d16 -D__IMXRT1062__ -DTEENSYDUINO=153 -DARDUINO=10813 -DARDUINO_TEENSY41 -DF_CPU=600000000 -DUSB_SERIAL -DLAYOUT_US_ENGLISH -I/Applications/Teensyduino.app/Contents/Java/hardware/teensy/avr/cores/teensy4 -I/Users/mike/Documents/Arduino/libraries/Adafruit_GFX_Library -I/Users/mike/Documents/Arduino/libraries/Adafruit_ILI9341 -I/Applications/Teensyduino.app/Contents/Java/hardware/teensy/avr/libraries/SPI -I/Users/mike/Documents/Arduino/libraries/Adafruit_BusIO -I/Applications/Teensyduino.app/Contents/Java/hardware/teensy/avr/libraries/Wire /Users/mike/Documents/Arduino/libraries/Adafruit_GFX_Library/Adafruit_GrayOLED.cpp -o /dev/null -DARDUINO_LIB_DISCOVERY_PHASE
/Applications/Teensyduino.app/Contents/Java/hardware/teensy/../tools/arm/bin/arm-none-eabi-g++ -E -CC -x c++ -w -g -Wall -ffunction-sections -fdata-sections -nostdlib -std=gnu++14 -fno-exceptions -fpermissive -fno-rtti -fno-threadsafe-statics -felide-constructors -Wno-error=narrowing -mthumb -mcpu=cortex-m7 -mfloat-abi=hard -mfpu=fpv5-d16 -D__IMXRT1062__ -DTEENSYDUINO=153 -DARDUINO=10813 -DARDUINO_TEENSY41 -DF_CPU=600000000 -DUSB_SERIAL -DLAYOUT_US_ENGLISH -I/Applications/Teensyduino.app/Contents/Java/hardware/teensy/avr/cores/teensy4 -I/Users/mike/Documents/Arduino/libraries/Adafruit_GFX_Library -I/Users/mike/Documents/Arduino/libraries/Adafruit_ILI9341 -I/Applications/Teensyduino.app/Contents/Java/hardware/teensy/avr/libraries/SPI -I/Users/mike/Documents/Arduino/libraries/Adafruit_BusIO -I/Applications/Teensyduino.app/Contents/Java/hardware/teensy/avr/libraries/Wire /Users/mike/Documents/Arduino/libraries/Adafruit_GFX_Library/Adafruit_SPITFT.cpp -o /dev/null -DARDUINO_LIB_DISCOVERY_PHASE
/Applications/Teensyduino.app/Contents/Java/hardware/teensy/../tools/arm/bin/arm-none-eabi-g++ -E -CC -x c++ -w -g -Wall -ffunction-sections -fdata-sections -nostdlib -std=gnu++14 -fno-exceptions -fpermissive -fno-rtti -fno-threadsafe-statics -felide-constructors -Wno-error=narrowing -mthumb -mcpu=cortex-m7 -mfloat-abi=hard -mfpu=fpv5-d16 -D__IMXRT1062__ -DTEENSYDUINO=153 -DARDUINO=10813 -DARDUINO_TEENSY41 -DF_CPU=600000000 -DUSB_SERIAL -DLAYOUT_US_ENGLISH -I/Applications/Teensyduino.app/Contents/Java/hardware/teensy/avr/cores/teensy4 -I/Users/mike/Documents/Arduino/libraries/Adafruit_GFX_Library -I/Users/mike/Documents/Arduino/libraries/Adafruit_ILI9341 -I/Applications/Teensyduino.app/Contents/Java/hardware/teensy/avr/libraries/SPI -I/Users/mike/Documents/Arduino/libraries/Adafruit_BusIO -I/Applications/Teensyduino.app/Contents/Java/hardware/teensy/avr/libraries/Wire /Users/mike/Documents/Arduino/libraries/Adafruit_GFX_Library/glcdfont.c -o /dev/null -DARDUINO_LIB_DISCOVERY_PHASE
/Applications/Teensyduino.app/Contents/Java/hardware/teensy/../tools/arm/bin/arm-none-eabi-g++ -E -CC -x c++ -w -g -Wall -ffunction-sections -fdata-sections -nostdlib -std=gnu++14 -fno-exceptions -fpermissive -fno-rtti -fno-threadsafe-statics -felide-constructors -Wno-error=narrowing -mthumb -mcpu=cortex-m7 -mfloat-abi=hard -mfpu=fpv5-d16 -D__IMXRT1062__ -DTEENSYDUINO=153 -DARDUINO=10813 -DARDUINO_TEENSY41 -DF_CPU=600000000 -DUSB_SERIAL -DLAYOUT_US_ENGLISH -I/Applications/Teensyduino.app/Contents/Java/hardware/teensy/avr/cores/teensy4 -I/Users/mike/Documents/Arduino/libraries/Adafruit_GFX_Library -I/Users/mike/Documents/Arduino/libraries/Adafruit_ILI9341 -I/Applications/Teensyduino.app/Contents/Java/hardware/teensy/avr/libraries/SPI -I/Users/mike/Documents/Arduino/libraries/Adafruit_BusIO -I/Applications/Teensyduino.app/Contents/Java/hardware/teensy/avr/libraries/Wire /Users/mike/Documents/Arduino/libraries/Adafruit_ILI9341/ILI9341_t3.cpp -o /dev/null -DARDUINO_LIB_DISCOVERY_PHASE
/Applications/Teensyduino.app/Contents/Java/hardware/teensy/../tools/arm/bin/arm-none-eabi-g++ -E -CC -x c++ -w -g -Wall -ffunction-sections -fdata-sections -nostdlib -std=gnu++14 -fno-exceptions -fpermissive -fno-rtti -fno-threadsafe-statics -felide-constructors -Wno-error=narrowing -mthumb -mcpu=cortex-m7 -mfloat-abi=hard -mfpu=fpv5-d16 -D__IMXRT1062__ -DTEENSYDUINO=153 -DARDUINO=10813 -DARDUINO_TEENSY41 -DF_CPU=600000000 -DUSB_SERIAL -DLAYOUT_US_ENGLISH -I/Applications/Teensyduino.app/Contents/Java/hardware/teensy/avr/cores/teensy4 -I/Users/mike/Documents/Arduino/libraries/Adafruit_GFX_Library -I/Users/mike/Documents/Arduino/libraries/Adafruit_ILI9341 -I/Applications/Teensyduino.app/Contents/Java/hardware/teensy/avr/libraries/SPI -I/Users/mike/Documents/Arduino/libraries/Adafruit_BusIO -I/Applications/Teensyduino.app/Contents/Java/hardware/teensy/avr/libraries/Wire /Users/mike/Documents/Arduino/libraries/Adafruit_ILI9341/glcdfont.c -o /dev/null -DARDUINO_LIB_DISCOVERY_PHASE
/Applications/Teensyduino.app/Contents/Java/hardware/teensy/../tools/arm/bin/arm-none-eabi-g++ -E -CC -x c++ -w -g -Wall -ffunction-sections -fdata-sections -nostdlib -std=gnu++14 -fno-exceptions -fpermissive -fno-rtti -fno-threadsafe-statics -felide-constructors -Wno-error=narrowing -mthumb -mcpu=cortex-m7 -mfloat-abi=hard -mfpu=fpv5-d16 -D__IMXRT1062__ -DTEENSYDUINO=153 -DARDUINO=10813 -DARDUINO_TEENSY41 -DF_CPU=600000000 -DUSB_SERIAL -DLAYOUT_US_ENGLISH -I/Applications/Teensyduino.app/Contents/Java/hardware/teensy/avr/cores/teensy4 -I/Users/mike/Documents/Arduino/libraries/Adafruit_GFX_Library -I/Users/mike/Documents/Arduino/libraries/Adafruit_ILI9341 -I/Applications/Teensyduino.app/Contents/Java/hardware/teensy/avr/libraries/SPI -I/Users/mike/Documents/Arduino/libraries/Adafruit_BusIO -I/Applications/Teensyduino.app/Contents/Java/hardware/teensy/avr/libraries/Wire /Applications/Teensyduino.app/Contents/Java/hardware/teensy/avr/libraries/SPI/SPI.cpp -o /dev/null -DARDUINO_LIB_DISCOVERY_PHASE
/Applications/Teensyduino.app/Contents/Java/hardware/teensy/../tools/arm/bin/arm-none-eabi-g++ -E -CC -x c++ -w -g -Wall -ffunction-sections -fdata-sections -nostdlib -std=gnu++14 -fno-exceptions -fpermissive -fno-rtti -fno-threadsafe-statics -felide-constructors -Wno-error=narrowing -mthumb -mcpu=cortex-m7 -mfloat-abi=hard -mfpu=fpv5-d16 -D__IMXRT1062__ -DTEENSYDUINO=153 -DARDUINO=10813 -DARDUINO_TEENSY41 -DF_CPU=600000000 -DUSB_SERIAL -DLAYOUT_US_ENGLISH -I/Applications/Teensyduino.app/Contents/Java/hardware/teensy/avr/cores/teensy4 -I/Users/mike/Documents/Arduino/libraries/Adafruit_GFX_Library -I/Users/mike/Documents/Arduino/libraries/Adafruit_ILI9341 -I/Applications/Teensyduino.app/Contents/Java/hardware/teensy/avr/libraries/SPI -I/Users/mike/Documents/Arduino/libraries/Adafruit_BusIO -I/Applications/Teensyduino.app/Contents/Java/hardware/teensy/avr/libraries/Wire /Users/mike/Documents/Arduino/libraries/Adafruit_BusIO/Adafruit_BusIO_Register.cpp -o /dev/null -DARDUINO_LIB_DISCOVERY_PHASE
/Applications/Teensyduino.app/Contents/Java/hardware/teensy/../tools/arm/bin/arm-none-eabi-g++ -E -CC -x c++ -w -g -Wall -ffunction-sections -fdata-sections -nostdlib -std=gnu++14 -fno-exceptions -fpermissive -fno-rtti -fno-threadsafe-statics -felide-constructors -Wno-error=narrowing -mthumb -mcpu=cortex-m7 -mfloat-abi=hard -mfpu=fpv5-d16 -D__IMXRT1062__ -DTEENSYDUINO=153 -DARDUINO=10813 -DARDUINO_TEENSY41 -DF_CPU=600000000 -DUSB_SERIAL -DLAYOUT_US_ENGLISH -I/Applications/Teensyduino.app/Contents/Java/hardware/teensy/avr/cores/teensy4 -I/Users/mike/Documents/Arduino/libraries/Adafruit_GFX_Library -I/Users/mike/Documents/Arduino/libraries/Adafruit_ILI9341 -I/Applications/Teensyduino.app/Contents/Java/hardware/teensy/avr/libraries/SPI -I/Users/mike/Documents/Arduino/libraries/Adafruit_BusIO -I/Applications/Teensyduino.app/Contents/Java/hardware/teensy/avr/libraries/Wire /Users/mike/Documents/Arduino/libraries/Adafruit_BusIO/Adafruit_I2CDevice.cpp -o /dev/null -DARDUINO_LIB_DISCOVERY_PHASE
/Applications/Teensyduino.app/Contents/Java/hardware/teensy/../tools/arm/bin/arm-none-eabi-g++ -E -CC -x c++ -w -g -Wall -ffunction-sections -fdata-sections -nostdlib -std=gnu++14 -fno-exceptions -fpermissive -fno-rtti -fno-threadsafe-statics -felide-constructors -Wno-error=narrowing -mthumb -mcpu=cortex-m7 -mfloat-abi=hard -mfpu=fpv5-d16 -D__IMXRT1062__ -DTEENSYDUINO=153 -DARDUINO=10813 -DARDUINO_TEENSY41 -DF_CPU=600000000 -DUSB_SERIAL -DLAYOUT_US_ENGLISH -I/Applications/Teensyduino.app/Contents/Java/hardware/teensy/avr/cores/teensy4 -I/Users/mike/Documents/Arduino/libraries/Adafruit_GFX_Library -I/Users/mike/Documents/Arduino/libraries/Adafruit_ILI9341 -I/Applications/Teensyduino.app/Contents/Java/hardware/teensy/avr/libraries/SPI -I/Users/mike/Documents/Arduino/libraries/Adafruit_BusIO -I/Applications/Teensyduino.app/Contents/Java/hardware/teensy/avr/libraries/Wire /Users/mike/Documents/Arduino/libraries/Adafruit_BusIO/Adafruit_SPIDevice.cpp -o /dev/null -DARDUINO_LIB_DISCOVERY_PHASE
/Applications/Teensyduino.app/Contents/Java/hardware/teensy/../tools/arm/bin/arm-none-eabi-g++ -E -CC -x c++ -w -g -Wall -ffunction-sections -fdata-sections -nostdlib -std=gnu++14 -fno-exceptions -fpermissive -fno-rtti -fno-threadsafe-statics -felide-constructors -Wno-error=narrowing -mthumb -mcpu=cortex-m7 -mfloat-abi=hard -mfpu=fpv5-d16 -D__IMXRT1062__ -DTEENSYDUINO=153 -DARDUINO=10813 -DARDUINO_TEENSY41 -DF_CPU=600000000 -DUSB_SERIAL -DLAYOUT_US_ENGLISH -I/Applications/Teensyduino.app/Contents/Java/hardware/teensy/avr/cores/teensy4 -I/Users/mike/Documents/Arduino/libraries/Adafruit_GFX_Library -I/Users/mike/Documents/Arduino/libraries/Adafruit_ILI9341 -I/Applications/Teensyduino.app/Contents/Java/hardware/teensy/avr/libraries/SPI -I/Users/mike/Documents/Arduino/libraries/Adafruit_BusIO -I/Applications/Teensyduino.app/Contents/Java/hardware/teensy/avr/libraries/Wire -I/Applications/Teensyduino.app/Contents/Java/hardware/teensy/avr/libraries/Wire/utility /Applications/Teensyduino.app/Contents/Java/hardware/teensy/avr/libraries/Wire/Wire.cpp -o /dev/null -DARDUINO_LIB_DISCOVERY_PHASE
/Applications/Teensyduino.app/Contents/Java/hardware/teensy/../tools/arm/bin/arm-none-eabi-g++ -E -CC -x c++ -w -g -Wall -ffunction-sections -fdata-sections -nostdlib -std=gnu++14 -fno-exceptions -fpermissive -fno-rtti -fno-threadsafe-statics -felide-constructors -Wno-error=narrowing -mthumb -mcpu=cortex-m7 -mfloat-abi=hard -mfpu=fpv5-d16 -D__IMXRT1062__ -DTEENSYDUINO=153 -DARDUINO=10813 -DARDUINO_TEENSY41 -DF_CPU=600000000 -DUSB_SERIAL -DLAYOUT_US_ENGLISH -I/Applications/Teensyduino.app/Contents/Java/hardware/teensy/avr/cores/teensy4 -I/Users/mike/Documents/Arduino/libraries/Adafruit_GFX_Library -I/Users/mike/Documents/Arduino/libraries/Adafruit_ILI9341 -I/Applications/Teensyduino.app/Contents/Java/hardware/teensy/avr/libraries/SPI -I/Users/mike/Documents/Arduino/libraries/Adafruit_BusIO -I/Applications/Teensyduino.app/Contents/Java/hardware/teensy/avr/libraries/Wire -I/Applications/Teensyduino.app/Contents/Java/hardware/teensy/avr/libraries/Wire/utility /Applications/Teensyduino.app/Contents/Java/hardware/teensy/avr/libraries/Wire/WireIMXRT.cpp -o /dev/null -DARDUINO_LIB_DISCOVERY_PHASE
/Applications/Teensyduino.app/Contents/Java/hardware/teensy/../tools/arm/bin/arm-none-eabi-g++ -E -CC -x c++ -w -g -Wall -ffunction-sections -fdata-sections -nostdlib -std=gnu++14 -fno-exceptions -fpermissive -fno-rtti -fno-threadsafe-statics -felide-constructors -Wno-error=narrowing -mthumb -mcpu=cortex-m7 -mfloat-abi=hard -mfpu=fpv5-d16 -D__IMXRT1062__ -DTEENSYDUINO=153 -DARDUINO=10813 -DARDUINO_TEENSY41 -DF_CPU=600000000 -DUSB_SERIAL -DLAYOUT_US_ENGLISH -I/Applications/Teensyduino.app/Contents/Java/hardware/teensy/avr/cores/teensy4 -I/Users/mike/Documents/Arduino/libraries/Adafruit_GFX_Library -I/Users/mike/Documents/Arduino/libraries/Adafruit_ILI9341 -I/Applications/Teensyduino.app/Contents/Java/hardware/teensy/avr/libraries/SPI -I/Users/mike/Documents/Arduino/libraries/Adafruit_BusIO -I/Applications/Teensyduino.app/Contents/Java/hardware/teensy/avr/libraries/Wire -I/Applications/Teensyduino.app/Contents/Java/hardware/teensy/avr/libraries/Wire/utility /Applications/Teensyduino.app/Contents/Java/hardware/teensy/avr/libraries/Wire/WireKinetis.cpp -o /dev/null -DARDUINO_LIB_DISCOVERY_PHASE
/Applications/Teensyduino.app/Contents/Java/hardware/teensy/../tools/arm/bin/arm-none-eabi-g++ -E -CC -x c++ -w -g -Wall -ffunction-sections -fdata-sections -nostdlib -std=gnu++14 -fno-exceptions -fpermissive -fno-rtti -fno-threadsafe-statics -felide-constructors -Wno-error=narrowing -mthumb -mcpu=cortex-m7 -mfloat-abi=hard -mfpu=fpv5-d16 -D__IMXRT1062__ -DTEENSYDUINO=153 -DARDUINO=10813 -DARDUINO_TEENSY41 -DF_CPU=600000000 -DUSB_SERIAL -DLAYOUT_US_ENGLISH -I/Applications/Teensyduino.app/Contents/Java/hardware/teensy/avr/cores/teensy4 -I/Users/mike/Documents/Arduino/libraries/Adafruit_GFX_Library -I/Users/mike/Documents/Arduino/libraries/Adafruit_ILI9341 -I/Applications/Teensyduino.app/Contents/Java/hardware/teensy/avr/libraries/SPI -I/Users/mike/Documents/Arduino/libraries/Adafruit_BusIO -I/Applications/Teensyduino.app/Contents/Java/hardware/teensy/avr/libraries/Wire -I/Applications/Teensyduino.app/Contents/Java/hardware/teensy/avr/libraries/Wire/utility /Applications/Teensyduino.app/Contents/Java/hardware/teensy/avr/libraries/Wire/utility/twi.c -o /dev/null -DARDUINO_LIB_DISCOVERY_PHASE
Generating function prototypes...
/Applications/Teensyduino.app/Contents/Java/hardware/teensy/../tools/arm/bin/arm-none-eabi-g++ -E -CC -x c++ -w -g -Wall -ffunction-sections -fdata-sections -nostdlib -std=gnu++14 -fno-exceptions -fpermissive -fno-rtti -fno-threadsafe-statics -felide-constructors -Wno-error=narrowing -mthumb -mcpu=cortex-m7 -mfloat-abi=hard -mfpu=fpv5-d16 -D__IMXRT1062__ -DTEENSYDUINO=153 -DARDUINO=10813 -DARDUINO_TEENSY41 -DF_CPU=600000000 -DUSB_SERIAL -DLAYOUT_US_ENGLISH -I/Applications/Teensyduino.app/Contents/Java/hardware/teensy/avr/cores/teensy4 -I/Users/mike/Documents/Arduino/libraries/Adafruit_GFX_Library -I/Users/mike/Documents/Arduino/libraries/Adafruit_ILI9341 -I/Applications/Teensyduino.app/Contents/Java/hardware/teensy/avr/libraries/SPI -I/Users/mike/Documents/Arduino/libraries/Adafruit_BusIO -I/Applications/Teensyduino.app/Contents/Java/hardware/teensy/avr/libraries/Wire /var/folders/n1/2fz1ks3j52g3hd8zlb855mvr0000gn/T/arduino_build_623455/sketch/ECU_MultiScreen_TriangleTest_t3.ino.cpp -o /var/folders/n1/2fz1ks3j52g3hd8zlb855mvr0000gn/T/arduino_build_623455/preproc/ctags_target_for_gcc_minus_e.cpp -DARDUINO_LIB_DISCOVERY_PHASE
/Applications/Teensyduino.app/Contents/Java/tools-builder/ctags/5.8-arduino11/ctags -u --language-force=c++ -f - --c++-kinds=svpf --fields=KSTtzns --line-directives /var/folders/n1/2fz1ks3j52g3hd8zlb855mvr0000gn/T/arduino_build_623455/preproc/ctags_target_for_gcc_minus_e.cpp
Compiling sketch...
/Applications/Teensyduino.app/Contents/Java/hardware/teensy/../tools/precompile_helper /Applications/Teensyduino.app/Contents/Java/hardware/teensy/avr/cores/teensy4 /var/folders/n1/2fz1ks3j52g3hd8zlb855mvr0000gn/T/arduino_build_623455 /Applications/Teensyduino.app/Contents/Java/hardware/teensy/../tools/arm/bin/arm-none-eabi-g++ -x c++-header -O2 -g -Wall -ffunction-sections -fdata-sections -nostdlib -MMD -std=gnu++14 -fno-exceptions -fpermissive -fno-rtti -fno-threadsafe-statics -felide-constructors -Wno-error=narrowing -mthumb -mcpu=cortex-m7 -mfloat-abi=hard -mfpu=fpv5-d16 -D__IMXRT1062__ -DTEENSYDUINO=153 -DARDUINO=10813 -DARDUINO_TEENSY41 -DF_CPU=600000000 -DUSB_SERIAL -DLAYOUT_US_ENGLISH -I/Applications/Teensyduino.app/Contents/Java/hardware/teensy/avr/cores/teensy4 /var/folders/n1/2fz1ks3j52g3hd8zlb855mvr0000gn/T/arduino_build_623455/pch/Arduino.h -o /var/folders/n1/2fz1ks3j52g3hd8zlb855mvr0000gn/T/arduino_build_623455/pch/Arduino.h.gch
Using previously compiled file: /var/folders/n1/2fz1ks3j52g3hd8zlb855mvr0000gn/T/arduino_build_623455/pch/Arduino.h.gch
/Applications/Teensyduino.app/Contents/Java/hardware/teensy/../tools/arm/bin/arm-none-eabi-g++ -c -O2 -g -Wall -ffunction-sections -fdata-sections -nostdlib -MMD -std=gnu++14 -fno-exceptions -fpermissive -fno-rtti -fno-threadsafe-statics -felide-constructors -Wno-error=narrowing -mthumb -mcpu=cortex-m7 -mfloat-abi=hard -mfpu=fpv5-d16 -D__IMXRT1062__ -DTEENSYDUINO=153 -DARDUINO=10813 -DARDUINO_TEENSY41 -DF_CPU=600000000 -DUSB_SERIAL -DLAYOUT_US_ENGLISH -I/var/folders/n1/2fz1ks3j52g3hd8zlb855mvr0000gn/T/arduino_build_623455/pch -I/Applications/Teensyduino.app/Contents/Java/hardware/teensy/avr/cores/teensy4 -I/Users/mike/Documents/Arduino/libraries/Adafruit_GFX_Library -I/Users/mike/Documents/Arduino/libraries/Adafruit_ILI9341 -I/Applications/Teensyduino.app/Contents/Java/hardware/teensy/avr/libraries/SPI -I/Users/mike/Documents/Arduino/libraries/Adafruit_BusIO -I/Applications/Teensyduino.app/Contents/Java/hardware/teensy/avr/libraries/Wire /var/folders/n1/2fz1ks3j52g3hd8zlb855mvr0000gn/T/arduino_build_623455/sketch/ECU_MultiScreen_TriangleTest_t3.ino.cpp -o /var/folders/n1/2fz1ks3j52g3hd8zlb855mvr0000gn/T/arduino_build_623455/sketch/ECU_MultiScreen_TriangleTest_t3.ino.cpp.o
In file included from /Users/mike/Documents/Arduino/ECU_MultiScreen_TriangleTest_t3/ECU_MultiScreen_TriangleTest_t3.ino:3:0:
/Users/mike/Documents/Arduino/libraries/Adafruit_ILI9341/ILI9341_t3.h: In member function 'void ILI9341_t3::waitFifoNotFull()':
/Users/mike/Documents/Arduino/libraries/Adafruit_ILI9341/ILI9341_t3.h:178:9: error: 'KINETISK_SPI0' was not declared in this scope
    sr = KINETISK_SPI0.SR;
         ^
/Users/mike/Documents/Arduino/libraries/Adafruit_ILI9341/ILI9341_t3.h: In member function 'void ILI9341_t3::waitFifoEmpty()':
/Users/mike/Documents/Arduino/libraries/Adafruit_ILI9341/ILI9341_t3.h:187:9: error: 'KINETISK_SPI0' was not declared in this scope
    sr = KINETISK_SPI0.SR;
         ^
/Users/mike/Documents/Arduino/libraries/Adafruit_ILI9341/ILI9341_t3.h: In member function 'void ILI9341_t3::waitTransmitComplete()':
/Users/mike/Documents/Arduino/libraries/Adafruit_ILI9341/ILI9341_t3.h:193:12: error: 'KINETISK_SPI0' was not declared in this scope
   while (!(KINETISK_SPI0.SR & SPI_SR_TCF)) ; // wait until final output done
            ^
/Users/mike/Documents/Arduino/libraries/Adafruit_ILI9341/ILI9341_t3.h:193:31: error: 'SPI_SR_TCF' was not declared in this scope
   while (!(KINETISK_SPI0.SR & SPI_SR_TCF)) ; // wait until final output done
                               ^
/Users/mike/Documents/Arduino/libraries/Adafruit_ILI9341/ILI9341_t3.h:194:9: error: 'KINETISK_SPI0' was not declared in this scope
   tmp = KINETISK_SPI0.POPR;                  // drain the final RX FIFO word
         ^
/Users/mike/Documents/Arduino/libraries/Adafruit_ILI9341/ILI9341_t3.h: In member function 'void ILI9341_t3::writecommand_cont(uint8_t)':
/Users/mike/Documents/Arduino/libraries/Adafruit_ILI9341/ILI9341_t3.h:197:3: error: 'KINETISK_SPI0' was not declared in this scope
   KINETISK_SPI0.PUSHR = c | (pcs_command << 16) | SPI_PUSHR_CTAS(0) | SPI_PUSHR_CONT;
   ^
/Users/mike/Documents/Arduino/libraries/Adafruit_ILI9341/ILI9341_t3.h:197:67: error: 'SPI_PUSHR_CTAS' was not declared in this scope
   KINETISK_SPI0.PUSHR = c | (pcs_command << 16) | SPI_PUSHR_CTAS(0) | SPI_PUSHR_CONT;
                                                                   ^
/Users/mike/Documents/Arduino/libraries/Adafruit_ILI9341/ILI9341_t3.h:197:71: error: 'SPI_PUSHR_CONT' was not declared in this scope
   KINETISK_SPI0.PUSHR = c | (pcs_command << 16) | SPI_PUSHR_CTAS(0) | SPI_PUSHR_CONT;
                                                                       ^
/Users/mike/Documents/Arduino/libraries/Adafruit_ILI9341/ILI9341_t3.h: In member function 'void ILI9341_t3::writedata8_cont(uint8_t)':
/Users/mike/Documents/Arduino/libraries/Adafruit_ILI9341/ILI9341_t3.h:201:3: error: 'KINETISK_SPI0' was not declared in this scope
   KINETISK_SPI0.PUSHR = c | (pcs_data << 16) | SPI_PUSHR_CTAS(0) | SPI_PUSHR_CONT;
   ^
/Users/mike/Documents/Arduino/libraries/Adafruit_ILI9341/ILI9341_t3.h:201:64: error: 'SPI_PUSHR_CTAS' was not declared in this scope
   KINETISK_SPI0.PUSHR = c | (pcs_data << 16) | SPI_PUSHR_CTAS(0) | SPI_PUSHR_CONT;
                                                                ^
/Users/mike/Documents/Arduino/libraries/Adafruit_ILI9341/ILI9341_t3.h:201:68: error: 'SPI_PUSHR_CONT' was not declared in this scope
   KINETISK_SPI0.PUSHR = c | (pcs_data << 16) | SPI_PUSHR_CTAS(0) | SPI_PUSHR_CONT;
                                                                    ^
/Users/mike/Documents/Arduino/libraries/Adafruit_ILI9341/ILI9341_t3.h: In member function 'void ILI9341_t3::writedata16_cont(uint16_t)':
/Users/mike/Documents/Arduino/libraries/Adafruit_ILI9341/ILI9341_t3.h:205:3: error: 'KINETISK_SPI0' was not declared in this scope
   KINETISK_SPI0.PUSHR = d | (pcs_data << 16) | SPI_PUSHR_CTAS(1) | SPI_PUSHR_CONT;
   ^
/Users/mike/Documents/Arduino/libraries/Adafruit_ILI9341/ILI9341_t3.h:205:64: error: 'SPI_PUSHR_CTAS' was not declared in this scope
   KINETISK_SPI0.PUSHR = d | (pcs_data << 16) | SPI_PUSHR_CTAS(1) | SPI_PUSHR_CONT;
                                                                ^
/Users/mike/Documents/Arduino/libraries/Adafruit_ILI9341/ILI9341_t3.h:205:68: error: 'SPI_PUSHR_CONT' was not declared in this scope
   KINETISK_SPI0.PUSHR = d | (pcs_data << 16) | SPI_PUSHR_CTAS(1) | SPI_PUSHR_CONT;
                                                                    ^
/Users/mike/Documents/Arduino/libraries/Adafruit_ILI9341/ILI9341_t3.h: In member function 'void ILI9341_t3::writecommand_last(uint8_t)':
/Users/mike/Documents/Arduino/libraries/Adafruit_ILI9341/ILI9341_t3.h:210:3: error: 'KINETISK_SPI0' was not declared in this scope
   KINETISK_SPI0.SR = SPI_SR_TCF;
   ^
/Users/mike/Documents/Arduino/libraries/Adafruit_ILI9341/ILI9341_t3.h:210:22: error: 'SPI_SR_TCF' was not declared in this scope
   KINETISK_SPI0.SR = SPI_SR_TCF;
                      ^
/Users/mike/Documents/Arduino/libraries/Adafruit_ILI9341/ILI9341_t3.h:211:67: error: 'SPI_PUSHR_CTAS' was not declared in this scope
   KINETISK_SPI0.PUSHR = c | (pcs_command << 16) | SPI_PUSHR_CTAS(0);
                                                                   ^
/Users/mike/Documents/Arduino/libraries/Adafruit_ILI9341/ILI9341_t3.h: In member function 'void ILI9341_t3::writedata8_last(uint8_t)':
/Users/mike/Documents/Arduino/libraries/Adafruit_ILI9341/ILI9341_t3.h:216:3: error: 'KINETISK_SPI0' was not declared in this scope
   KINETISK_SPI0.SR = SPI_SR_TCF;
   ^
/Users/mike/Documents/Arduino/libraries/Adafruit_ILI9341/ILI9341_t3.h:216:22: error: 'SPI_SR_TCF' was not declared in this scope
   KINETISK_SPI0.SR = SPI_SR_TCF;
                      ^
/Users/mike/Documents/Arduino/libraries/Adafruit_ILI9341/ILI9341_t3.h:217:64: error: 'SPI_PUSHR_CTAS' was not declared in this scope
   KINETISK_SPI0.PUSHR = c | (pcs_data << 16) | SPI_PUSHR_CTAS(0);
                                                                ^
/Users/mike/Documents/Arduino/libraries/Adafruit_ILI9341/ILI9341_t3.h: In member function 'void ILI9341_t3::writedata16_last(uint16_t)':
/Users/mike/Documents/Arduino/libraries/Adafruit_ILI9341/ILI9341_t3.h:222:3: error: 'KINETISK_SPI0' was not declared in this scope
   KINETISK_SPI0.SR = SPI_SR_TCF;
   ^
/Users/mike/Documents/Arduino/libraries/Adafruit_ILI9341/ILI9341_t3.h:222:22: error: 'SPI_SR_TCF' was not declared in this scope
   KINETISK_SPI0.SR = SPI_SR_TCF;
                      ^
/Users/mike/Documents/Arduino/libraries/Adafruit_ILI9341/ILI9341_t3.h:223:64: error: 'SPI_PUSHR_CTAS' was not declared in this scope
   KINETISK_SPI0.PUSHR = d | (pcs_data << 16) | SPI_PUSHR_CTAS(1);
                                                                ^
Using library Adafruit_GFX_Library at version 1.10.2 in folder: /Users/mike/Documents/Arduino/libraries/Adafruit_GFX_Library 
Using library Adafruit_ILI9341 at version 1.0 in folder: /Users/mike/Documents/Arduino/libraries/Adafruit_ILI9341 
Using library SPI at version 1.0 in folder: /Applications/Teensyduino.app/Contents/Java/hardware/teensy/avr/libraries/SPI 
Using library Adafruit_BusIO at version 1.6.0 in folder: /Users/mike/Documents/Arduino/libraries/Adafruit_BusIO 
Using library Wire at version 1.0 in folder: /Applications/Teensyduino.app/Contents/Java/hardware/teensy/avr/libraries/Wire 
Error compiling for board Teensy 4.1.
 
You must have a really old version of the library. Also not sure why it is inside of Adafruit_ili9341 directory.

Note: The current versions are installed by Teensyduino in the <where you install arduino>/hardware/teensy/avr/libraries/ili9341_t3

Which is not used here. Also note I mostly use my own version ili9341_t3n (https://github.com/kurte/ili9341_t3n)
Note: Our libraries don't use the Canvas stuff of Adafruit.

But the ili9341_t3n has an ability to turn on a frame buffer and do writes through it, where you then tell the screen to update...


For example this sketch works:
Code:
#include <ILI9341_t3n.h>

const uint16_t  tft_Color_Black        = 0x0000;
const uint16_t  tft_Color_Blue         = 0x001F;
const uint16_t  tft_Color_Red          = 0xF800;

#define TFT_CS 10
#define TFT_DC  9
#define TFT_RST  8

ILI9341_t3n tft = ILI9341_t3n(TFT_CS, TFT_DC, TFT_RST);

void setup() {

  delay(250);

  tft.begin();
  tft.setFont();
  tft.fillScreen(tft_Color_Black);
  tft.setRotation(0);

}

int loop_count = 0;
void loop() {
  loop_count++;
  if (loop_count & 1) {
    tft.useFrameBuffer(0); // make sure frame buffer is turned off.
    tft.drawTriangle(0, 0, 240, 0, 120, 320, ILI9341_RED);  // This works fine
    tft.fillTriangle(0, 0, 240, 0, 120, 272, ILI9341_BLUE);  // This is what stops halfway down screen.
  } else {
    tft.useFrameBuffer(1);
    tft.drawTriangle(0, 0, 240, 0, 120, 320, ILI9341_BLUE);  // This works fine
    tft.fillTriangle(0, 0, 240, 0, 120, 272, ILI9341_RED);  // This is what stops halfway down screen.
    tft.updateScreen();
  }
  delay(250);
}
It shows it alternating from use frame buffer or not using frame buffer. Ana I alternate which color is use for fill and draw...
IMG_1269.jpg
 
Thanks for your help everyone, I was able to get it working with KurtE's library. It looks to be like 10X faster too! Awesome.

Now if I can just figure out how to make a filled Arc....
 
Also I should mention there is a minor issue with this example:
like: fillRectangle(0, 0, 240, 0, 120, 320, tft_Color_Red
That is the display is 240x320, so the valid ranges for this orientation is X: 0-239 and y: 0-319

Note changing the fill did not fix the issue.

Although I have found the problem... Will update the Issue...

But if anyone wishes to use the Canvas stuff, the fix is near the end of the Adafruit_GFX.cpp file.
Code:
void GFXcanvas16::drawFastRawHLine(int16_t x, int16_t y, int16_t w,
                                   uint16_t color) {
  // x & y already in raw (rotation 0) coordinates, no need to transform.
  [COLOR="#FF0000"]uint32_t [/COLOR]buffer_index = y * WIDTH + x;
  Serial.printf("  DFRHL: %d %d %d: %u\n", x, y, w, buffer_index);
  for ([COLOR="#FF0000"]uint32_t[/COLOR] i = buffer_index; i < buffer_index + w; i++) {
    buffer[i] = color;
  }
}
I changed the two defines in RED to uint32_t, the first was size_t and the other was int16_t, but when you are working with displays of 320x240 the whole index wont fit into
an int16_t...
 
Quick followup on the Canvas issue.

I went ahead and did a Pull Request for the fix, which has been merged and a new version of the Adafruit_gfx library has been released.
 
Status
Not open for further replies.
Back
Top