 
 static void sleepSeconds(unsigned char secs)
 {
+#if RECEIVE_TEST
+  unsigned long start = millis();
+  while (millis() - start < (secs * 1000U))
+    rf12_doWork();
+  ADCSRA |= bit(ADEN);
+#else
   while (secs >= 8) { sleep(WDTO_8S, true); secs -=8; }
   if (secs >= 4) { sleep(WDTO_4S, true); secs -= 4; }
   if (secs >= 2) { sleep(WDTO_2S, true); secs -= 2; }
   if (secs >= 1) { sleep(WDTO_1S, true); }
-}
-
-static void rf12_doWork(void)
-{
-  if (rf12_recvDone() && rf12_crc == 0)
-  {
-    if (_pinLedRx != 0xff) digitalWrite(_pinLedRx, HIGH);
-    // (currently have nothing to receive)
-  }
-  if (_pinLedRx != 0xff) digitalWrite(_pinLedRx, LOW);
+#endif
 }
 
 static void updateBatteryLow(void)

    hasTransmitted = true;
  }
  
  rf12_sleep(RF12_SLEEP);
  if (_pinLedTx != 0xff)
  {
    digitalWrite(_pinLedTx, HIGH);

ISR(WDT_vect) { wdt_disable(); }
ISR(ADC_vect) { _adcBusy = 0; }

static void packetReceived(unsigned char nodeId, unsigned int val)
{
#ifdef LMREMOTE_SERIAL
  Serial.print(F("IN("));
  Serial.print(nodeId);
  Serial.print(F(")="));
  Serial.print(val);
  Serial.print('\n');
#endif

  if (nodeId != NODEID_MASTER)
    return;
  // val contains requested fan speed percent
}

static void rf12_doWork(void)
{
  if (rf12_recvDone() && rf12_crc == 0)
  {
    if (_pinLedRx != 0xff) digitalWrite(_pinLedRx, HIGH);

    unsigned char nodeId = ((rf12_buf[0] & 0x0f) << 2) | (rf12_buf[1] >> 6);
    unsigned int val = (rf12_buf[1] & 0x0f) << 8 | rf12_buf[2];
    packetReceived(nodeId, val);
  }
  if (_pinLedRx != 0xff) digitalWrite(_pinLedRx, LOW);
}

static unsigned int analogReadSleep(unsigned char pin)
{
  _adcBusy = 1;
