cancel
Showing results for 
Search instead for 
Did you mean: 

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

manto.1
Senior

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

8 REPLIES 8
MM..1
Chief III

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

FTrom
Associate II

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
Senior

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.

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.

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

Thank you this worked. Can you also explain how much space should there be between start of dubble buffer and animation buffer?

I use bank size as offsets, but for low resolution displays you can use display dimensions as offsets, read LTDC optimizing appnote.

Hi,

You need to make sure you have enough space for your double buffer, so usually you would set the animation buffer right at the end of the second buffer. In general the amount of memory used by a framebuffer is: Width * Height * color depth in bits / 8 bytes.

/Romain