Subversion Repositories shark

Rev

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


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


/*
 * 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 "chimera.h"

void my_close(void *arg)
{
        int i;
        TIME tmp;

        end_send();

        for (i=3; i<MAX_PROC; i++){
                if (!jet_getstat(i, NULL, &tmp, NULL, NULL))
                        kern_printf("Task Name : %s - Max Time  : %d\n", proc_table[i].name, (int)tmp);
        }
}

void action_stand_up(void) {
                                                                                                                             
  static struct action_event e[20];
  int i,temp;
                                                                                                                             
  for (i=0;i<3;i++) {
                                                                                                                             
    kern_gettime(&(e[i].time));
    ADDUSEC2TIMESPEC(10000000,&(e[i].time));
    temp = i*1000000;
    ADDUSEC2TIMESPEC(temp,&(e[i].time));
                                                                                                                             
    e[i].type = EVT_SET_MASK_LEG_ANGLE;
    e[i].mask = 1 << i;
    *(int *)(e[i].data) = 45 * 3600;
    *(int *)(e[i].data + 4) = 0;
    *(int *)(e[i].data + 8) = 0;
    *(unsigned char *)(e[i].data + 12) = 7;
                                                                                                                             
    insert_action_event(&(e[i]));
                                                                                                                             
  }

  for (i=0;i<3;i++) {
                                                                                                                             
    kern_gettime(&(e[6+i].time));
    ADDUSEC2TIMESPEC(20000000,&(e[6+i].time));
    temp = i*1000000;
    ADDUSEC2TIMESPEC(temp,&(e[6+i].time));
                                                                                                                             
    e[6+i].type = EVT_SET_MASK_LEG_ANGLE;
    e[6+i].mask = 1 << i;
    *(int *)(e[6+i].data) = 0 * 3600;
    *(int *)(e[6+i].data + 4) = 0;
    *(int *)(e[6+i].data + 8) = 0;
    *(unsigned char *)(e[i].data + 12) = 7;    
                                                                                                                         
    insert_action_event(&(e[6+i]));
                                                                                                                             
  }
                                                                                                                             
}

int main(int argc, char **argv)
{
        TIME seme;

        seme = sys_gettime(NULL);
        srand(seme);

        sys_atrunlevel(my_close, NULL, RUNLEVEL_BEFORE_EXIT);

        init_send();            /* Comunication */
        init_key();             /* Keyboard */

        action_stand_up();

        return 0;
}