Function pointers are possible in nesc. Here is an example:
typedef uint8_t (*fnptr_t)(uint8_t a, uint8_t b);
uint8_t adder(uint8_t a, uint8_t b) {
return a+b;
}
fnptr_t fnptr;
command result_t StdControl.start() {
fnptr = adder;
}
// every time the timer fires, add 3 to x
event result_t Timer.fired() {
x = fnptr(x, 3);
}
- om_p
-------
You might be out of luck with the function pointers, I seem to
remember someone saying that they aren't used in nesc...try
searching this list and the nesc doc for some background.
Data pointers should be fine, although there are some tricks to
including C files. There was a discussion in march under the subject:
"c-written subroutines" that you may be able to search out as well.
I'm pretty fuzzy on it myself...
MS
Imanol Padillo wrote:
> Hi everybody> is that the program I use to do the fuzzy logic aplication can
> give me
> the source code in C, but uses pointers to functions, pointers to
> pointers and pointers to variables. The compiler gives me problems with
> the pointers and I wanted to know if somebody have tried to include a
> "*.c" file in the code for the mote and if I have to delete the pointers
> or something like that.
>
> It could help me too if somebody have done something of Fuzzy Logic and
> in what inference motor have implemented the aplication.
>
> Thank you
>
> ------------------------------------------------------------------------
>
> LLama Gratis a cualquier PC del Mundo.
> Llamadas a fijos y mviles desde 1 c ntimo por minuto.
> http://es.voice.yahoo.com
> <http://us.rd.yahoo.com/mail/es/tagline/messenger/*http://es.voice.yahoo.com/
_______________________________________________
Tinyos-help mailing list
[email protected]
https://mail.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help