Hello.
Welcome back.
So, um, let's continue where we left off.
Now let's analyze our free Archos config dot h file.
Because if you want to change the, um, the settings of the kernel.
This is why you do it.
So double click here.
Free Archos config dot h.
And over here, this is where we decide to use various aspects of the kernel.
It says over here, config use preemption.
One means.
Use it.
Zero means force meaning do not use it.
So we want to use preemption set to one.
We want to support static allocation.
This is a two one dynamic allocation is set to one.
We don't want to use either.
Hook is set to zero.
We don't want to use take hook is set to zero.
So if you want to know more about these parameters, I would advise you to free up to, um, to take
a look at the, um.
To take a look at my other.
Free ATA's on, um, process source.
From ground up.
Um, most um.
Oh.
If you're already seeing the free Artus for uh for um process source then you'd already know this.
The reason I'm saying this is that in free ATA's on um processors from ground up we use the call I d
e and this lesson might be included in that same course to show people how to use free ARTUS with Cuba
mix in Cuba.
So if you are viewing free arter from, um, processors from ground up, you already know these.
But if you're not you, your view and just kinda makes ASTM to Cuba mix.
Cause then you wouldn't know the meaning of these parameters and you could check that other course out
or you could just um search the free ARTUS, uh, manual.
Okay.
So these are where all parameters are.
So if I want to use something, we set it here.
If we do not, we set it off.
We turn it on and off in this file config use mutex because we are using mbewe text is set to one if
we were going to be set to zero.
We're not using the sixteen bits tick's.
So it is set to zero maximum number of priorities.
Seven.
The take rate is to 1000 hertz the clock.
Hertz is using system clock.
When I use it I.
I do hook.
And when we come down here we use using our cystic as the time base for our ARTUS.
Like I mentioned earlier.
So yeah.
So let's move on with our Y experiment.
I'll come back to the main dot CFR.
So now, um, we have our system work in a round robin harbor.
We talk about LTE.
We're going to use our thread.
Want to talk it with reality so we can go to the thread.
Function off the one.
And at the ality Togo code over there.
This is the red one.
We have the pre uh, we have the profile.
We can comment this out.
The profile is good for debugging.
We only turn it on when we want to see how things y a threat is not working.
The first thing you do is you profile it to see if it's change and meaning the threat is executing.
Right.
So I'm going to comment out of profilers and bring back the the delay it I was in the thread function
when it was first created for us.
Okay, common desalt also.
So the third one, this was thread function one.
I'm going to start off by talking in our early deoxy hall on the score cheapie I oh, on the score,
Torgau Pain and our early DP five.
So CGP are you a
comma qpr you g.p.a. you on this score pain underscore five like this.
We can also send some um some data from here.
We can um tell you what I'll say.
You ain't eight, you ain't eight on the score t and then I'll call this message and then I'll give
it a size of let's say twenty five and then I'll see maybe greetings from third one.
Something like that.
I'll put new line encourage return here.
Oh increase this to thirty five and then semicolon over here so we can transmit this using our you ut.
So now we simply see how an escort you out on the score transmit and then you are Tando the address
h you two and then the pa voice quote message
the prophesies to get an actual size we can count one, two, three, four, five, six, seven, eight,
nine, ten.
Okay I'll just put thirty five to thirty five and then we can put a time out of one.
Okay.
Cause we've declared thirty five.
It might be bigger than that, although we could include the string dot h and be able to automatically
compute the size of the buffer.
Uh I'll leave that to you.
And uh um one M.
S delays too late too.
So I'm going to increase this a bit.
Once this is done, I'll build.
And I'm going to turn it on to the board by clicking over here debug.
And I'm going to open up terror term.
Zero program to see what a I can view the data.
It's like this.
This is it.
And then you orthopod rate the default.
But wait, what are you.
What is it?
One hundred and fifteen thousand two hundred.
Okay, then, um.
I'm gonna click play over here.
So we have greetings from threat one, the reason it's behaving like this.
It's because of our courage, return with courage, return is not.
Let's see,
I've reset my board.
Let me see the same way, okay.
OK, I'm going to change this, then this.
We have 24 characters in our cities, two to enforce.
Well, I'm going to click here to build.
It's important that we get it to right?
Perfectly so that when it jumbo's up, we can know that it's jumbled up because I want to demonstrate
what happens when we are trying to use to threats to access the same resource.
So we need this to one to show how it's working in it.
Good work and condition.
And then when it starts jumbling up text and we no doubt it is not the way it should work in a way.
You would see what I mean.
OK.
So click here to run this.
Do I have to return open Tobin?
Lucy.
You know, I escape from this, then I'm out of the Dybbuk.
Of course, we don't need.
We just need to flush it to our board once I'm out.
I'm going to press to reset my board.
It's strange.
I'm going to start to reteam again because it's misbehaving.
This is it.
This over here.
And then zero port.
One hundred and fifteen thousand two hundred, OK.
Like this.
They reset board is giving us.
So let's increase the time out a bit.
I'm going to increase it over here to ten.
Okay.
This is the same.
We have our courage return a new line when I click here to build.
It's built successfully.
Click here to get onto the board.
Okay, it's downloaded a quick here.
It's still working this way, too, but I can escape this by simply coming out since it's already on
the board.
No, I can go to to.
And take a look at it.
Come over here.
This is the port and then select the portrait.
Over here like this and then.
Okay.
And this is what we have.
It's a peer, not a one second rate, and my ality is totally at a one second rate as well because we
are talking in reality.
So this is it.
We are sending this this message to the U.
S.
From our threat one.
Right.
Moving on, no less.
Interact with threat to what we're going to do in threat to check if the button is pressed and if that
is price.
We want to send you a greeting from threat to us.
Well, so come over here.
This is a threat function to what I'm gonna do is check if the push button is pressed.
We can see how on this call we want to use that GPL.
You read Peine, GPL, you underscore read.
And then this one takes the port and then a PIN number GPL.
You print 13 because it's P.c 13.
And we want to check if this is reset, meaning, uh, this push button is active, low by default,
it is high.
When you press it to activate it, it becomes law.
You want to check if it's Lowe's, which upl you opinion on this call reset like this.
This is surrounded by an if
if this is reset, then we want to send a message and the message can be similar to the one we sent.
So just come over here and copy this.
And then push this in here and then I'm going to copy this.
This message we have here and then I'll pasted up here and I'll just change the number one to two.
So this creten from third to like this.
And just like, well, we have in thread one, I'm going to set it Dilli here to 1000 as well.
Right.
So I'm going to click here to build.
It's built successfully.
I'll get it onto the board by clicking over here.
Okay.
It's downloaded onto the board.
I'm simply going to escape this and go to Terra to
click over here to open.
Over here, then.
Okay.
And then I'm going to set the ball straight through a port.
This is all board rates and I'm going to press to reset my board.
OK.
The boathouse where we sit.
So I've not pressed a button yet.
So we just get in hello from threat one.
So I'm gonna press the button and we have.
Hello.
From threat to.
Okay.
Sometimes when I press the button, there's a miss.
But we can see it.
Okay, so the reason this is work and thus far and there is no conflict is because we have a significant
amount of delay between the two.
What we're going to do now is reduce the amount of delay.
Let's do that.
See what we get before we reduce the delay.
Before we reduce the delay.
Let's get the two threads to have the same amount of work to do.
What I mean by that is I'm going to comment thread one.
Libby togo out such that they are both doing exactly the same thing.
They just transmitting this.
Right.
They just transmitted the message.
OK, so when I click over here.
It's built in.
It's built successfully.
And then, um.
We get to the debug to get onto a board.
Okay, let's download it.
So I'm going to escape this and then try it manually.
What I mean by my knowledge is actually the was on the board.
So I don't need to be in the debark.
I'm going to click here to stop it.
And then I'm going to.
And then I'm going to go to Terra term.
Click over here.
This is it then set up through a port.
This are bought right then.
OK.
Over here.
OK, I'm going to press the button when I press the button.
We still get it.
OK.
They're doing the same amount of work.
Sometimes when I press the button, I don't get no threat to appear at all cause there's conflict sometimes.
OK.
So next experiment, I'm going to disable the button, then just let him, you know, run on your own.
We just push on it to the part where we realize the system cannot be able to provide us both at the
same time.
So over here we have.
If the button is pressed, transmit the message.
So I'm going to just take this out and then put over here and then comment out this this block of code.
Switch it up.
Are the same.
No.
The red one transmits greetings from threat one.
Always daily this and then through to transmits this was delayed this.
Okay.
This could work as well because that delayed is a huge delay.
One second real time reporting system.
You know, universe is quite a lot of time to wait.
Right.
So it's build successfully.
We click over here to go to the book.
It open in.
It's on our board.
I'm just going to exit.
I'm going to go to terror term.
And then also like this.
And then also like the board rate
then.
Okay.
Gonna click to reset the board.
OK.
So we have the Cretans from thread one, Cretans from thread to greetings from thread to greetings from
thread one, two, one, two, one, two, one.
We're still looking good, right?
So great to reduce the delay amount to 10, Emmis.
OK.
Going to click here to build.
Let's.
Click here to go to debunk, and then I'm going to escape the debacle by clicking here.
OK.
And then to return.
Come over here.
This is how comport then I'm gonna select the board rate.
And then click to reset a board.
OK.
So this where we get to know, we get in gibberish.
This is it, because both of the threads are trying to access the same, um, the same resource at the
same time.
And because of this, there's a coalition and the the hardware, which is the single resource, cannot
handle this.
OK.
To prove that this is what is really happening.
I'm going to comment out thread two and keep thread one.
Send in its message unless you because it could just be that 10 M.
S is too, too little for any threat.
So I'm going to comment on that threat, too.
And let's just see thread one attempt to send with a delay of 10 M.
S.
It's built in.
Click here to get onto the board.
It's downloading.
It's done.
I'm going to click here to escape and then I'll go to terror turn by clicking over here.
Then I select my port.
Then I'll change the board rate by coming over here.
She can see through it, one is working on its own with 10 M.
S delay.
So the problem was we had two threads trying to access the same resource at almost the same time.
And if we had some delay, which is 10 Imus and 10 Imus in real, uh, in our toast time in our total
universe, that's a lot of time.
But that's the quittin allowed the, um, the two different threads to access the same resource.
So we solve this problem using Ammu ticks the music we created earlier.
Right.
So I'm going to enable the message from thread to again, cause we can use, you know, with the aid
of the mute ticks or just do controversy over hand and controversy over here.
So we shall continue that experiment and the next lesson.
So I'll see you in the next lesson as we see how to solve this issue using the UTX we created.