 //--------------------------------------------------------------------------------------------------
 // Sleep Configuration 
 //-------------------------------------------------------------------------------------------------
-// 0=16ms, 1=32ms,2=64ms,3=128ms,4=250ms,5=500ms
-// 6=1 sec,7=2 sec, 8=4 sec, 9= 8sec
-void setup_watchdog(int sleepMode) {
+// 0=16ms, 1=32ms,2=64ms,3=128ms,4=250ms,5=500ms,6=1 sec,7=2 sec, 8=4 sec, 9=8 sec
+void setup_watchdog(uint8_t sleepMode) {
 
   byte sleepByte;
-  if (sleepMode > 9 ) sleepMode=9;
-  sleepByte = sleepMode & 7;
+  if (sleepMode > 9 ) sleepMode = 9;
+  sleepByte = sleepMode & 0x07;
   if (sleepMode > 7) sleepByte |= (1<<5);
   sleepByte |= (1<<WDCE);
 

#define network 210      // RF12 Network group
#define freq RF12_433MHZ // Frequency of RFM12B module

#define USE_ACK           // Enable ACKs, comment out to disable
#define RETRY_PERIOD 5    // How soon to retry (in seconds) if ACK didn't come in
#define RETRY_LIMIT 5     // Maximum number of times to retry
#define ACK_TIME 10       // Number of milliseconds to wait for an ack

#endif
// Serial Functions End

//--------------------------------------------------------------------------------------------------
// Free Available Memory Function
//--------------------------------------------------------------------------------------------------
int freeMemory() {
  extern int __heap_start, *__brkval; 
  int v; 
  return (int) &v - (__brkval == 0 ? (int) &__heap_start : (int) __brkval); 
}






