diff options
| author | Sadeep Madurange <sadeep@asciimx.com> | 2025-06-09 10:29:49 +0800 |
|---|---|---|
| committer | Sadeep Madurange <sadeep@asciimx.com> | 2025-06-09 10:29:49 +0800 |
| commit | dfae018264ab33f4ec0e04fb61805465f905e6a5 (patch) | |
| tree | 7c0a6b9bd7c931094b14a5cd0a2be0fb1664b8cf /main.c | |
| parent | c7ee90c9612721f6458e9126b4425d4b6aef04dc (diff) | |
| download | fpm-door-lock-dfae018264ab33f4ec0e04fb61805465f905e6a5.tar.gz | |
Disable watchdog timer and power down. Button presses are finnicky, may need to add a delay.
Diffstat (limited to 'main.c')
| -rw-r--r-- | main.c | 10 |
1 files changed, 10 insertions, 0 deletions
@@ -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; |
