35 #include "lib/sensors.h"
36 #include "dev/hwconf.h"
37 #include "dev/button-sensor.h"
39 const struct sensors_sensor button_sensor;
41 static struct timer debouncetimer;
42 static int status(
int type);
44 HWCONF_PIN(BUTTON, 2, 5);
45 HWCONF_IRQ(BUTTON, 2, 5);
49 #ifdef __IAR_SYSTEMS_ICC__
50 #pragma vector=PORT2_VECTOR
53 interrupt(PORT2_VECTOR)
57 ENERGEST_ON(ENERGEST_TYPE_IRQ);
59 if(BUTTON_CHECK_IRQ()) {
62 sensors_changed(&button_sensor);
67 ENERGEST_OFF(ENERGEST_TYPE_IRQ);
77 configure(
int type,
int c)
82 if(!status(SENSORS_ACTIVE)) {
84 BUTTON_IRQ_EDGE_SELECTD();
105 return BUTTON_IRQ_ENABLED();
110 SENSORS_SENSOR(button_sensor, BUTTON_SENSOR,
111 value, configure, status);