I'm using ECAP input capture to determine speed from a position sensor. An ESD hit can cause glitches on the ECAP input pin. The ECAP is configured to capture on the rising edge. A simple way to detect a glitch would be to read the pin value after each capture event. If the input is still high after a capture event, then the capture is good. If the input is low after a capture event, then it was a glitch.
Is there a way to read the pin value while the pin is configured for ECAP input capture?