[Tinyos-2-commits] CVS: tinyos-2.x/tos/lib/serial SerialP.nc, 1.1.2.8, 1.1.2.9

David Gay idgay at users.sourceforge.net
Tue May 2 07:50:01 PDT 2006


Update of /cvsroot/tinyos/tinyos-2.x/tos/lib/serial
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv16071

Modified Files:
      Tag: tinyos-2_0_devel-BRANCH
	SerialP.nc 
Log Message:
fix for one-byte-too-many in serial packets


Index: SerialP.nc
===================================================================
RCS file: /cvsroot/tinyos/tinyos-2.x/tos/lib/serial/Attic/SerialP.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
*** SerialP.nc	14 Feb 2006 17:01:44 -0000	1.1.2.8
--- SerialP.nc	2 May 2006 14:49:58 -0000	1.1.2.9
***************
*** 670,683 ****
          
        case TXSTATE_INFO:
!         atomic {          
            txResult = call SerialFrameComm.putData(txBuf[txIndex].buf);
            txCRC = crcByte(txCRC,txBuf[txIndex].buf);
            ++txByteCnt;
            
            if (txBuf[txIndex].state == BUFFER_COMPLETE || txByteCnt >= SERIAL_MTU){
              txState = TXSTATE_FCS1;
            }
            else { /* never called on ack b/c ack is BUFFER_COMPLETE initially */
!             txBuf[txIndex].buf = signal SendBytePacket.nextByte();
            }
          }
--- 670,686 ----
          
        case TXSTATE_INFO:
!         atomic {
! 	  uint8_t nextByte;
! 
            txResult = call SerialFrameComm.putData(txBuf[txIndex].buf);
            txCRC = crcByte(txCRC,txBuf[txIndex].buf);
            ++txByteCnt;
            
+ 	  nextByte = signal SendBytePacket.nextByte();
            if (txBuf[txIndex].state == BUFFER_COMPLETE || txByteCnt >= SERIAL_MTU){
              txState = TXSTATE_FCS1;
            }
            else { /* never called on ack b/c ack is BUFFER_COMPLETE initially */
!             txBuf[txIndex].buf = nextByte;
            }
          }



More information about the Tinyos-2-commits mailing list