Changing Screen programmatically
Hi, I have been trying to have my screen change from my own code.
Right now, I tried from another thread to do the following:
I have two screens that I currently alternate every 15 seconds.
FrontendApplication* App;
App = static_cast<FrontendApplication*>(Application::getInstance());
uint8_t Screen = 1;
while(1)
{
osDelay(15000);
if(Screen == 0)
{
App->gotoStatus1ScreenNoTransition();
Screen = 1;
}
else
{
App->gotoStatus2ScreenNoTransition();
Screen = 0;
}
}My program starts with the Status1 screen displayed.
When my call to gotoStatus2ScreenNoTransition gets executed, the screen rarely gets refreshed. When it does, it gets refreshed after 10-12 seconds only. Most of the time it does not refresh at all during the 15 seconds delay. I only get a frozen Screen1 (Screen1 has information that scrolls and changes).
But as soon as the call to gotoStatus1ScreenNoTransition is executed, the screen is refreshed properly .
I know it is a hard to understand without the full context, but maybe someone can give a pointer to where to look to correct this? Is it the proper way of changing screens at runtime without any buttons or screen touches (our product does not have a touch screen anyway).
I also tried to change the screen in Model::tick() with the same result.
So where is the best place to put the screen changing code? What does need to be done except from calling the screen transition functions? Any redraw, invalidate or anything else needs to be called?
Thank you in advance for any response as I am puzzled with this right now.