Hi All
I am trying to call readStream.read(100) from the readStream.readDone
through a task
the code snippet is as follows :
========================
event void ReadStream.readDone(error_t result, uint32_t actualPeriod)
{
if (result == SUCCESS && streamSuccess)
{
call Leds.led2Toggle();
printf("Here is a the actual Period: %ld\n",actualPeriod);
printf("The size of the buffer filled is: %u\n",BUF_SIZE);
while(i<BUF_SIZE){
temp=temp+buf[i];
i++;
}
printf("temp Value is: %ld\n",temp);
temp=temp/BUF_SIZE;
printf("Average Value is: %ld\n",temp);
printfflush();
post sampleData();
}
}
task void sampleData(){
call Leds.led1Toggle();
//call ReadStream.postBuffer(buf, BUF_SIZE);
call ReadStream.read(100);
}
============
the readStream is wired to MicStreamC .
the printed values are
temp =503990
average=503
then second iteration
temp=503
average=0
and then all loops that follow have 0 for both values
while the actualPeriod returned continues to be 342 microseconds while I had
asked for 100 microseconds.
Can someone please guide me where I cam going wrong here
thanks
Akankshu Dhawan
--
First they ignore you, then they laugh at you, then they fight you, then you
win.
- Mahatma Gandhi
_______________________________________________
Tinyos-help mailing list
[email protected]
https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help