I am using the following code:
//=============================================================================
// sets dummy handler for INT1
//=============================================================================
#define InstallDummyHandlerForINTs() ({\
_old_int1_ = GetIntVec(AUTO_INT_1);SetIntVec(AUTO_INT_1,DUMMY_HANDLER);\
_old_int5_ = GetIntVec(AUTO_INT_5);SetIntVec(AUTO_INT_5,DUMMY_HANDLER);\
})
//=============================================================================
// restore old handler for INT1
//=============================================================================
#define RestoreHandlerForINTs() ({\
SetIntVec(AUTO_INT_1,_old_int1_);SetIntVec(AUTO_INT_5,_old_int5_);})
Without it, I get random incorrect keypresses (the esc + enter combo likes to pop up... very annoying) so I assume it must somehow work with _rowread.
But with it, this hangs:
void wait(short n)
{
OSFreeTimer (USER1_TIMER);
OSRegisterTimer (USER1_TIMER, 20 * n);
while (!OSTimerExpired (USER1_TIMER));
OSTimerRestart(USER1_TIMER);
}
I tried this:
void wait(short n)
{
RestoreHandlerForINTs()
OSFreeTimer (USER1_TIMER);
OSRegisterTimer (USER1_TIMER, 20 * n);
while (!OSTimerExpired (USER1_TIMER));
OSTimerRestart(USER1_TIMER);
InstallDummyHandlerForINTs()
}
But it hangs also.
I know I'm not the only one to post this question, or some permutation of it. I did find this link:
http://tichessteamhq.yuku.com/reply/2454#reply-2454
But nothing seemed to work.
Is there anyway to get both working _rowread and my wait() function to work at the same time?
Thanks in advance,
Jeff


