I have a problem with keil i write a simple peace of code used to turn ON and OFF All GPIO2 in LPC1768 but it return 110 Warning!
Here is my Code:
#include <LPC17xx.h>
void delay_ms(unsigned int ms);
void delay_ms(unsigned int ms)
{
unsigned int i,j;
for(i=0;i<ms;i++)
for(j=0;j<20000;j++);
}
/* start the main program */
int main()
{
SystemInit(); //Clock and PLL configuration
LPC_PINCON->PINSEL4 = 0x000000; //Configure the PORT2 Pins as GPIO;
LPC_GPIO2->FIODIR = 0xffffffff; //Configure the PORT2 pins as OUTPUT;
while(1)
{
LPC_GPIO2->FIOSET = 0xffffffff; // Make all the Port pins as high
delay_ms(100);
LPC_GPIO2->FIOCLR = 0xffffffff; // Make all the Port pins as low
delay_ms(100);
}
}
And Here is my results: [OUTPUT] [WARNINGS]
I tried reinstall all software pack and keil but it doesn't help and at first place keil returned "use of old-style cast" I fixed it Under Project -> Options For Target -> C/C++ tab , for Misc controls "-Wno-old-style-cast" press OK and rebuild the project.
Try to use another compiler.
Under Options for Target you can select the compiler in the tab 'Target'. I always use compiler version 5 (you may have to install it), because version 6 always shows strange warnings in my experience.