[Tinyos-help] AVR GCC compiler problems

José Moyano josehmoyano at yahoo.com.ar
Wed Feb 27 12:11:23 PST 2008

Yes, you are right. If so many people is using this compiler, must be my error. I try hardcoding, and the error continues. Maybe an optimization problem? I'm using -o0 (no optimization).
One more thing: Does C support coercion? Theoretically, I don't need casting for my example. Or, at least, the compiler must throw a warning or something. Do you use casting for all your 32-bit statements? 
I've used casting for the comparison (mask != CAN_DEFAULT_MASK) but the error continues.
Another clue: The error happens only when there are few sentences betweens two (or more) calls to the routine. If I wait some time for the second call, it works fine. However, as you can see in the code, the routine doesn't need clock cycles to be called again.


----- Mensaje original ----
De: Kevin Klues <klueska at gmail.com>
Para: José Moyano <josehmoyano at yahoo.com.ar>
CC: tinyos-help at millennium.berkeley.edu
Enviado: miércoles 27 de febrero de 2008, 16:10:06
Asunto: Re: [Tinyos-help] AVR GCC compiler problems

> uint16_t number1 = 0x1002;
> uint32_t number2;
> number2 = number1 << 14;

This is not a compiler error, but rather an error in your code.
Correct c syntax for doing what you are trying to do is:

number2 = ((uint32_t)number1) << 14;

Now back to your real problem........ again I'm not inclined to say
its a compiler problem, as many many people have been using this
compiler for many years, and this is the first time what you describe
has ever come up as an issue.  Have you tried hardcoding 10 into the
channel that you pass to make sure that somehow this channel value
isn't changing before the call you make?


      Los referentes más importantes en compra/ venta de autos se juntaron:
Demotores y Yahoo!
Ahora comprar o vender tu auto es más fácil. Vistá ar.autos.yahoo.com/
-------------- next part --------------
An HTML attachment was scrubbed...
URL: https://www.millennium.berkeley.edu/pipermail/tinyos-help/attachments/20080227/fa841ef6/attachment.html

More information about the Tinyos-help mailing list