Subversion Repositories shark

Rev

Rev 1655 | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
1655 giacomo 1
#include <ll/ll.h>
2
#include <kernel/types.h>
3
#include <kernel/descr.h>
4
#include <math.h>
5
#include <drivers/glib.h>
6
#include <drivers/keyb.h>
7
 
8
#include <modules/hartport.h>
9
#include <modules/sem.h>
10
 
11
#define JET_ON
12
#define BALL_ON
13
 
14
/*
15
 *
16
 * WCET, Periods and Models
17
 *
18
 */
19
 
20
 
21
/* define if you want NRT or SOFT... */
22
#define TASK_TYPE SOFT
23
//#define TASK_TYPE NRT
24
 
25
#define WCET_JETCTRL      7500
26
#define WCET_JETDUMMY      200
27
#define WCET_JETSLIDE     2100
28
 
29
#define PERIOD_JETCTRL  100000
30
#define PERIOD_JETDUMMY 100000
31
#define PERIOD_JETSLIDE 100000
32
 
33
#define JET_GROUP    1
34
 
35
 
36
#define WCET_BALL          600
37
 
38
#define PERIOD_BALL        20000
39
 
40
#define WCET_SCHED         1200
41
 
42
#define PERIOD_SCHED      15000
43
 
44
 
45
/* graphic mutex... */
46
extern mutex_t mutex;
47
 
48
extern mutex_t palmutex;
49
extern mutex_t delmutex;
50
 
51
/* useful colors... */
52
extern int white;
53
extern int black;
54
extern int red;
55
extern int gray;
56
extern int green;
57
extern int lime;
58
extern int brown;
59
 
60
void init_jetcontrol();
61
void init_ball(void);
62
void scenario_jetcontrol();
63
void scenario_ball();
64
char *itoa(int n, char *s);
65
int myrand(int x);
66
 
67
void initSched(void);
68
void setPalla (int);
69
void inizioPartita (void);
70
void collisioneRilevata(int);
71
int controlloBuche (float, float, int);
72
void hardSched (void);
73
void hardball (void);
74
void killball (void);
75
void assegnaForza (KEY_EVT *);
76
 
77
 
78
#define JET_NTASK   15
79
#define JET_Y_NAME 260
80
 
81
#define DUMMY_PID    1
82
 
83
#define JET_DUMMY_WIDTH    250
84
#define JET_DUMMY_HEIGHT    80
85
 
86
#define JET_DUMMY_X        370
87
#define JET_DUMMY_Y        150
88
 
89
#define JET_SLIDE_WIDTH     50
90
#define JET_SLIDE_X        566
91
 
92
 
93
 
94
#define BALL_YMAX   390   /* position of the ceil  */
95
#define BALL_Y      425   /* position of the floor  */
96
#define BALL_XMIN    65   /* min position X of the ball */
97
#define BALL_XMAX   255   /* max position X of the ball */
98
#define BALL_MAX_P   11   // numero di palle
99
 
100
#define BALL_GROUP    2          // gruppo palla
101
 
102