Data hosted with ♥ by Pastebin.com - Download Raw - See Original
  1. // Enable watchdog interrupt, set prescaling to 1 sec
  2. void init_wdt()
  3. {
  4.     // Disable interrupts
  5.     cli();
  6.     // Start timed sequence
  7.     // Set Watchdog Change Enable bit
  8.     WDTCR |= (1<<WDCE);
  9.     // Set new prescaler (1 sec), unset reset enable
  10.     // enable WDT interrupt
  11.     WDTCR = (1<<WDTIE)|(1<<WDP2)|(1<<WDP1);
  12.     sei();
  13. }