[Tinyos-2-commits] CVS: tinyos-2.x/tos/chips/tda5250 Tda5250RegCommP.nc, 1.1.2.8, 1.1.2.9

Jonathan Hui jwhui at users.sourceforge.net
Thu Sep 28 12:26:24 PDT 2006


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

Modified Files:
      Tag: tinyos-2_0_devel-BRANCH
	Tda5250RegCommP.nc 
Log Message:

Changes to SpiByte interface. Return received byte since error_t is no
longer returned.



Index: Tda5250RegCommP.nc
===================================================================
RCS file: /cvsroot/tinyos/tinyos-2.x/tos/chips/tda5250/Tda5250RegCommP.nc,v
retrieving revision 1.1.2.8
retrieving revision 1.1.2.9
diff -C2 -d -r1.1.2.8 -r1.1.2.9
*** Tda5250RegCommP.nc	15 Aug 2006 11:59:09 -0000	1.1.2.8
--- Tda5250RegCommP.nc	28 Sep 2006 19:26:22 -0000	1.1.2.9
***************
*** 83,113 ****
  
     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);
!       call SpiByte.write(((uint8_t) data),&rxbyte);
        return SUCCESS;
     }
  
     async command uint8_t Tda5250RegComm.readByte(uint8_t address){
-       uint8_t rxbyte;
        if(call SpiResource.isOwner() == FALSE)
          return 0x00;
!       call SpiByte.write(address, &rxbyte);
  
        // FIXME: Put SIMO/SOMI in input
!       call SpiByte.write(0x00, &rxbyte);
        return rxbyte;
     }
--- 83,110 ----
  
     async command error_t Tda5250RegComm.writeByte(uint8_t address, uint8_t data) {
       if(call SpiResource.isOwner() == FALSE) {
         return FAIL;
       }
!      call SpiByte.write(address);
!      call SpiByte.write(data);
       return SUCCESS;
     }
     
     async command error_t Tda5250RegComm.writeWord(uint8_t address, uint16_t data) {
        if(call SpiResource.isOwner() == FALSE)
          return FAIL;
!       call SpiByte.write(address);
!       call SpiByte.write(((uint8_t) (data >> 8)));
!       call SpiByte.write(((uint8_t) data));
        return SUCCESS;
     }
  
     async command uint8_t Tda5250RegComm.readByte(uint8_t address){
        if(call SpiResource.isOwner() == FALSE)
          return 0x00;
!       call SpiByte.write(address);
  
        // FIXME: Put SIMO/SOMI in input
!       call SpiByte.write(0x00);
        return rxbyte;
     }



More information about the Tinyos-2-commits mailing list