如何延时,让灯闪烁
#include"stm32f10x.h"//void delay()
//{
//int i,j;
// for(i=0;i<100000;i++)
// for(j=0;i<100;j++)
//}
int main(void)
{
*(unsigned int*)0x40021018 |=(1<<6);//打开APB2时钟
*(unsigned int*)0x40011800 |=(3<<(4*5))|(3<<(24))|(3<<16);//配置模式
*(unsigned int*)0x40011804 |=(3<<(28));
*(unsigned int*)0x4001180C &=~(1<<5);//配置输出寄存器
//*(unsigned int*)0x4001180C |=(1<<5);//配置输出寄存器
*(unsigned int*)0x4001180C &=~(1<<6);//配置输出寄存器
*(unsigned int*)0x4001180C &=~(1<<4);//配置输出寄存器
*(unsigned int*)0x4001180C &=~(1<<15);//配置输出寄存器
while (1)
{
}
}
void SystemInit(void)
{
}
页:
[1]