I understand the concept of making a call to a function that is in a different file. I created a Function_Prototypes.h file where all my prototypes are placed. Function_Prototypes.h is #included in all the .c files. All the files are part of the project. I assume (I know the danger of that) gcc automatically links all the files in a project. I am running Atmel Studio 7 Version 7.0.2397.
I use init.c to initialize all the different hardware items (USARTs, Timers, Interrupts, GPIO, etc. ). I ideally I create a file for each hardware item (USART0-3.c, Timers.c, Int.c) and call the initialize functions from each of the hardware files (USART_Initialize(), Timers_Initialize(), Init_Initalize() ).
Some of the init functions will compile when called by init.c - USART_init() works from the USART0-3.c file, yet the tc_init() will not work from the Timer.c file.
The interrupt calls for the different hardware do not work from the hardware files and must be placed in init.c for them to work.
The error reported is "undefined reference to 'tc_init' "and for the interrupt "undefined reference to 'usart0_int_handler' ".
Any insight into this issue would be appreciated!
David