[Tinyos-contrib-commits]
CVS: tinyos-1.x/contrib/handhelds/swtest/TestDMA_SD
TestDMA_SD.nc, 1.1, 1.2 TestDMA_SD_M.nc, 1.2,
1.3 remote_client.c, 1.1, 1.2
steve ayer
ayer1 at users.sourceforge.net
Wed Dec 13 10:40:49 PST 2006
Update of /cvsroot/tinyos/tinyos-1.x/contrib/handhelds/swtest/TestDMA_SD
In directory sc8-pr-cvs10.sourceforge.net:/tmp/cvs-serv8865
Modified Files:
TestDMA_SD.nc TestDMA_SD_M.nc remote_client.c
Log Message:
added updates to handle missed dma transfer cues, removal of
dma_transfers variable...
Index: TestDMA_SD.nc
===================================================================
RCS file: /cvsroot/tinyos/tinyos-1.x/contrib/handhelds/swtest/TestDMA_SD/TestDMA_SD.nc,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** TestDMA_SD.nc 3 Aug 2006 19:16:49 -0000 1.1
--- TestDMA_SD.nc 13 Dec 2006 18:40:47 -0000 1.2
***************
*** 42,47 ****
--- 42,50 ----
SD_M,
SDC,
+ MMA7260_AccelM,
TimerC,
LedsC,
+ // NTPClientM,
+ TimeM,
IPCLIENT as IPClientC,
TelnetM,
***************
*** 50,53 ****
--- 53,57 ----
Main.StdControl->TestDMA_SD_M;
Main.StdControl->TimerC;
+ Main.StdControl->TimeM;
/* have to fix compile time channel limitation */
***************
*** 55,66 ****
TestDMA_SD_M.DMA1 -> DMA_M.DMA[1];
TestDMA_SD_M.DMA2 -> DMA_M.DMA[2];
! TestDMA_SD_M.Leds -> LedsC;
TestDMA_SD_M.yTimer -> TimerC.Timer[unique("Timer")];
! TestDMA_SD_M.gTimer -> TimerC.Timer[unique("Timer")];
! TestDMA_SD_M.rTimer -> TimerC.Timer[unique("Timer")];
!
TestDMA_SD_M.SDStdControl -> SDC;
TestDMA_SD_M.SD -> SD_M;
/* telnet stuff */
TestDMA_SD_M.IPStdControl -> IPClientC;
--- 59,72 ----
TestDMA_SD_M.DMA1 -> DMA_M.DMA[1];
TestDMA_SD_M.DMA2 -> DMA_M.DMA[2];
! TestDMA_SD_M.Leds -> LedsC;
TestDMA_SD_M.yTimer -> TimerC.Timer[unique("Timer")];
! TestDMA_SD_M.Time -> TimeM;
!
TestDMA_SD_M.SDStdControl -> SDC;
TestDMA_SD_M.SD -> SD_M;
+ TestDMA_SD_M.AccelStdControl -> MMA7260_AccelM;
+ TestDMA_SD_M.Accel -> MMA7260_AccelM;
+
/* telnet stuff */
TestDMA_SD_M.IPStdControl -> IPClientC;
***************
*** 74,77 ****
--- 80,87 ----
TestDMA_SD_M.TelnetStdControl -> TelnetM;
+ TimeM.LocalTime -> TimerC;
+ TimeM.Timer -> TimerC.Timer[unique("Timer")];
+ TestDMA_SD_M.LocalTime -> TimerC;
+
TelnetM.TCPServer -> IPClientC.TCPServer[unique("TCPServer")];
Index: TestDMA_SD_M.nc
===================================================================
RCS file: /cvsroot/tinyos/tinyos-1.x/contrib/handhelds/swtest/TestDMA_SD/TestDMA_SD_M.nc,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** TestDMA_SD_M.nc 25 Oct 2006 13:52:12 -0000 1.2
--- TestDMA_SD_M.nc 13 Dec 2006 18:40:47 -0000 1.3
***************
*** 90,94 ****
void * server_token;
! uint8_t dma_transfers, write_step, myreason = 0;
uint16_t inbuf0[256], inbuf1[256], inbuf2[256], *curr0, *curr1, *curr2, shipping_sector;
norace uint32_t current_sector = 52999;
--- 90,94 ----
void * server_token;
! uint8_t write_step, myreason = 0;
uint16_t inbuf0[256], inbuf1[256], inbuf2[256], *curr0, *curr1, *curr2, shipping_sector;
norace uint32_t current_sector = 52999;
***************
*** 185,222 ****
uint8_t rval;
- dma_transfers++;
call Leds.orangeToggle();
! if(dma_transfers == 255){
! /*
! call DMA0.stopTransfer();
! call DMA1.stopTransfer();
! call DMA2.stopTransfer();
! */
! call DMA0.ADCstopConversion();
! dma_transfers = 0;
! call DMA0.setDestinationAddress(inbuf0);
! call DMA1.setDestinationAddress(inbuf1);
! call DMA2.setDestinationAddress(inbuf2);
!
! call Leds.yellowOn();
! if((rval = call SD.writeSector(current_sector++, (uint8_t *)inbuf0)))
! sprintf(msgbuf, "bad write, error=%d", rval);
! if((rval = call SD.writeSector(current_sector++, (uint8_t *)inbuf1)))
! sprintf(msgbuf, "bad write, error=%d", rval);
! if((rval = call SD.writeSector(current_sector++, (uint8_t *)inbuf2)))
! sprintf(msgbuf, "bad write, error=%d", rval);
! call Leds.yellowOff();
! call DMA0.ADCbeginConversion();
! /*
! call DMA0.beginTransfer();
! call DMA1.beginTransfer();
! call DMA2.beginTransfer();
! */
! }
}
--- 185,204 ----
uint8_t rval;
call Leds.orangeToggle();
! call DMA0.ADCstopConversion();
! call Leds.yellowOn();
! if((rval = call SD.writeSector(current_sector++, (uint8_t *)inbuf0)))
! sprintf(msgbuf, "bad write, error=%d", rval);
! if((rval = call SD.writeSector(current_sector++, (uint8_t *)inbuf1)))
! sprintf(msgbuf, "bad write, error=%d", rval);
! if((rval = call SD.writeSector(current_sector++, (uint8_t *)inbuf2)))
! sprintf(msgbuf, "bad write, error=%d", rval);
! call Leds.yellowOff();
! call DMA0.ADCbeginConversion();
}
***************
*** 230,235 ****
call AccelStdControl.init();
! dma_transfers = 0;
!
memset(inbuf0, 0, sizeof(inbuf0));
curr0 = inbuf0;
--- 212,221 ----
call AccelStdControl.init();
! /* put the roving radio bt module to sleep
! TOSH_SEL_GIO1_IOFUNC();
! TOSH_MAKE_GIO1_OUTPUT();
! TOSH_SET_GIO1_PIN();
! TOSH_CLR_BT_RESET_PIN();
! */
memset(inbuf0, 0, sizeof(inbuf0));
curr0 = inbuf0;
***************
*** 492,496 ****
const struct Param s_DMA0Output[] = {
{ "current sector", PARAM_TYPE_UINT32, ¤t_sector },
- { "dma transfers", PARAM_TYPE_UINT8, &dma_transfers },
{ "error_reason", PARAM_TYPE_UINT8, &myreason },
{ "card size", PARAM_TYPE_UINT32, &howbig },
--- 478,481 ----
***************
*** 515,519 ****
};
struct ParamList g_ADCRegsList = { "adcregs", &s_ADCRegs[0] };
! struct ParamList g_DMA0OutList = { "output0", &s_DMA0Output[0] };
struct ParamList g_DMARegsList = { "dmaregs", &s_DMARegs[0] };
--- 500,504 ----
};
struct ParamList g_ADCRegsList = { "adcregs", &s_ADCRegs[0] };
! struct ParamList g_DMA0OutList = { "z", &s_DMA0Output[0] };
struct ParamList g_DMARegsList = { "dmaregs", &s_DMARegs[0] };
Index: remote_client.c
===================================================================
RCS file: /cvsroot/tinyos/tinyos-1.x/contrib/handhelds/swtest/TestDMA_SD/remote_client.c,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** remote_client.c 3 Aug 2006 19:16:49 -0000 1.1
--- remote_client.c 13 Dec 2006 18:40:47 -0000 1.2
***************
*** 1,3 ****
--- 1,4 ----
#include <stdio.h>
+ #include <stdlib.h>
#include <sys/types.h>
#include <sys/socket.h>
***************
*** 8,12 ****
#include <unistd.h>
! #define HOSTNAME "63.118.194.202"
#define oops(msg) {perror(msg); exit(-1);}
#define CLIENT_IO "r"
--- 9,13 ----
#include <unistd.h>
! #define HOSTNAME "65.202.3.110"
#define oops(msg) {perror(msg); exit(-1);}
#define CLIENT_IO "r"
***************
*** 50,54 ****
memset(buf2, ' ', BUFFSIZE * sizeof(unsigned short));
! while(connect(s, &saddr, slen));
fprintf(stderr, "Connected\n");
--- 51,55 ----
memset(buf2, ' ', BUFFSIZE * sizeof(unsigned short));
! while(connect(s, (struct sockaddr *)&saddr, slen));
fprintf(stderr, "Connected\n");
More information about the Tinyos-contrib-commits
mailing list