Skip to main content
manto.1
Associate III
February 1, 2022
Question

No screen slide transition on device, but when on simulator it works!

  • February 1, 2022
  • 8 replies
  • 1653 views

When i use simulator and change screen I want to have a sliding transition from one screen to another. I managed to do this in Simulator, but when I try it on actual display the screen change happens without transition or so fast that it is not visible.

Please help

This topic has been closed for replies.

8 replies

MM..1
Super User
February 1, 2022

You need animation buffer enable when you have ram ... in target hal code

manto.1
manto.1Author
Associate III
February 2, 2022

Hi. Thank you for the advice but I need some more help. I am searching in the TouchGFXHAL.cpp file and can't find any animation buffer.

MM..1
Super User
February 2, 2022

In generated HAL for double buffer ...

void TouchGFXGeneratedHAL::initialize()
{
 HAL::initialize();
 registerEventListener(*(Application::getInstance()));
 setFrameBufferStartAddresses((void*)disp_mem, (void*)(disp_mem+0x00200000), (void*)0);
}

and in user HAL

void TouchGFXHAL::initialize()
{
 // Calling parent implementation of initialize().
 //
 // To overwrite the generated implementation, omit call to parent function
 // and implemented needed functionality here.
 // Please note, HAL::initialize() must be called to initialize the framework.
 TouchGFXGeneratedHAL::initialize();
}

for override read comment and change

void TouchGFXHAL::initialize()
{
 // Calling parent implementation of initialize().
 //
 // To overwrite the generated implementation, omit call to parent function
 // and implemented needed functionality here.
 // Please note, HAL::initialize() must be called to initialize the framework.
 HAL::initialize();
 registerEventListener(*(Application::getInstance()));
 setFrameBufferStartAddresses((void*)disp_mem, (void*)(disp_mem+0x00200000), (void*)(disp_mem+0x00400000));
}

third parameter is animate buffer start addr. My disp_mem define is 0xD0000000

you need change buffers to your

FTrom
Associate III
February 1, 2022

Can you explain it better? I have the same issue and I´m studing an example provided by ST.

In a working ScreenView.cpp I can see the following code (Im will copy only one part)

void Screen1View::handleKeyEvent(uint8_t key)
{
 if (animationState != ANIMATION_READY ||
 menuAnimationState != MENU_ANIMATION_READY)
 {
 return;
 }
 
 if (key == '6')
 {
 // Right
 menuSelectRight();
 }
 else if (key == '4')
 {
 // Left
 menuSelectLeft();
 }
 else

where menuSelectRight is:

void Screen1View::menuSelectRight()
{
 menuAnimationState = MENU_ANIMATION_STEP_0;
 menuAnimationTickCounter = 0;
 
 menuAnimationDirectionLeft = false;
}

where menuAnimationState is a enum and menuAnimationDirectionLeft is a boolean flag.

What I don´find is "who" trigs the acton to move to the other slide.

PS in debug mode, i can see that the GPIO of the joystick works.

Fausto

manto.1
manto.1Author
Associate III
February 2, 2022

I was working like this post explains. Used a dummy button to generte screen transition and then calling it in some other place like gestureEventHandler or dragEventHandler:

https://community.st.com/s/question/0D53W00000XHSWySAP/example-on-how-to-swipe-to-change-a-screen

But I still did not found the solution to my problem.