   }
 #endif // DPIN_OOK_RX
 }
+
 void setup() {
   Serial.begin(38400);
   Serial.println("$UCID,Powermon433,"__DATE__" "__TIME__);
 
   pinModeFast(DPIN_LED, OUTPUT);
 
-#if defined(DPIN_OOK_RX)
-  setupPinChangeInterrupt();
-#endif
-
-#if defined(DPIN_OOK_TX)
-  pinModeFast(DPIN_OOK_TX, OUTPUT);
-  pinModeFast(DPIN_STARTTX_BUTTON, INPUT);
-  digitalWriteFast(DPIN_STARTTX_BUTTON, HIGH);
-  
-  wireval.hdr = 0xfe;
-  g_TxTemperature = tempFToCnt(116.22);
-  g_TxFlags = 0x7c;
-  g_TxWatts = 5000;
-  g_TxTotal = 60000;
-#endif
+  txSetup();
+  rxSetup();
+
   g_TxId = DEFAULT_TX_ID;
 }
 

    Serial.println("CRC ERR");
}

static void ookTx(void)
{
#if defined(DPIN_OOK_TX)


static char g_SerialBuff[40];

static struct tagWireVal
{
  uint8_t hdr;
  union {
