 #define HYGRO_SECOND_PROBE 0x7D
 #define HYGRO_LMREMOTE_KEY 0x7F
 
+#define RECV_CYCLE_TIME  5000    // expected receive cycle, millisecond
+#define MIN_RECV_WIN     8       // minimum window size, power of 2
+#define MAX_RECV_WIN     512     // maximum window size, power of 2
+
 #ifdef LMREMOTE_SERIAL
 #undef MINIMAL_POWER_MODE
 #endif

static unsigned char _isRecent = BYTE1_RECENT_BOOT;
static unsigned char _isBattLow;

static unsigned int _recvCycleAct;
static unsigned int _recvWindow;
static unsigned long _recvLast;
static bool _recvSynced;

static bool packetReceived(unsigned char nodeId, unsigned int val)
{


static void checkTemps(void)
{
  _tempReadLast = millis();

  const unsigned char OVERSAMPLE_COUNT[] = {1, 4, 16, 64};  // 4^n
  boolean modified = false;
  unsigned int oversampled_adc = 0;

#ifdef LMREMOTE_SERIAL
  Serial.print(millis(), DEC);
  Serial.print(F(" Checking temps: "));
#endif

  // Enable the ADC
  ADCSRA |= bit(ADEN);
  // The probe themistor voltage dividers are normally powered down
  // to save power, using digital lines to supply Vcc to them.
  digitalWriteFast(_pinProbeSupply, HIGH);
  // Wait for AREF capacitor to charge
  stabilizeAdc();

