If you use the IoAbstraction library, this is an important note about switches.changeEncoderPrecision(..) from V2.4.0 to V3.0.0.
TLDR: switches.changeEncoderPrecision had a bad override between those versions and this has been fixed at 3.0.1, the original overloads were put back as before, and a new explicit overload added. Thanks to @StefanL38 for helping me find this.
Background
IoAbstraction contains a class instance called switches
that handles both button presses and rotary encoders. A few months ago a new feature was added that allowed for wrap around of values on encoders, and allowed the step rate to be changed. Unfortunately, when this was added it created a situation where there were two incompatible defaulted overloads on the above method, such that the wrong version of the changeEncoderPrecision
could be chosen by the compiler. This resulted in difficult to track down behaviour in the code.
What change has been made to fix this?
We have put back the two original overloads of the method and in order to use the step or wrap parameters you have to be explicit:
// originals have now been put back exactly as before
void changeEncoderPrecision(uint16_t precision, uint16_t currentValue)
void changeEncoderPrecision(uint8_t slot, uint16_t precision, uint16_t currentValue)
// using step or rollover/wrap requires ALL parameters to be explicitly defined
void changeEncoderPrecision(uint8_t slot, uint16_t precision, uint16_t currentValue, bool rollover, int step)
If you are hit by a compile time error as a result of this, (because you had used one of the bad overrides) then use the later function overload that allows you to provide these parameters explicitly. I try to never break backward compatibility, but in this case, the status-quo is already broken, and I've had two reports on this, one from a long-term user, and one from a new user.