circuit strat, first version
[aversive.git] / projects / microb2010 / mainboard / strat_avoid.h
diff --git a/projects/microb2010/mainboard/strat_avoid.h b/projects/microb2010/mainboard/strat_avoid.h
new file mode 100644 (file)
index 0000000..4afe032
--- /dev/null
@@ -0,0 +1,47 @@
+/*
+ *  Copyright Droids, Microb Technology (2010)
+ *
+ *  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
+ *  (at your option) any later version.
+ *
+ *  This program is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *  GNU General Public License for more details.
+ *
+ *  You should have received a copy of the GNU General Public License
+ *  along with this program; if not, write to the Free Software
+ *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ *
+ *  Revision : $Id: strat.c,v 1.6 2009-11-08 17:24:33 zer0 Exp $
+ *
+ *  Olivier MATZ <zer0@droids-corp.org>
+ */
+
+#ifndef _STRAT_AVOID_H_
+#define _STRAT_AVOID_H_
+#define MAX_CIRCUIT_WPLINE 15
+
+struct wp_coord {
+       uint8_t i:4;
+       uint8_t j:3;
+       uint8_t end:1;
+};
+
+struct wp_line {
+       uint8_t line_num:4;
+       uint8_t dir:4;
+};
+
+int8_t browse_circuits(uint8_t i, uint8_t j,
+                      const struct wp_coord **selected_circuit,
+                      int8_t *selected_face);
+
+/* harvest on the best circuit */
+uint8_t strat_harvest_circuit(void);
+
+void test_strat_avoid(void);
+
+#endif