Rev 1390 | 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)); |
1339 | giacomo | 61 | |
1395 | giacomo | 62 | ADDUSEC2TIMESPEC(1000000,&(e.time)); |
1334 | giacomo | 63 | |
1395 | giacomo | 64 | e.type = EVT_SET_MASK_LEG_ANGLE; |
65 | e.mask = 0x3F; |
||
66 | e.ang.a = 0 * 3600; |
||
67 | e.ang.b = 0 * 3600; |
||
68 | e.ang.c = 0; |
||
69 | e.pwm = 7; |
||
1333 | giacomo | 70 | |
1395 | giacomo | 71 | event = insert_action_event(&(e)); |
1334 | giacomo | 72 | |
1333 | giacomo | 73 | } |
74 | |||
1331 | giacomo | 75 | int main(int argc, char **argv) |
76 | { |
||
77 | TIME seme; |
||
1395 | giacomo | 78 | KEY_EVT k; |
1331 | giacomo | 79 | |
80 | seme = sys_gettime(NULL); |
||
81 | srand(seme); |
||
82 | |||
1395 | giacomo | 83 | k.flag = ALTL_BIT; |
84 | k.scan = KEY_C; |
||
85 | k.ascii = 'c'; |
||
86 | keyb_hook(k,program_key_end); |
||
1331 | giacomo | 87 | |
1395 | giacomo | 88 | a = FTrace_chunk_create(20000000, 10, FTRACE_CHUNK_FLAG_FREE | FTRACE_CHUNK_FLAG_CYC); |
89 | |||
90 | FTrace_actual_chunk_select(a); |
||
91 | |||
92 | FTrace_enable(); |
||
93 | |||
1335 | giacomo | 94 | clear(); |
95 | |||
1331 | giacomo | 96 | init_send(); /* Comunication */ |
97 | init_key(); /* Keyboard */ |
||
98 | |||
1390 | mauro | 99 | action_stand_up(); |
1333 | giacomo | 100 | |
1331 | giacomo | 101 | return 0; |
1359 | giacomo | 102 | |
1331 | giacomo | 103 | } |