summaryrefslogtreecommitdiffstats
path: root/main.c
diff options
context:
space:
mode:
Diffstat (limited to 'main.c')
-rw-r--r--main.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/main.c b/main.c
index 7aea82a..f805c48 100644
--- a/main.c
+++ b/main.c
@@ -34,6 +34,13 @@
int main(void)
{
+ /* disable watchdog timer */
+ cli();
+ wdt_reset();
+ MCUSR &= ~(1 << WDRF);
+ WDTCSR |= (1 << WDCE) | (1 << WDE);
+ WDTCSR = 0x00;
+
/* init input ports */
INPUT_DDR &= ~((1 << BACK_LOCK_PIN) | (1 << BACK_UNLOCK_PIN) |
(1 << FRONT_LOCK_PIN) | (1 << FRONT_UNLOCK_PIN) |
@@ -61,6 +68,9 @@ int main(void)
sei();
for (;;) {
+ sleep_bod_disable();
+ set_sleep_mode(SLEEP_MODE_PWR_DOWN);
+ sleep_mode();
}
return 0;