Subversion Repositories shark

Rev

Rev 1390 | 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"
#include <FTrace_chunk.h>
#include <FTrace_udp.h>
#include <tracer.h>

int a;

void program_key_end(KEY_EVT* e)
{

        int i;
        TIME tmp;

        end_send();

        FTrace_disable();

        FTrace_OSD_init_udp(1, "192.168.82.43", "192.168.82.20");

        FTrace_send_chunk(a, 0, FTRACE_CHUNK_FLAG_FREE | FTRACE_CHUNK_FLAG_CYC);

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

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

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

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

        a = FTrace_chunk_create(20000000, 10, FTRACE_CHUNK_FLAG_FREE | FTRACE_CHUNK_FLAG_CYC);

        FTrace_actual_chunk_select(a);

        FTrace_enable();

        clear();

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

        action_stand_up();

        return 0;

}