I'm facing a problem on Eclipse IDE that when compiling my project (which has
#include <avr/io.h>), the compiler includes
avr/iom16.h (for ATmega16) instead of
avr/iom32.h (for my ATmega32). It appears when I press ctrl + click on any constant like
DDR in my program, It opens the
avr/iom16.h file which means it was included.
I've checked the compiler options of the project and found that the control switch option
-mmcu=atmega32 is fine, the same is for assembler options and linker options.
I've tried to make a new project, chosen target hardware as
Atmega 32 -as I usually do-, copied my source files into the new project, compiled the project, but the problem persists.
A strange thing also need to be mentioned is when I open the file
avr/io.h after compiling, it is showing all the controller constants in gray background (which means they are not defined) except for this one
__AVR_ATmega32__ in white background (which means it is defined). The following is the two lines of code that appears with a white background:
#elif defined (__AVR_ATmega32__) # include <avr/iom32.h>
So, what is making the trouble then? is it could be something in the earlier preprocessing stages?
Any help would be appreciated. Thanks in advance!