hbc: added stub files
[lra-as-sensor] / hbc.c
diff --git a/hbc.c b/hbc.c
index 0cca0dc..a0e77e0 100644 (file)
--- a/hbc.c
+++ b/hbc.c
@@ -1,14 +1,34 @@
+#include <stdio.h>
+#include <stdlib.h>
 #include <avr/io.h>
+#include <avr/wdt.h>
+#include <avr/sleep.h>
+#include <avr/power.h>
 #include <avr/interrupt.h>
+#include <util/delay.h>
+#include "haptic.h"
 
-#include <stdio.h>
-#include <stdlib.h>
+/* wake up on interrupt */
+static void switch_idle(void)
+{
+       sei();
+       set_sleep_mode(SLEEP_MODE_IDLE);
+       sleep_mode();
+}
 
-#include <util/delay.h>
+static void init_board(void)
+{
+       power_adc_disable();
+       wdt_disable();
+       /* enable interal reference for 
+        * comparator 
+        * When the bandgap reference is connected to the Analog Comparator (by setting the ACBG bit in ACSR). */
+}
 
-int main(void) {
-       
+int main(void)
+{
        
+       init_board();   
        DDRB |= (1 << DDB3);
        PORTB = (1 << PB3);