Hi Frank,
It would be great to take a look at your code... I have some stuff started, but not yet tested.
My library can (or at least used to, but I have not tested it out for awhile), do autorefresh...
That is my functions are:
Code:
void setFrameBuffer(uint16_t *frame_buffer);
uint8_t useFrameBuffer(boolean b); // use the frame buffer? First call will allocate
void freeFrameBuffer(void); // explicit call to release the buffer
void updateScreen(void); // call to say update the screen now.
bool updateScreenAsync(bool update_cont = false); // call to say update the screen optinoally turn into continuous mode.
void waitUpdateAsyncComplete(void);
void endUpdateAsync(); // Turn of the continueous mode fla
void dumpDMASettings();
The code only allocates a frame buffer if ask to use one: useFrameBuffer called with TRUE. You can turn on and off as my test code does.
You can in theory pass in frame buffer, so for those who wanted everything preallocated, they call allocate it and then pass in pointer.
The: updateScreen()
does a one shot update screen, which is the same as: writeRect from Frame buffer to screen. Does not use DMA.
Then there is the updateScreenAsync - which can either update the screen once using DMA or can do continuous, where you can then use the endUpdateAsync to turn off and you can call wait to wait until a dma operation has completed...
My work flow when using this, is either just the updateScreen Or sometimes I use the Async one shot and then continue to do whatever computations are needed and then call wait for the last update to complete before I then start updating my display (frame buffer...) Not sure if that makes sense.
Side Note:
Currently if I try to define static buffer like:
Code:
uint16_t tft_frame_buffer[ILI9341_TFTWIDTH * ILI9341_TFTHEIGHT];
The link fails:
Code:
Compiling library "SPIN"
Using previously compiled file: C:\Users\kurte\AppData\Local\Temp\arduino_build_162945\libraries\SPIN\SPIN.cpp.o
Compiling core...
Using precompiled core: C:\Users\kurte\AppData\Local\Temp\arduino_cache_734367\core\core_teensy_avr_teensy4b_usb_serial,opt_o2std,keys_en-us_86f260b7ebc565879a7e32f9efe1770a.a
Linking everything together...
"D:\\arduino-1.8.8\\hardware\\teensy/../tools/arm/bin/arm-none-eabi-gcc" -O2 -Wl,--gc-sections,--relax "-TD:\\arduino-1.8.8\\hardware\\teensy\\avr\\cores\\teensy4/imxrt.ld" -mthumb -mcpu=cortex-m7 -mfloat-abi=hard -mfpu=fpv5-d16 -o "C:\\Users\\kurte\\AppData\\Local\\Temp\\arduino_build_162945/Kurts_ILI9341_t3n_FB_and_clip_tests.ino.elf" "C:\\Users\\kurte\\AppData\\Local\\Temp\\arduino_build_162945\\sketch\\Kurts_ILI9341_t3n_FB_and_clip_tests.ino.cpp.o" "C:\\Users\\kurte\\AppData\\Local\\Temp\\arduino_build_162945\\libraries\\ili9341_t3n\\ILI9341_t3n.cpp.o" "C:\\Users\\kurte\\AppData\\Local\\Temp\\arduino_build_162945\\libraries\\ili9341_t3n\\glcdfont.c.o" "C:\\Users\\kurte\\AppData\\Local\\Temp\\arduino_build_162945\\libraries\\ili9341_t3n\\ili9341_t3n_font_Arial.c.o" "C:\\Users\\kurte\\AppData\\Local\\Temp\\arduino_build_162945\\libraries\\ili9341_t3n\\ili9341_t3n_font_ArialBold.c.o" "C:\\Users\\kurte\\AppData\\Local\\Temp\\arduino_build_162945\\libraries\\SPI\\SPI.cpp.o" "C:\\Users\\kurte\\AppData\\Local\\Temp\\arduino_build_162945\\libraries\\SPIN\\SPIN.cpp.o" "C:\\Users\\kurte\\AppData\\Local\\Temp\\arduino_build_162945/..\\arduino_cache_734367\\core\\core_teensy_avr_teensy4b_usb_serial,opt_o2std,keys_en-us_86f260b7ebc565879a7e32f9efe1770a.a" "-LC:\\Users\\kurte\\AppData\\Local\\Temp\\arduino_build_162945" -larm_cortexM7lfsp_math -lm -lstdc++
d:/arduino-1.8.8/hardware/tools/arm/bin/../lib/gcc/arm-none-eabi/5.4.1/../../../../arm-none-eabi/bin/ld.exe: address 0x200302c0 of C:\Users\kurte\AppData\Local\Temp\arduino_build_162945/Kurts_ILI9341_t3n_FB_and_clip_tests.ino.elf section `.bss' is not within region `DTCM'
d:/arduino-1.8.8/hardware/tools/arm/bin/../lib/gcc/arm-none-eabi/5.4.1/../../../../arm-none-eabi/bin/ld.exe: address 0x200302c0 of C:\Users\kurte\AppData\Local\Temp\arduino_build_162945/Kurts_ILI9341_t3n_FB_and_clip_tests.ino.elf section `.bss' is not within region `DTCM'
collect2.exe: error: ld returned 1 exit status
Maybe need some qualifier now like DMAMEM?