Minimum time for digital signal reading

Here's a hastily scribbled state diagram that I had to make to be sure I understand.

Removing the two lines I was complaining about will not change your program.

So what might fix things is not taking the transitions until the ECU signal has changed and been stable for some amount of time.

Now it just runs off with the nearest glitch of a reading, right?

a7