   return rf12_recvDone() && rf12_crc == 0 && rf12_hdr == SEND_ID;
 }
 
-// the since watchdog timer is inaccurate, tune the estimate first
+// since the watchdog timer is inaccurate, we must estimate
 static bool estimateWithWatchdog () {
   // first wait indefinitely for a packet to come in
   while (!isDesiredPacket())

  } while (!isDesiredPacket());

  int offset = window - (diff - lowEstimate);
  estimate = diff & ~0x0F; // truncate down to a 16 ms multiple

  Serial.print(" ok at "); Serial.print(diff);
  Serial.print(", window = "); Serial.print(window);

/// @dir syncRecv
/// Try to receive periodic transmissions with minimal power consumption.
/// @see http://jeelabs.org/2012/11/02/synchronised-reception/
// 2012-10-30 <jc@wippler.nl> http://opensource.org/licenses/mit-license.php

#include <JeeLib.h>

#define SEND_ID 9       // wait for packets from node 9

word estimate = 3000;   // packet expected every 3s
word window = 512;      // start with +/- 17 % window, power of 2
byte missed;            // count how often in a row receive failed

ISR(WDT_vect) { Sleepy::watchdogEvent(); }

