Creates a buffered copy of the pulse duration within the base class. This requires 2 extra bytes of storage, but the benefit is that if the pulse duration wanders out of the 'valid' range for any reason the function will return the last known valid pulse rather than the center of the range. If the signal is noisy or ringing this will help keep it steady rather than constantly bouncing back and forth from the range's center.
This changes the default behavior of getPulse() when no signal is detected. It now returns the low end of the range rather than the center. As this modifies a class value, all of the 'get' functions that call getPulse() are no longer const.
This PR also fixes a minor issue with the getBoolean() function that replicated functionality from the getRangeCenter() function.
Creates a buffered copy of the pulse duration within the base class. This requires 2 extra bytes of storage, but the benefit is that if the pulse duration wanders out of the 'valid' range for any reason the function will return the last known valid pulse rather than the center of the range. If the signal is noisy or ringing this will help keep it steady rather than constantly bouncing back and forth from the range's center.
This changes the default behavior of
getPulse()
when no signal is detected. It now returns the low end of the range rather than the center. As this modifies a class value, all of the 'get' functions that callgetPulse()
are no longerconst
.This PR also fixes a minor issue with the
getBoolean()
function that replicated functionality from thegetRangeCenter()
function.