[Tinyos-help] How to search in "mail archives" effectively?

Ning Dai byron.dai at gmail.com
Wed Sep 7 09:46:45 PDT 2005


It worked well. Thanks Joe. 

I did exercise in tutorial lesson 2, but I'm not sure whether I did it right 
or not. I add an component variable sensor_reading and post an task in 
ADC.dataReady(). If I don't use atomic in the task, I will get the below 
compiling warning. After I added atomic in the task, the app passed 
compilation and run well in the TOSSIM. I found an old email mentioned by *
Kristin* that I have to use the task in this exercise.

Can anybody take a glimpse whether my code is correct?
-NING 
---------------------------------------------------------------------
$ make pc
compiling Sense to a pc binary
ncc -o build/pc/main.exe -g -O0 -board=micasb -pthread -target=pc -Wall 
-Wshado
w -DDEF_TOS_AM_GROUP=0x7d -Wnesc-all -fnesc-nido-tosnodes=1000 
-fnesc-cfile=buil
d/pc/app.c Sense.nc <http://Sense.nc> -lm
SenseM.nc:60: warning: non-atomic accesses to shared variable 
`sensor_reading':
SenseM.nc:88: warning: non-atomic read
SenseM.nc:96: warning: non-atomic read
SenseM.nc:104: warning: non-atomic read
gcc: unrecognized option `-pthread'
compiled Sense to build/pc/main.exe
43520 bytes in ROM
638608 bytes in RAM
---------------------------------------------------------------------
task void playChirp() 
{
atomic{
if (sensor_reading &1){
call SounderControl.start();
dbg(DBG_USR1, "\nChirping on");
}
else{ 
call SounderControl.stop();
dbg(DBG_USR1, "\nChirping off");
}
if (sensor_reading &2){
call SounderControl.start();
dbg(DBG_USR1, "\nChirping on");
}
else{
call SounderControl.stop();
dbg(DBG_USR1, "\nChirping off");
} 
if (sensor_reading &4){
call SounderControl.start();
dbg(DBG_USR1, "\nChirping on");
}

else{
call SounderControl.stop();
dbg(DBG_USR1, "\nChirping off");
}
}
} 
... ...
async event result_t ADC.dataReady(uint16_t data) {
atomic{
sensor_reading = 7-((data>>7) &0x7);
display(sensor_reading);
}
post playChirp();
return SUCCESS;
}

On 9/7/05, Joe Polastre <joe at polastre.com> wrote:
> 
> Use google instead :)
> 
> "search term" site:mail.millennium.berkeley.edu<http://mail.millennium.berkeley.edu>
> 
> will help you out.
> 
> -Joe
> 
> On 9/6/05, Ning Dai <byron.dai at gmail.com> wrote:
> > Hi,
> >
> > When I searched the mail archives, I could only get the 100 matches in
> > "time", "reverse time" or other orders. I wonder whether there is a way 
> to
> > get all the searching
> >
> > result besides searching in every Gzip'd text archives. Because I'm a
> > newbie to TinyOS, I guess I can usually find the answers to my questions 
> in
> > the archives.
> >
> > I'm specially interested in the answers to the exercises at the end of
> > tutorial lessons, but it's a little difficult to find them.
> >
> > I'd appreciate if anyone can help me on this.
> >
> > Regards
> > -NING
> >
> > _______________________________________________
> > Tinyos-help mailing list
> > Tinyos-help at Millennium.Berkeley.EDU
> > 
> https://mail.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help
> >
> >
> >
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.millennium.berkeley.edu/pipermail/tinyos-help/attachments/20050907/58395298/attachment.html


More information about the Tinyos-help mailing list