* CAP 1,5,6,7,8
*/
static struct sensor_filter sensor_filter[SENSOR_MAX] = {
- [S_CAP1] = { 1, 0, 0, 1, 0, 0 }, /* 4 */
+ [S_CAP1] = { 1, 0, 0, 1, 0, 0 }, /* 0 */
[S_CAP2] = { 1, 0, 0, 1, 0, 0 }, /* 1 */
- [S_COLUMN_LEFT] = { 1, 0, 0, 1, 0, 1 }, /* 2 */
- [S_COLUMN_RIGHT] = { 1, 0, 0, 1, 0, 1 }, /* 3 */
- [S_START_SWITCH] = { 10, 0, 3, 7, 0, 0 }, /* 0 */
- [S_DISP_LEFT] = { 1, 0, 0, 1, 0, 1 }, /* 5 */
- [S_DISP_RIGHT] = { 1, 0, 0, 1, 0, 1 }, /* 6 */
- [S_CAP8] = { 1, 0, 0, 1, 0, 0 }, /* 7 */
+ [S_LFRONT] = { 1, 0, 0, 1, 0, 1 }, /* 2 */
+ [S_RFRONT] = { 1, 0, 0, 1, 0, 1 }, /* 3 */
+ [S_START_SWITCH] = { 10, 0, 3, 7, 0, 0 }, /* 4 */
+ [S_DISP_LEFT] = { 1, 0, 0, 1, 0, 1 }, /* 5 */
+ [S_RCOB_WHITE] = { 1, 0, 0, 1, 0, 0 }, /* 6 */
+ [S_LCOB_WHITE] = { 1, 0, 0, 1, 0, 0 }, /* 7 */
[S_RESERVED1] = { 10, 0, 3, 7, 0, 0 }, /* 8 */
[S_RESERVED2] = { 10, 0, 3, 7, 0, 0 }, /* 9 */
[S_RESERVED3] = { 1, 0, 0, 1, 0, 0 }, /* 10 */
/************ global sensor init */
+#define BACKGROUND_ADC 0
-#ifndef HOST_VERSION
/* called every 10 ms, see init below */
static void do_sensors(void *dummy)
{
- do_adc(NULL);
+#ifndef HOST_VERSION
+ if (BACKGROUND_ADC)
+ do_adc(NULL);
do_boolean_sensors(NULL);
+#endif
sensor_obstacle_update();
}
-#endif
void sensor_init(void)
{
-#ifdef HOST_VERSION
- return;
-#else
+#ifndef HOST_VERSION
adc_init();
- adc_register_event(adc_event);
+ if (BACKGROUND_ADC)
+ adc_register_event(adc_event);
+#endif
+
/* CS EVENT */
scheduler_add_periodical_event_priority(do_sensors, NULL,
10000L / SCHEDULER_UNIT,
ADC_PRIO);
-#endif
}