//---------------------------------------------------------------------------- // User rouitine to processing IRQ ( for LPC24XX) //---------------------------------------------------------------------------- void tn_cpu_irq_handler(void) { register int irq_stat; register int rc; int data; irq_stat = VICIRQStatus; //----- Timebase 0.8 ms int (actually this time is set by sending desired value to FPGA) ----- if((irq_stat & (1<<15)) > 0) { // Drop external signal: status = inpw(STATUS); // (Drops interrupt request when read) // Clear EINT1 source: EXTINT = 0x00000002; //semaphore setting to make interrupt processing: tn_sem_isignal(&SemISR); // code from timer interrupt processing. tn_tick_int_processing(); //----- UART TX Helper ---------------------- if((U0LSR & (1<<5))>0) { rc = tn_queue_ireceive(&queueTxUart,(void **)&data); if(rc == TERR_NO_ERR) U0THR = data; } // code from timer interrupt processing - END. } VICVectAddr = 0; }
interrupt_attr void rtc_irq_handler(void) { LED4 ^= 1; tn_tick_int_processing(); tn_int_exit(); }
//---------------------------------------------------------------------------- // прерывание от 1ms - системный тик void SysTick_Handler(void) { tn_tick_int_processing(); tn_calc_performance(); timer1ms++; if (counter1000ms++ >= 999) { counter1000ms = 0; timer1s++; } tn_int_exit(); }
void tn_sys_tick_int_handler() { tn_tick_int_processing(); ++g_sys_ticks; if (g_sys_ticks % TN_SYS_TICK_FQ_HZ == 0) hw_unix_time_int_handler(); if (g_sys_ticks % ETH_TIMER_EVENT_TICKS == 0) lwip_timer_event_iset(); tn_int_exit(); }