X-Git-Url: http://git.droids-corp.org/?p=aversive.git;a=blobdiff_plain;f=projects%2Fmicrob2010%2Fmainboard%2Fstrat.c;h=97d159c3405c8877b4a1848e626c93833ec505b0;hp=864b00b562fe8ca0cbd5d7caf4b4bb6597088bf1;hb=6914527de2ecfef9d790740c71739e7418246b96;hpb=1714f4ee916fca95ce24120ea6e698237913f947 diff --git a/projects/microb2010/mainboard/strat.c b/projects/microb2010/mainboard/strat.c index 864b00b..97d159c 100644 --- a/projects/microb2010/mainboard/strat.c +++ b/projects/microb2010/mainboard/strat.c @@ -1,6 +1,6 @@ -/* +/* * Copyright Droids, Microb Technology (2009) - * + * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or @@ -17,7 +17,7 @@ * * Revision : $Id: strat.c,v 1.6 2009-11-08 17:24:33 zer0 Exp $ * - * Olivier MATZ + * Olivier MATZ */ #include @@ -70,7 +70,10 @@ struct strat_infos strat_infos = { .conf = { .flags = 0, }, - + /* status */ + .status = { + .flags = 0, + }, }; /*************************************************************/ @@ -81,7 +84,7 @@ struct strat_infos strat_infos = { void strat_set_bounding_box(void) { - if (get_color() == I2C_COLOR_RED) { + if (get_color() == I2C_COLOR_YELLOW) { strat_infos.area_bbox.x1 = 300; strat_infos.area_bbox.y1 = 200; strat_infos.area_bbox.x2 = 2720; /* needed for c1 */ @@ -150,7 +153,7 @@ void strat_init(void) interrupt_traj_reset(); /* used in strat_base for END_TIMER */ - mainboard.flags = DO_ENCODERS | DO_CS | DO_RS | + mainboard.flags = DO_ENCODERS | DO_CS | DO_RS | DO_POS | DO_BD | DO_TIMER | DO_POWER; } @@ -174,6 +177,17 @@ void strat_exit(void) /* called periodically */ void strat_event(void *dummy) { +#if 0 + /* pack or deploy spickle */ + if (strat_infos.status.flags & STRAT_STATUS_LHARVEST) { + if (sensor_get(S_LCOB_PRESENT)) { + if (sensor_get(S_LCOB_WHITE)) + i2c_ballboard_set_mode(); + else + ; + } + } +#endif /* limit speed when opponent is close */ strat_limit_speed(); } @@ -197,7 +211,7 @@ uint8_t strat_main(void) { uint8_t err; - /* do static cols + first temple */ + /* */ err = strat_beginning(); return err;