Rev 1335 | Rev 1337 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
1331 | giacomo | 1 | |
2 | /* |
||
3 | * Project: S.Ha.R.K. |
||
4 | * |
||
5 | * Coordinators: Giorgio Buttazzo <giorgio@sssup.it> |
||
6 | * |
||
7 | * ReTiS Lab (Scuola Superiore S.Anna - Pisa - Italy) |
||
8 | * |
||
9 | * http://www.sssup.it |
||
10 | * http://retis.sssup.it |
||
11 | * http://shark.sssup.it |
||
12 | */ |
||
13 | |||
14 | /* |
||
15 | * Copyright (C) 2000 Paolo Gai |
||
16 | * |
||
17 | * This program is free software; you can redistribute it and/or modify |
||
18 | * it under the terms of the GNU General Public License as published by |
||
19 | * the Free Software Foundation; either version 2 of the License, or |
||
20 | * (at your option) any later version. |
||
21 | * |
||
22 | * This program is distributed in the hope that it will be useful, |
||
23 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
||
24 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
||
25 | * GNU General Public License for more details. |
||
26 | * |
||
27 | * You should have received a copy of the GNU General Public License |
||
28 | * along with this program; if not, write to the Free Software |
||
29 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
||
30 | * |
||
31 | */ |
||
32 | |||
33 | #include "chimera.h" |
||
34 | |||
35 | void my_close(void *arg) |
||
36 | { |
||
37 | int i; |
||
38 | TIME tmp; |
||
39 | |||
40 | end_send(); |
||
41 | |||
42 | for (i=3; i<MAX_PROC; i++){ |
||
43 | if (!jet_getstat(i, NULL, &tmp, NULL, NULL)) |
||
44 | kern_printf("Task Name : %s - Max Time : %d\n", proc_table[i].name, (int)tmp); |
||
45 | } |
||
46 | } |
||
47 | |||
1333 | giacomo | 48 | void action_stand_up(void) { |
49 | |||
1334 | giacomo | 50 | static struct action_event e[20]; |
1333 | giacomo | 51 | int i,temp; |
52 | |||
1334 | giacomo | 53 | for (i=0;i<3;i++) { |
1333 | giacomo | 54 | |
1334 | giacomo | 55 | kern_gettime(&(e[i].time)); |
56 | ADDUSEC2TIMESPEC(10000000,&(e[i].time)); |
||
57 | temp = i*1000000; |
||
58 | ADDUSEC2TIMESPEC(temp,&(e[i].time)); |
||
1333 | giacomo | 59 | |
1334 | giacomo | 60 | e[i].type = EVT_SET_MASK_LEG_ANGLE; |
61 | e[i].mask = 1 << i; |
||
1336 | giacomo | 62 | e[i].ang.a = 45 * 3600; |
63 | e[i].ang.b = 0; |
||
64 | e[i].ang.c = 0; |
||
65 | e[i].pwm = 7; |
||
1333 | giacomo | 66 | |
1334 | giacomo | 67 | insert_action_event(&(e[i])); |
1333 | giacomo | 68 | |
69 | } |
||
1334 | giacomo | 70 | |
71 | for (i=0;i<3;i++) { |
||
1333 | giacomo | 72 | |
1334 | giacomo | 73 | kern_gettime(&(e[6+i].time)); |
74 | ADDUSEC2TIMESPEC(20000000,&(e[6+i].time)); |
||
75 | temp = i*1000000; |
||
76 | ADDUSEC2TIMESPEC(temp,&(e[6+i].time)); |
||
77 | |||
78 | e[6+i].type = EVT_SET_MASK_LEG_ANGLE; |
||
79 | e[6+i].mask = 1 << i; |
||
1336 | giacomo | 80 | e[6+i].ang.a = 135 * 3600; |
81 | e[6+i].ang.b = 0; |
||
82 | e[6+i].ang.c = 0; |
||
83 | e[6+i].pwm = 7; |
||
84 | |||
85 | |||
1334 | giacomo | 86 | insert_action_event(&(e[6+i])); |
87 | |||
88 | } |
||
1335 | giacomo | 89 | |
1333 | giacomo | 90 | } |
91 | |||
1331 | giacomo | 92 | int main(int argc, char **argv) |
93 | { |
||
94 | TIME seme; |
||
95 | |||
96 | seme = sys_gettime(NULL); |
||
97 | srand(seme); |
||
98 | |||
99 | sys_atrunlevel(my_close, NULL, RUNLEVEL_BEFORE_EXIT); |
||
100 | |||
1335 | giacomo | 101 | clear(); |
102 | |||
1331 | giacomo | 103 | init_send(); /* Comunication */ |
104 | init_key(); /* Keyboard */ |
||
105 | |||
1333 | giacomo | 106 | action_stand_up(); |
107 | |||
1331 | giacomo | 108 | return 0; |
109 | } |