int main(void)
{
volatile unsigned int *pRegLed;
volatile unsigned int *pRegKey2;
pRegKey2 = (volatile unsigned int *)(0x020C4074);
*pRegKey2 |= (3<<12);
pRegLed = (volatile unsigned int *)(0x02290000 + 0x14);
*pRegLed |= (0x5);
pRegKey2 = (volatile unsigned int *)(0x020E01B0);
*pRegKey2 &= ~(0xf);
*pRegKey2 |= (0x5);
pRegLed = (volatile unsigned int *)(0x020AC004);
*pRegLed |= (1<<3);
pRegKey2 = (volatile unsigned int *)(0x020A8004);
*pRegKey2 &= ~(1<<14);
pRegLed = (volatile unsigned int *)(0x020AC000);
pRegKey2 = (volatile unsigned int *)(0x020A8000);
while(1)
{
if((*pRegKey2 & (1 << 14)) == 0)
{
*pRegLed &= ~(1<<3);
}
else
{
*pRegLed |= (1<<3);
}
}
}
|