编译通过,生成hex文件,但是下载到目标板没反应
#define GPIOE_CRL (*((unsigned int *)(0x40012000)))
#define GPIOE_BSRR (*((unsigned int *)(0x40012010)))
#define GPIOE_BRR (*((unsigned int *)(0x40012014)))
#define RCC_APB2ENR (*((unsigned int *)(0x40022018)))
void delay(void)
{
unsigned int i;
for(i = 0; i < 0xffff; ++i)
;
}
enum BIT{BIT0,BIT1} ;
int main(void)
{
RCC_APB2ENR |=(1<<6); //使能PORTA时钟
GPIOE_CRL = 0x44444422;//PE0,1配置为输出
while(1)
{
GPIOE_BSRR |= BIT0;
GPIOE_BRR |= BIT0;
delay();
GPIOE_BRR |= BIT0;
GPIOE_BSRR |= BIT1;
delay();
}
} |