34 #include "lib/sensors.h"
35 #include "dev/hwconf.h"
36 #include "dev/button-sensor.h"
38 const struct sensors_sensor button_sensor;
40 static struct timer debouncetimer;
41 static int status(
int type);
43 HWCONF_PIN(BUTTON, 2, 7);
44 HWCONF_IRQ(BUTTON, 2, 7);
47 #ifdef __IAR_SYSTEMS_ICC__
48 #pragma vector=PORT2_VECTOR
51 interrupt(PORT2_VECTOR)
55 ENERGEST_ON(ENERGEST_TYPE_IRQ);
57 if(BUTTON_CHECK_IRQ()) {
60 sensors_changed(&button_sensor);
65 ENERGEST_OFF(ENERGEST_TYPE_IRQ);
75 configure(
int type,
int c)
80 if(!status(SENSORS_ACTIVE)) {
82 BUTTON_IRQ_EDGE_SELECTD();
103 return BUTTON_IRQ_ENABLED();
108 SENSORS_SENSOR(button_sensor, BUTTON_SENSOR,
109 value, configure, status);