Subversion Repositories shark


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

//   global variables and tasks bodies declaration

#include <kernel/func.h>
#include <semaphore.h>
#ifndef CST
#include "constant.h"

/*Global stuff*/

extern car_data car_data_array[MAX_CAR];
extern tl_data tl_data_array[MAX_TL];

//car starting points
extern starting_set starting_set_array[S_POINT];

// PID vectors
extern PID p_table[MAX_CAR];
extern PID c_table[MAX_CAR];
extern PID g_table[MAX_CAR];
extern PID a_table[MAX_CAR];

extern char kill_flag[MAX_CAR];
//graphic mutex
extern sem_t mutex;

//kill_flag mutexes
extern sem_t kill_mutex[MAX_CAR];

//various sprites
extern DWORD macchine[ROW][COL][NCAR];
extern DWORD strada[H][W];
extern BYTE street[H*W*2];
extern BYTE vbuf[MAX_CAR][ROW*COL*2];
extern BYTE clrcam[(ROW+2)*(COL+2)*2];
extern BYTE gauge_img[ROW*COL*2];
extern BYTE brk_gauge[ROW*COL*2];
extern BYTE arrow[3][ROW*COL*2];
extern DWORD sprites[ROW][COL][NO_SPRITE];
extern BYTE clrscr[800*600*2];
extern DWORD faces[2][74][47];

extern char sens;
//sine & cosine look-up tables
extern float cosine[360],sine[360];

//traffic light sprites
extern DWORD y_sem[4][SH][SW];
extern DWORD r_sem[4][SH][SW];
extern DWORD g_sem[4][SH][SW];

//useful colors
extern DWORD white;
extern DWORD black;
extern DWORD red;
extern DWORD gray;
extern DWORD blue;
extern DWORD green;
extern DWORD border;
extern DWORD tl_bg;

//task chain pointers
extern car_data *free_n,*busy_n,*free_o,*busy_o;
// car counter
extern short maxc;

/*function declaration */

/* task bodies*/
TASK car(car_data *);
TASK traffic_light(tl_data *);
TASK camera(int);
TASK gauge_c(int);
TASK blink_arrow(int);
TASK refresher(void *);
TASK killer(void *);