Subversion Repositories shark

Rev

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

/*
 * Project: S.Ha.R.K.
 *
 * Coordinators: Giorgio Buttazzo <giorgio@sssup.it>
 *
 * ReTiS Lab (Scuola Superiore S.Anna - Pisa - Italy)
 *
 * http://www.sssup.it
 * http://retis.sssup.it
 * http://shark.sssup.it
 */


#include "chimera.h"

void program_key_end(KEY_EVT* e)
{

        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);
        }

        trace_send();

        sys_end();

}

void action_stand_up(void) {
                                                                                                                             
  struct action_event e;
  int event;
 
  status.power = 1;

  kern_gettime(&(e.time));
  ADDUSEC2TIMESPEC(5000000,&(e.time));
                                                                                                                             
  e.type = EVT_SET_MASK_LEG_ANGLE;
  e.mask = 0x3F;
  e.ang.a = 0 * 3600;
  e.ang.b = 70 * 3600;
  e.ang.c = 0;
  e.pwm = 7;
                                                                                                                             
  event = insert_action_event(&(e));
  cprintf("Event num = %d\n",event);

  ADDUSEC2TIMESPEC(1000000,&(e.time));

  e.type = EVT_SET_MASK_LEG_ANGLE;
  e.mask = 0x3F;
  e.ang.a = 0 * 3600;
  e.ang.b = 0 * 3600;
  e.ang.c = 0;
  e.pwm = 7;
                                                                                                                             
  event = insert_action_event(&(e));
  cprintf("Event num = %d\n",event);                          
                                                                                                 
}

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

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

        k.flag = ALTL_BIT;
        k.scan = KEY_C;
        k.ascii = 'c';
        keyb_hook(k,program_key_end);

        clear();

        trace_init(1000000);

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

        init_action_event(100);

        action_stand_up();

        return 0;

}