Advertisement
Guest User

Untitled

a guest
Jan 19th, 2017
86
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.40 KB | None | 0 0
  1. #include "watchdog.h"
  2. #include "diodes.h"
  3. #include "buttons.h"
  4.  
  5. void main( )
  6. {
  7.     disableWDT();
  8.     initDiodes();
  9.     initButtons();
  10.     offSTATUS();
  11.     enableWDT(ACLK, DIV512);
  12.  
  13.     if(wasWDTReset())
  14.     {
  15.         clearInterruptFlag();
  16.         onSTATUS();
  17.     }
  18.  
  19.     while(1)
  20.     {
  21.         if(isB1Pressed())
  22.             while(1) {}
  23.         else
  24.             resetWDTClock();
  25.     }
  26. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement