X-Git-Url: http://git.droids-corp.org/?p=aversive.git;a=blobdiff_plain;f=projects%2Fmicrob2010%2Ftests%2Fhostsim%2Fmain.c;h=85a31a2370878ae491a5412307c10ef45873800d;hp=9f5a15f7addd3ae1431b6e3a4ef3cd1395c4f373;hb=87ccd3af8abb0da3e0fa98dc8e9216fc7b676f97;hpb=1f8274e9bca0d2433f101f267b86bc70dc2ae8c4 diff --git a/projects/microb2010/tests/hostsim/main.c b/projects/microb2010/tests/hostsim/main.c index 9f5a15f..85a31a2 100644 --- a/projects/microb2010/tests/hostsim/main.c +++ b/projects/microb2010/tests/hostsim/main.c @@ -46,6 +46,7 @@ #include #include "cs.h" +#include "cmdline.h" #include "main.h" struct genboard gen; @@ -53,14 +54,23 @@ struct mainboard mainboard; int main(void) { -#ifndef HOST_VERSION uart_init(); + uart_register_rx_event(CMDLINE_UART, emergency); +#ifndef HOST_VERSION fdevopen(uart0_dev_send, uart0_dev_recv); sei(); -#else - int i; #endif + memset(&gen, 0, sizeof(gen)); + memset(&mainboard, 0, sizeof(mainboard)); + + /* LOGS */ + error_register_emerg(mylog); + error_register_error(mylog); + error_register_warning(mylog); + error_register_notice(mylog); + error_register_debug(mylog); + #ifdef CONFIG_MODULE_TIMER timer_init(); #endif @@ -69,21 +79,26 @@ int main(void) #ifdef HOST_VERSION hostsim_init(); + robotsim_init(); #endif - time_init(TIME_PRIO); - - microb_cs_init(); - gen.logs[0] = E_USER_CS; - gen.log_level = 5; + time_init(TIME_PRIO); + + printf_P(PSTR("\r\n")); + printf_P(PSTR("Respect et robustesse.\r\n")); mainboard.flags = DO_ENCODERS | DO_RS | DO_POS | DO_POWER | DO_BD | DO_CS; + strat_reset_pos(1000, 1000, 0); - trajectory_d_rel(&mainboard.traj, 100); + cmdline_interact(); - time_wait_ms(1000); +/* trajectory_d_rel(&mainboard.traj, 1000); */ +/* time_wait_ms(2000); */ +/* trajectory_circle_rel(&mainboard.traj, 1500, 1000, */ +/* 250, 360, 0); */ +/* time_wait_ms(15000); */ return 0; }