Subversion Repositories shark

Rev

Rev 1085 | Rev 1160 | Go to most recent revision | Blame | Compare with Previous | Last modification | View Log | RSS feed

/*
 * Project: S.Ha.R.K.
 *
 * Coordinators:
 *   Giorgio Buttazzo    <giorgio@sssup.it>
 *   Paolo Gai           <pj@gandalf.sssup.it>
 *
 * Authors     :
 *   Paolo Gai           <pj@gandalf.sssup.it>
 *   (see the web pages for full authors list)
 *
 * ReTiS Lab (Scuola Superiore S.Anna - Pisa - Italy)
 *
 * http://www.sssup.it
 * http://retis.sssup.it
 * http://shark.sssup.it
 */


/**
 ------------
 CVS :        $Id: demo.h,v 1.1.1.1 2002-09-02 09:37:41 pj Exp $

 File:        $File$
 Revision:    $Revision: 1.1.1.1 $
 Last update: $Date: 2002-09-02 09:37:41 $
 ------------
**/


/*
 * Copyright (C) 2000 Paolo Gai
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 *
 */



#include <ll/ll.h>
#include <kernel/types.h>
#include <kernel/descr.h>
#include <math.h>
#include <drivers/glib.h>
#include <drivers/keyb.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 WCET_BALL          100

#define PERIOD_BALL      10000

/*
 *
 * Global Stuffs
 *
 */


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

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

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



/*
 *
 * JETCONTROL stuffs
 *
 */


#define JET_NTASK   35
#define JET_Y_NAME 170

#define DUMMY_PID    1

#define JET_DUMMY_WIDTH    210
#define JET_DUMMY_HEIGHT    80

/* the point (x, y) is the top left corner */
#define JET_DUMMY_X        428
#define JET_DUMMY_Y        65

#define JET_SLIDE_WIDTH     50
#define JET_SLIDE_X        576




/*
 *
 * BALL stuffs
 *
 */


// x and y corners are specified whithout consider a border of 3 pixels
#define BALL_Y      450         /* position of the floor        */
#define BALL_HEIGHT 385         /* initial height of the ball   */
#define BALL_XMIN    10         /* min position X of the ball   */
#define BALL_XMAX   370         /* max position X of the ball   */
#define BALL_VELX     5.        /* horizontal ball velocity     */
#define BALL_VYMIN   11.        /* min ground speed             */
#define BALL_MAX_P   60         /* max number of balls          */

#define BALL_GROUP    2          /* task group of the balls */