7 #include <avr/interrupt.h>
8 #include <util/delay.h>
11 volatile int xvar = 1;
13 /* idle mode will wake up board and will
14 * return PC after latest sleep_mode() call */
15 EMPTY_INTERRUPT(SIG_COMPARATOR);
22 /* for debugging purposes */
28 static void switch_idle(void)
31 set_sleep_mode(SLEEP_MODE_IDLE);
35 static void init_board(void)
39 /* enable interal reference for
41 * When the bandgap reference is connected to the Analog Comparator (by setting the ACBG bit in ACSR). */
52 TCCR0B = (1 << CS00) | (1 << CS02);
54 TIMSK |= (1 << TOIE0);
59 /* set LRA as sensor and switch to idle mode
60 * check back-EMF of LRA: if treshold is surpassed
61 * comparator intterupt is triggered */
62 // set_lra_as_sensor();
65 // /* board wakes up, set LRA as actuator and
66 // * plays haptic effect */
67 // set_lra_as_actuator();