Skip to main content
AD�?b
Senior
Jan 28, 2020 5:52 PM UTC
Solved

STM32F746G-DISCO, FreeRTOS, TouchFGX

If I call the function with the button from the STM32F746G-DISCO screen, e.g. a counter, do I have to use FreeRTOS to display the value of the counter on the screen?

This topic has been closed for replies.
Martin KJELDSEN
Martin KJELDSENBest answer
Principal III
Jan 31, 2020 10:23 AM UTC

In that case just follow the instructions in the pinned post in this forum, there's information on that. Generally:

1) Fetch the value from your other RTOS task inside Model::tick()

2) implement a function in the modelListener interface to handle this value (temperatureUpdated(uint8_t _temp))

3) Notify active presenter of this new value: modelListener->temperatureUpdated(val)

4) Implement that function in your presenter.

5) Call something on the view to update the temperature, maybe text area.

/Martin

10 replies

Martin KJELDSEN
Principal III
Jan 29, 2020 1:41 PM UTC

You do not have to use an RTOS. I'm not 100% sure what you mean by "if i call the function with the button".

Generally: The Model class (Model.cpp) is the heart of a TouchGFX application. This is where you will interface with e.g. OS message queues to get values from other tasks, or you could simply sample a GPIO port directly inside Model::tick() if you wanted. A Model knows about a ModelListener (as modelListener). Use this interface to propagate values to your active screen.

modelListener->temperatureUpdated(temp);

Please see the pinned post/sticky on integrating hardware with your UI.

If you're generating this value yourself you can also simply use the same interface

/Martin

AD�?b
AD�?bAuthor
Senior
Jan 29, 2020 3:34 PM UTC

Hi Martin

Thank you.

There is a button on the STM32F746-DISCO desktop. It calls the pulse counting function. I want to display the number of pulses.