程序烧到芯片里,怎么没出现正确结果啊,哪里错了

2019-03-23 18:48发布

#include"led.h"
void LED_GPIO_Config()
{
   GPIO_InitTypeDef GPIO_InitStructure;
   RCC_APB2PeriphClockCmd(RCC_APB2Periph_GPIOG, ENABLE); //开启GPIO_G外设时钟

   GPIO_InitStructure.GPIO_Pin = GPIO_Pin_14;    //板上LED编号 D2
   GPIO_InitStructure.GPIO_Mode = GPIO_Mode_Out_PP;   //通用推挽输出
   GPIO_InitStructure.GPIO_Speed = GPIO_Speed_50MHz;   //设置引脚速率
   GPIO_Init(GPIOG, &GPIO_InitStructure);     //调用库函数,初始化GPIO_G
      GPIO_ResetBits(GPIOG,GPIO_Pin_14 );   //关闭LED灯
    }


#include "stm32f10x.h"
#include"led.h"
/*****************************/
void Delay(vu32 nCount)
{
   for(; nCount != 0; nCount--);
}
/****************************/
main()  //点亮D2
{
   void LED_GPIO_Config();
   while(1)
    {
      GPIO_SetBits(GPIOG,GPIO_Pin_14 );
      Delay(0x8ffff);
      GPIO_ResetBits(GPIOG,GPIO_Pin_14 );   
      Delay(0x8ffff);
    }
}
此帖出自小平头技术问答
友情提示: 此问题已得到解决,问题已经关闭,关闭后问题禁止继续编辑,回答。
该问题目前已经被作者或者管理员关闭, 无法添加新回复
8条回答
LIAOYUAN
1楼-- · 2019-03-25 01:41
 精彩回答 2  元偷偷看……
ienglgge
2楼-- · 2019-03-25 07:19
LIAOYUAN 发表于 2014-11-12 11:17
这个void到底什么意思啊,有的书上是有加的啊,还请详述下

void 指的是函数的类型,在函数定义和声明时,会出现,在调用时不出现~~~~~~~~~~

一周热门 更多>