[Tinyos-2-commits] CVS: tinyos-2.x/tos/chips/tda5250/mac CsmaMacP.nc, 1.1.2.6, 1.1.2.7

Philipp Huppertz phihup at users.sourceforge.net
Thu Jun 8 08:31:07 PDT 2006


Update of /cvsroot/tinyos/tinyos-2.x/tos/chips/tda5250/mac
In directory sc8-pr-cvs10.sourceforge.net:/tmp/cvs-serv19280/tos/chips/tda5250/mac

Modified Files:
      Tag: tinyos-2_0_devel-BRANCH
	CsmaMacP.nc 
Log Message:
- fixed a bug in UartPhy and some more on PacketSerializer
- added some documentaion to interfaces
- BEWARE: radio strangely only works when compiled with "debug" option.

Index: CsmaMacP.nc
===================================================================
RCS file: /cvsroot/tinyos/tinyos-2.x/tos/chips/tda5250/mac/Attic/CsmaMacP.nc,v
retrieving revision 1.1.2.6
retrieving revision 1.1.2.7
diff -C2 -d -r1.1.2.6 -r1.1.2.7
*** CsmaMacP.nc	7 Jun 2006 19:54:53 -0000	1.1.2.6
--- CsmaMacP.nc	8 Jun 2006 15:31:05 -0000	1.1.2.7
***************
*** 74,78 ****
  #define CSMA_ACK 100
  #define BYTE_TIME 17
! #define MACM_DEBUG                    // debug...
  #define MAX_LONG_RETRY 3              // Missing acks, or short retry limit hits -> increase long retry 
  #define MAX_SHORT_RETRY 5             // busy channel -> increase short retry
--- 74,78 ----
  #define CSMA_ACK 100
  #define BYTE_TIME 17
! // #define MACM_DEBUG                    // debug...
  #define MAX_LONG_RETRY 3              // Missing acks, or short retry limit hits -> increase long retry 
  #define MAX_SHORT_RETRY 5             // busy channel -> increase short retry
***************
*** 104,108 ****
          RSSI_STABLE = 1,
          BUSY_DETECTED_VIA_RSSI = 2,
!         CHECK_RX_LIVENESS = 4
      } flags_t;
  
--- 104,109 ----
          RSSI_STABLE = 1,
          BUSY_DETECTED_VIA_RSSI = 2,
!         CHECK_RX_LIVENESS = 4,
!         DIFS_TIMER_FIRED = 8
      } flags_t;
  
***************
*** 183,191 ****
      void signalMacState() {
  #ifdef MACM_DEBUG
! /*        (macState & 1) ? call Led0.set() : call Led0.clr();
!         (macState & 2) ? call Led1.set() : call Led1.clr();
!         (macState & 4) ? call Led2.set() : call Led2.clr();
!         (macState & 8) ? call Led3.set() : call Led3.clr();
! */
  #endif
      }
--- 184,191 ----
      void signalMacState() {
  #ifdef MACM_DEBUG
! //         (macState & 1) ? call Led0.set() : call Led0.clr();
! //         (macState & 2) ? call Led1.set() : call Led1.clr();
! //         (macState & 4) ? call Led2.set() : call Led2.clr();
! //         (macState & 8) ? call Led3.set() : call Led3.clr();
  #endif
      }
***************
*** 265,269 ****
          if((txBufPtr != NULL) && (macState == RX) && (!call Timer.isRunning())) {
              clearFlag(&flags, CHECK_RX_LIVENESS);
!             if(!call UartPhyControl.isBusy()) {
                  if(isFlagSet(&flags, RSSI_STABLE)) {
                      macState = CCA;
--- 265,270 ----
          if((txBufPtr != NULL) && (macState == RX) && (!call Timer.isRunning())) {
              clearFlag(&flags, CHECK_RX_LIVENESS);
!             clearFlag(&flags, DIFS_TIMER_FIRED);
!             /*           if(!call UartPhyControl.isBusy()) { */
                  if(isFlagSet(&flags, RSSI_STABLE)) {
                      macState = CCA;
***************
*** 277,281 ****
                      storeOldState(131);
                  }
!             }
              else {
                  storeOldState(132);
--- 278,282 ----
                      storeOldState(131);
                  }
!  /*           }
              else {
                  storeOldState(132);
***************
*** 284,288 ****
                  call Timer.start(backoff());
              }
!         }
      }
      
--- 285,290 ----
                  call Timer.start(backoff());
              }
!                 */
!       }
      }
      
***************
*** 557,566 ****
              storeOldState(90);
              if(isFlagSet(&flags, CHECK_RX_LIVENESS)) {
!                 if(call UartPhyControl.isBusy()) {
                      call Timer.start(CHECK_RX_LIVENESS_INTERVALL);
                  }
                  else {
                      call ChannelMonitor.start();
!                 }
              } else {
                  checkSend();
--- 559,569 ----
              storeOldState(90);
              if(isFlagSet(&flags, CHECK_RX_LIVENESS)) {
!                 /* if(call UartPhyControl.isBusy()) {
                      call Timer.start(CHECK_RX_LIVENESS_INTERVALL);
                  }
                  else {
+                 */
                      call ChannelMonitor.start();
!                     /*} */
              } else {
                  checkSend();
***************
*** 576,582 ****
          else if(macState == CCA) {
              storeOldState(92);
!             macState = SW_TX;
!             signalMacState();
!             setTxMode();
          }
          else {
--- 579,584 ----
          else if(macState == CCA) {
              storeOldState(92);
!             setFlag(&flags, DIFS_TIMER_FIRED);
!             call ChannelMonitor.start();
          }
          else {
***************
*** 616,619 ****
--- 618,630 ----
                  call Timer.start(backoff());
          }
+         else if(macState == CCA) {
+           if(isFlagSet(&flags, DIFS_TIMER_FIRED)) {    
+             clearFlag(&flags, DIFS_TIMER_FIRED);
+             storeOldState(112);
+             macState = SW_TX;
+             signalMacState();
+             setTxMode();
+           }
+         }
      }
  



More information about the Tinyos-2-commits mailing list