X-Git-Url: http://git.droids-corp.org/?p=aversive.git;a=blobdiff_plain;f=projects%2Fmicrob2010%2Fmainboard%2Fsensor.c;h=bda3bd56ab8c8b3a8110d7dab36eb4ce61fdacb9;hp=473ed76472b413fdec9f31f6f05b5702ef7c9169;hb=17aadc4c8c3e60c2b5e6bbba91c8542849addbd7;hpb=b022f257a5ee568737e1a684a83d0154397fffcb diff --git a/projects/microb2010/mainboard/sensor.c b/projects/microb2010/mainboard/sensor.c index 473ed76..bda3bd5 100644 --- a/projects/microb2010/mainboard/sensor.c +++ b/projects/microb2010/mainboard/sensor.c @@ -160,8 +160,8 @@ struct sensor_filter { 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_COLUMN_LEFT] = { 1, 0, 0, 1, 0, 1 }, /* 2 */ - [S_COLUMN_RIGHT] = { 1, 0, 0, 1, 0, 1 }, /* 3 */ + [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 */ @@ -286,12 +286,14 @@ uint8_t sensor_obstacle_is_disabled(void) /************ 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); + if (BACKGROUND_ADC) + do_adc(NULL); do_boolean_sensors(NULL); sensor_obstacle_update(); } @@ -303,7 +305,8 @@ void sensor_init(void) return; #else adc_init(); - adc_register_event(adc_event); + if (BACKGROUND_ADC) + adc_register_event(adc_event); /* CS EVENT */ scheduler_add_periodical_event_priority(do_sensors, NULL, 10000L / SCHEDULER_UNIT,