[Tinyos-contrib-commits] CVS: tinyos-1.x/contrib/handhelds/apps/SixAxisTransmitter SixAxisTransmitterM.nc, 1.2, 1.3

steve ayer ayer1 at users.sourceforge.net
Wed Jun 13 11:31:10 PDT 2007


Update of /cvsroot/tinyos/tinyos-1.x/contrib/handhelds/apps/SixAxisTransmitter
In directory sc8-pr-cvs10.sourceforge.net:/tmp/cvs-serv13312

Modified Files:
	SixAxisTransmitterM.nc 
Log Message:

in ship_contents(), added connectivity check before socket send;
cc2420 gets into a bad state if txfifo is blasted while disconnected.

also, increased conversion buffers size (and correspondig number of
conversions) to accomodate for greater capacity of udp packets over tcp

Index: SixAxisTransmitterM.nc
===================================================================
RCS file: /cvsroot/tinyos/tinyos-1.x/contrib/handhelds/apps/SixAxisTransmitter/SixAxisTransmitterM.nc,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** SixAxisTransmitterM.nc	2 May 2007 16:44:42 -0000	1.2
--- SixAxisTransmitterM.nc	13 Jun 2007 18:31:08 -0000	1.3
***************
*** 76,80 ****
    uint8_t enable_shipping = 0;
    norace uint8_t current_buffer = 0, dma_blocks = 0;
!   uint16_t sbuf0[36], sbuf1[36], dmadain, wheressbuf0, sample_period = 5;
    uint8_t msgbuf[128];
    struct udp_address udpaddr;
--- 76,80 ----
    uint8_t enable_shipping = 0;
    norace uint8_t current_buffer = 0, dma_blocks = 0;
!   uint16_t sbuf0[42], sbuf1[42], dmadain, wheressbuf0, sample_period = 5;
    uint8_t msgbuf[128];
    struct udp_address udpaddr;
***************
*** 145,152 ****
    task void ship_contents() {
      if(enable_shipping){
!       if(current_buffer == 1)
! 	call UDPClient.send((uint8_t *)sbuf0, 72);
!       else
! 	call UDPClient.send((uint8_t *)sbuf1, 72);
      }
    }
--- 145,154 ----
    task void ship_contents() {
      if(enable_shipping){
!       if(call Client.is_connected()){
! 	if(current_buffer == 1)
! 	  call UDPClient.send((uint8_t *)sbuf0, 84);
! 	else
! 	  call UDPClient.send((uint8_t *)sbuf1, 84);
!       }
      }
    }
***************
*** 337,341 ****
      dma_blocks++;
      atomic DMA0DA += 12;
!     if(dma_blocks == 6){
        dma_blocks = 0;
  
--- 339,343 ----
      dma_blocks++;
      atomic DMA0DA += 12;
!     if(dma_blocks == 7){
        dma_blocks = 0;
  



More information about the Tinyos-contrib-commits mailing list