]> oss.titaniummirror.com Git - tinyos-2.x.git/commitdiff
remove conflicting entry
authorandreaskoepke <andreaskoepke>
Wed, 18 Jun 2008 01:25:54 +0000 (01:25 +0000)
committerandreaskoepke <andreaskoepke>
Wed, 18 Jun 2008 01:25:54 +0000 (01:25 +0000)
tos/chips/tda5250/Tda5250RadioP.nc
tos/chips/tda5250/mac/RedMacP.nc

index a1ea56a82814a46faeae1de3bfc57c1a1eae58f0..de20682ead73a4f6645e40126518a48737f1f1e4 100644 (file)
@@ -55,6 +55,9 @@ module Tda5250RadioP {
         interface RadioByteComm;
         interface ResourceRequested;
         interface ClkDiv;
+#ifdef LNDW
+        interface RfPower;
+#endif
     }
     uses {
         interface HplTda5250Config;
@@ -79,6 +82,27 @@ implementation {
     radioMode_t radioMode;    // Current Mode of the Radio
     float onTime, offTime;
 
+#ifdef LNDW
+    norace bool rfpowerdirty = FALSE;
+    norace uint8_t rfpower = INITIAL_RF_POWER;
+    task void setRfPower() {
+        uint8_t rp, rd;
+        atomic {
+            rp = rfpower;
+            rd = rfpowerdirty;
+        }
+        if(rd) {
+            if(call ConfigResource.immediateRequest() == SUCCESS)  {
+                call HplTda5250Config.SetRFPower(rp);                
+                atomic rfpowerdirty = FALSE;
+            }
+            else {
+                post setRfPower();
+            }
+        }
+    }
+#endif
+    
     /**************** Radio Init *****************/
     command error_t Init.init() {
         radioMode = RADIO_MODE_OFF;
@@ -156,6 +180,9 @@ implementation {
                 call HplTda5250Config.SetSleepMode();
                 atomic radioMode = RADIO_MODE_SLEEP;
                 signal Tda5250Control.SleepModeDone();
+#ifdef LNDW
+                if(rfpowerdirty) post setRfPower();
+#endif
                 break;
             case RADIO_MODE_TX_TRANSITION:
                 call HplTda5250Config.SetSlaveMode();
@@ -454,4 +481,13 @@ implementation {
       }
       default async event void ClkDiv.stopping() {
       }
+#ifdef LNDW
+      async command error_t RfPower.set(uint8_t setting) {
+          atomic {
+              rfpower = setting;
+              rfpowerdirty = TRUE;
+          }
+          return SUCCESS;
+      }
+#endif
 }
index c34bcdae217faabb68141578f86cea69dda4b981..6d07f267c2275fd476221c13e3efc02a9945b414 100644 (file)
@@ -147,10 +147,10 @@ implementation
         SUB_HEADER_TIME=PHY_HEADER_TIME + sizeof(message_header_t)*BYTE_TIME,
         SUB_FOOTER_TIME=2*BYTE_TIME, // 2 bytes crc 
         // DEFAULT_SLEEP_TIME=1625,
-        DEFAULT_SLEEP_TIME=2048,
+        // DEFAULT_SLEEP_TIME=2048,
         // DEFAULT_SLEEP_TIME=4096,
         // DEFAULT_SLEEP_TIME=8192,
-        // DEFAULT_SLEEP_TIME=16384,
+        DEFAULT_SLEEP_TIME=16384,
         // DEFAULT_SLEEP_TIME=32768U,
         // DEFAULT_SLEEP_TIME=65535U,
         DATA_DETECT_TIME=17,
@@ -163,8 +163,8 @@ implementation
         ACK_DURATION = SUB_HEADER_TIME + SUB_FOOTER_TIME,
         NAV_FACTOR = 4,
 #ifndef MAC_EVAL
-        MAX_SHORT_RETRY=3,
-        MAX_LONG_RETRY=7,
+        MAX_SHORT_RETRY=9,
+        MAX_LONG_RETRY=3,
         ADD_NAV = 2,
         INCREASE_BACKOFF = TRUE,
 #endif