34 #include "lib/sensors.h"
35 #include "dev/hwconf.h"
36 #include "dev/button-sensor.h"
37 #include "isr_compat.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);
50 ENERGEST_ON(ENERGEST_TYPE_IRQ);
52 if(BUTTON_CHECK_IRQ()) {
55 sensors_changed(&button_sensor);
60 ENERGEST_OFF(ENERGEST_TYPE_IRQ);
70 configure(
int type,
int c)
75 if(!status(SENSORS_ACTIVE)) {
77 BUTTON_IRQ_EDGE_SELECTD();
98 return BUTTON_IRQ_ENABLED();
103 SENSORS_SENSOR(button_sensor, BUTTON_SENSOR,
104 value, configure, status);
void timer_set(struct timer *t, clock_time_t interval)
Set a timer.
int timer_expired(struct timer *t)
Check if a timer has expired.
#define CLOCK_SECOND
A second, measured in system clock time.