Hi,
Thanks for your suggestions.
I'm not sure how a delegate would help me in this situation - it might be just my understanding though.
If I have the following class in C++, how would I then go about using a delegate to point to my instance method?
// ============================================================================
// CSerialPort class
// ============================================================================
// ----------------------------------------------------------------------------
// Declarations
// ----------------------------------------------------------------------------
class CSerialPort;
typedef CSerialPort *PSerialPort;
// ----------------------------------------------------------------------------
// Definitions
// ----------------------------------------------------------------------------
class CSerialPort {
public:
CSerialPort(UART_MemMapPtr uart);
private:
void InterruptHandler(void);
UART_MemMapPtr m_pUart;
};
// ----------------------------------------------------------------------------
// Implementation
// ----------------------------------------------------------------------------
// Constructor
CSerialPort::CSerialPort(UART_MemMapPtr uart) {
m_pUart = uart;
// Here I need to modify the NVIC so that the UARTn IRQ points to the
// CSerialPort->InterruptHandler function
}
// This routine should be registered in the NVIC vector table
void CSerialPort::InterruptHandler(void) {
// UARTn_IRQHandler routine
}
// The usual UARTn interrupt handler which is to be replaced somehow
void UART0_IRQHandler(void) {
}
Sorry about the formatting.
Thanks,
Kev