OpenEdv-开源电子网

 找回密码
 立即注册
正点原子全套STM32/Linux/FPGA开发资料,上千讲STM32视频教程免费下载...
查看: 3233|回复: 1

谁帮忙看看,这段代码有什么问题?

[复制链接]

3

主题

9

帖子

0

精华

新手上路

积分
33
金钱
33
注册时间
2016-6-4
在线时间
3 小时
发表于 2016-6-9 16:52:44 | 显示全部楼层 |阅读模式
3金钱
int main(void)
{ delay_init(168);
        led_init();
  while(1)
        { if ((GPIO_ReadInputDataBit(GPIOA,GPIO_Pin_0 ))|(GPIO_ReadInputDataBit(GPIOE,GPIO_Pin_2 ))|(GPIO_ReadInputDataBit(GPIOE,GPIO_Pin_3 ))|(GPIO_ReadInputDataBit(GPIOE,GPIO_Pin_4 )))
                {
                        if (GPIO_ReadInputDataBit(GPIOE,GPIO_Pin_2))GPIO_SetBits(GPIOF,GPIO_Pin_8 );
                        else if (GPIO_ReadInputDataBit(GPIOE,GPIO_Pin_3))GPIO_ResetBits(GPIOF,GPIO_Pin_9 );
                        else if (GPIO_ReadInputDataBit(GPIOE,GPIO_Pin_4))GPIO_ResetBits(GPIOF,GPIO_Pin_10 );
                        else if (GPIO_ReadInputDataBit(GPIOA,GPIO_Pin_0))GPIO_ResetBits(GPIOF,GPIO_Pin_9 |GPIO_Pin_10);
                }
                else {GPIO_ResetBits(GPIOF,GPIO_Pin_8 );GPIO_SetBits(GPIOF,GPIO_Pin_9 |GPIO_Pin_10);}
               
               
        }
}

最佳答案

查看完整内容[请看2#楼]

这段代码,大致意思是读取开发板I/O输入状态,输出到开发板I/O输出
正点原子逻辑分析仪DL16劲爆上市
回复

使用道具 举报

3

主题

9

帖子

0

精华

新手上路

积分
33
金钱
33
注册时间
2016-6-4
在线时间
3 小时
 楼主| 发表于 2016-6-9 16:52:45 | 显示全部楼层
这段代码,大致意思是读取开发板I/O输入状态,输出到开发板I/O输出
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则



关闭

原子哥极力推荐上一条 /2 下一条

正点原子公众号

QQ|手机版|OpenEdv-开源电子网 ( 粤ICP备12000418号-1 )

GMT+8, 2025-2-27 12:29

Powered by OpenEdv-开源电子网

© 2001-2030 OpenEdv-开源电子网

快速回复 返回顶部 返回列表