I open a SerialPort (COM3) in managed code.
Then I start RLP code that writes a byte to U2THR, this works fine, and transmits the byte over COM3.
void HCD_SendByte(BYTE Data)
{
/* Wait until previous byte transmitted */
while (!(U2LSR & LSR_THRE));
U2THR = Data;
}
Now I’ve also installed an interrupt to detect when the THR is empty. (For now the code doesn’t filter the THRE interrupt)
Handler code:
void InterruptHandler(void * arg)
{
RLPext->GPIO.WritePin(27, TRUE);
RLPext->Delay(1000);
RLPext->GPIO.WritePin(27, FALSE);
VICVectAddr = 0; /* Acknowledge Interrupt */
}
Installed with:
if (!RLPext->Interrupt.Install(UART2_INT, InterruptHandler, NULL))
return FALSE;
The Interrupt.Install method doesn’t return false, so the interrupt should be installed fine. However, the interrupt handler never gets called.
Any ideas? (Maybe the managed code already installed an interrupt)