X-Git-Url: http://git.droids-corp.org/?p=aversive.git;a=blobdiff_plain;f=projects%2Fmicrob2010%2Ftests%2Fhostsim%2Fmain.c;h=31a7832ed8e111ee509bd0a61b7ecca3d349b1b8;hp=3907c2a1b9acaead51a2c2aebc0a8b746dc67c12;hb=ef732b9dd629cab8602783d77bffa2395100393a;hpb=450875fb3d6f1f6966e1b0f79af0572126eea3d3 diff --git a/projects/microb2010/tests/hostsim/main.c b/projects/microb2010/tests/hostsim/main.c index 3907c2a..31a7832 100644 --- a/projects/microb2010/tests/hostsim/main.c +++ b/projects/microb2010/tests/hostsim/main.c @@ -46,6 +46,10 @@ #include #include "cs.h" +#include "cmdline.h" +#include "robotsim.h" +#include "strat.h" +#include "strat_base.h" #include "main.h" struct genboard gen; @@ -53,38 +57,47 @@ struct mainboard mainboard; int main(void) { + uart_init(); + uart_register_rx_event(CMDLINE_UART, emergency); +#ifndef HOST_VERSION + fdevopen(uart0_dev_send, uart0_dev_recv); + sei(); +#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 + printf("init\n"); scheduler_init(); - time_init(TIME_PRIO); hostsim_init(); robotsim_init(); 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); + + cmdline_interact(); - time_wait_ms(1000); - printf("init\n"); - trajectory_d_rel(&mainboard.traj, 1000); - time_wait_ms(1300); - /* - printf("init\n"); - trajectory_goto_xy_abs(&mainboard.traj, 1500, 2000); - time_wait_ms(2000); - */ - trajectory_circle_rel(&mainboard.traj, - 1000, 500, - 500, - 400, - 0); - - time_wait_ms(10000); return 0; }