Hello,
Thank you all for the replies. I was trying to avoid too many
parameters as that becomes confusing if many components are involved.
It will build up files in the working directory but I'll create a
different configuration component for each type parameter combination.
Best regards
Hugo
On 7/16/07, Philip Levis <[EMAIL PROTECTED]> wrote:
On Jul 16, 2007, at 4:25 AM, Hugo Sousa wrote:
> Let me clarify, let's say a certain generic component has a parameter
> "typedef width_t" (and an interface with a command that allows to pass
> along a "width_t variable")
>
> I want to perform some calculations on the variable, and store the
> results on other variables, but the type of those variables is width_t
> dependent
>
> for example, let's say that width_t is uint16_t
>
> then i'll want
>
> uint32_t mult;
> uint16_t sum;
> int16_t subtract;
>
> etc.
>
> if width_t is uint8_t it will be
>
> uint16_t mult;
> uint8_t sum;
> int8_t subtract;
>
> etc
>
> To simplify I can define some structs like
> typedef struct { ... } store_result16_t
> typedef struct { ... } store_result8_t
>
> but when I declared the struct variable to be used, is there a way to
> chose the one I want depending on width_t?
Probably the easiest way to do this is to pass all three types:
generic module X(typedef sum_t @integer(), typedef mult_t @integer(),
typedef subract_t @integer()) {
}
Phil
_______________________________________________
Tinyos-help mailing list
[email protected]
https://mail.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help