On Mon, May 27, 2013 at 7:31 PM, He Dajiang (I2R) <[email protected]>wrote:

> for u to pass compiling, you must code ADC.dataReady like this:
>     async event result_t ADC.dataReady(uint16_t dummy) {
> even you don't use the "dummy" parameter.
>
> To get rid of those warnings, declare your variables like:
>     norace  uint16_t dataValue
> * if you are sure there is no race condition*; or access variables like:
>

you really want to make sure you understand what is going on with the race
condition.

Blindly applying "norace" is asking for trouble.

nesc knows how to check for race conditions between task context
(non-interrupt code) and async level which typically is interrupt code.

If you don't know what this means you should read...
 doc/pdf/tinyos-programming.pdf in the release tree.   Section 4.5 on
Concurrency.

If you still don't understand, you should read up on concurrency and mutual
exclusion in any operating system text.


>    atomic {
>       dataValue = xxx;
>    }
>
> ________________________________________
> From: [email protected] [
> [email protected]] on behalf of
> [email protected] [
> [email protected]]
> Sent: Tuesday, 28 May, 2013 3:00:03 AM
> To: [email protected]
> Subject: Tinyos-help Digest, Vol 121, Issue 28
>
> Send Tinyos-help mailing list submissions to
>         [email protected]
>
> To subscribe or unsubscribe via the World Wide Web, visit
>
> https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help
>
> or, via email, send a message with subject or body 'help' to
>         [email protected]
>
> You can reach the person managing the list at
>         [email protected]
>
> When replying, please edit your Subject line so it is more specific
> than "Re: Contents of Tinyos-help digest..."
>
>
> Today's Topics:
>
>    1. Re: send a packet (He Dajiang (I2R))
>    2. Re: send a packet (Eric Decker)
>    3. no compile ([email protected])
>    4. to fix a parameter ([email protected])
>
>
> ----------------------------------------------------------------------
>
> Message: 1
> Date: Mon, 27 May 2013 01:50:43 +0000
> From: "He Dajiang (I2R)" <[email protected]>
> Subject: Re: [Tinyos-help] send a packet
> To: "[email protected]"
>         <[email protected]>
> Message-ID:
>
> <F726DEB3CA4E28449D635321F51C8A90315C0E@S3-EXCHMB07.shared-svc.local>
> Content-Type: text/plain; charset="us-ascii"
>
> CC2420 can transmit payload of more than 100 bytes.
>
> Institute for Infocomm Research disclaimer:  "This email is confidential
> and may be privileged. If you are not the intended recipient, please delete
> it and notify us immediately. Please do not copy or use it for any purpose,
> or disclose its contents to any other person. Thank you."
>
>
>
> ------------------------------
>
> Message: 2
> Date: Sun, 26 May 2013 21:44:11 -0700
> From: Eric Decker <[email protected]>
> Subject: Re: [Tinyos-help] send a packet
> To: "He Dajiang (I2R)" <[email protected]>
> Cc: "[email protected]"
>         <[email protected]>
> Message-ID:
>         <CAMdX_2A2Kb=
> [email protected]>
> Content-Type: text/plain; charset="iso-8859-1"
>
> still limited to 128 bytes unless you do special stuff.
>
> It isn't so much the h/w.   TinyOS uses fixed sized packet buffers.   I
> haven't gotten around to tweaking this yet.
>
>
>
> On Sun, May 26, 2013 at 6:50 PM, He Dajiang (I2R) <[email protected]
> >wrote:
>
> > CC2420 can transmit payload of more than 100 bytes.
> >
> > Institute for Infocomm Research disclaimer:  "This email is confidential
> > and may be privileged. If you are not the intended recipient, please
> delete
> > it and notify us immediately. Please do not copy or use it for any
> purpose,
> > or disclose its contents to any other person. Thank you."
> >
> > _______________________________________________
> > Tinyos-help mailing list
> > [email protected]
> > https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help
> >
>
>
>
> --
> Eric B. Decker
> Senior (over 50 :-) Researcher
> -------------- next part --------------
> An HTML attachment was scrubbed...
> URL:
> https://www.millennium.berkeley.edu/pipermail/tinyos-help/attachments/20130526/b5ab8202/attachment.html
>
> ------------------------------
>
> Message: 3
> Date: Mon, 27 May 2013 12:58:32 +0200
> From: [email protected]
> Subject: [Tinyos-help] no compile
> To: "[email protected]"
>         <[email protected]>
> Message-ID: <[email protected]>
> Content-Type: text/plain; charset=ISO-8859-1
>
>
>
> Hi all,
>
> I am trying to set up a program called TempAverageM to do an average about
> 10
> temperatures values received from an iris sensor mts310. I am programming
> with
> MoteWorks, TinyOS 1.x.
> It seems have declaration variables problem in my program :
>
> TempAverageM.nc:23: warning:   non-atomic write
> TempAverageM.nc:49: warning:   non-atomic read
> TempAverageM.nc:50: warning:   non-atomic write
> TempAverageM.nc:17: warning: non-atomic accesses to shared variable
> `dataValue':
> TempAverageM.nc:51: warning:   non-atomic write
> TempAverageM.nc:52: warning:   non-atomic read
> TempAverageM.nc:18: warning: non-atomic accesses to shared variable
> `array':
> TempAverageM.nc:52: warning:   non-atomic write
> TempAverageM.nc:54: warning:   non-atomic read
> TempAverageM.nc:54: warning:   non-atomic read
> TempAverageM.nc:54: warning:   non-atomic read
> TempAverageM.nc:54: warning:   non-atomic read
> TempAverageM.nc:54: warning:   non-atomic read
> TempAverageM.nc:54: warning:   non-atomic read
> TempAverageM.nc:54: warning:   non-atomic read
> TempAverageM.nc:54: warning:   non-atomic read
> TempAverageM.nc:54: warning:   non-atomic read
> TempAverageM.nc:54: warning:   non-atomic read
> TempAverageM.nc:20: warning: non-atomic accesses to shared variable `i':
> TempAverageM.nc:52: warning:   non-atomic read
> TempAverageM.nc:53: warning:   non-atomic r/w
> TempAverageM.nc:55: warning:   non-atomic read
> TempAverageM.nc:56: warning:   non-atomic write
> TempAverageM.nc:19: warning: non-atomic accesses to shared variable `moy':
> TempAverageM.nc:54: warning:   non-atomic write
> C:\Crossbow\cygwin\opt\MoteWorks\apps\tutorials\lesson_6\TempAverageM.nc:
> In
> function `TempAverageM$StdControl$start':
>
> C:\Crossbow\cygwin\opt\MoteWorks\apps\tutorials\lesson_6\TempAverageM.nc:35:
> warning: no return statement in function returning non-void
> C:\Crossbow\cygwin\opt\MoteWorks\apps\tutorials\lesson_6\TempAverageM.nc:
> In
> function `TempAverageM$ADC$dataReady':
>
> C:\Crossbow\cygwin\opt\MoteWorks\apps\tutorials\lesson_6\TempAverageM.nc:48:
> error: parameter name omitted
> make: *** [exe0] Error 1
>
> Here, this is how I declared my variables :
>
> implementation {
>
>         //variables initialisation
>
>         bool dataPending;
>         uint16_t dataValue;
>         uint16_t array[10];
>         uint16_t moy;
>         int i = 0;
>
> and hw I am trying to do average :
>
> async event result_t ADC.dataReady(uint16_t){
>                 if (!dataPending) {
>                         dataPending = TRUE;
>                                 dataValue = call ADC.getData(); //uint16_t
> = data
>                                 array[i]=dataValue;
>                                 i++;
>                                 moy = ((array[0] + array[1] + array[2] +
> array[3] + array[4] + array[5] +
> array[6] + array[7] + array[8] + array[9] )/10);
>                                 if (i==10){
>                                         i=0;
>                                 }
>                 post sendData();
>                 call Leds.yellowToggle();
>                 return SUCCESS;
>                 }
>         }
>
> I need a table because I have to remplace the first value by the last one
> every
> ten values.
>
> Can someone help me ?
>
> Thank you
>
>
> ------------------------------
>
> Message: 4
> Date: Mon, 27 May 2013 16:12:57 +0200
> From: [email protected]
> Subject: [Tinyos-help] to fix a parameter
> To: [email protected]
> Message-ID: <[email protected]>
> Content-Type: text/plain; charset=ISO-8859-1
>
> Hi, I have to do an average and this is my event :
>
> async event result_t ADC.dataReady(uint16_t){
>
>                 bool dataPending;
>                 uint16_t dataValue;
>                 uint16_t array[10];
>                 uint16_t moy;
>                 int i = 0;
>
>                 if (!dataPending) {
>                         dataPending = TRUE;
>                                 dataValue = call ADC.getData(); //uint16_t
> = data
>                                 array[i]=dataValue;
>                                 i++;
>                                 moy = ((array[0] + array[1] + array[2] +
> array[3] + array[4] + array[5] +
> array[6] + array[7] + array[8] + array[9] )/10);
>                                 if (i==10){
>                                         i=0;
>                                 }
>                 post sendData();
>                 call Leds.yellowToggle();
>                 return SUCCESS;
>                 }
>         }
>
> I got this error :
>
>
> C:\Crossbow\cygwin\opt\MoteWorks\apps\tutorials\lesson_6\TempAverageM.nc:44:
> error: parameter name omitted
> make: *** [exe0] Error 1
>
> How to fix a parameter, please ?
>
>
> ------------------------------
>
> _______________________________________________
> Tinyos-help mailing list
> [email protected]
> https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help
>
> End of Tinyos-help Digest, Vol 121, Issue 28
> ********************************************
>
> Institute for Infocomm Research disclaimer:  "This email is confidential
> and may be privileged. If you are not the intended recipient, please delete
> it and notify us immediately. Please do not copy or use it for any purpose,
> or disclose its contents to any other person. Thank you."
>
> _______________________________________________
> Tinyos-help mailing list
> [email protected]
> https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help
>



-- 
Eric B. Decker
Senior (over 50 :-) Researcher
_______________________________________________
Tinyos-help mailing list
[email protected]
https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help

Reply via email to