Hello, welcome back.
In this lesson, we're going to talk about the ideal task.
So there must be at least one task in the running state at any given moment because of this, the EIDO
task automatically moves to the running state when there is no task there.
The EIDO task is created automatically.
We don't create this task.
This task is created automatically when we start a scheduler.
The EIDO task has the lowest priority.
This ensures that it's never prevent a higher priority application tasks from entering the run in state.
The EIDO task has the IDU hook function, we can add application specific code directly into the IDU
task by using the hook function.
So if there is some cleanup, we want to perform when the when there is no application, higher priority
task run and we can put that clean up code in the ideal work function.
This function is called automatically by the EIDO task once per iteration of the EIDO task loop.
So whenever the EIDO task executes the content of the task book function, just like any function would
execute.
Remember, just like our functions have, just like our tasks of the task functions, you can think
of the ideal task function that we are we we have access to to be called the Idaho function is just
like the you can think of it simply as the task function for the EIDO task.
And if we have a piece of code that we want to execute whenever the process is ideal, we can drop it
into the EIDO function.
And of course, this has to be enabled.
We enable the use of the Idaho function by setting config use Idaho to one in our free Arktos, not
each file.
Also, if we want to prevent the EIDO task from consuming more CPU time, we can set config EIDO should
yield to we can set it to one.
And what this means is in some configuration, the idato task may be allocated at times like this to
run.
Either that time slice will be exhausted before another higher priority task that just got woken up
would have the chance to run, or we could just see the EIDO task shouldn't exhaust all of its time
slice once it's executed, once issue just uit issued, there should be a contest which.
I don't know if this is clear, but basically this is used to prevent the EIDO task from consuming more
CPU time and that and the reason it is framed as yield is that in a particular configuration of the
scheduler, you can have it such that each task runs for a particular amount of time.
This is known as the time quanta or the time slice.
So we can see each task should run for five months.
So five times each task runs.
OK, so then if we said this value, the ideal task would run for five months, but it could be that
within the running of this five times a higher priority task has just been woken up.
We can see Eido taskin yield such that the EIDO task, its run duration is now not the time, duration
is not the amount of time, it is just a single run.
So it runs once and then it checks for higher priority task and then he runs again rather than running.
All of it's five minutes before it checks for higher priority tasks.
Who want to use the process?
So if you do not understand this, it is fine.
We'll go to the code and write.
We see how the EIDO task works and you can experiment.
Once you've seen how we write the code for the idle task, you can experiment by setting IDU should
you add one and then setting it to zero and see the difference based on the the framework of experiments
that we said are the practical side of this lesson.
So that's all there is.
I'll see you later.
If you do not understand this, of course you can leave it in the questions analysis area.
Oh so you have a nice day.