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
centrifugal scripted command in microb_cmd
[aversive.git]
/
projects
/
microb2010
/
ballboard
/
sensor.c
diff --git
a/projects/microb2010/ballboard/sensor.c
b/projects/microb2010/ballboard/sensor.c
index
fe7f92a
..
a3a705b
100644
(file)
--- a/
projects/microb2010/ballboard/sensor.c
+++ b/
projects/microb2010/ballboard/sensor.c
@@
-146,8
+146,8
@@
struct sensor_filter {
* CAP 1
*/
static struct sensor_filter sensor_filter[SENSOR_MAX] = {
* CAP 1
*/
static struct sensor_filter sensor_filter[SENSOR_MAX] = {
- [S_
CAP1] = { 1, 0, 0, 1, 0, 0
}, /* 0 */
- [S_
CAP2] = { 1, 0, 0
, 1, 0, 0 }, /* 1 */
+ [S_
HIGH_BARRIER] = { 20, 0, 1, 19, 0, 1
}, /* 0 */
+ [S_
LOW_BARRIER] = { 50, 0, 1
, 1, 0, 0 }, /* 1 */
[S_CAP3] = { 1, 0, 0, 1, 0, 0 }, /* 2 */
[S_CAP4] = { 1, 0, 0, 1, 0, 0 }, /* 3 */
[S_R_IR] = { 1, 0, 0, 1, 0, 0 }, /* 4 */
[S_CAP3] = { 1, 0, 0, 1, 0, 0 }, /* 2 */
[S_CAP4] = { 1, 0, 0, 1, 0, 0 }, /* 3 */
[S_R_IR] = { 1, 0, 0, 1, 0, 0 }, /* 4 */
@@
-235,7
+235,8
@@
static void do_boolean_sensors(void *dummy)
IRQ_UNLOCK(flags);
}
IRQ_UNLOCK(flags);
}
-static volatile uint8_t lcob_seen = I2C_COB_NONE, rcob_seen = I2C_COB_NONE;
+static volatile uint8_t lcob_seen = I2C_COB_NONE;
+static volatile uint8_t rcob_seen = I2C_COB_NONE;
uint8_t cob_detect_left(void)
{
uint8_t cob_detect_left(void)
{
@@
-298,6
+299,12
@@
static void do_cob_detection(void)
else
lcob_seen = I2C_COB_BLACK;
IRQ_UNLOCK(flags);
else
lcob_seen = I2C_COB_BLACK;
IRQ_UNLOCK(flags);
+ if (l_cpt_on > l_cpt_off)
+ DEBUG(E_USER_SENSOR, "left white %d %d",
+ l_cpt_on, l_cpt_off);
+ else
+ DEBUG(E_USER_SENSOR, "left black %d %d",
+ l_cpt_on, l_cpt_off);
}
}
}
}
@@
-328,6
+335,13
@@
static void do_cob_detection(void)
else
rcob_seen = I2C_COB_BLACK;
IRQ_UNLOCK(flags);
else
rcob_seen = I2C_COB_BLACK;
IRQ_UNLOCK(flags);
+
+ if (r_cpt_on > r_cpt_off)
+ DEBUG(E_USER_SENSOR, "right white %d %d",
+ r_cpt_on, r_cpt_off);
+ else
+ DEBUG(E_USER_SENSOR, "right black %d %d",
+ r_cpt_on, r_cpt_off);
}
}
}
}