2020-03-27 02:54 AM
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
Solved! Go to Solution.
2020-03-30 12:12 AM
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
2020-03-27 08:12 AM
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
2020-03-27 10:02 AM
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
2020-03-28 01:54 AM
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
2020-03-29 11:24 AM
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
2020-03-30 12:12 AM
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
2020-03-30 02:05 AM
Hey Alexandre
Perfect, it works !! :)
Thank you very much !!
Greets
Henning