Listing 7: Handling an Interrupt
class InputCapture1Class : public InterruptHandlerClass
{
// This class responds to an interrupt generated by the 68HC16
// Input Capture 1 circuit which is tied to interrupt vector 0xF1.
protected:
virtual void Handle();
public:
InputCapture1Class();
} IC1Grabber;
InputCapture1Class::InputCapture1Class()
{
pInterruptF1HandlerObject = (void *)this; // Latch onto the right
// interrupt vector. pInterruptF1HandlerObject will be used
// to get the "this" pointer right when the interrupt occurs.
}
void InputCapture1Class::Handle()
{
// Service the interrupt...
}