Hardware Reference
In-Depth Information
/*-----------------------------------------------------------*/
/* end cycle -- inserts a task in the idle queue */
/*-----------------------------------------------------------*/
void end cycle (void)
long dl;
save context();
dl = vdes[pexe].dline;
if (sys clock < dl) {
vdes[pexe].state = IDLE;
insert(pexe, &idle);
else dl = dl + (long)vdes[pexe].period;
vdes[pexe].dline = dl;
vdes[pexe].state = READY;
insert(pexe, &ready);
dispatch();
load context();
}
A typical example of periodic task is shown in the following code:
proc cycle()
{ while (TRUE) {
<periodic code>
end cycle();
}
}
Search WWH ::




Custom Search