Ok so I am attempting to hop back into micro controller programming. I have done a fair bit with mplab back in the day. But for whatever reason I was asked to use avr equipment so I am.
That being said I was asked to translate a asm program into C for more flexibility.
So far I have just dont a tonne of defines that were used in the asm program to set up prescalers etc and port setting etc. I am splitting my source files for organisational reasons. I have so far 3, main.c, inc.c, setup.c.
The problem is that the compiler, is not doing them in the order I included them. Its doing setup first, which is causing declaration errors. I was under the impression compilers looked for the file with main() then went from there. But it isn't, so any help would be lovely!