cancel
Showing results for 
Search instead for 
Did you mean: 

LTDC STMF32 Double buffering problem

Ahmed Tolba
Associate II
Posted on June 08, 2018 at 02:24

I'm trying to do double buffering using the hardware, STMF32492I.. so first I'm initalizing two layers in two different addresses.

Then I write to the back buffer, switch the back buffer..

But The problem I get multiple copies of the sprite that is animated, so its either I'm drawing to the front buffer multiple times, or the back buffer needs to be cleared.

Here is how I'm doing it

void main{ while (1)     

{        

      LTDC_switch_framebuffer();

      // draw spries   

}

}

void LTDC_switch_framebuffer(void)

{

LTDC->SRCR = LTDC_SRCR_VBR; // reload shadow registers on vertical blank

while ((LTDC->CDSR & LTDC_CDSR_VSYNCS) == 0); // wait for reload

;

flip ^= 1;

BSP_LCD_SetLayerVisible(flip, ENABLE);

BSP_LCD_SelectLayer(1-flip);

}

#ltdc #double-buffer #stm32f4-ltdc
0 REPLIES 0