Open
Description
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.
RUN_TEST(test_One);
RUN_TEST(test_Three);
RUN_TEST(test_RunTwoMotorsAsync);
RUN_TEST(test_ManualMotorReset);
RUN_TEST(test_InitializeTwentyTwoMotors);
RUN_TEST(test_InitializeTwentyTwoMotorsAndMoveTwo);