How to use avrfix

Status
Not open for further replies.

polashd

Member
MCU= Atmel Avr (Atmega, Attiny..)
Programming software= WinAvr avrgcc

I've downloaded avrfix to use fixed point math in my program.

The zip file contains files named - "avrfix.h" "libavrfix.a" "sizes.txt" (not sure if it is of any use)
Q:-
-How do I use these files for fixed point calculations?
-In which directory these files to be copied so that the IDE (Winavr avrgcc) can use these.
-Do I need to change anything in the make file.

note:-
I created libraries for my self ( pair of files *.c & *.h) for different purposes.
I saved these in the same dir of main.c
 
>> -How do I use these files for fixed point calculations?
Try #including the "avrfix.h" header file and linking the "libavrfix.a" library file. This is done using the -lavrfix commandline switch (this can go into your makefile). Also include the directory of the library file using the -L switch...

e.g. -L c:\users\me\libraries -lavrfix

>> -In which directory these files to be copied so that the IDE (Winavr avrgcc) can use these.
The files can go in the same directory as the code. You could put them in the winavr lib and include directories if you think you'll be using them often I guess...

>> -Do I need to change anything in the make file.
Add the linker switch in link to the static library.
 
Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…