Could someone let me know how often the:
void __irq timer4Int(void) { }
Will be executed each second? Ie how many times will the above function be called each second?
Presumably this might depend on my clock speed?
This is how my timer4 interrupt is setup:
RELEVANT INFO:
(inside gpmain)
SetCpuSpeed(166);
#define INT_RATE 100000.0f
void __irq timer4Int(void) { }
Will be executed each second? Ie how many times will the above function be called each second?
Presumably this might depend on my clock speed?
This is how my timer4 interrupt is setup:
Code:
void installTimer4( void )
{
double pclk;
// Calculate timer frequencies etc..
pclk = (double)GpPClkGet();
pclk /= 2; // clock divider 1/16
pclk /= 0+1; // prescaler 256
pclk /= INT_RATE;
_pclk = (int)pclk;
// Install timer4 interrupt..
disable_IRQ();
swi_install_irq(14,timer4Int);
*tcntb4 = _pclk; // timer4 counter
*tcon = (*tcon & 0x0fffff) | 0x200000; // manually update timer4 counter
*tcfg0 |= 0x0000;
*tcfg1 = (*tcfg1 & 0x0ffff) | 0x00000; // configure timer4, clock divider 1/2
*tcon = (*tcon & 0x0fffff) | 0x100000; // start timer4
enable_IRQ();
}
RELEVANT INFO:
(inside gpmain)
SetCpuSpeed(166);
#define INT_RATE 100000.0f