[Tinyos-2-commits] CVS: tinyos-2.x/tos/chips/tda5250 HplTda5250Config.nc, 1.1.2.5, 1.1.2.6 HplTda5250ConfigP.nc, 1.1.2.4, 1.1.2.5 HplTda5250Data.nc, 1.1.2.3, 1.1.2.4 HplTda5250DataP.nc, 1.1.2.6, 1.1.2.7 tda5250_message.h, 1.1.2.2, 1.1.2.3 Tda5250RadioC.nc, 1.1.2.5, 1.1.2.6 Tda5250RadioP.nc, 1.1.2.7, 1.1.2.8 Tda5250RegCommP.nc, 1.1.2.6, 1.1.2.7

Philipp Huppertz phihup at users.sourceforge.net
Thu Aug 3 11:17:54 PDT 2006


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

Modified Files:
      Tag: tinyos-2_0_devel-BRANCH
	HplTda5250Config.nc HplTda5250ConfigP.nc HplTda5250Data.nc 
	HplTda5250DataP.nc tda5250_message.h Tda5250RadioC.nc 
	Tda5250RadioP.nc Tda5250RegCommP.nc 
Log Message:
- updated eyes platform to use usart configure
- a few bug fixes

Index: HplTda5250Config.nc
===================================================================
RCS file: /cvsroot/tinyos/tinyos-2.x/tos/chips/tda5250/HplTda5250Config.nc,v
retrieving revision 1.1.2.5
retrieving revision 1.1.2.6
diff -C2 -d -r1.1.2.5 -r1.1.2.6
*** HplTda5250Config.nc	31 May 2006 13:53:02 -0000	1.1.2.5
--- HplTda5250Config.nc	3 Aug 2006 18:17:52 -0000	1.1.2.6
***************
*** 469,473 ****
     async command bool IsRSSIGreaterThanThreshold();
  
!   
     /**
     * Switches the radio to TxMode when in SLAVE_MODE
--- 469,481 ----
     async command bool IsRSSIGreaterThanThreshold();
  
!    /**
!    * Checks if the Tx Rx and Sleep radiomodes can be set via pin.
!    * This only concerns SetTxMode(), SetRxMode() and SetSleepMode().
!    *
!    * @return TRUE if radiomodes can be set via pin
!    *         FALSE otherwise.
!    */
!    async command bool IsTxRxPinControlled();
!    
     /**
     * Switches the radio to TxMode when in SLAVE_MODE

Index: HplTda5250ConfigP.nc
===================================================================
RCS file: /cvsroot/tinyos/tinyos-2.x/tos/chips/tda5250/HplTda5250ConfigP.nc,v
retrieving revision 1.1.2.4
retrieving revision 1.1.2.5
diff -C2 -d -r1.1.2.4 -r1.1.2.5
*** HplTda5250ConfigP.nc	31 May 2006 13:53:02 -0000	1.1.2.4
--- HplTda5250ConfigP.nc	3 Aug 2006 18:17:52 -0000	1.1.2.5
***************
*** 177,181 ****
    async command void HplTda5250Config.UseFSK(tda5250_cap_vals_t pos_shift, tda5250_cap_vals_t neg_shift) {
      currentConfig = CONFIG_ASK_NFSK_FSK(currentConfig);
!     if(currentConfig | MASK_CONFIG_CONTROL_TXRX_REGISTER) {
        call CONFIG.set(currentConfig);
      }
--- 177,181 ----
    async command void HplTda5250Config.UseFSK(tda5250_cap_vals_t pos_shift, tda5250_cap_vals_t neg_shift) {
      currentConfig = CONFIG_ASK_NFSK_FSK(currentConfig);
!     if(currentConfig & MASK_CONFIG_CONTROL_TXRX_REGISTER) {
        call CONFIG.set(currentConfig);
      }
***************
*** 189,193 ****
    async command void HplTda5250Config.UseASK(tda5250_cap_vals_t value) {
      currentConfig = CONFIG_ASK_NFSK_ASK(currentConfig);
!     if((currentConfig | MASK_CONFIG_CONTROL_TXRX_REGISTER)) {
        call CONFIG.set(currentConfig);
      } 
--- 189,193 ----
    async command void HplTda5250Config.UseASK(tda5250_cap_vals_t value) {
      currentConfig = CONFIG_ASK_NFSK_ASK(currentConfig);
!     if(currentConfig & MASK_CONFIG_CONTROL_TXRX_REGISTER) {
        call CONFIG.set(currentConfig);
      } 
***************
*** 466,470 ****
      currentConfig = CONFIG_RX_NTX_TX(currentConfig);
      currentConfig = CONFIG_ALL_PD_NORMAL(currentConfig);
!     if (currentConfig | MASK_CONFIG_CONTROL_TXRX_REGISTER) {
        call CONFIG.set(currentConfig);
      }
--- 466,470 ----
      currentConfig = CONFIG_RX_NTX_TX(currentConfig);
      currentConfig = CONFIG_ALL_PD_NORMAL(currentConfig);
!     if (currentConfig & MASK_CONFIG_CONTROL_TXRX_REGISTER) {
        call CONFIG.set(currentConfig);
      }
***************
*** 474,483 ****
      }
    }
! 
    /* << tested >> */
    async command void HplTda5250Config.SetRxMode() {
      currentConfig = CONFIG_RX_NTX_RX(currentConfig);
      currentConfig = CONFIG_ALL_PD_NORMAL(currentConfig);
!     if (currentConfig | MASK_CONFIG_CONTROL_TXRX_REGISTER) {
        call CONFIG.set(currentConfig);
      }
--- 474,483 ----
      }
    }
