Subversion Repositories shark

Rev

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

Rev Author Line No. Line
1085 pj 1
/*************************const.h*******************************/
2
// constants and new types declaration
3
#include <kernel/func.h>
4
#define CST
5
 
6
#define NO_SPRITE 8
7
 
8
 
9
#define GRAPH
10
#define SENSOR
11
#define MAX_CAR 10
12
#define MAX_TL 3
13
#define S_POINT 4
14
#define PERIOD_CAR 135000 //period for K62 350MHZ
15
//#define PERIOD_CAR 87000 //period for PIII 733MHZ
16
#define SPERIOD_CAR 13000
17
#define SCAR_WCET 4300
18
#define SECOND 1000000
19
#define TL_WCET    200
20
#define CAM_WCET   200
21
#define GAUGE_WCET 200
22
#define ARROW_WCET 100
23
//#define CAR_WCET  7700 //wcet for PIII 733MHZ
24
#define CAR_WCET  12400  //wcet for K62 350MHZ
25
#define ROW 30
26
#define COL 30
27
#define NCAR 24
28
#define W 640
29
#define H 480
30
#define SH 12
31
#define SW 12
32
#define MAX_DIST 50.0
33
#define NORM_DIST 15.0
34
#define COLL_DIST 25.0
35
#define MIN_SPEED 0.0
36
#define NORM_SPEED 4.0
37
#define MAX_SPEED 6.0
38
#define MAX_LOOK 50
39
#define LOOK_ANGLE 70
40
#define DIST_ANGLE 90
41
#define CORR_FACT 0.7
42
#define FRANTIC 0.0
43
#define POS_RAND
44
#define OBL_START 1
45
#define DEG_TO_RAD(x) ((float)x)/180.0*3.14
46
#define RAD_TO_DEG(x) ((float)x)/3.14*180.0
47
#define RANDDIR       (rand()%3-1)
48
#define L 0
49
#define R 1
50
#define U 2
51
#define D 3
52
 
53
#define DRAW 1
54
#define CANCEL 0
55
#define VERTICAL 1
56
#define HORIZONTAL 0
57
 
58
#define STEER_LEFT 1
59
#define STEER_RIGHT -1
60
#define STRAIGHT 0
61
 
62
#define CAMX 670
63
#define CAMY 120
64
#define MAPX 8
65
#define MAPY 113
66
 
67
#define FREE 0
68
#define STOP 1
69
#define CAR 2
70
 
71
/*data types*/
72
 
73
typedef struct car_d {
74
  int number;
75
  float xpos,ypos;
76
  int xp,yp;
77
  float dist_obs,dist_sem;
78
  float speed,middle,front,rear,somma;
79
  int angle,sat;
80
  char collision,boom,correggi,incrocio;
81
  char dir,running;
82
  struct car_d *next;
83
} car_data;
84
 
85
typedef struct {
86
  int x,y;
87
} point;
88
 
89
typedef struct {
90
  char vpos,hpos,tl_name[8];
91
  point l,r,u,d;
92
  PID pid;
93
  DWORD period;
94
} tl_data;
95
 
96
 
97
typedef struct {
98
  int xpos,ypos,angles;
99
} starting_set;