Subversion Repositories shark

Rev

Rev 1085 | 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
 *   Massimiliano Giorgi <massy@gandalf.sssup.it>
11
 *   Luca Abeni          <luca@gandalf.sssup.it>
12
 *   (see the web pages for full authors list)
13
 *
14
 * ReTiS Lab (Scuola Superiore S.Anna - Pisa - Italy)
15
 *
16
 * http://www.sssup.it
17
 * http://retis.sssup.it
18
 * http://shark.sssup.it
19
 */
20
 
21
 
22
/**
23
 ------------
24
 CVS :        $Id: const.h,v 1.1.1.1 2002-09-02 09:37:42 pj Exp $
25
 
26
 File:        $File$
27
 Revision:    $Revision: 1.1.1.1 $
28
 Last update: $Date: 2002-09-02 09:37:42 $
29
 ------------
30
**/
31
 
32
/*
33
 * Copyright (C) 2000 Marco Dallera and Marco Fiocca
34
 *
35
 * This program is free software; you can redistribute it and/or modify
36
 * it under the terms of the GNU General Public License as published by
37
 * the Free Software Foundation; either version 2 of the License, or
38
 * (at your option) any later version.
39
 *
40
 * This program is distributed in the hope that it will be useful,
41
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
42
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
43
 * GNU General Public License for more details.
44
 *
45
 * You should have received a copy of the GNU General Public License
46
 * along with this program; if not, write to the Free Software
47
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
48
 *
49
 */
50
 
51
/*
52
 *              AUTO
53
 *
54
 * Another Unuseful Track simulatOr
55
 *
56
 * Authors: Marco Dallera
57
 *          Marco Fiocca
58
 *
59
 */
60
 
61
/* ------------------ */
62
/*  Useful constants  */
63
/* ------------------ */
64
 
65
#ifndef __CONST_H_
66
 
67
#define __CONST_H_
68
 
69
/* Screen dimensions */
70
#define SCREEN_WIDTH  800
71
#define SCREEN_HEIGHT 600
72
#define SCREEN_BIT_COLORS 8
73
 
74
/* Visible area */
75
#define TEL_WIDTH  50
76
#define TEL_HEIGHT 50
77
 
78
/* Car dimensions */
79
#define CAR_WIDTH  12
80
#define CAR_HEIGHT 12
81
#define CAR_W   8
82
#define CAR_H   10
83
 
84
/* Track dimensions */
85
#define TRACK_WIDTH  500
86
#define TRACK_HEIGHT 500
87
 
88
/* Track position */
89
#define TRACK_X1        0
90
#define TRACK_Y1        0
91
#define TRACK_X2        TRACK_X1+TRACK_WIDTH-1
92
#define TRACK_Y2        TRACK_Y1+TRACK_HEIGHT-1
93
 
94
/* Max number of car on track */
95
#define MAX_CAR_NUMBER  10
96
#define DRIVERS_NUMBER  20
97
#define MAX_DRIVER_NAME_LENGTH 20
98
#define MAX_TRACK_NAME_LENGTH   20
99
#define TRACK_NUMBER    4
100
 
101
/* Lap direction */
102
#define CLOCK           0
103
#define ANTICLOCK       1
104
 
105
/* Information display coords */
106
#define CMD_WIDTH       TRACK_WIDTH
107
#define CMD_HEIGHT      (SCREEN_HEIGHT-TRACK_HEIGHT-3)
108
 
109
/* Car position limits */
110
#define MIN_CAR_X  (TRACK_X1 + CAR_WIDTH/2  + 4)
111
#define MIN_CAR_Y  (TRACK_Y1 + CAR_HEIGHT/2 + 4)
112
#define MAX_CAR_X  (TRACK_X2 - CAR_WIDTH/2  - 4)
113
#define MAX_CAR_Y  (TRACK_Y2 - CAR_HEIGHT/2 - 4)
114
 
115
/* Road constants */
116
#define LEFT_ONLY               10
117
#define RIGHT_ONLY              11
118
#define ROAD_OK                 12
119
#define NO_ROAD                 13
120
 
121
/* Collision constants */
122
#define COLLISION_LEFT  20
123
#define COLLISION_RIGHT 21
124
#define COLLISION_BACK  22
125
#define NO_COLL 0
126
 
127
/* CAB constants */
128
#define ROAD_MSG_DIM    sizeof(road_info)
129
#define ROAD_MSG_READER 4
130
 
131
#define CAR_MSG_DIM     sizeof(car_status)
132
#define CAR_MSG_READER  5
133
 
134
/* Tasks parameters */
135
#define SENSOR_WCET     3000
136
#define SENSOR_PERIOD  40000
137
#define CONTROL_WCET    1000
138
#define CONTROL_PERIOD 40000
139
 
140
#endif
141