!  
    /* << tested >> */
    async command void HplTda5250Config.SetRxMode() {
      currentConfig = CONFIG_RX_NTX_RX(currentConfig);
      currentConfig = CONFIG_ALL_PD_NORMAL(currentConfig);
!     if (currentConfig & MASK_CONFIG_CONTROL_TXRX_REGISTER) {
        call CONFIG.set(currentConfig);
      }
***************
*** 491,495 ****
    async command void HplTda5250Config.SetSleepMode() {
      currentConfig = CONFIG_ALL_PD_POWER_DOWN(currentConfig);
!     if (currentConfig | MASK_CONFIG_CONTROL_TXRX_REGISTER) {
        call CONFIG.set(currentConfig);
      }
--- 491,495 ----
    async command void HplTda5250Config.SetSleepMode() {
      currentConfig = CONFIG_ALL_PD_POWER_DOWN(currentConfig);
!     if (currentConfig & MASK_CONFIG_CONTROL_TXRX_REGISTER) {
        call CONFIG.set(currentConfig);
      }
***************
*** 499,502 ****
--- 499,506 ----
      }
    }
+   
+   async command bool HplTda5250Config.IsTxRxPinControlled() {
+     return (currentConfig & MASK_CONFIG_CONTROL_TXRX_REGISTER);
+   }
  
    /****************************************************************

Index: HplTda5250Data.nc
===================================================================
RCS file: /cvsroot/tinyos/tinyos-2.x/tos/chips/tda5250/HplTda5250Data.nc,v
retrieving revision 1.1.2.3
retrieving revision 1.1.2.4
diff -C2 -d -r1.1.2.3 -r1.1.2.4
*** HplTda5250Data.nc	1 Feb 2006 17:44:18 -0000	1.1.2.3
--- HplTda5250Data.nc	3 Aug 2006 18:17:52 -0000	1.1.2.4
***************
*** 61,65 ****
     *         FALSE otherwise.
     */
!   async command bool isTxDone();
  
    /**
--- 61,65 ----
     *         FALSE otherwise.
     */
!   //async command bool isTxDone();
  
    /**
***************
*** 70,103 ****
  
    /**
!    * Enable transmitting over the radio.
!    *
     * @return SUCCESS on success
     *         FAIL otherwise.
     */
!   async command error_t enableTx();
  
-   /**
-    * Disable transmitting over the radio
-    *
-    * @return SUCCESS on success
-    *         FAIL otherwise.
-    */
-   async command error_t disableTx();
  
    /**
!    * Enable receiving over the radio
     *
     * @return SUCCESS on success
     *         FAIL otherwise.
    */
!   async command error_t enableRx();
! 
!   /**
!    * Disable receiving over the radio
!    *
!    * @return SUCCESS on success
!    *         FAIL otherwise.
!    */
!   async command error_t disableRx();
  }
  
