Hello, welcome back.
And this lesson we go into see another project with regards to cues, we're going to see how to synchronize
the cues.
I'm going to make a copy of the last project, number 14 over here.
I'm going to make a copy by copy and paste over here like this.
Call this.
Fifteen, and then I call it sinking cuz.
Like this.
OK.
So let's open it up, come down here, expand, call source, and then this will mean that Sifa.
So this to me to see as it's currently ups.
We have a Sinda task and a receiver task.
Let's analyze the current kaleidoscopes.
I'm trying to close this a bit and then expand this, so let's come down, we have two tasks.
We have a receiver with a higher priority and a center task with a lower priority.
What are we going to do is we going to create to send the tasks of the same priority and a receiver
task of a lower priority.
So over here, what do we need to add?
This is our task function prototype for our center task.
I'm going to call this center task one, then I'm going to make a copy of this and call this send a
task to.
And then I'm going to come down here and this bit here.
I'm going to make a copy of it.
Copy, then I'll paste this over here and then I'll call this center task one.
And then in its name, I call it Task Center, Task one as well over here, then a task, too.
And this one center task, too.
And what I'm going to do is I'm going to give the receiver task a higher priority.
Currently, the receiver, OK, has a priority of two and Ascender tasks.
Priority one, priority one.
OK, I'm going to put a comment here for you so that when I upload and you review in this.
Create a receiver task of a higher priority.
And then over here, what we are doing is.
Great to send that asks.
Of the same priority.
Lower than the receiver task priority.
Like this.
OK, so we.
Need to update the task function for the senators, I'm going to come down here, we have this task
here, send a task.
Now, it doesn't exist.
It is called Send a task one.
Then I'm going to make a copy of this and then I'll put it down here.
I'll call this send that task to like this.
So send a task.
Want to send in 20, 50 or send a task to is going to send lessie 50 50 something of this nature.
OK, so we have two tasks.
Of sending.
They have the same priority and one receive a task with a higher priority.
Let's see how this turns out.
Let's try to to load this and print it out and see what we get.
So I'm going to build this.
All right, click this and then come to build.
The old project over here.
It's in.
OK, it's done building, so to run this rather than click this and then run in one of our old projects
by mistake, I'm going to right click this and then click runners.
I don't even have to go debuggers.
I can do runners and then select SDM 30 to.
And then I'll select number 15 over here.
It's open in.
OK, I'll see, OK, over here.
No stealing connected.
OK, microcontrollers not connected, it says.
I have connected my microcontrollers, so let's try it again, right, click runners estimated you select
to number 15 over here, no stealing connected, restart your debug session.
Okay, how about I click this new city link?
Let me post a video and find this out.
OK, so I have to I had to restart my computer to get rid of the no StreetLink error.
So if you have a face that you can try, restart on your computer.
So here we are.
We are to project 15.
We try to flash onto our board and we received that error.
Actually, I'm going to rename the name of the project also.
It's about sinkin tasks using cues, not necessarily sinkin cues, because we have a single clue here.
So I'm going to right.
Click and rename here.
I call this.
Cinching.
Talks with Kyuss.
OK.
It's.
It's renaming.
OK, it's renamed, so I'm going to build this right, click our number 15 again, right, click at.
And then I'll deal with project.
It's Putin.
So once that is done, I'm going to right click and then click, run us ASTM 32, Coatex and.
And it's going to flush it onto the board.
Going to see OK over here.
And it's downloaded onto the boat when we run.
It doesn't take us to Dybbuk View, it simply downloads onto our microcontroller.
OK, so I'm going to open real here.
This is real, Tim.
I'm going to come over here, select new line mode and then Partovi over here, oscillator or port?
And then I'll select your portraits first and then I'll Portis over here and then I'll click to Open.
As you can see, we're receiving the data.
OK?
So.
Receiving the data here, the value received ID is 20, 50, the value received ID is 50 50.
And we said over here, the reason we find the error is because we said whenever the time out occurs,
we can print the error.
But this is not necessarily error.
We just.
It's just the data did not.
It did not get sent in the in the time that we wanted it to.
OK, so we print in this area here to simplify it.
I'm going to I think the error was printed from the receive side of things.
Let's see.
Could not receive, so he's from here.
Right.
So to receive this where we have the time out of two hundred or so.
Over here, we have weeks time.
OK, so if we are not able to receive within this week time and then we printed this, I'm going to
simplify it by commenting this out and then we're going to do it again to analyze the results we get.
OK, so we're not printing this if we don't receive within hundred, Ms.
Nothing will be printed.
OK?
So I'll come over here to build our project again.
I can just click here to build.
OK, it's done building.
Oh, get onto the boat before that, I'm going to clear real time here by clicking clear, OK.
And all right, click on the project and then I'll go to Runner's ASTM 30 to.
And it's flashing onto the board.
It's seventy nine percent, ninety seven.
It's almost done.
OK, one hundred percent.
OK, now, because I stopped real time by closing the ports, I'm going to click OK over here.
And as you can see, we have the value received ID 50 50 and then two fifty.
I'll close the port by clicking this.
And the important thing here, the reason I did this experiment is to show that when we created our
send in tasks and assign them equal priority are sending one after the other.
No one is sending more than the other.
You would see the task task one since it's.
20, 50, and then task to since the 50 50 U.S. task, one is since task to as we see 50 fifty to fifty
fifty, fifty to fifty, fifty, fifty, fifty to fifty.
We never see twenty, fifty to fifty and then fifty fifty.
This is because they send in tasks have the same priority.
Right.
So they send one after the other.
Exactly.
One after the other.
In a way the ascendant is synchronized.
One sense the other one says one does in W.S. and then the other one sends ones.
So this is what we meant by synchronizing tasks, using cues.
We've synchronize the descending from the two tasks into the same cue.
And we did this by, you know, assigning the priorities, by giving them the same priority.
So this order is for this lesson.
If you have any questions, leave them in the questions in this area and I'll see you later.
Have a nice day.