X-Git-Url: https://robinkrens.nl/gitweb/?p=lra-as-sensor;a=blobdiff_plain;f=hbc.c;fp=hbc.c;h=a0e77e0385048f6dfc34c2318b306ee4c6c704ae;hp=0cca0dcd7e69ed9f6762535dd32a84a5c3322bf6;hb=b5003bc24fecbcdf437ddb7d8ef2b54f3649c6c2;hpb=5516dd3ac4a28c03b095101ff45f8787c895b847 diff --git a/hbc.c b/hbc.c index 0cca0dc..a0e77e0 100644 --- a/hbc.c +++ b/hbc.c @@ -1,14 +1,34 @@ +#include +#include #include +#include +#include +#include #include +#include +#include "haptic.h" -#include -#include +/* wake up on interrupt */ +static void switch_idle(void) +{ + sei(); + set_sleep_mode(SLEEP_MODE_IDLE); + sleep_mode(); +} -#include +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);