--- 70,88 ----
  
    /**
!    * Sets the radio to transmit. 
!    * 
     * @return SUCCESS on success
     *         FAIL otherwise.
     */
!   async command error_t setToTx();
  
  
    /**
!    * Sets the radio to receive.
     *
     * @return SUCCESS on success
     *         FAIL otherwise.
    */
!   async command error_t setToRx();
  }
  

Index: HplTda5250DataP.nc
===================================================================
RCS file: /cvsroot/tinyos/tinyos-2.x/tos/chips/tda5250/HplTda5250DataP.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
*** HplTda5250DataP.nc	31 May 2006 13:53:02 -0000	1.1.2.6
--- HplTda5250DataP.nc	3 Aug 2006 18:17:52 -0000	1.1.2.7
***************
*** 35,38 ****
--- 35,39 ----
   * HplTda5250DataP module
   *
+  * @author Philipp Hupertz (huppertz at tkn.tu-berlin.de)
   * @author Kevin Klues (klues at tkn.tu-berlin.de)
    */
***************
*** 42,53 ****
      interface Init;
      interface HplTda5250Data;
      interface Resource;
    }
    uses {
      interface GeneralIO as DATA;
!     // FIXME: platform dependence at HPL-level!
!     interface HplMsp430Usart as Usart;
!     interface HplMsp430UsartInterrupts as UsartInterrupts;
      interface Resource as UartResource;
    }
  }
--- 43,57 ----
      interface Init;
      interface HplTda5250Data;
+ 
+ //     interface ResourceRequested;
      interface Resource;
+ 
    }
    uses {
      interface GeneralIO as DATA;
!     interface SerialByteComm as Uart;
!     interface Msp430UartControl as UartControl;
      interface Resource as UartResource;
+ //     interface ResourceRequested as UartResourceRequested;
    }
  }
***************
*** 78,88 ****
        return EBUSY;
      }
-     call Usart.setModeUART();
      return SUCCESS;
    }
  
    async command void Resource.release() {
-     call Usart.disableRxIntr();
-     call Usart.disableTxIntr();
      call UartResource.release();
    }
--- 82,89 ----
***************
*** 93,150 ****
  
    event void UartResource.granted() {
-     call Usart.setModeUART();
      signal Resource.granted();
    }
! 
!   async command error_t HplTda5250Data.tx(uint8_t data) {
!     if(call UartResource.isOwner() == FALSE)
!      return FAIL;
!     call Usart.tx(data);
!     return SUCCESS;
!   }
! 
!   async command bool HplTda5250Data.isTxDone() {
!     if(call UartResource.isOwner() == FALSE)
!       return FAIL;
!     return call Usart.isTxEmpty();
!   }
! 
!   async command error_t HplTda5250Data.enableTx() {
!     if(call UartResource.isOwner() == FALSE)
!       return FAIL;
!     call Usart.setModeUART_TX();
!     call Usart.setClockSource(SSEL_SMCLK);
!     call Usart.setClockRate(UBR_SMCLK_38400, UMCTL_SMCLK_38400);
!     call Usart.enableTxIntr();
!     return SUCCESS;
!   }
! 
!   async command error_t HplTda5250Data.disableTx() {
      if(call UartResource.isOwner() == FALSE)
        return FAIL;
!     call Usart.disableUARTTx();
!     call Usart.disableTxIntr();
      return SUCCESS;
    }
  
!   async command error_t HplTda5250Data.enableRx() {
!     if(call UartResource.isOwner() == FALSE)
!       return FAIL;
!     call Usart.setModeUART_RX();
!     call Usart.setClockSource(SSEL_SMCLK);
!     call Usart.setClockRate(UBR_SMCLK_38400, UMCTL_SMCLK_38400);
!     call Usart.enableRxIntr();
!     return SUCCESS;
    }
  
!   async command error_t HplTda5250Data.disableRx() {
      if(call UartResource.isOwner() == FALSE)
        return FAIL;
!     call Usart.disableUARTRx();
!     call Usart.disableRxIntr();
!     return SUCCESS;
    }
  
