Subversion Repositories shark

Compare Revisions

Ignore whitespace Rev 1379 → Rev 1380

/demos/trunk/jumpball/rrn.c
18,11 → 18,11
 
/**
------------
CVS : $Id: rrn.c,v 1.2 2004-04-17 17:16:47 giacomo Exp $
CVS : $Id: rrn.c,v 1.3 2004-04-18 09:45:28 giacomo Exp $
 
File: $File$
Revision: $Revision: 1.2 $
Last update: $Date: 2004-04-17 17:16:47 $
Revision: $Revision: 1.3 $
Last update: $Date: 2004-04-18 09:45:28 $
------------
**/
 
46,6 → 46,7
*/
 
#include "kernel/kern.h"
#include "modules/intdrive.h"
#include "modules/edf.h"
#include "modules/rr.h"
#include "modules/rrsoft.h"
55,6 → 56,8
#include "modules/hartport.h"
#include "modules/cabs.h"
 
#include "modules/nop.h"
 
/*+ sysyem tick in us +*/
#define TICK 0
 
66,7 → 69,6
#define INTDRIVE_T 10000
#define INTDRIVE_FLAG 0
 
 
TIME __kernel_register_levels__(void *arg)
{
struct multiboot_info *mb = (struct multiboot_info *)arg;
81,6 → 83,8
 
CABS_register_module();
 
NOP_register_module();
 
return TICK;
}
 
94,3 → 98,13
 
return (void *)0;
}
 
void app_mutex_init(mutex_t *m)
{
NOP_mutexattr_t attr;
 
NOP_mutexattr_default(attr);
 
mutex_init(m, &attr);
}
 
/demos/trunk/jumpball/rrp.c
18,11 → 18,11
 
/**
------------
CVS : $Id: rrp.c,v 1.2 2004-04-17 17:16:47 giacomo Exp $
CVS : $Id: rrp.c,v 1.3 2004-04-18 09:45:28 giacomo Exp $
 
File: $File$
Revision: $Revision: 1.2 $
Last update: $Date: 2004-04-17 17:16:47 $
Revision: $Revision: 1.3 $
Last update: $Date: 2004-04-18 09:45:28 $
------------
**/
 
56,6 → 56,8
#include "modules/hartport.h"
#include "modules/cabs.h"
 
#include "modules/pi.h"
 
/*+ sysyem tick in us +*/
#define TICK 0
 
81,6 → 83,8
 
CABS_register_module();
 
PI_register_module();
 
return TICK;
}
 
94,3 → 98,13
 
return (void *)0;
}
 
void app_mutex_init(mutex_t *m)
{
PI_mutexattr_t attr;
 
PI_mutexattr_default(attr);
 
mutex_init(m, &attr);
}
 
/demos/trunk/jumpball/demo.c
18,11 → 18,11
 
/**
------------
CVS : $Id: demo.c,v 1.5 2004-04-17 17:16:46 giacomo Exp $
CVS : $Id: demo.c,v 1.6 2004-04-18 09:45:27 giacomo Exp $
 
File: $File$
Revision: $Revision: 1.5 $
Last update: $Date: 2004-04-17 17:16:46 $
Revision: $Revision: 1.6 $
Last update: $Date: 2004-04-18 09:45:27 $
------------
**/
 
58,6 → 58,8
 
PID shutdown_task_PID = -1;
 
void app_mutex_init(mutex_t *m);
 
