hi bart,

the variables in transferdone are doing buffer accounting.

DMA0DA is the dma module's destination address. if you put six bytes in, you've gotta move the pointer so that next transfer doesn't overwrite them. if each transfer is six bytes, and the buffer is 1024 bytes (512 * 2), then how many transfers does the buffer hold? get it?

adapt this to your new scheme, and you'll be all set.

-steve

On 10/06/2011 09:27 AM, Jansen, Bart wrote:
Hello,

In order to both log gyro and accelerometer data to the sd card in the
justfatlogging demo, I’ve added the gyro initialization (based on the
boilerplate). However, the app only seems to write the accelerometer
signal to the sd card. I had the impression that the writing to the sd
is scalable to the number of channels (by reading NUM_ADC_CHANS), which
does not seem to be the case.

I’ve verified that this variable is now 6.

Is it ok to leave the transferDone unchanged for my purpose, as below?

async event void DMA0.transferDone(error_t success) {

// call Leds.led0Toggle();

dma_blocks++;

atomic DMA0DA += 6;

if(dma_blocks == 170){

dma_blocks = 0;

if(current_buffer == 0){

call DMA0.repeatTransfer((void *)ADC12MEM0_, (void *)sbuf1, NUM_ADC_CHANS);

current_buffer = 1;

}

else {

call DMA0.repeatTransfer((void *)ADC12MEM0_, (void *)sbuf0, NUM_ADC_CHANS);

current_buffer = 0;

}

post store_contents();

}

}

What is exactly happening with the 170 dma_blocks and the atomic DMA0DA
+= 6 ?

Thanks a lot for your help,

Bart



_______________________________________________
Shimmer-users mailing list
[email protected]
https://lists.eecs.harvard.edu/mailman/listinfo/shimmer-users
_______________________________________________
Shimmer-users mailing list
[email protected]
https://lists.eecs.harvard.edu/mailman/listinfo/shimmer-users

Reply via email to