!   async event void UsartInterrupts.txDone() {
      if(call UartResource.isOwner() == FALSE)
        return;
--- 94,129 ----
  
    event void UartResource.granted() {
      signal Resource.granted();
    }
!   
! //   async event void UartResourceRequested.requested() {
! //     signal ResourceRequested.requested(); 
! //   }
! //   
! //   async event void UartResourceRequested.immediateRequested() {
! //     signal ResourceRequested.immediateRequested(); 
! //   }
!   
!   async command error_t HplTda5250Data.setToTx() {
      if(call UartResource.isOwner() == FALSE)
        return FAIL;
!     call UartControl.setModeTx();
      return SUCCESS;
    }
  
!   async command error_t HplTda5250Data.setToRx() {
!    if(call UartResource.isOwner() == FALSE)
!      return FAIL;
!    call UartControl.setModeRx();
!    return SUCCESS;
    }
  
!   async command error_t HplTda5250Data.tx(uint8_t data) {
      if(call UartResource.isOwner() == FALSE)
        return FAIL;
!     return call Uart.put(data);
    }
  
!   async event void Uart.putDone() {
      if(call UartResource.isOwner() == FALSE)
        return;
***************
*** 152,156 ****
    }
  
!   async event void UsartInterrupts.rxDone(uint8_t data) {
      if(call UartResource.isOwner() == FALSE)
        return;
--- 131,135 ----
    }
  
!   async event void Uart.get(uint8_t data) {
      if(call UartResource.isOwner() == FALSE)
        return;

Index: tda5250_message.h
===================================================================
RCS file: /cvsroot/tinyos/tinyos-2.x/tos/chips/tda5250/tda5250_message.h,v
retrieving revision 1.1.2.2
retrieving revision 1.1.2.3
diff -C2 -d -r1.1.2.2 -r1.1.2.3
*** tda5250_message.h	29 Jan 2006 02:34:56 -0000	1.1.2.2
--- tda5250_message.h	3 Aug 2006 18:17:52 -0000	1.1.2.3
***************
*** 18,22 ****
    nx_uint16_t strength;
    nx_uint8_t ack;
!   nx_uint16_t time;
    nx_uint8_t sendSecurityMode;
    nx_uint8_t receiveSecurityMode;
--- 18,23 ----
    nx_uint16_t strength;
    nx_uint8_t ack;
!   /* local time when message was generated */
!   nx_uint32_t time;
    nx_uint8_t sendSecurityMode;
    nx_uint8_t receiveSecurityMode;

Index: Tda5250RadioC.nc
===================================================================
RCS file: /cvsroot/tinyos/tinyos-2.x/tos/chips/tda5250/Tda5250RadioC.nc,v
retrieving revision 1.1.2.5
retrieving revision 1.1.2.6
diff -C2 -d -r1.1.2.5 -r1.1.2.6
*** Tda5250RadioC.nc	31 May 2006 16:32:43 -0000	1.1.2.5
--- Tda5250RadioC.nc	3 Aug 2006 18:17:52 -0000	1.1.2.6
***************
*** 45,48 ****
--- 45,49 ----
      interface SplitControl;
      interface Tda5250Control;
+ //     interface ResourceRequested;
      interface RadioByteComm;
    }
***************
*** 60,63 ****
--- 61,65 ----
             
    Tda5250Control = Tda5250RadioP;
+ //   ResourceRequested = Tda5250RadioP;
    RadioByteComm = Tda5250RadioP;
    SplitControl = Tda5250RadioP;
***************
*** 67,71 ****
    Tda5250RadioP.ConfigResource -> HplTda5250ConfigC;
    Tda5250RadioP.DataResource -> HplTda5250DataC;
! 
    Tda5250RadioP.HplTda5250Config -> HplTda5250ConfigC;
    Tda5250RadioP.HplTda5250Data -> HplTda5250DataC;
--- 69,74 ----
    Tda5250RadioP.ConfigResource -> HplTda5250ConfigC;
    Tda5250RadioP.DataResource -> HplTda5250DataC;
! //   Tda5250RadioP.DataResourceRequested -> HplTda5250DataC;
!   
    Tda5250RadioP.HplTda5250Config -> HplTda5250ConfigC;
    Tda5250RadioP.HplTda5250Data -> HplTda5250DataC;

Index: Tda5250RadioP.nc
===================================================================
RCS file: /cvsroot/tinyos/tinyos-2.x/tos/chips/tda5250/Tda5250RadioP.nc,v
retrieving revision 1.1.2.7
retrieving revision 1.1.2.8
diff -C2 -d -r1.1.2.7 -r1.1.2.8
*** Tda5250RadioP.nc	21 Jun 2006 14:45:10 -0000	1.1.2.7
--- Tda5250RadioP.nc	3 Aug 2006 18:17:52 -0000	1.1.2.8
***************
*** 51,54 ****
--- 51,55 ----
      interface Tda5250Control;
      interface RadioByteComm;
+ //     interface ResourceRequested;
    }
    uses {
***************
*** 57,60 ****
--- 58,63 ----
      interface Resource as ConfigResource;
      interface Resource as DataResource;
+ //     interface ResourceRequested as DataResourceRequested;
+     
      interface Alarm<T32khz, uint16_t> as DelayTimer;
    }
