Open fwacer opened 1 year ago
Memory usage change @ 987fb8f24ee9c582646fe0bd312a92082f92b113
Board | flash | % | RAM for global variables | % |
---|---|---|---|---|
arduino:mbed_nano:nano33ble |
:small_red_triangle: +264 - +272 | +0.03 - +0.03 | :green_heart: -8 - 0 | -0.0 - 0.0 |
arduino:mbed_nano:nanorp2040connect |
:small_red_triangle: +270 - +270 | 0.0 - 0.0 | 0 - 0 | 0.0 - 0.0 |
arduino:mbed_portenta:envie_m7:target_core=cm4 |
N/A | N/A | N/A | N/A |
arduino:mbed_portenta:envie_m7 |
N/A | N/A | N/A | N/A |
Resolves #67 by changing Servo constructors and adding destructors. The constructor looks for an unused Servo to re-use first, before adding onto the end of the array.
So far this is untested on hardware.
I'm a little uncertain that changing "ServoCount" to "MAX_SERVOS" in the following lines is ok. As far as I can tell, it's just trying to keep the code from operating out of bounds on the servo array. https://github.com/arduino-libraries/Servo/blob/9fe754682b51fd532109fac86ff3d1991e978637/src/avr/Servo.cpp#L62 https://github.com/arduino-libraries/Servo/blob/9fe754682b51fd532109fac86ff3d1991e978637/src/avr/Servo.cpp#L57