??? 06/02/09 05:50 Read: times |
#165722 - s/w delay function |
Hello,
I am having 8052 based project. I am using Keil Microvision 3 compiler and am using PC-Lint for error checking and debugging. I am using simple software delay function in my project code as follows: #include<Reg52.h> /* Keil header file for 8052 variants */ void swdelay(void) { /* This is simple software delay generation function */ unsigned char i; for(i=255;i;i--) ; for(i=255;i;i--) ; } /* This function sends the val to Serial Buffer SBUF of 8051 and waits for some time for the data to be sent. SBUF is defined in Reg52.h header file of Keil. sfr SBUF = 0x99; */ void sendAndWait(unsigned char val) { SBUF = val; swdelay(); } Keil compilation is ok. The program is running fine and the delay is also generated. But, PC-Lint is generating the Warning: "Warning 522: Highest operation, function 'sdelay', lacks side-effects" at the swdelay() calling line. Q: I had gone thro PC-Lint pdf file and read the 522 related information, pure function and many more. But, I didn't understand what is the wrong with this function. Please suggest. thanks. |