]> oss.titaniummirror.com Git - tinyos-2.x.git/blobdiff - tos/chips/rf2xx/rf230/RF230DriverLayerP.nc
simplify default channel configuration
[tinyos-2.x.git] / tos / chips / rf2xx / rf230 / RF230DriverLayerP.nc
index c7e59fb2f89e0a1657f79a572839f773c6fa0877..17ea8ffa13a7be06272d0eb33272000c7f184061 100644 (file)
@@ -222,10 +222,10 @@ implementation
 
                writeRegister(RF230_IRQ_MASK, RF230_IRQ_TRX_UR | RF230_IRQ_PLL_LOCK | RF230_IRQ_TRX_END | RF230_IRQ_RX_START);
                writeRegister(RF230_CCA_THRES, RF230_CCA_THRES_VALUE);
-               writeRegister(RF230_PHY_TX_PWR, RF230_TX_AUTO_CRC_ON | RF230_TX_PWR_DEFAULT);
+               writeRegister(RF230_PHY_TX_PWR, RF230_TX_AUTO_CRC_ON | (RF230_DEF_RFPOWER & RF230_TX_PWR_MASK));
 
-               txPower = RF230_TX_PWR_DEFAULT;
-               channel = call RF230DriverConfig.getDefaultChannel() & RF230_CHANNEL_MASK;
+               txPower = RF230_DEF_RFPOWER & RF230_TX_PWR_MASK;
+               channel = RF230_DEF_CHANNEL & RF230_CHANNEL_MASK;
                writeRegister(RF230_PHY_CC_CCA, RF230_CCA_MODE_VALUE | channel);
 
                call SLP_TR.set();
@@ -433,12 +433,14 @@ implementation
                        return EBUSY;
                }
 
+#ifndef RF230_SLOW_SPI
                atomic
                {
                        call SLP_TR.set();
                        time = call RadioAlarm.getNow() + TX_SFD_DELAY;
                }
                call SLP_TR.clr();
+#endif
 
                ASSERT( ! radioIrq );
 
@@ -466,6 +468,15 @@ implementation
                }
                while( --header != 0 );
 
+#ifdef RF230_SLOW_SPI
+               atomic
+               {
+                       call SLP_TR.set();
+                       time = call RadioAlarm.getNow() + TX_SFD_DELAY;
+               }
+               call SLP_TR.clr();
+#endif
+
                time32 += (int16_t)(time) - (int16_t)(time32);
 
                if( timesync != 0 )