***************
*** 145,149 ****
              call HplTda5250Config.SetSlaveMode();
              call HplTda5250Config.SetSleepMode();
!             call ConfigResource.release();
              atomic radioMode = RADIO_MODE_SLEEP;
              signal Tda5250Control.SleepModeDone();
--- 148,153 ----
              call HplTda5250Config.SetSlaveMode();
              call HplTda5250Config.SetSleepMode();
!             if (!(call HplTda5250Config.IsTxRxPinControlled()))
!               call ConfigResource.release();
              atomic radioMode = RADIO_MODE_SLEEP;
              signal Tda5250Control.SleepModeDone();
***************
*** 152,155 ****
--- 156,161 ----
              call HplTda5250Config.SetSlaveMode();
              call HplTda5250Config.SetTxMode();
+             if (!(call HplTda5250Config.IsTxRxPinControlled()))
+               call ConfigResource.release();
              atomic delayTimer = TRANSMITTER_DELAY;
              call DelayTimer.start(TDA5250_TRANSMITTER_SETUP_TIME);
***************
*** 158,161 ****
--- 164,169 ----
              call HplTda5250Config.SetSlaveMode();
              call HplTda5250Config.SetRxMode();
+             if (!(call HplTda5250Config.IsTxRxPinControlled()))
+               call ConfigResource.release();
              atomic delayTimer = RECEIVER_DELAY;
              call DelayTimer.start(TDA5250_RECEIVER_SETUP_TIME);
***************
*** 187,196 ****
          switch(mode) {
            case RADIO_MODE_TX_TRANSITION:
!             call HplTda5250Data.enableTx();
              atomic radioMode = RADIO_MODE_TX;
              signal Tda5250Control.TxModeDone();
              break;
            case RADIO_MODE_RX_TRANSITION:
!             call HplTda5250Data.enableRx();
              atomic radioMode = RADIO_MODE_RX;
              signal Tda5250Control.RxModeDone();
--- 195,204 ----
          switch(mode) {
            case RADIO_MODE_TX_TRANSITION:
!             call HplTda5250Data.setToTx();
              atomic radioMode = RADIO_MODE_TX;
              signal Tda5250Control.TxModeDone();
              break;
            case RADIO_MODE_RX_TRANSITION:
!             call HplTda5250Data.setToRx();
              atomic radioMode = RADIO_MODE_RX;
              signal Tda5250Control.RxModeDone();
***************
*** 204,207 ****
--- 212,224 ----
          switchDataResource();
        }
+       
+       // information for higher layers that the DataResource has been requested
+ //       async event void DataResourceRequested.requested() {
+ //         signal ResourceRequested.requested();
+ //       }
+ 
+ //       async event void DataResourceRequested.immediateRequested() {
+ //         signal ResourceRequested.immediateRequested();
+ //       }
  
    /**
***************
*** 210,213 ****
--- 227,231 ----
    */
        async command error_t Tda5250Control.TimerMode(float on_time, float off_time) {
+         radioMode_t mode;
          atomic {
            if(radioBusy() == FALSE) {
***************
*** 216,227 ****
              offTime = off_time;
            }
          }
          if(radioMode == RADIO_MODE_TIMER_TRANSITION) {
            call DataResource.release();
!           if (call ConfigResource.immediateRequest() == SUCCESS) {
!             switchConfigResource();
!           } else {
              call ConfigResource.request();
!           }
            return SUCCESS;
          }
--- 234,246 ----
              offTime = off_time;
            }
+           mode = radioMode;
          }
          if(radioMode == RADIO_MODE_TIMER_TRANSITION) {
            call DataResource.release();
!          if (call ConfigResource.immediateRequest() == SUCCESS) {
!            switchConfigResource();
!          } else {
              call ConfigResource.request();
!          }
            return SUCCESS;
          }
