Hi,
I am working on (MSP430G2553) Launchpad using IAR embedded workbench 5.30 on windows 7.
What exactly is the use of header files in embedded software development?
I have written a small program to blink an led on MSP430 which contain a single function void delay(void).
code is somewhat like this
main.c-->contains a single loop which calls delay() function and toggles the port
delay.c -->Contains the delay implementation ,basically a for loop-- for(i=0;i<oxffff;i++);
why do we have to put "void delay(void)" inside a header file like delay.h? why cant we just include "delay.c" directly?
I was doing that(using delay.c without delay.h) previously and the system works ok.
And if i am using a header file do i have to include both delay.c and delay.h in main.c as shown below
main.c-
{
#include "delay.h"
#include "delay.c"
}