本帖最后由 linfuchi 于 2010-5-26 10:27 编辑
在KEIL Uvision中void Delay(__IO uint32_t nCount){}函数跳不出来,什么缘故?
这样调用的:Delay(0x8ffff);
#include "stm32f10x.h"
#include "stm32_eval.h"
GPIO_InitTypeDef GPIO_InitStructure;
/* Private function prototypes -----------------------------------------------*/
void RCC_Configuration(void);
void Delay(__IO uint32_t nCount);
void main(void)
{
/* System Clocks Configuration **********************************************/
RCC_Configuration();
/* Configure all unused GPIO port pins in Analog Input mode (floating input
trigger OFF), this will reduce the power consumption and increase the device
immunity against EMI/EMC *************************************************/
RCC_APB2PeriphClockCmd(RCC_APB2Periph_GPIOA , ENABLE);//开GPIOA
GPIO_InitStructure.GPIO_Pin = GPIO_Pin_6; GPIO_InitStructure.GPIO_Mode = GPIO_Mode_Out_PP;
GPIO_Init(GPIOA, &GPIO_InitStructure);
GPIO_InitStructure.GPIO_Speed = GPIO_Speed_2MHz;
while (1)
{
GPIO_SetBits(GPIOA, GPIO_Pin_6); //GPIOC.6=1
Delay(0x8ffff);
GPIO_ResetBits(GPIOA, GPIO_Pin_6); //GPIOC.6=0
Delay(0x8ffff);
}
}
void RCC_Configuration(void)
{
/* Setup the microcontroller system. Initialize the Embedded Flash Interface,
initialize the PLL and update the SystemFrequency variable. */
SystemInit();
}
void Delay(__IO uint32_t nCount)
{
for(; nCount != 0; nCount--);
} |