***************
*** 230,237 ****
--- 249,258 ----
  
        async command error_t Tda5250Control.ResetTimerMode() {
+         radioMode_t mode;
          atomic {
            if(radioBusy() == FALSE) {
              radioMode = RADIO_MODE_TIMER_TRANSITION;
            }
+           mode = radioMode;
          }
          if(radioMode == RADIO_MODE_TIMER_TRANSITION) {
***************
*** 248,251 ****
--- 269,273 ----
  
        async command error_t Tda5250Control.SelfPollingMode(float on_time, float off_time) {
+         radioMode_t mode;
          atomic {
            if(radioBusy() == FALSE) {
***************
*** 254,257 ****
--- 276,280 ----
              offTime = off_time;
            }
+           mode = radioMode;
          }
          if(radioMode == RADIO_MODE_SELF_POLLING_TRANSITION) {
***************
*** 268,275 ****
--- 291,300 ----
  
        async command error_t Tda5250Control.ResetSelfPollingMode() {
+         radioMode_t mode;
          atomic {
            if(radioBusy() == FALSE) {
              radioMode = RADIO_MODE_SELF_POLLING_TRANSITION;
            }
+           mode = radioMode;
          }
          if(radioMode == RADIO_MODE_SELF_POLLING_TRANSITION) {
***************
*** 288,304 ****
          radioMode_t mode;
          atomic{
-           mode = radioMode;
            if(radioBusy() == FALSE) {
!             mode = radioMode = RADIO_MODE_SLEEP_TRANSITION;
            }
          }
          if(mode == RADIO_MODE_SLEEP_TRANSITION) {
-           call HplTda5250Data.disableTx();	
-           call HplTda5250Data.disableRx();	
            call DataResource.release();
!           if (call ConfigResource.immediateRequest() == SUCCESS) {
              switchConfigResource();
            } else {
!             call ConfigResource.request();
            }
            return SUCCESS;
--- 313,331 ----
          radioMode_t mode;
          atomic{
            if(radioBusy() == FALSE) {
!             radioMode = RADIO_MODE_SLEEP_TRANSITION;
            }
+           mode = radioMode;
          }
          if(mode == RADIO_MODE_SLEEP_TRANSITION) {
            call DataResource.release();
!           if (call HplTda5250Config.IsTxRxPinControlled()) {
              switchConfigResource();
            } else {
!             if (call ConfigResource.immediateRequest() == SUCCESS) {
!               switchConfigResource();
!             } else {
!               call ConfigResource.request();
!             }
            }
            return SUCCESS;
***************
*** 310,323 ****
          radioMode_t mode;
          atomic {
!           if(radioBusy() == FALSE)
              radioMode = RADIO_MODE_TX_TRANSITION;
          }
-         atomic mode = radioMode;
          if(mode == RADIO_MODE_TX_TRANSITION) {
            call DataResource.release();
!           if (call ConfigResource.immediateRequest() == SUCCESS) {
              switchConfigResource();
            } else {
!             call ConfigResource.request();
            }
            return SUCCESS;
--- 337,355 ----
          radioMode_t mode;
          atomic {
!           if(radioBusy() == FALSE) {
              radioMode = RADIO_MODE_TX_TRANSITION;
+           }
+           mode = radioMode;
          }
          if(mode == RADIO_MODE_TX_TRANSITION) {
            call DataResource.release();
!           if (call HplTda5250Config.IsTxRxPinControlled()) {
              switchConfigResource();
            } else {
!             if (call ConfigResource.immediateRequest() == SUCCESS) {
!               switchConfigResource();
!             } else {
!               call ConfigResource.request();
!             }
            }
            return SUCCESS;
***************
*** 332,343 ****
              radioMode = RADIO_MODE_RX_TRANSITION;
            }
          }
-         atomic mode = radioMode;
          if(mode == RADIO_MODE_RX_TRANSITION) {
            call DataResource.release();
!           if (call ConfigResource.immediateRequest() == SUCCESS) {
              switchConfigResource();
            } else {
!             call ConfigResource.request();
            }
            return SUCCESS;
--- 364,379 ----
              radioMode = RADIO_MODE_RX_TRANSITION;
            }
+           mode = radioMode;
          }
          if(mode == RADIO_MODE_RX_TRANSITION) {
            call DataResource.release();
!           if (call HplTda5250Config.IsTxRxPinControlled()) {
              switchConfigResource();
            } else {
!             if (call ConfigResource.immediateRequest() == SUCCESS) {
!               switchConfigResource();
!             } else {
!               call ConfigResource.request();
!             }
            }
            return SUCCESS;
***************
*** 365,369 ****
  
        async command bool RadioByteComm.isTxDone() {
!         return call HplTda5250Data.isTxDone();
        }
        
--- 401,406 ----
  
        async command bool RadioByteComm.isTxDone() {
!         //return call HplTda5250Data.isTxDone();
!         return TRUE;
        }
        
***************
*** 379,383 ****
              delayTimer = RSSISTABLE_DELAY;
              call DelayTimer.start(TDA5250_RSSI_STABLE_TIME-TDA5250_RECEIVER_SETUP_TIME);
-             call ConfigResource.release();
              if (call DataResource.immediateRequest() == SUCCESS) {
                switchDataResource();
--- 416,419 ----
***************
*** 387,392 ****
              break;
            case TRANSMITTER_DELAY :
!             call ConfigResource.release();
!             if (call DataResource.immediateRequest() == SUCCESS) {
                switchDataResource();
              } else {
--- 423,427 ----
              break;
            case TRANSMITTER_DELAY :
!            if (call DataResource.immediateRequest() == SUCCESS) {
                switchDataResource();
              } else {
***************
*** 397,400 ****
--- 432,439 ----
        }
  
+ //       default async event void ResourceRequested.requested() {
+ //       }
+ //       default async event void ResourceRequested.immediateRequested() {
+ //       }
        default async event void Tda5250Control.TimerModeDone(){
        }

Index: Tda5250RegCommP.nc
===================================================================
RCS file: /cvsroot/tinyos/tinyos-2.x/tos/chips/tda5250/Tda5250RegCommP.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
*** Tda5250RegCommP.nc	31 May 2006 13:53:02 -0000	1.1.2.6
--- Tda5250RegCommP.nc	3 Aug 2006 18:17:52 -0000	1.1.2.7
***************
*** 84,100 ****
     async command error_t Tda5250RegComm.writeByte(uint8_t address, uint8_t data) {
       uint8_t rxbyte;
!      // FIXME: nobody seems to care in HplTda5250Config if call is not successfull, so why should we care here....
! //     if(call SpiResource.isOwner() == FALSE) {
! //       return FAIL;
! //     }
       call SpiByte.write(address,&rxbyte);
       call SpiByte.write(data,&rxbyte);
       return SUCCESS;
     }
     async command error_t Tda5250RegComm.writeWord(uint8_t address, uint16_t data) {
        uint8_t rxbyte;
!       // FIXME: nobody seems to care in HplTda5250Config if call is not successfull, so why should we care here....
!       // if(call SpiResource.isOwner() == FALSE)
!       //   return FAIL;
        call SpiByte.write(address, &rxbyte);
        call SpiByte.write(((uint8_t) (data >> 8)),&rxbyte);
--- 84,99 ----
     async command error_t Tda5250RegComm.writeByte(uint8_t address, uint8_t data) {
       uint8_t rxbyte;
!      if(call SpiResource.isOwner() == FALSE) {
!        return FAIL;
!      }
       call SpiByte.write(address,&rxbyte);
       call SpiByte.write(data,&rxbyte);
       return SUCCESS;
     }
+    
     async command error_t Tda5250RegComm.writeWord(uint8_t address, uint16_t data) {
        uint8_t rxbyte;
!       if(call SpiResource.isOwner() == FALSE)
!         return FAIL;
        call SpiByte.write(address, &rxbyte);
        call SpiByte.write(((uint8_t) (data >> 8)),&rxbyte);



More information about the Tinyos-2-commits mailing list