Is there something wrong with my test code?
Code: Select all
HiResTimer *hrt;
void UserMain(void * pd)
{
BYTE counter=0;
OSChangePrio(MAIN_PRIO);
InitializeStack();
EnableAutoUpdate();
GetDHCPAddressIfNecessary();
InitIO();
while( true )
{
hrt->start();
Pins[10] = 1;
OSTimeDly(TICKS_PER_SECOND*2);
}
}
void InitIO()
{
Pins[10].function( PIN_10_GPIO );
hrt = HiResTimer::getHiResTimer( 1 );
hrt->init(0.1); // 100ms timer.
hrt->setInterruptFunction( tx_timer_isr );
}
void tx_timer_isr()
{
hrt->stop();
Pins[10] = 0;
}
example programs the interrupt function was set by using an ampersand char in front of the function name
(i.e. setInterruptFunction( &tx_timer_isr ). While that seems wrong to me, it didn't work either.
What am I missing?