34,7 → 34,7 |
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
* |
* |
* CVS : $Id: aster4.c,v 1.3 2004-04-19 14:48:04 giacomo Exp $ |
* CVS : $Id: aster4.c,v 1.4 2005-01-08 14:31:38 pj Exp $ |
|
Test Number 13 (D): |
|
105,6 → 105,8 |
|
PID aper_table[APER_MAX]; |
|
int shutting_down = 0; |
|
TASK asteroide(void) |
{ |
int i; |
159,6 → 161,11 |
s[0] = c; |
puts_xy(i,y,rand()%15+1,s); |
|
if (shutting_down) { |
cprintf("Ending System Task %d\n",exec_shadow); |
return 0; |
} |
|
task_endcycle(); |
|
puts_xy(i,y,WHITE," "); |
308,9 → 315,15 |
|
void endfun(KEY_EVT *k) |
{ |
sys_end(); |
exit(0); |
} |
|
void exiting(void *arg) |
{ |
cprintf("System shut down...\n"); |
shutting_down = 1; |
} |
|
int main(int argc, char **argv) |
{ |
KEY_EVT k; |
329,6 → 342,8 |
|
clear(); |
cprintf("Press ENTER to end the demo..."); |
|
sys_atrunlevel(exiting, NULL, RUNLEVEL_SHUTDOWN); |
|
hard_task_default_model(m); |
hard_task_def_wcet(m,ASTER_WCET); |
346,8 → 361,7 |
p1 = task_create("Aster",aster,&m,NULL); |
if (p1 == -1) { |
sys_shutdown_message("aster4.c(main): Could not create task <aster> ..."); |
sys_end(); |
return 0; |
exit(0); |
} |
|
hard_task_def_mit(m,500000); |
355,15 → 369,13 |
p2 = task_create("Clock",clock,&m,NULL); |
if (p2 == -1) { |
sys_shutdown_message("aster4.c(main): Could not create task <Clock> ..."); |
sys_end(); |
return 0; |
exit(0); |
} |
|
p3 = task_create("JetControl",jetcontrol,&m_soft,NULL); |
if (p3 == -1) { |
sys_shutdown_message("aster4.c(main): Could not create task <JetControl> ..."); |
sys_end(); |
return 0; |
exit(0); |
} |
|
soft_task_default_model(m_aper); |
378,8 → 390,7 |
aper_table[i] = task_create("aper",aper_asteroid,&m_aper,NULL); |
if (aper_table[i] == -1) { |
sys_shutdown_message("aster4.c(main): Could not create task <aper> ..."); |
sys_end(); |
return 0; |
exit(0); |
} |
} |
|