7 #include <avr/interrupt.h>
8 #include <util/delay.h>
11 /* idle mode will wake up board and will
12 * return PC after latest sleep_mode() call */
13 EMPTY_INTERRUPT(SIG_COMPARATOR);
15 /* for debugging purposes */
20 static void switch_idle(void)
23 set_sleep_mode(SLEEP_MODE_IDLE);
27 static void init_board(void)
31 /* enable interal reference for
33 * When the bandgap reference is connected to the Analog Comparator (by setting the ACBG bit in ACSR). */
43 /* set LRA as sensor and switch to idle mode
44 * check back-EMF of LRA: if treshold is surpassed
45 * comparator intterupt is triggered */
49 /* board wakes up, set LRA as actuator and
50 * plays haptic effect */
51 set_lra_as_actuator();