34#include "lib/sensors.h"
35#include "dev/hwconf.h"
36#include "dev/button-sensor.h"
37#include "isr_compat.h"
39const struct sensors_sensor button_sensor;
41static struct timer debouncetimer;
42static int status(
int type);
44HWCONF_PIN(BUTTON, 2, 5);
45HWCONF_IRQ(BUTTON, 2, 5);
50 if(BUTTON_CHECK_IRQ()) {
53 sensors_changed(&button_sensor);
67configure(
int type,
int c)
72 if(!status(SENSORS_ACTIVE)) {
74 BUTTON_IRQ_EDGE_SELECTD();
95 return BUTTON_IRQ_ENABLED();
100SENSORS_SENSOR(button_sensor, BUTTON_SENSOR,
101 value, configure, status);
#define CLOCK_SECOND
A second, measured in system clock time.
void timer_set(struct timer *t, clock_time_t interval)
Set a timer.
bool timer_expired(struct timer *t)
Check if a timer has expired.