]> oss.titaniummirror.com Git - tinyos-2.x.git/commitdiff
LPL patch by thomas schmidt
authorkusy <kusy>
Thu, 16 Jul 2009 06:49:47 +0000 (06:49 +0000)
committerkusy <kusy>
Thu, 16 Jul 2009 06:49:47 +0000 (06:49 +0000)
tos/lib/ftsp/TimeSyncC.nc
tos/lib/ftsp/TimeSyncP.nc

index 58af71d282c36e84bc0b91f458f5a874e1f8b108..8022d8a9f6a354fcb06023aa9c1c191ff30a0e65 100644 (file)
@@ -69,4 +69,9 @@ implementation
 #endif
   TimeSyncP.Leds  ->  LedsC;
 
+#ifdef LOW_POWER_LISTENING
+  components CC2420ActiveMessageC;
+  TimeSyncP.LowPowerListening -> CC2420ActiveMessageC;
+#endif
+
 }
index 86035dc2ca1ec23027c0bf099da3ae66439d5d54..3c3affe83d12528d0d7ef1ece43dfbe316742875 100644 (file)
@@ -46,6 +46,12 @@ generic module TimeSyncP(typedef precision_tag)
         interface Leds;
         interface TimeSyncPacket<precision_tag,uint32_t>;
         interface LocalTime<precision_tag> as LocalTime;
+
+
+#ifdef LOW_POWER_LISTENING
+        interface LowPowerListening;
+#endif
+
     }
 }
 implementation
@@ -61,7 +67,7 @@ implementation
         IGNORE_ROOT_MSG       = 4,              // after becoming the root ignore other roots messages (in send period)
         ENTRY_VALID_LIMIT     = 4,              // number of entries to become synchronized
         ENTRY_SEND_LIMIT      = 3,              // number of entries to send sync messages
-        ENTRY_THROWOUT_LIMIT  = 100,            // if time sync error is bigger than this clear the table
+        ENTRY_THROWOUT_LIMIT  = 500,            // if time sync error is bigger than this clear the table
     };
 
     typedef struct TableItem
@@ -353,6 +359,9 @@ implementation
 
         outgoingMsg->globalTime = globalTime;
 
+#ifdef LOW_POWER_LISTENING
+        call LowPowerListening.setRxSleepInterval(&outgoingMsgBuffer, LPL_INTERVAL);
+#endif
         // we don't send time sync msg, if we don't have enough data
         if( numEntries < ENTRY_SEND_LIMIT && outgoingMsg->rootID != TOS_NODE_ID ){
             ++heartBeats;