Subversion Repositories shark

Rev

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

#include <ll/ll.h>
#include <kernel/types.h>
#include <kernel/descr.h>
#include <math.h>
#include <drivers/glib.h>
#include <drivers/keyb.h>

#include <modules/hartport.h>
#include <modules/sem.h>

#define JET_ON
#define BALL_ON

/*
 *
 * WCET, Periods and Models
 *
 */



/* define if you want NRT or SOFT... */
#define TASK_TYPE SOFT
//#define TASK_TYPE NRT

#define WCET_JETCTRL      7500
#define WCET_JETDUMMY      200
#define WCET_JETSLIDE     2100

#define PERIOD_JETCTRL  100000
#define PERIOD_JETDUMMY 100000
#define PERIOD_JETSLIDE 100000

#define JET_GROUP    1


#define WCET_BALL          600

#define PERIOD_BALL        20000

#define WCET_SCHED         1200

#define PERIOD_SCHED      15000


/* graphic mutex... */
extern mutex_t mutex;

extern mutex_t palmutex;
extern mutex_t delmutex;

/* useful colors... */
extern int white;
extern int black;
extern int red;
extern int gray;
extern int green;
extern int lime;
extern int brown;

void init_jetcontrol();
void init_ball(void);
void scenario_jetcontrol();
void scenario_ball();
char *itoa(int n, char *s);
int myrand(int x);

void initSched(void);
void setPalla (int);
void inizioPartita (void);
void collisioneRilevata(int);
int controlloBuche (float, float, int);
void hardSched (void);
void hardball (void);
void killball (void);
void assegnaForza (KEY_EVT *);


#define JET_NTASK   15
#define JET_Y_NAME 260

#define DUMMY_PID    1

#define JET_DUMMY_WIDTH    250
#define JET_DUMMY_HEIGHT    80

#define JET_DUMMY_X        370
#define JET_DUMMY_Y        150

#define JET_SLIDE_WIDTH     50
#define JET_SLIDE_X        566



#define BALL_YMAX   390   /* position of the ceil  */
#define BALL_Y      425   /* position of the floor  */
#define BALL_XMIN    65   /* min position X of the ball */
#define BALL_XMAX   255   /* max position X of the ball */
#define BALL_MAX_P   11   // numero di palle

#define BALL_GROUP    2          // gruppo palla