You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is it possible to have a destructor for Servo that removes the motor from static list of Servos? The reason for asking is that I am artificially hitting the MAX_SERVOS limit when running unit tests for my solution. I have a test suite that initializes motors which contain Servos and then destructs the Motor to move on to the next test. See example below. B/c the Servo constructor adds to the static list of servos and caps it out at 48 (for the Mega 2560) after so many tests, the servos will stop attaching. Seems to me like there should be a destructor that does the cleanup for what the constructor is doing.
Resolvesarduino-libraries#67 by changing Servo constructors and adding destructors.
Constructor looks for an unused Servo to re-use first, before adding onto the end of the array.
Is it possible to have a destructor for Servo that removes the motor from static list of Servos? The reason for asking is that I am artificially hitting the
MAX_SERVOS
limit when running unit tests for my solution. I have a test suite that initializes motors which contain Servos and then destructs the Motor to move on to the next test. See example below. B/c the Servo constructor adds to the static list of servos and caps it out at 48 (for the Mega 2560) after so many tests, the servos will stop attaching. Seems to me like there should be a destructor that does the cleanup for what the constructor is doing.The text was updated successfully, but these errors were encountered: