18,11 → 18,11 |
|
/** |
------------ |
CVS : $Id: fly.c,v 1.9 2004-06-15 14:10:23 giacomo Exp $ |
CVS : $Id: fly.c,v 1.8 2004-04-23 07:57:33 giacomo Exp $ |
|
File: $File$ |
Revision: $Revision: 1.9 $ |
Last update: $Date: 2004-06-15 14:10:23 $ |
Revision: $Revision: 1.8 $ |
Last update: $Date: 2004-04-23 07:57:33 $ |
------------ |
**/ |
|
50,7 → 50,6 |
/*--------------------------------------------------------------*/ |
|
#include <kernel/kern.h> |
#include <modules/sem.h> |
#include <stdlib.h> |
#include <math.h> |
|
75,8 → 74,6 |
int fly_wcet = 1000; /* task wcet */ |
PID pid; |
|
sem_t grx_mutex; |
|
/*--------------------------------------------------------------*/ |
|
void draw_fly(int x, int y, int c) |
136,11 → 133,9 |
y += dy; |
} |
|
sem_wait(&grx_mutex); |
draw_fly(ox, oy, 0); |
draw_fly(x, y, col); |
ox = x; oy = y; |
sem_post(&grx_mutex); |
|
task_endcycle(); |
} |
156,9 → 151,6 |
int i = 0; /* number of tasks created */ |
TIME seme; /* used to init the random seed */ |
|
/* Init the mutex */ |
sem_init(&grx_mutex,0,1); |
|
/* The scenario */ |
grx_rect(XMIN-D-1, YMIN-D-1, XMAX+D+1, YMAX+D+1, rgb16(255,255,255)); |
grx_text("Simulation of Random Flies", XMIN, YMENU+10, rgb16(255,255,255), 0); |