cancel
Showing results for 
Search instead for 
Did you mean: 

Display Refresh

HSchl.1
Associate II

Hello,

I have an STM32F469NI display board. The program I wrote runs without errors. The only problem: The display now has to update itself automatically.

Can you help me with the settings I need to make? Or do I have to generate that in the code?

I would be very grateful for any feedback.

greeting

Henning Schlömer

1 ACCEPTED SOLUTION

Accepted Solutions

Hi,

Normally you should be able to call TouchGFX functions in the handleTickEvent() function. Here is below a way to implement handleTickEvent().

Screen1View.hpp

#ifndef SCREEN1VIEW_HPP
#define SCREEN1VIEW_HPP
 
#include <gui_generated/screen1_screen/Screen1ViewBase.hpp>
#include <gui/screen1_screen/Screen1Presenter.hpp>
 
class Screen1View : public Screen1ViewBase
{
public:
    Screen1View();
    virtual ~Screen1View() {}
    virtual void setupScreen();
    virtual void tearDownScreen();
    virtual void handleTickEvent();
};
 
#endif // SCREEN1VIEW_HPP

Screen1View.cpp

#include <gui/screen1_screen/Screen1View.hpp>
 
Screen1View::Screen1View()
{
 
}
 
void Screen1View::setupScreen()
{
    Screen1ViewBase::setupScreen();
}
 
void Screen1View::tearDownScreen()
{
    Screen1ViewBase::tearDownScreen();
}
 
void Screen1View::handleTickEvent()
{
    // Funtion called every 16 ms
    // Read the new value
    // Update the widget that needs to be updated when a new value appears by invalidating it
    // widget.invalidate()
}

/Alexandre

View solution in original post

6 REPLIES 6
Alexandre RENOUX
Principal

Hi Henning,

I am not sure I completely understand your problem. What do you mean by the display has to update itself automatically ?

Are you using the STM32F469 EVAL or DISCO board ? Could you provide more information like what do you use to build the project and download it in the board ?

/Alexandre

Hello

I work with the stm32f469 discovery board. my problem: i use CANopen to read a value that changes frequently. This change must be permanently updated on the display. I can write the value once but it doesn't update automatically. The display surface would have to be updated in one of my created tasks to show the current value. i can send you the project.

Greeting Henning Schlömer

Hi,

To permanently update the display, you should implement virtual void handleTickEvent(); and update the value inside. This function is called every 16 ms (60 Hz).

Can you add the part of code where you expect the continuous update (you can do it by clicking on the </> button when you write a post) ?

/Alexandre

Hello

In which file do I have to implement the "handle tick event"? do you have an example? can I call up the functions of the touchGFX in the tick event? if you give me your email, I could send you my project.

greeting

Hi,

Normally you should be able to call TouchGFX functions in the handleTickEvent() function. Here is below a way to implement handleTickEvent().

Screen1View.hpp

#ifndef SCREEN1VIEW_HPP
#define SCREEN1VIEW_HPP
 
#include <gui_generated/screen1_screen/Screen1ViewBase.hpp>
#include <gui/screen1_screen/Screen1Presenter.hpp>
 
class Screen1View : public Screen1ViewBase
{
public:
    Screen1View();
    virtual ~Screen1View() {}
    virtual void setupScreen();
    virtual void tearDownScreen();
    virtual void handleTickEvent();
};
 
#endif // SCREEN1VIEW_HPP

Screen1View.cpp

#include <gui/screen1_screen/Screen1View.hpp>
 
Screen1View::Screen1View()
{
 
}
 
void Screen1View::setupScreen()
{
    Screen1ViewBase::setupScreen();
}
 
void Screen1View::tearDownScreen()
{
    Screen1ViewBase::tearDownScreen();
}
 
void Screen1View::handleTickEvent()
{
    // Funtion called every 16 ms
    // Read the new value
    // Update the widget that needs to be updated when a new value appears by invalidating it
    // widget.invalidate()
}

/Alexandre

Hey Alexandre

Perfect, it works !! :-)

Thank you very much !!

Greets

Henning