Contiki 2.6
|
00001 /* Dummy sensor routine */ 00002 00003 #include "lib/sensors.h" 00004 #include "dev/button-sensor.h" 00005 const struct sensors_sensor button_sensor; 00006 static int status(int type); 00007 struct sensors_sensor *sensors[1]; 00008 unsigned char sensors_flags[1]; 00009 00010 00011 static int 00012 value(int type) 00013 { 00014 return 0; 00015 } 00016 00017 static int 00018 configure(int type, int c) 00019 { 00020 switch (type) { 00021 case SENSORS_ACTIVE: 00022 if (c) { 00023 if(!status(SENSORS_ACTIVE)) { 00024 } 00025 } else { 00026 } 00027 return 1; 00028 } 00029 return 0; 00030 } 00031 00032 static int 00033 status(int type) 00034 { 00035 switch (type) { 00036 case SENSORS_ACTIVE: 00037 case SENSORS_READY: 00038 return 1; 00039 } 00040 return 0; 00041 } 00042 00043 SENSORS_SENSOR(button_sensor, BUTTON_SENSOR, 00044 value, configure, status); 00045