loki666
rtems gp32 bsp maintainer
i'm trying to build an isr for timer4, but it doesnt seems to work
could someone check this for me
i was wondering do i have to clear the timer4 bit in rSRCPND?
thanx for any help
could someone check this for me
Code:
__irq static void timer4_isr( void )
{
int i;
int keys=gp_ButtonResult();
for(i=0; i<10;i++)
uKeys[i]=((0x1<<i)&keys)? 1: 0;
//clear bit?
}
void InstallKbdHandler( void )
{
ClearKeys();
rCLKCON |= 0x40; //enable pwmtimer
rTCFG0 = 0xFF00; //8bit prescale = 255 --> 16.1133 KHz for PCLK=66MHz
rTCFG1 = 0x30000; //4bit divider = 1/16
rTCNTB4 = 322; //~20ms
rTCON = 0x6 << 20; //auto reload + maunal update
ARMDisableInterrupt();
swi_install_irq(BIT_TIMER4,timer4_isr);
ARMEnableInterrupt();
rTCON = 0x5 << 20; //start + auto-reload
}
thanx for any help