cancel
Showing results for 
Search instead for 
Did you mean: 

How to pass data from RTOS task to Model in MVP pattern. STM32F469I-DISCO

Fran Marala
Associate III

Hi all

Currently, I’m working with IDE TouchFGXDesigner in a STM32F469I DISCO module, this kind of system feature a Model View Presenter pattern and a RTOS, so, I’m trying to get some data from hardware (for instance a value in an ADC pin) in order to be processed into MVP model, to do that I’m using a task through RTOS that periodically read the data from hardware pin, my problem is how to carry out this data to the Model in this system. On one hand I have reach read the data in a task periodically in a thread running into the FreeRTOS and on the other hand the model has the data class prepared to be refresh from the task, but I don’t find the way to communicate both world. Waiting for your help.

Best Regards

Francisco García

3 REPLIES 3
Romain DIELEMAN
ST Employee

Hi,

Have a look at the Backend communication article in the documentation. It describes two solutions of how to communicate between your HW peripherals and the Model class of your GUI. There are also some examples you can download to have a look at how it was implemented.

/Romain

Fran Marala
Associate III

Hi Romain

First thank you for your answer. I was reading it and was what I was looking for.

Regards

Francisco

Fran Marala
Associate III

Hi again

I finally get the result hoped, I'd like to share with everybody this link, it was very hep full for me, in that you can see easily the way to communicate using queue

Enjoy it:

https://www.youtube.com/watch?v=J6J8EUcw6qU&t=68s

Regards