6 #include "dev/button-sensor.h"
7 #include "dev/temperature-sensor.h"
8 #include "dev/acc-sensor.h"
10 static uint8_t sensors_status;
12 #define BUTTON_STATUS_ACTIVE (1 << 0)
13 #define TEMP_STATUS_ACTIVE (1 << 1)
14 #define ACC_STATUS_ACTIVE (1 << 2)
25 if(button_sensor.status(SENSORS_READY)){
26 sensors_status |= BUTTON_STATUS_ACTIVE;
28 if(temperature_sensor.status(SENSORS_READY)){
29 sensors_status |= TEMP_STATUS_ACTIVE;
31 if(acc_sensor.status(SENSORS_READY)){
32 sensors_status |= ACC_STATUS_ACTIVE;
34 SENSORS_DEACTIVATE(acc_sensor);
41 button_sensor.configure(SENSORS_HW_INIT, 0);
42 temperature_sensor.configure(SENSORS_HW_INIT, 0);
43 acc_sensor.configure(SENSORS_HW_INIT, 0);
45 if(sensors_status & BUTTON_STATUS_ACTIVE){
46 SENSORS_ACTIVATE(button_sensor);
48 if(sensors_status & TEMP_STATUS_ACTIVE){
49 SENSORS_ACTIVATE(temperature_sensor);
51 if(sensors_status & ACC_STATUS_ACTIVE){
52 SENSORS_ACTIVATE(acc_sensor);