diff --git a/platform/osd-er-lp24/contiki-main.c b/platform/osd-er-lp24/contiki-main.c index cfc83a0f0..e267b1060 100644 --- a/platform/osd-er-lp24/contiki-main.c +++ b/platform/osd-er-lp24/contiki-main.c @@ -146,8 +146,9 @@ FUSES ={.low = 0xC2, .high = 0x99, .extended = 0xfe,}; #include "lib/sensors.h" #include "dev/button-sensor.h" +#include "dev/battery-sensor.h" #include "dev/pir-sensor.h" -SENSORS(&button_sensor, &pir_sensor); +SENSORS(&button_sensor, &battery_sensor, &pir_sensor); uint8_t rng_get_uint8(void) { diff --git a/platform/osd-er-lp24/dev/adc.c b/platform/osd-er-lp24/dev/adc.c index cdb7eb7a0..82c66411f 100644 --- a/platform/osd-er-lp24/dev/adc.c +++ b/platform/osd-er-lp24/dev/adc.c @@ -54,10 +54,10 @@ int readADC(uint8_t pin) ADMUX = _BV(REFS1) | _BV(REFS0) | ( pin & 7 ) ; ADCSRA = _BV(ADEN) | _BV(ADPS0) | _BV(ADPS2) ; - sbi(ADCSRA,ADSC); loop_until_bit_is_clear(ADCSRA,ADSC); + result = ADC; ADCSRA=0; //disable ADC @@ -76,10 +76,9 @@ int readInternalTemp(void) ADCSRB |= _BV(MUX5); ADMUX = _BV(REFS1) | _BV(REFS0) | 0b1001 ; ADCSRA = _BV(ADEN) | _BV(ADPS0) | _BV(ADPS2) ; - + sbi(ADCSRA,ADSC); loop_until_bit_is_clear(ADCSRA,ADSC); - reading = ADC; ADCSRA=0; //disable ADC diff --git a/platform/osd-er-lp24/dev/button-sensor.c b/platform/osd-er-lp24/dev/button-sensor.c index 505eda9c9..491879f3a 100644 --- a/platform/osd-er-lp24/dev/button-sensor.c +++ b/platform/osd-er-lp24/dev/button-sensor.c @@ -46,14 +46,12 @@ value(int type) static int configure(int type, int c) { - PRINTF("Sensor Button Configure called: %d, %d\n",type,c); switch (type) { case SENSORS_ACTIVE: if (c) { if(!status(SENSORS_ACTIVE)) { led1_on(); timer_set(&debouncetimer, 0); - PRINTF("Setup sensor started\n"); DDRE |= (0<