11,98 → 11,86 |
*/ |
|
#include "chimera.h" |
#include <FTrace_chunk.h> |
#include <FTrace_udp.h> |
#include <tracer.h> |
|
void my_close(void *arg) |
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) { |
|
static struct action_event e[20]; |
int i = 0; |
struct action_event e; |
int event; |
|
status.power = 1; |
|
kern_gettime(&(e[i].time)); |
ADDUSEC2TIMESPEC( 5000000,&(e[i].time)); |
kern_gettime(&(e.time)); |
ADDUSEC2TIMESPEC(5000000,&(e.time)); |
|
e[i].type = EVT_SET_MASK_LEG_ANGLE; |
e[i].mask = 0x3F; |
e[i].ang.a = 0 * 3600; |
e[i].ang.b = 70 * 3600; |
e[i].ang.c = 0; |
e[i].pwm = 7; |
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; |
|
insert_action_event(&(e[i])); |
|
kern_gettime(&(e[i+1].time)); |
ADDUSEC2TIMESPEC( 6000000,&(e[i+1].time)); |
|
e[i+1].type = EVT_SET_MASK_LEG_ANGLE; |
e[i+1].mask = 0x3F; |
e[i+1].ang.a = 90 * 3600; |
e[i+1].ang.b = 70 * 3600; |
e[i+1].ang.c = 0; |
e[i+1].pwm = 7; |
|
insert_action_event(&(e[i+1])); |
event = insert_action_event(&(e)); |
|
kern_gettime(&(e[i+2].time)); |
ADDUSEC2TIMESPEC( 7000000,&(e[i+2].time)); |
|
e[i+2].type = EVT_SET_MASK_LEG_ANGLE; |
e[i+2].mask = 0x3F; |
e[i+2].ang.a = 90 * 3600; |
e[i+2].ang.b = -50 * 3600; |
e[i+2].ang.c = 0; |
e[i+2].pwm = 7; |
|
insert_action_event(&(e[i+2])); |
ADDUSEC2TIMESPEC(1000000,&(e.time)); |
|
kern_gettime(&(e[i+3].time)); |
ADDUSEC2TIMESPEC( 8000000,&(e[i+3].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; |
|
e[i+3].type = EVT_SET_MASK_LEG_ANGLE; |
e[i+3].mask = 0x3F; |
e[i+3].ang.a = 90 * 3600; |
e[i+3].ang.b = 0 * 3600; |
e[i+3].ang.c = 0; |
e[i+3].pwm = 7; |
event = insert_action_event(&(e)); |
|
insert_action_event(&(e[i+3])); |
|
kern_gettime(&(e[i+4].time)); |
ADDUSEC2TIMESPEC(10000000,&(e[i+4].time)); |
|
e[i+4].type = EVT_SET_MASK_LEG_ANGLE; |
e[i+4].mask = 0x3F; |
e[i+4].ang.a = 90 * 3600; |
e[i+4].ang.b = 0 * 3600; |
e[i+4].ang.c = 0; |
e[i+4].pwm = 7; |
|
insert_action_event(&(e[i+4])); |
|
} |
|
int main(int argc, char **argv) |
{ |
TIME seme; |
KEY_EVT k; |
|
seme = sys_gettime(NULL); |
srand(seme); |
|
sys_atrunlevel(my_close, NULL, RUNLEVEL_BEFORE_EXIT); |
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 */ |