Content originally posted in LPCWare by wmues on Fri May 23 00:34:23 MST 2014
Configure these 2 Ports to generate interrupts on rising or falling edge.
In your interrupt function, use 2 timers, one for each port. If a port has a rising edge, (re)start the corresponding timer.
In normal operation, the timer does not overflow, because it is restarted by the next rising edge.
Configure the timers to rise an interrupt on overflow.
If your overflow interrupt function is called, trigger the alarm.
regards
Wolfgang