Subversion Repositories shark

Rev

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

/*************************const.h*******************************/
// constants and new types declaration
#include <kernel/func.h>
#define CST

#define NO_SPRITE 8


#define GRAPH
#define SENSOR
#define MAX_CAR 10
#define MAX_TL 3
#define S_POINT 4
#define PERIOD_CAR 135000 //period for K62 350MHZ
//#define PERIOD_CAR 87000 //period for PIII 733MHZ
#define SPERIOD_CAR 13000
#define SCAR_WCET 4300
#define SECOND 1000000
#define TL_WCET    200
#define CAM_WCET   200
#define GAUGE_WCET 200
#define ARROW_WCET 100
//#define CAR_WCET  7700 //wcet for PIII 733MHZ
#define CAR_WCET  12400  //wcet for K62 350MHZ
#define ROW 30
#define COL 30
#define NCAR 24
#define W 640
#define H 480
#define SH 12
#define SW 12
#define MAX_DIST 50.0
#define NORM_DIST 15.0
#define COLL_DIST 25.0
#define MIN_SPEED 0.0
#define NORM_SPEED 4.0
#define MAX_SPEED 6.0
#define MAX_LOOK 50
#define LOOK_ANGLE 70
#define DIST_ANGLE 90
#define CORR_FACT 0.7
#define FRANTIC 0.0
#define POS_RAND
#define OBL_START 1
#define DEG_TO_RAD(x) ((float)x)/180.0*3.14
#define RAD_TO_DEG(x) ((float)x)/3.14*180.0
#define RANDDIR       (rand()%3-1)
#define L 0
#define R 1
#define U 2
#define D 3

#define DRAW 1
#define CANCEL 0
#define VERTICAL 1
#define HORIZONTAL 0

#define STEER_LEFT 1
#define STEER_RIGHT -1
#define STRAIGHT 0

#define CAMX 670
#define CAMY 120
#define MAPX 8
#define MAPY 113

#define FREE 0
#define STOP 1
#define CAR 2

/*data types*/

typedef struct car_d {
  int number;
  float xpos,ypos;
  int xp,yp;
  float dist_obs,dist_sem;
  float speed,middle,front,rear,somma;
  int angle,sat;
  char collision,boom,correggi,incrocio;
  char dir,running;
  struct car_d *next;
} car_data;

typedef struct {
  int x,y;
} point;

typedef struct {
  char vpos,hpos,tl_name[8];
  point l,r,u,d;
  PID pid;
  DWORD period;
} tl_data;


typedef struct {
  int xpos,ypos,angles;
} starting_set;