Replies: 1 comment 1 reply
-
The problem is in the sketch, the sprite is being redrawn by the processor while it is still being rendered by the DMA engine. Either wait for the sprite rendering to complete, ie use dmaWait(), before changing it or use double buffering with 2 sprites. |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Many thanks Bodmer and any helpers for the fantastic library.
I'm using a single DMA sprite to draw to the screen, but have corruption/artifacts.
Not sure if my code is faulty? Or it is the limitations of screen? Or a fault somewhere else?
Anybody have any ideas why?
Screen works perfect using two DMA sprites.
Thought maybe the sprite was too big (240x320) so tested with 160x160 sprite, but still corruption in 160x160 DMA sprite area.
Strangely I noticed if I added delay (~60MS or bigger, FPS=16.23) the artifacts would go away.
My setup:
Pico Pi
320x240 ILI9341 2.4" (non touch)
Setup60_RP2040_ILI9341.h (wired SPI, same pins as described in header, same result with TFT_CS to ground and to pin20)
SPI_FREQUENCY 40000000 (40MHz, tested with 80MHz no change)
Code:
`#include <TFT_eSPI.h>
#include <SPI.h>
TFT_eSPI tft = TFT_eSPI();
uint16_t* sprPtr;
TFT_eSprite spr = TFT_eSprite(&tft);
void setup()
{
sprPtr = (uint16_t*)spr.createSprite(240, 320);
tft.init();
tft.initDMA();
tft.startWrite();
}
void loop()
{
spr.fillSprite(TFT_BLACK);
spr.fillRect(0,0,80,320, TFT_WHITE);
spr.fillCircle(40, 40, 38, TFT_RED);
tft.pushImageDMA(0, 0, 240, 320, sprPtr);
//NOTE adding delay(60); //This gives 16.23 FPS and screen now WORKING ??!?!??
}`
Beta Was this translation helpful? Give feedback.
All reactions