]> oss.titaniummirror.com Git - tinyos-2.x.git/blobdiff - tos/chips/tda5250/mac/CsmaMacC.nc
update to new debug if
[tinyos-2.x.git] / tos / chips / tda5250 / mac / CsmaMacC.nc
index 4a246cbec90ebc26d92e6aa5936918d256c4fdb3..4810c5a5339fe939af016830a7ae6e726f90920b 100644 (file)
  * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 
  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE 
  * USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
-*/
+ */
 
 /**
- * Confuguration for the CsmaMac.
+ * Configuration for the CsmaMac.
  *
  * @author: Kevin Klues (klues@tkn.tu-berlin.de)
  * @author: Andreas Koepke (koepke@tkn.tu-berlin.de)
  * @author: Philipp Huppertz (huppertz@tkn.tu-berlin.de)
  */
+
+// #define MAC_DEBUG
 configuration CsmaMacC {
   provides {
     interface SplitControl;
     interface MacSend;
     interface MacReceive;
+    interface Packet;
   }
   uses {
     interface PhySend as PacketSend;
     interface PhyReceive as PacketReceive;
-        
+    interface Packet as SubPacket;
     interface Tda5250Control;  
     interface UartPhyControl;
+    interface RadioTimeStamping;
   }
 }
 implementation {
-  components  MainC,
+  components  Tda5250RadioC,    
       CsmaMacP,
       RssiFixedThresholdCMC as Cca,
-      new Alarm32khzC() as Timer,
-      RandomLfsrC,
-      PlatformLedsC;
-              
-    MainC.SoftwareInit -> CsmaMacP;
-              
+      new Alarm32khz16C() as Timer,
+      new TimerMilliC() as ReRxTimer,
+      DuplicateC,
+      TimeDiffC,
+      LocalTimeC,
+      RandomLfsrC
+#ifdef MAC_DEBUG
+      ,PlatformLedsC
+#endif
+      ;
+    
     SplitControl = CsmaMacP;
     
     MacSend = CsmaMacP;
     MacReceive = CsmaMacP;
     Tda5250Control = CsmaMacP;
     UartPhyControl = CsmaMacP;
+    RadioTimeStamping = CsmaMacP;
     
+    CsmaMacP = Packet;
+    CsmaMacP = SubPacket;
     CsmaMacP = PacketSend;
     CsmaMacP = PacketReceive;
     
@@ -73,12 +84,26 @@ implementation {
     CsmaMacP.ChannelMonitor -> Cca.ChannelMonitor;
     CsmaMacP.ChannelMonitorData -> Cca.ChannelMonitorData;
     CsmaMacP.ChannelMonitorControl -> Cca.ChannelMonitorControl;
+    CsmaMacP.RssiAdcResource -> Cca.RssiAdcResource;
+
+    components ActiveMessageAddressC;
+    CsmaMacP.amAddress -> ActiveMessageAddressC;
+
     CsmaMacP.Random -> RandomLfsrC;
 
+    CsmaMacP.RadioResourceRequested -> Tda5250RadioC.ResourceRequested;
+
     CsmaMacP.Timer -> Timer;
-    CsmaMacP.Led0 -> PlatformLedsC.Led0;
-    CsmaMacP.Led1 -> PlatformLedsC.Led1;
-    CsmaMacP.Led2 -> PlatformLedsC.Led2;
-    CsmaMacP.Led3 -> PlatformLedsC.Led3;
+
+    CsmaMacP.ReRxTimer -> ReRxTimer;
+
+    CsmaMacP.Duplicate -> DuplicateC;
+    CsmaMacP.TimeDiff16 -> TimeDiffC;
+    CsmaMacP.LocalTime32kHz -> LocalTimeC;
+
+#ifdef MACM_DEBUG
+    components new SerialDebugC() as SD;
+    CsmaMacP.SerialDebug -> SD;
+#endif    
 }