Subversion Repositories shark

Compare Revisions

Ignore whitespace Rev 1451 → Rev 1452

/demos/trunk/mix/mix.c
18,11 → 18,11
 
/*
------------
CVS : $Id: mix.c,v 1.5 2004-05-23 10:15:12 giacomo Exp $
CVS : $Id: mix.c,v 1.6 2004-05-23 11:15:29 giacomo Exp $
 
File: $File$
Revision: $Revision: 1.5 $
Last update: $Date: 2004-05-23 10:15:12 $
Revision: $Revision: 1.6 $
Last update: $Date: 2004-05-23 11:15:29 $
------------
*/
 
56,6 → 56,7
 
#include <semaphore.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>
 
#define PIG 3.1415
74,7 → 75,7
#define YWM 165 /* top Y of MIDDLE window */
#define YWL 325 /* top Y of LOW window */
 
int flen; /* file length */
int flen = 0; /* file length */
int fine = 0; /* ending flag */
 
sem_t mx_mat, mx_grf; /* mutex semaphores */
91,17 → 92,17
" June 5, 2001 "};
 
char fbuf[1000] = "\
TASK NAME PERIOD WCET\
------------------------------------------\
task1 watch: 1000000 200\
task2 tasto: 2000 200\
task3 palla: 2000 200\
task4 mosca: 20000 200\
task5 infor: 20000 300\
task6 ruota: 5000 400\
task7 color: 2000 200\
task8 pendo: 5000 400\
------------------------------------------";
TASK NAME PERIOD WCET\n\
------------------------------------------\n\
task1 watch: 1000000 200\n\
task2 tasto: 2000 200\n\
task3 palla: 2000 200\n\
task4 mosca: 20000 200\n\
task5 infor: 20000 300\n\
task6 ruota: 5000 400\n\
task7 color: 2000 200\n\
task8 pendo: 5000 400\n\
------------------------------------------\n";
 
extern int vga16color[16];
 
137,12 → 138,12
int x = 0;
int i;
 
flen = strlen(fbuf);
 
for (i=1; i<=8; i++) {
while ((fbuf[x] != ':') && (x < flen)) x++;
x++;
sscanf(&fbuf[x], "%d %d", &period[i], &wcet[i]);
cprintf("per[%d] = %d, wcet[%d] = %d\n",
i, period[i], i, wcet[i]);
}
}
 
681,7 → 682,6
srand(seme);
 
get_par();
keyb_getch(BLOCK);
 
grx_rect(XWL,YWH,XWL+LW,YWH+HW,vga16color[14]);
grx_rect(XWM,YWH,XWM+LW,YWH+HW,vga16color[14]);