|
1金钱
我按照教学视频的代码,编译后0error0warning,烧录后,开发板led始终不亮,请问是哪里的设置有问题#ifndef _led_H
#define _led_H
#include "stm32f10x.h"
#define LED_PORT GPIOC
#define LED_PIN (GPIO_Pin_0|GPIO_Pin_1|GPIO_Pin_2|GPIO_Pin_3|GPIO_Pin_4|GPIO_Pin_5|GPIO_Pin_6|GPIO_Pin_7)
#define LED_PORT_RCC RCC_APB2Periph_GPIOC
void LED_Init(void);
#endif
#include "led.h"
void LED_Init()
{
GPIO_InitTypeDef GPIO_InitStructure;
RCC_APB2PeriphClockCmd(LED_PORT_RCC,ENABLE);
GPIO_InitStructure.GPIO_Pin=LED_PIN;
GPIO_InitStructure.GPIO_Mode=GPIO_Mode_Out_PP;
GPIO_InitStructure.GPIO_Speed=GPIO_Speed_50MHz;
GPIO_Init(LED_PORT,&GPIO_InitStructure);
GPIO_SetBits(LED_PORT,LED_PIN);
}
#include "stm32f10x.h"
#include "led.h"
int main()
{
LED_Init();
while(1)
{
GPIO_ResetBits(LED_PORT,GPIO_Pin_0);
}
}
我知道答案
本帖寻求最佳答案回答被采纳后将获得系统奖励 10 金钱 , 目前已有 0人回答
|
|