Subversion Repositories shark

Compare Revisions

Regard whitespace Rev 1481 → Rev 1482

/demos/trunk/base/fly.c
18,11 → 18,11
 
/**
------------
CVS : $Id: fly.c,v 1.8 2004-04-23 07:57:33 giacomo Exp $
CVS : $Id: fly.c,v 1.9 2004-06-15 14:10:23 giacomo Exp $
 
File: $File$
Revision: $Revision: 1.8 $
Last update: $Date: 2004-04-23 07:57:33 $
Revision: $Revision: 1.9 $
Last update: $Date: 2004-06-15 14:10:23 $
------------
**/
 
50,6 → 50,7
/*--------------------------------------------------------------*/
 
#include <kernel/kern.h>
#include <modules/sem.h>
#include <stdlib.h>
#include <math.h>
 
74,6 → 75,8
int fly_wcet = 1000; /* task wcet */
PID pid;
 
sem_t grx_mutex;
 
/*--------------------------------------------------------------*/
 
void draw_fly(int x, int y, int c)
133,9 → 136,11
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();
}
151,6 → 156,9
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);