cancel
Showing results for 
Search instead for 
Did you mean: 

Redrawing using STemWin 2D graphics API on STM32L4R9I Discovery

Johan Bergman
Associate II

I'm running the STM32L4R9I STemWin HelloWorld demo, which basically renders some content to the screen, and then proceeds to an infinite loop, like this:

GUI_SetBkColor(GUI_BLACK);
GUI_Clear();
GUI_SetFont(GUI_FONT_24B_1);
GUI_DispStringHCenterAt("Hello world!", LCD_GetXSize() / 2, (LCD_GetYSize() - 16) / 2);
 
while (1)  {
  LCD_WaitForDisplayCompletion();
 
  GUI_Exec();
  LCD_ActiveRegion = 1;
 
  LCD_WaitForDisplayCompletion();
}

I would like to keep clearing and updating the screen at preferably 30hz, but simply placing the draw instructions inside the while loop casues a lot of flicker and is not consistent at all.

I would really appreciate some insight on this!

Regards,

Johan

2 REPLIES 2

You can try use of FREERTOS

Add

osDelay(10)

after

GUI_Exec();

Johan Bergman
Associate II

Hi!

Sadly I'm not using any RTOS, since it is not required for my project. I don't really need the Window Manager of STemWin either, and I'm not sure if I'm currently using it or not.