This has been covered many times. As long as the input pin is toggling (even just with noise), the timeout will keep being reset. Also, I cannot recall which (but you can easily test this), but if the input is in the wrong state when at idle, it won't time out either. You can force the correct idle state through additional hardware, or by software.
I remember posting this over a year ago (although I can't seem to find it now) as an example to a Hardware solution...
Bookmarks