int device_drivers_close() {
FB26_close(FRAME_BUFFER_DEVICE);
242,6 → 244,9
k.status = KEY_PRESSED;
keyb_hook(k,endfun,FALSE);
 
/* init the graphic mutex */
app_mutex_init(&mutex);
 
/* useful colors ... */
white = rgb16(255,255,255);
black = rgb16(0,0,0);
/demos/trunk/jumpball/ern.c
18,11 → 18,11
 
/**
------------
CVS : $Id: ern.c,v 1.2 2004-04-17 17:16:47 giacomo Exp $
CVS : $Id: ern.c,v 1.3 2004-04-18 09:45:27 giacomo Exp $
 
File: $File$
Revision: $Revision: 1.2 $
Last update: $Date: 2004-04-17 17:16:47 $
Revision: $Revision: 1.3 $
Last update: $Date: 2004-04-18 09:45:27 $
------------
**/
 
56,6 → 56,8
#include "modules/hartport.h"
#include "modules/cabs.h"
 
#include "modules/nop.h"
 
/*+ sysyem tick in us +*/
#define TICK 0
 
81,6 → 83,8
 
CABS_register_module();
 
NOP_register_module();
 
return TICK;
}
 
94,3 → 98,13
 
return (void *)0;
}
 
void app_mutex_init(mutex_t *m)
{
NOP_mutexattr_t attr;
 
NOP_mutexattr_default(attr);
 
mutex_init(m, &attr);
}
 
/demos/trunk/jumpball/ecp.c
18,11 → 18,11
 
/**
------------
CVS : $Id: ecp.c,v 1.2 2004-04-17 17:16:46 giacomo Exp $
CVS : $Id: ecp.c,v 1.3 2004-04-18 09:45:27 giacomo Exp $
 
File: $File$
Revision: $Revision: 1.2 $
Last update: $Date: 2004-04-17 17:16:46 $
Revision: $Revision: 1.3 $
Last update: $Date: 2004-04-18 09:45:27 $
------------
**/
 
56,6 → 56,8
#include "modules/hartport.h"
#include "modules/cabs.h"
 
#include "modules/pi.h"
 
/*+ sysyem tick in us +*/
#define TICK 0
 
79,6 → 81,7
 
SEM_register_module();
CABS_register_module();
PI_register_module();
 
return TICK;
}
93,3 → 96,12
 
return (void *)0;
}
 
void app_mutex_init(mutex_t *m)
{
PI_mutexattr_t attr;
 
PI_mutexattr_default(attr);
 
mutex_init(m, &attr);
}
/demos/trunk/jumpball/demo.h
18,11 → 18,11
 
/**
------------
CVS : $Id: demo.h,v 1.5 2004-04-17 17:16:46 giacomo Exp $
CVS : $Id: demo.h,v 1.6 2004-04-18 09:45:27 giacomo Exp $
 
File: $File$
Revision: $Revision: 1.5 $
Last update: $Date: 2004-04-17 17:16:46 $
Revision: $Revision: 1.6 $
Last update: $Date: 2004-04-18 09:45:27 $
------------
**/
 
128,6 → 128,9
 
extern PID shutdown_task_PID;
 
/* graphic mutex... */
extern mutex_t mutex;
 
/* useful colors... */
extern int white;
extern int black;
/demos/trunk/jumpball/ball.c
18,11 → 18,11
 
/**
------------
CVS : $Id: ball.c,v 1.4 2004-04-17 17:16:46 giacomo Exp $
CVS : $Id: ball.c,v 1.5 2004-04-18 09:45:27 giacomo Exp $
 
File: $File$
Revision: $Revision: 1.4 $
Last update: $Date: 2004-04-17 17:16:46 $
Revision: $Revision: 1.5 $
Last update: $Date: 2004-04-18 09:45:27 $
------------
**/
 
125,21 → 125,20
x = x0 + vx * tx;
}
 
task_nopreempt();
grx_disc(ox, oy, R, 0);
task_preempt();
mutex_lock(&mutex);
grx_disc(ox, oy, R, 0);
ox = x;
oy = BALL_Y - y;
mutex_unlock(&mutex);
 
ox = x;
oy = BALL_Y - y;
 
if (ballexit && i!=0xFFFF) {
npc--;
return 0;
}
 
task_nopreempt();
grx_disc(ox, oy, R, i);
task_preempt();
mutex_lock(&mutex);
grx_disc(ox, oy, R, i);
mutex_unlock(&mutex);
 
my_delay();