git.droids-corp.org
/
aversive.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
vt100: include pgmspace.h as we use PROGMEM macro
[aversive.git]
/
projects
/
microb2010
/
mainboard
/
strat_corn.c
diff --git
a/projects/microb2010/mainboard/strat_corn.c
b/projects/microb2010/mainboard/strat_corn.c
index
e64871e
..
8abef5b
100644
(file)
--- a/
projects/microb2010/mainboard/strat_corn.c
+++ b/
projects/microb2010/mainboard/strat_corn.c
@@
-70,7
+70,8
@@
static volatile uint8_t clitoid_slow = 0;
/* return 1 if there is a corn near, and fill the index ptr */
static volatile uint8_t clitoid_slow = 0;
/* return 1 if there is a corn near, and fill the index ptr */
-int8_t corn_is_near(uint8_t *corn_idx, uint8_t side)
+int8_t corn_is_near(uint8_t *corn_idx, uint8_t side,
+ int16_t *xspickle, int16_t *yspickle)
{
/* XXX to be checked */
#define SENSOR_CORN_DIST 225
{
/* XXX to be checked */
#define SENSOR_CORN_DIST 225
@@
-92,6
+93,8
@@
int8_t corn_is_near(uint8_t *corn_idx, uint8_t side)
}
x_corn_int = x_corn;
y_corn_int = y_corn;
}
x_corn_int = x_corn;
y_corn_int = y_corn;
+ *xspickle = x_corn_int;
+ *yspickle = y_corn_int;
wp = xycoord_to_corn_idx(&x_corn_int, &y_corn_int);
if (wp == NULL)
wp = xycoord_to_corn_idx(&x_corn_int, &y_corn_int);
if (wp == NULL)
@@
-162,7
+165,7
@@
static uint8_t clitoid_select_speed(uint8_t num1, uint8_t dir1,
if (get_cob_count() >= 5)
return 0; /* fast */
if (get_cob_count() >= 5)
return 0; /* fast */
- if (xycoord_to_ijcoord(&x, &y, &i, &j) < 0) {
+ if (xycoord_to_ijcoord
_not_corn
(&x, &y, &i, &j) < 0) {
DEBUG(E_USER_STRAT, "%s(): cannot find waypoint at %d,%d",
__FUNCTION__, x, y);
return 1;
DEBUG(E_USER_STRAT, "%s(): cannot find waypoint at %d,%d",
__FUNCTION__, x, y);
return 1;
@@
-300,7
+303,7
@@
static int8_t strat_calc_clitoid(uint8_t num1, uint8_t dir1,
}
else {
beta_deg = 0;
}
else {
beta_deg = 0;
- *pack_spickles = I2C_
RIGH
T_SIDE;
+ *pack_spickles = I2C_
LEF
T_SIDE;
}
}
/* double 90 deg for half turn -- not used */
}
}
/* double 90 deg for half turn -- not used */