#include <avr/interrupt.h>
#include <util/delay.h>
#include "haptic.h"
+
+volatile int xvar = 1;
/* idle mode will wake up board and will
* return PC after latest sleep_mode() call */
EMPTY_INTERRUPT(SIG_COMPARATOR);
+ISR(TIM0_OVF_vect)
+{
+ xvar++;
+}
+
/* for debugging purposes */
ISR(BADISR_vect)
{
}
+
static void switch_idle(void)
{
sei();
int main(void)
{
- init_board();
+ init_board();
+
+ xvar = 1;
+ cli();
+ TCCR0A = 0x00;
+ TCCR0B = (1 << CS00) | (1 << CS02);
+ TCNT0 = 0;
+ TIMSK |= (1 << TOIE0);
+ sei();
while(1) {
/* set LRA as sensor and switch to idle mode
* check back-EMF of LRA: if treshold is surpassed
* comparator intterupt is triggered */
- set_lra_as_sensor();
- switch_idle();
-
- /* board wakes up, set LRA as actuator and
- * plays haptic effect */
- set_lra_as_actuator();
- play_haptic();
+// set_lra_as_sensor();
+// switch_idle();
+//
+// /* board wakes up, set LRA as actuator and
+// * plays haptic effect */
+// set_lra_as_actuator();
+// play_haptic();
}