Hi,
I'm wrapping my head around the BoilerPlate firmware, specifically the call
graph and flow of data. So far so good, but I'm curious about the usage of the
'current_buffer' variable.
async event void DMA0.transferDone(error_t success) {
if(current_buffer == 0){
call DMA0.repeatTransfer((void*)ADC12MEM0_, (void*)sbuf1,
nbr_adc_chans);
atomic timestamp1 = call LocalTime.get();
//current_buffer = 1;
}
else {
call DMA0.repeatTransfer((void*)ADC12MEM0_, (void*)sbuf0,
nbr_adc_chans);
atomic timestamp0 = call LocalTime.get();
//current_buffer = 0;
}
if(nbr_digi_chans > 0)
post clockin_result();
else
post sendSensorData();
}
This is the event handler where it starts. During the first sampling, the DMA0
is setup with 'sbuf0' as destination for the sensor data and 'current_buffer' i
0. Good. Now, when the first sampling is done and the data is ready in the
DMA0, this data is accessible through 'sbuf0'. But why does this event handler
then call DMA0.RepeatTransfer(...) with 'sbuf1' when 'current_buffer' is 0? To
my best knowledge, at this point 'sbuf0' and 'sbuf1' will contain the same data.
Am I wrong?
Kind regards,
Anders
_______________________________________________
Shimmer-users mailing list
[email protected]
https://lists.eecs.harvard.edu/mailman/listinfo/shimmer-users