Rev 1086 | Rev 1160 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
1085 | pj | 1 | /* |
2 | * Project: S.Ha.R.K. |
||
3 | * |
||
4 | * Coordinators: |
||
5 | * Giorgio Buttazzo <giorgio@sssup.it> |
||
6 | * Paolo Gai <pj@gandalf.sssup.it> |
||
7 | * |
||
8 | * Authors : |
||
9 | * Paolo Gai <pj@gandalf.sssup.it> |
||
10 | * (see the web pages for full authors list) |
||
11 | * |
||
12 | * ReTiS Lab (Scuola Superiore S.Anna - Pisa - Italy) |
||
13 | * |
||
14 | * http://www.sssup.it |
||
15 | * http://retis.sssup.it |
||
16 | * http://shark.sssup.it |
||
17 | */ |
||
18 | |||
19 | /** |
||
20 | ------------ |
||
1158 | pj | 21 | CVS : $Id: demo.h,v 1.2 2003-05-01 19:43:16 pj Exp $ |
1085 | pj | 22 | |
23 | File: $File$ |
||
1158 | pj | 24 | Revision: $Revision: 1.2 $ |
25 | Last update: $Date: 2003-05-01 19:43:16 $ |
||
1085 | pj | 26 | ------------ |
27 | **/ |
||
28 | |||
29 | /* |
||
30 | * Copyright (C) 2000 Paolo Gai |
||
31 | * |
||
32 | * This program is free software; you can redistribute it and/or modify |
||
33 | * it under the terms of the GNU General Public License as published by |
||
34 | * the Free Software Foundation; either version 2 of the License, or |
||
35 | * (at your option) any later version. |
||
36 | * |
||
37 | * This program is distributed in the hope that it will be useful, |
||
38 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
||
39 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
||
40 | * GNU General Public License for more details. |
||
41 | * |
||
42 | * You should have received a copy of the GNU General Public License |
||
43 | * along with this program; if not, write to the Free Software |
||
44 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
||
45 | * |
||
46 | */ |
||
47 | |||
48 | |||
49 | #include <ll/ll.h> |
||
50 | #include <kernel/types.h> |
||
51 | #include <kernel/descr.h> |
||
52 | #include <math.h> |
||
53 | #include <drivers/glib.h> |
||
54 | #include <drivers/keyb.h> |
||
55 | |||
56 | |||
1158 | pj | 57 | /* Subparts */ |
1085 | pj | 58 | #define JET_ON |
59 | #define BALL_ON |
||
60 | |||
1158 | pj | 61 | |
62 | /* CPU Speed Selection |
||
63 | -------------------------------------------------------------------- |
||
64 | 400 - Pentium 2 400 MHz |
||
65 | 133 - Pentium 1 133 MHz |
||
66 | */ |
||
67 | #define CPU 133 |
||
68 | |||
1085 | pj | 69 | /* |
70 | * |
||
71 | * WCET, Periods and Models |
||
72 | * |
||
73 | */ |
||
74 | |||
1158 | pj | 75 | #if CPU==133 |
76 | #define WCET_JETCTRL 10000 |
||
77 | #define WCET_JETDUMMY 300 |
||
78 | #define WCET_JETSLIDE 2000 |
||
79 | #define WCET_BALL 250 |
||
80 | #define WCET_HARD_BALL 1000 |
||
81 | #endif |
||
1085 | pj | 82 | |
1158 | pj | 83 | #if CPU==400 |
1085 | pj | 84 | #define WCET_JETCTRL 7500 |
85 | #define WCET_JETDUMMY 200 |
||
86 | #define WCET_JETSLIDE 2100 |
||
1158 | pj | 87 | #define WCET_BALL 100 |
88 | #define WCET_HARD_BALL 380 |
||
89 | #endif |
||
1085 | pj | 90 | |
1158 | pj | 91 | |
1085 | pj | 92 | #define PERIOD_JETCTRL 100000 |
93 | #define PERIOD_JETDUMMY 100000 |
||
94 | #define PERIOD_JETSLIDE 100000 |
||
95 | #define PERIOD_BALL 10000 |
||
96 | |||
97 | /* |
||
98 | * |
||
99 | * Global Stuffs |
||
100 | * |
||
101 | */ |
||
102 | |||
103 | /* graphic mutex... */ |
||
104 | extern mutex_t mutex; |
||
105 | |||
106 | /* useful colors... */ |
||
107 | extern int white; |
||
108 | extern int black; |
||
109 | extern int red; |
||
110 | extern int gray; |
||
111 | |||
112 | void init_jetcontrol(); |
||
113 | void init_ball(void); |
||
114 | void scenario_jetcontrol(); |
||
115 | void scenario_ball(); |
||
116 | char *itoa(int n, char *s); |
||
117 | int myrand(int x); |
||
118 | |||
119 | |||
120 | |||
121 | /* |
||
122 | * |
||
123 | * JETCONTROL stuffs |
||
124 | * |
||
125 | */ |
||
126 | |||
127 | #define JET_NTASK 35 |
||
128 | #define JET_Y_NAME 170 |
||
129 | |||
130 | #define DUMMY_PID 1 |
||
131 | |||
132 | #define JET_DUMMY_WIDTH 210 |
||
133 | #define JET_DUMMY_HEIGHT 80 |
||
134 | |||
135 | /* the point (x, y) is the top left corner */ |
||
136 | #define JET_DUMMY_X 428 |
||
137 | #define JET_DUMMY_Y 65 |
||
138 | |||
139 | #define JET_SLIDE_WIDTH 50 |
||
140 | #define JET_SLIDE_X 576 |
||
141 | |||
142 | |||
143 | |||
144 | |||
145 | /* |
||
146 | * |
||
147 | * BALL stuffs |
||
148 | * |
||
149 | */ |
||
150 | |||
151 | // x and y corners are specified whithout consider a border of 3 pixels |
||
152 | #define BALL_Y 450 /* position of the floor */ |
||
153 | #define BALL_HEIGHT 385 /* initial height of the ball */ |
||
154 | #define BALL_XMIN 10 /* min position X of the ball */ |
||
155 | #define BALL_XMAX 370 /* max position X of the ball */ |
||
156 | #define BALL_VELX 5. /* horizontal ball velocity */ |
||
157 | #define BALL_VYMIN 11. /* min ground speed */ |
||
158 | #define BALL_MAX_P 60 /* max number of balls */ |
||
159 | |||
160 | #define BALL_GROUP 2 /* task group of the balls */ |