//D4點(diǎn)亮LED
void LED_CSH(void)
{
? ? *(unsigned int *)0x40021018|=0x20;? ? ? ? ? //開啟GPIO_D的時(shí)鐘
? ? *(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()后面可以關(guān)掉LED燈,都是如果放在while(1)就關(guān)不掉LED燈