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
go fast between corn cobs
[aversive.git]
/
projects
/
microb2010
/
mainboard
/
strat_db.c
diff --git
a/projects/microb2010/mainboard/strat_db.c
b/projects/microb2010/mainboard/strat_db.c
index
d2835fe
..
f21dd57
100644
(file)
--- a/
projects/microb2010/mainboard/strat_db.c
+++ b/
projects/microb2010/mainboard/strat_db.c
@@
-173,10
+173,14
@@
int8_t xycoord_to_ijcoord(int16_t *xp, int16_t *yp, uint8_t *ip, uint8_t *jp)
if ((i & 1) == 1) {
j = y / STEP_CORN_Y;
}
if ((i & 1) == 1) {
j = y / STEP_CORN_Y;
}
+ else if ((i & 3) == 0) {
+ j = y / (STEP_CORN_Y*2);
+ j = j*2 + 1;
+ }
else {
else {
- y += (STEP_CORN_Y
/2
);
-
y /=
(STEP_CORN_Y*2);
- j =
(y * 2) + 1
;
+ y += (STEP_CORN_Y);
+
j = y /
(STEP_CORN_Y*2);
+ j =
j*2
;
}
if (ijcoord_to_xycoord(i, j, &x, &y) < 0)
}
if (ijcoord_to_xycoord(i, j, &x, &y) < 0)
@@
-194,7
+198,6
@@
int8_t xycoord_to_ijcoord(int16_t *xp, int16_t *yp, uint8_t *ip, uint8_t *jp)
return 0;
}
return 0;
}
-
/******** CORN */
/* return the index of a corn given its i,j coords. */
/******** CORN */
/* return the index of a corn given its i,j coords. */