ВходНаше всё Теги codebook 无线电组件 Поиск Опросы Закон Четверг
18 июля
9530 Топик полностью
kpv (17.04.2004 00:44, просмотров: 1) ответил yes на не, нетого советуете - в этот регистр (а не вектор) записывается адрес обработчика события
команда ldr pc, [pc, #-0xFF0] по адресу вектора IRQ (0x18) загрузит VICVectAddr (адрес у него 0xfffff030) VIC ессно инициализировать необходимо Если лень доки читать, хотя бы в примеры заглянули, а не говорили, что без VIC можно обойтись. знающие люди подскажут откуда "сдвижка на 0x8" в таких хитрых адресациях набегает... static void timer0ISR(void) __attribute__ ((interrupt ("IRQ"))); static void timer0ISR(void) { if (++timer0Count % 2) ledOn(0x100); else ledOff(0x100); /* Clear the timer 0 interrupt */ T0IR = 0xFF; /* Update VIC priorities */ VICVectAddr = 0; } static void timer1ISR(void) __attribute__ ((interrupt ("IRQ"))); static void timer1ISR(void) { ++timer1Count; /* Clear the timer 1 interrupt */ T1IR = 0xFF; /* Update VIC priorities */ VICVectAddr = 0; } int main(void) { ledInit(); VICProtection=0; /* Timer 0 interrupt is an IRQ interrupt */ VICIntSelect &= ~0x10; /* Enable timer 0 interrupt */ VICIntEnable = 0x10; /* Use slot 0 for timer 0 interrupt */ VICVectCntl0 = 0x24; /* Set the address of ISR for slot 0 */ VICVectAddr0 = (unsigned int)timer0ISR; /* Timer 1 interrupt is an IRQ interrupt */ VICIntSelect &= ~0x20; /* Enable timer 1 interrupt */ VICIntEnable = 0x20; /* Use slot 1 for timer 1 interrupt */ VICVectCntl1 = 0x25; /* Set the address of ISR for slot 1 */ VICVectAddr1 = (unsigned int)timer1ISR;