Contiki 2.5
button-sensor.c
1 /* Dummy sensor routine */
2 
3 #include "lib/sensors.h"
4 #include "dev/button-sensor.h"
5 const struct sensors_sensor button_sensor;
6 static int status(int type);
7 struct sensors_sensor *sensors[1];
8 unsigned char sensors_flags[1];
9 
10 
11 static int
12 value(int type)
13 {
14  return 0;
15 }
16 
17 static int
18 configure(int type, int c)
19 {
20  switch (type) {
21  case SENSORS_ACTIVE:
22  if (c) {
23  if(!status(SENSORS_ACTIVE)) {
24  }
25  } else {
26  }
27  return 1;
28  }
29  return 0;
30 }
31 
32 static int
33 status(int type)
34 {
35  switch (type) {
36  case SENSORS_ACTIVE:
37  case SENSORS_READY:
38  return 1;
39  }
40  return 0;
41 }
42 
43 SENSORS_SENSOR(button_sensor, BUTTON_SENSOR,
44  value, configure, status);
45