vt100: include pgmspace.h as we use PROGMEM macro
[aversive.git] / projects / microb2010 / mainboard / strat_corn.h
index 8ab2398..4f50cb6 100644 (file)
  *  Olivier MATZ <zer0@droids-corp.org>
  */
 
-#define CORN_NB 18
+#define LINE_UP     0
+#define LINE_L_UP   1
+#define LINE_L_DOWN 2
+#define LINE_DOWN   3
+#define LINE_R_DOWN 4
+#define LINE_R_UP   5
 
-/* enum is better */
-#define TYPE_WAYPOINT 0
-#define TYPE_DANGEROUS 1
-#define TYPE_WHITE_CORN 2
-#define TYPE_BLACK_CORN 3
-#define TYPE_OBSTACLE 4
+struct line_2pts {
+       point_t p1;
+       point_t p2;
+};
 
-extern uint8_t corn_table[CORN_NB];
+/* there is a corn near */
+int8_t corn_is_near(uint8_t *corn_idx, uint8_t side,
+                   int16_t *xspickle, int16_t *yspickle);
 
-int8_t ijcoord_to_corn_idx(int8_t i, int8_t j);
-int8_t xycoord_to_corn_idx(int16_t *x, int16_t *y);
-void init_corn_table(int8_t conf_side, int8_t conf_center);
+/* go from line num1,dir1 to line num2,dir2. Uses trjectory flags
+ * specified as argument and return END_xxx condition */
+uint8_t line2line(uint8_t num1, uint8_t dir1, uint8_t num2,
+                 uint8_t dir2, uint8_t flags);