Question
fastest method of drawing one pixel
Hello! I have a good 3d library https://github.com/FabioRM/dsp3D
The author of the library ran it on STM32F746 . The library has the function
void dsp3D_LL_drawPoint(uint32_t x, uint32_t y, color32_t color)
{
if(x < minX)
minX = x;
if(x > maxX)
maxX = x;
if(y < minY)
minY = y;
if(y > maxY)
maxY = y;
// YOUR IMPLEMENTATION
}we need to substitute the code of the output pixel
I wrote to it my function TFT_FillRectangle(uint16_t x1, uint16_t y1, uint16_t x2, uint16_t y2, uint32_t color)
oid TFT_FillRectangle(uint16_t x1, uint16_t y1, uint16_t x2, uint16_t y2, uint32_t color)
{
#define swap(a,b) {int16_t t=a;a=b;b=t;}
if(x1>x2) swap(x1,x2);
if(y1>y2) swap(y1,y2);
uint32_t addr=0;
addr = hltdc.LayerCfg[0].FBStartAdress + 3*(y1*hltdc.LayerCfg[0].ImageWidth+x1);
hdma2d.Init.Mode = DMA2D_R2M;
hdma2d.Init.OutputOffset = hltdc.LayerCfg[0].ImageWidth - (x2-x1);
if(HAL_DMA2D_Init(&hdma2d) == HAL_OK)
{
if(HAL_DMA2D_Start(&hdma2d, color, addr, x2-x1, y2-y1) == HAL_OK)
{
HAL_DMA2D_PollForTransfer(&hdma2d, 10);
}
}
}but drawing is very slowly
https://cloud.mail.ru/public/DGUX/TZoRw7stw
the author of the library does it faster
https://www.youtube.com/watch?v=HqQ-ebsyalM&feature=emb_logo
Please tell me, how can I draw one pixel faster?
