pulseIn Bug

I would say it is technically not a bug, but it does potentially break pre-existing code.
Whether that is a good thing or not depends on your point of view and whether or not
it breaks your code or makes you feel that your code is now more robust.

My personal opinion is that the current implementation is a bad thing.
While it does make code more robust by protecting from a potential hang condition, it does it in a way
that forces a lower granularity on everyone including those that may need the higher
level of granularity and are willing to give of that level of additional level of robustness
in order to get it.

An example of this is that pulsein() is used on things like ultrasonic distance sensors. Now all of a sudden
your distance measurements are not as accurate and there is nothing you can do about it in your application.

So my overall view is that it isn't the functionality of additional robustness , which I think is a
good thing, that I am opposed to, it is the cost associated with the current implementation
that I am opposed to.

There are other ways to handle this added functionality than the current implementation
that are still compatible with the current API and yet provide additional robustness.

I think the ideal solution would be to extend the API to support 2 optional timeouts as I noted before.
That way, those that want/need the extra level of robustness can ask for
timeouts and get it, and those that want/need the extra level of granularity can have
that as well.

It also allows all pre-existing code to continue to function with the behavior and
granularity that they had prior to this change.

The current implementation (and previous version as well)
uses the same code but then insert a super long
timeout value when timeouts are not needed/wanted.
Those applications that are not asking for a timeout are still paying the price to support a timeout.

From a granularity perspective, a better way to do it is to have
3 separate functions rather than have a common
function and make the timeouts "long" when they are not needed.
With separate functions, the code can be squeezed down to offer better granularity
when timeouts are not requested.

--- bill