Subversion Repositories shark

Rev

Rev 1396 | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
1331 giacomo 1
/*
2
 * Project: S.Ha.R.K.
3
 *
4
 * Coordinators: Giorgio Buttazzo <giorgio@sssup.it>
5
 *
6
 * ReTiS Lab (Scuola Superiore S.Anna - Pisa - Italy)
7
 *
8
 * http://www.sssup.it
9
 * http://retis.sssup.it
10
 * http://shark.sssup.it
11
 */
12
 
13
#include "chimera.h"
1395 giacomo 14
#include <FTrace_chunk.h>
15
#include <FTrace_udp.h>
16
#include <tracer.h>
1331 giacomo 17
 
1395 giacomo 18
int a;
19
 
20
void program_key_end(KEY_EVT* e)
1331 giacomo 21
{
1395 giacomo 22
 
1331 giacomo 23
        int i;
24
        TIME tmp;
25
 
26
        end_send();
27
 
1395 giacomo 28
        FTrace_disable();
29
 
30
        FTrace_OSD_init_udp(1, "192.168.82.43", "192.168.82.20");
31
 
32
        FTrace_send_chunk(a, 0, FTRACE_CHUNK_FLAG_FREE | FTRACE_CHUNK_FLAG_CYC);
33
 
1331 giacomo 34
        for (i=3; i<MAX_PROC; i++){
35
                if (!jet_getstat(i, NULL, &tmp, NULL, NULL))
36
                        kern_printf("Task Name : %s - Max Time  : %d\n", proc_table[i].name, (int)tmp);
37
        }
1395 giacomo 38
 
39
        sys_end();
40
 
1331 giacomo 41
}
42
 
1333 giacomo 43
void action_stand_up(void) {
44
 
1395 giacomo 45
  struct action_event e;
46
  int event;
1339 giacomo 47
 
48
  status.power = 1;
49
 
1395 giacomo 50
  kern_gettime(&(e.time));
51
  ADDUSEC2TIMESPEC(5000000,&(e.time));
1333 giacomo 52
 
1395 giacomo 53
  e.type = EVT_SET_MASK_LEG_ANGLE;
54
  e.mask = 0x3F;
55
  e.ang.a = 0 * 3600;
56
  e.ang.b = 70 * 3600;
57
  e.ang.c = 0;
58
  e.pwm = 7;
1333 giacomo 59
 
1395 giacomo 60
  event = insert_action_event(&(e));
1397 giacomo 61
  cprintf("Event num = %d\n",event);
1339 giacomo 62
 
1395 giacomo 63
  ADDUSEC2TIMESPEC(1000000,&(e.time));
1334 giacomo 64
 
1395 giacomo 65
  e.type = EVT_SET_MASK_LEG_ANGLE;
66
  e.mask = 0x3F;
67
  e.ang.a = 0 * 3600;
68
  e.ang.b = 0 * 3600;
69
  e.ang.c = 0;
70
  e.pwm = 7;
1333 giacomo 71
 
1395 giacomo 72
  event = insert_action_event(&(e));
1397 giacomo 73
  cprintf("Event num = %d\n",event);                          
74
 
1333 giacomo 75
}
76
 
1331 giacomo 77
int main(int argc, char **argv)
78
{
79
        TIME seme;
1395 giacomo 80
        KEY_EVT k;
1331 giacomo 81
 
82
        seme = sys_gettime(NULL);
83
        srand(seme);
84
 
1395 giacomo 85
        k.flag = ALTL_BIT;
86
        k.scan = KEY_C;
87
        k.ascii = 'c';
88
        keyb_hook(k,program_key_end);
1331 giacomo 89
 
1395 giacomo 90
        a = FTrace_chunk_create(20000000, 10, FTRACE_CHUNK_FLAG_FREE | FTRACE_CHUNK_FLAG_CYC);
91
 
92
        FTrace_actual_chunk_select(a);
93
 
94
        FTrace_enable();
95
 
1335 giacomo 96
        clear();
97
 
1331 giacomo 98
        init_send();            /* Comunication */
99
        init_key();             /* Keyboard */
100
 
1396 giacomo 101
        init_action_event(100);
102
 
1390 mauro 103
        action_stand_up();
1333 giacomo 104
 
1331 giacomo 105
        return 0;
1359 giacomo 106
 
1331 giacomo 107
}