You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

Keil环境下LPC1768 GPIO2控制代码出现110条警告求助

LPC1768 GPIO控制代码编译出现大量警告求助

我在Keil环境中编写了一段控制LPC1768的GPIO2全部引脚亮灭的简单代码,但编译后出现110条警告。

代码实现

#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);
    }
}

我已尝试重新安装Keil软件及对应芯片软件包,但问题未解决;此前遇到“use of old-style cast”警告,通过在Project->Options For Target->C/C++选项卡的Misc controls中添加-Wno-old-style-cast已解决,但仍存在大量警告,恳请协助排查解决。

内容的提问来源于stack exchange,提问作者Mahdi Ahmadimehr

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.07.28 22:52:13