野火电子论坛

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 17916|回复: 2

为什么LED初始化函数最后早关LED?

[复制链接]
发表于 2014-7-25 10:17:59 | 显示全部楼层 |阅读模式
void LED_GPIO_Config(void)
{
        /*define a GPIO_InitTypeDef type structure*/
        GPIO_InitTypeDef GPIO_InitStructure;
       
        /*Open the fpCLK of the GPIOB,GPIOF */
        RCC_APB2PeriphClockCmd( RCC_APB2Periph_GPIOB | RCC_APB2Periph_GPIOF,ENABLE);
       
        /*Select the under control Pin_GPIOB_0*/
        GPIO_InitStructure.GPIO_Pin   = GPIO_Pin_0;
       
        /*Setting the pin mode as Push pull output */
        GPIO_InitStructure.GPIO_Mode  = GPIO_Mode_Out_PP;
       
        /*Setting the pin speed as 50MHz*/
        GPIO_InitStructure.GPIO_Speed = GPIO_Speed_50MHz;
       
        /*Call Library Function to initialize the GPIOB0*/
        GPIO_Init(GPIOB, &GPIO_InitStructure);
       
        /*Close all LED lights*/
        GPIO_SetBits(GPIOB, GPIO_Pin_0);



最后的        /*Close all LED lights*/
        GPIO_SetBits(GPIOB, GPIO_Pin_0);  起什么作用》??
  
回复

使用道具 举报

发表于 2014-7-25 10:30:28 | 显示全部楼层
就是关闭led。。防止在初始化完成后,它就自己亮了
回复 支持 反对

使用道具 举报

 楼主| 发表于 2014-7-25 10:35:59 | 显示全部楼层
汪曼丽 发表于 2014-7-25 10:30
就是关闭led。。防止在初始化完成后,它就自己亮了

强烈支持,非常感谢哥们
回复 支持 反对

使用道具 举报

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

本版积分规则

联系站长|手机版|野火电子官网|野火淘宝店铺|野火电子论坛 ( 粤ICP备14069197号 ) 大学生ARM嵌入式2群

GMT+8, 2024-9-22 11:33 , Processed in 0.031782 second(s), 23 queries , Gzip On.

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

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