We are running a survey to help us improve the experience for all of our members. If you see the survey appear, please take the time to tell us about your experience if you can.
sir i have developed my own header file in case of lpc2148 arm7 in keil software which is..
#include<lpc214x.h> void gpioset(int port,unsigned long set) { if(port==0) { IO0SET=set; } else { IO1SET=set; } }
and it is added in main file like..
#include<lpc214x.h> #include "haresh.h" #include "GPIO_SET.H" #include "GPIO_CLEAR.H" void delay(unsigned int); int main(void) { gpiodir(0,0x0000000f); while(1) { gpioset(0,0x0000000f); delay(100); gpioclear(0,0x0000000f); delay(100); } } void delay(unsigned int x) { unsigned int y,k; for(y=0;y<x;y++) { for(k=0;k<1275;k++); } }
and there is no error during the compilation but in case of simulation i cant get output and automatically break point is set at the starting of main file.
#include<lpc214x.h> #include "haresh.h" #include "GPIO_SET.H" #include "GPIO_CLEAR.H" void delay(unsigned int); int main(void) here break point-> { gpiodir(0,0x0000000f); while(1)
please give me the solution as soon as possible...
Do not define functions (or variables, for that matter) in header files.
Instead, have the definition in a .c file, and just a declaration (aka "prototype" in the case of a function) in the header.
c-faq.com/.../decldef.html
Yes, that's bound to fix it.
Pfffh.