我得到了错误:错误:'RCC_ABH1Periph_GPIOD‘未声明(在此函数中首次使用)时,有人知道为什么吗?
这是给STM32F4发现板的。
抛出错误的行是:
RCC_AHB1PeriphClockLPModeCmd(RCC_ABH1Periph_GPIOD,使能);
我已经包括了所有需要的文件。
#include "defines.h"
#include "stm32f4xx.h"
#include "stm32f4xx_rcc.h"
#include "stm32f4xx_gpio.h"
#include "stm32f4xx_adc.h"
//Configure sysTick
static __IO uint32_t timingDelay;
void Delay(uint32_t nTime)
{
timingDelay = nTime;
while (timingDelay != 0);
}
void sysTick_Handler(void)
{
if (timingDelay != 0x00)
{
timingDelay--;
}
}
//Configure GPIO
GPIO_InitTypeDef GPIO_initStruct;
void init_led(void)
{
RCC_AHB1PeriphClockLPModeCmd(RCC_ABH1Periph_GPIOD, ENABLE);
GPIO_initStruct.GPIO_Pin = GPIO_Pin_12 | GPIO_Pin_13 | GPIO_Pin_14 | GPIO_Pin_15;
GPIO_initStruct.GPIO_Mode = GPIO_MODE_OUT;
GPIO_initStruct.GPIO_OType = GPIO_OType_PP;
GPIO_initStruct.GPIO_Speed = GPIO_Speed_100MHz;
GPIO_initStruct.GPIO_PuPd = GPIO_PuPd_NOPULL;
GPIO_initStruct(GPIOD, &~GPIO_initStruct);
}
int main(void)
{
if (SysTick_Config((SystemCoreClock/1000)));
while (1);
init_led();
while(1)
{
GPIO_ToggleBits(GPIOD, GPIO_Pin_12 | GPIO_Pin_13 | GPIO_Pin_14 | GPIO_Pin_15);
Delay(1000);
}
}发布于 2016-04-11 11:49:03
这个RCC_ABH1Periph_GPIOD应该是RCC_AHB1Periph_GPIOD.在写问题之前仔细检查你的代码!
https://stackoverflow.com/questions/36547404
复制相似问题