2025-05-20 2:50 AM - last edited on 2025-05-20 7:16 AM by GaetanGodart
I am working on the STM32N6570-DK board, and I have a question about demonstrating data on the lcd screen. You see, my project need to do multiple tasks, like collecting the data from the sensors and using the camera to do some AI model inference. Let's name it task A, and task B. I have already written these data-collecting functions in the main.c file, and in model.cpp, I wrote the Model::getcollecteddata() and Model::AIinference() function, and connect this model.cpp with main.c. However, I am wondering if I want to use the Model::tick to send the data to the presenter and use the lcd to show them, due to the fact that I already wrote two functions and the two functions mean s two tasks, in the Model::tick(), can I use the function below:
void Model::tick()
{
tickCounter++;
if((tickCounter%20)==0)
{
modelListener->collecteddatavalue(getcollecteddata());
modelListener->AIinferencevalue(AIinference());
}
}
What I really want to ask is when I use the touchgfx, the functions, like the getcollecteddata() and the AIinference(), will operate and get the data synchronously, so that I don't need to set a flag and set these functions to run orderly(like task A->task B->task C->taskA->...),right?(Since it is based on the threadx operating system)
And if they are not set to work like this, then where should I modify to make it work like it? And I want to know whether the flag idea can actually work.
2025-05-20 8:18 AM
You can IF one primary condition meet. Time for both func is shorter as one tick.