//D4点亮LED
void LED_CSH(void)
{
*(unsigned int *)0x40021018|=0x20; //开启GPIO_D的时钟
*(unsigned int *)0x40011400&=~0xf0000;
*(unsigned int *)0x40011400|=0x70000;
*(unsigned int *)0x4001140C&=~0x10;
}
int main(void)
{
LED_CSH();
while(1)
{
*(unsigned int *)0x4001140C|=0x10;
}
}
把 *(unsigned int *)0x4001140C|=0x10 直接放在LED_CSH()后面可以关掉LED灯,都是如果放在while(1)就关不掉LED灯