avr-gcc-list
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [avr-gcc-list] Converting from IAR to avr-gcc


From: eric
Subject: Re: [avr-gcc-list] Converting from IAR to avr-gcc
Date: Sat, 23 Aug 2003 14:14:22 GMT

> I am converting a very large program for the atmega128 
from IAR to
> avr-gcc and I'm having some problems.  Once I get this to 
compile and
> work I want to convert it to atmega103 since the 128 is 
obsolete.  We
> are currently building boards with the 128 until we run 
out, sometime in
> Februrary or March.  

You mean "convert to mega128 from the mega103". :)

>My current problem is a function that takes a float
> and returns a float.  The header prototype is;
> 
> float AdjFZSP(float SP);
> 
> I get and error of;
> 
> parse error before '(' token
> 
> Can't I have a return type float?
> 
> Could someone show me a way to get around this?


I don't know for sure without seeing the code in context 
and the actual compiler output, but some points:
1. Do you have a prototype written for the function?
2. Do you have #include <math.h>?
3. For later, when you link, be sure to have the -lm switch 
in the linker flags to link in the math library. If you are 
using the WinAVR sample makefile, it automatically includes 
this switch.


 
> Is there some information on converting from IAR to avr-
gcc?
> 

Not that I'm aware of. Best to read the avr-libc 
documentation thoroughly. However, converting from IAR to 
GCC is not that difficult (I used to use IAR). The biggest 
differences are:
1. Interrupt Service Routines. (But everybody is different 
as there is no standard.)
2. Putting strings in Flash and reading from Flash.
3. Minor header file differences.


So, what are your reasons from moving from IAR to GCC?

Eric




reply via email to

[Prev in Thread] Current Thread [Next in Thread]