Subversion Repositories shark

Compare Revisions

Ignore whitespace Rev 1085 → Rev 1132

/demos/tags/rel_0_4/simcity/keyboard.c
46,4 → 46,4
k.scan = KEY_D;
k.ascii = 'd';
keyb_hook(k, sensor_switch);
}
}
/demos/tags/rel_0_4/simcity/include/simcity.h
2,7 → 2,7
// global variables and tasks bodies declaration
 
#include <kernel/func.h>
#include <semaphor.h>
#include <semaphore.h>
#ifndef CST
#include "constant.h"
#endif
/demos/tags/rel_0_4/simcity/include/keyfunct.h
7,4 → 7,4
void h_car_kill(KEY_EVT *);
void endfun(KEY_EVT *);
void refresh(KEY_EVT *);
void sensor_switch(KEY_EVT *);
void sensor_switch(KEY_EVT *);
/demos/tags/rel_0_4/simcity/initfile.c
77,10 → 77,7
 
HARTPORT_init();
 
kern_printf("TIME=%d\n",sys_gettime(NULL));
KEYB_init(NULL);
kern_printf("TIME=%d\n",sys_gettime(NULL));
KEYB_init(NULL);
 
__call_main__(mb);
 
/demos/tags/rel_0_4/simcity/car.c
172,4 → 172,4
set_spd=MAX_SPEED;
}
cd->speed=set_spd;
}
}
/demos/tags/rel_0_4/simcity/simcity.c
6,7 → 6,7
#include <drivers/keyb.h>
#include <drivers/glib.h>
#include <kernel/kern.h>
#include <semaphor.h>
#include <semaphore.h>
#include <math.h>
#include "include/constant.h"
#include "include/misc.h"
76,23 → 76,6
cprintf("Ferrari Fabio\n");
}
 
void demo_exc_handler(int signo, siginfo_t *info, void *extra)
{
struct timespec t;
 
grx_close();
/* Default action for an kern exception is */
kern_cli();
ll_gettime(TIME_EXACT, &t),
kern_printf("\nS.Ha.R.K. Exception raised!!!"
"\nTime (s:ns) :%d:%d"
"\nException number:%d"
"\nPID :%d\n",
t.tv_sec, t.tv_nsec, info->si_value.sival_int,
info->si_task);
sys_end();
}
 
void my_close(void *arg)
{
grx_close();
103,20 → 86,9
{
int i;
char tl_name[4];
struct sigaction action;
 
version();
 
/* Init the standard Hartik exception handler */
/* Set the signal action */
action.sa_flags = SA_SIGINFO;
action.sa_sigaction = demo_exc_handler;
action.sa_handler = 0;
sigfillset(&action.sa_mask); /* we block all the other signals... */
if (sigaction(SIGHEXC, &action, NULL) == -1) {
perror("Error initializing signals...");
sys_end();
}
sys_atrunlevel(my_close, NULL, RUNLEVEL_BEFORE_EXIT);
 
//resetting kill flags
/demos/tags/rel_0_4/simcity/tasks.c
5,7 → 5,7
#include <string.h>
#include <kernel/func.h>
#include <drivers/glib.h>
#include <semaphor.h>
#include <semaphore.h>
#include <math.h>
#include "include/simcity.h"
#include "include/states.h"
406,4 → 406,4
cd->xp=my_rint(cd->xpos);
cd->yp=my_rint(cd->ypos);
}
}
}
/demos/tags/rel_0_4/simcity/keyfunct.c
82,4 → 82,4
void sensor_switch(KEY_EVT *k) {
if(sens==0) sens=1;
else sens=0;
}
}
/demos/tags/rel_0_4/simcity/misc.c
212,4 → 212,4
break;
}
return min_tl;
}
}