For the variable to ever appear in the symbol listing generated by
tos-set-symbols, it MUST be in the final symbol table of the generated
executable.
(Neither enums or defines constitute variables, ever.)
> enum{
> symbol_1=1,
> symbol_2=2
> };
Enumerations are removed during compilation, they are substituted with
their values directly by the compiler.
> #define symbol_4 10
Macros are expanded during the CPP (C pre-processor pass), the name
"symbol_4" never even makes it to the compiling stage!
> uint8_t symbol_3=10;
This statement (outside of a function) creates a symbol.
However, if the symbol is never used it could be (and indeed, in this
case, it is) optimized out!
[It seems to be removed during the app.c generation phase, but I am
unsure as to exactly why.]
That is, the compiler sees it is never used, deems it unnecessary, and
removes it.
So, to make a long answer short:
1) Declare a variable with an initial value outside of a function scope
2) Reference the variable in one or more function(s)
There may be some cool way to specify special volatility, I have no idea how.
HTH,
Paul
On Mon, Jul 21, 2008 at 7:33 AM, De-MonHell <[EMAIL PROTECTED]> wrote:
> Hi all, i'm an italian student developing a tinyos based project for my master
> degree thesis.
>
> As my application need to have some symbol set at deploy time (like
> TOS_NODE_ID and some COLLECTION and DISSEMINATION id ), i'm trying to use
> tos-set-symbols.
> But i don't understand which kind of variables/constants/enum is editable with
> this tool after compiling
> e.g.: if i declare somewhere code like this in an application:
>
> ...
> ...
>
> after compilation (make telosb), a
> tos-set-symbol --read /build/telosb/main.exe
> doesn't seem to show any of the above variable/enum/constant.
> (indeed i see some static variables that i've declared in some module and some
> boolean variable declared at module level (inside the implementation scope))
>
> any help its appreciated
>
> i hope my english is understable enougth.
>
> _______________________________________________
> Tinyos-help mailing list
> [email protected]
> https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help
>
_______________________________________________
Tinyos-help mailing list
[email protected]
https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help