I'm using the Snooze library with a Teensy 3.6. I use the following code to set the microcontroller into hibernate status:

digital.pinMode(WakeUpPin, INPUT_PULLUP, RISING);
whoWakeup = (uint8_t)Snooze.hibernate(config);

The code works but after few minutes the board wakes up even if there is no pulse on the WakeUpPin. I read somewhere that there is a time limit when using the digital pin to wake up the CPU, and I should use the RTC instead.
The use of RTC is not useful for my automotive application that needs to wake up the CPU when the engine RPM sensor senses the spark plug pulses.

Is there an alternate solution?