|
1金钱
#include "stm32f10x.h" // Device header
#include "led.h"
#define uint32 unsigned int
void Delay(uint32 i)
{
while(i--);
}
int main()
{
//使能外设总线GPIOC时针
RCC_APB2PeriphClockCmd(RCC_APB2Periph_GPIOC,ENABLE);
//初始化LED IO口
LED_Init();
while(1)
{
GPIO_SetBits(GPIOC, GPIO_Pin_0);
Delay(0x00ffffff);
GPIO_ResetBits(GPIOC,GPIO_Pin_0);
Delay(0x00ffffff);
//void GPIO_SetBits(GPIO_TypeDef* GPIOx, uint16_t GPIO_Pin); //设置指定的数据端口位
//void GPIO_ResetBits(GPIO_TypeDef* GPIOx, uint16_t GPIO_Pin); //清除指定的数据端口位
}
}
仿真运行Delay(0x00ffffff); 软件上显示用时15秒多,比实示快了10几倍,这是怎么回事???
我知道答案
本帖寻求最佳答案回答被采纳后将获得系统奖励 10 金钱 , 目前已有 1人回答
|
|