//============================================================================= // [Aduc7024] Evm Test Program // // by http://cafe.naver.com/elab //=============================================================================
/* - Adcu7024 EVM Basic Test - EX0 인터럽트 발생시 P3 -> LED에 연결된 LED를 On/Off하는 프로그램 */
#include <ioaduc7024.h>
//----------------------------------------------------------------------------- //LED Test Futicion #define Led1On() (GP3SET = 0xFFFFFFFF) #define Led1Off() (GP3CLR = 0xFFFFFFFF)
void InitLed(void) { GP3CON = 0x0; GP3DAT = 0xFFFFFFFF; } //-----------------------------------------------------------------------------
//----------------------------------------------------------------------------- //Simple System Delay void Delay(void) { volatile int iDelay = 0x1FFFF;
while (iDelay--); } //-----------------------------------------------------------------------------
//----------------------------------------------------------------------------- int m_flag = 0; __irq __arm void irq_handler(void); // IRQ Function Prototype
//IRQ Handler __irq __arm void irq_handler(void) { m_flag ^= 1;
if(m_flag)Led1On(); else Led1Off(); return ; } //-----------------------------------------------------------------------------
int main (void) {
// Enable XIRQ0 in IRQEnable IRQEN = XIRQ0_BIT;
InitLed();
while(1) {
} } |