Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix min/max private variables overflow #101

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

bleubidon
Copy link

Using an int8_t for min and max causes the computation of this->min and this->max in Servo::attach(int pin, int min, int max) to overflow (for instance when calling my_servo.attach(my_pin, 544, 1100), following https://www.arduino.cc/reference/en/libraries/servo/attach/).

@CLAassistant
Copy link

CLAassistant commented Jun 25, 2022

CLA assistant check
All committers have signed the CLA.

@github-actions
Copy link

Memory usage change @ 7b4f264

Board flash % RAM for global variables %
arduino:avr:leonardo 🔺 +8 - +8 +0.03 - +0.03 🔺 +2 - +2 +0.08 - +0.08
arduino:avr:mega 🔺 +8 - +8 0.0 - 0.0 🔺 +2 - +2 +0.02 - +0.02
arduino:avr:nano 🔺 +8 - +8 +0.03 - +0.03 🔺 +2 - +2 +0.1 - +0.1
arduino:mbed_nano:nano33ble 💚 -64 - 0 -0.01 - 0.0 🔺 +8 - +8 0.0 - 0.0
arduino:mbed_nano:nanorp2040connect 💚 -4 - -4 -0.0 - -0.0 🔺 +8 - +8 0.0 - 0.0
arduino:mbed_portenta:envie_m4 0 - 0 0.0 - 0.0 🔺 +8 - +8 0.0 - 0.0
arduino:mbed_portenta:envie_m7 0 - 0 0.0 - 0.0 🔺 +8 - +8 0.0 - 0.0
arduino:megaavr:nona4809 🔺 +8 - +8 +0.02 - +0.02 🔺 +2 - +2 +0.03 - +0.03
arduino:sam:arduino_due_x_dbg 💚 -16 - -8 -0.0 - -0.0 N/A N/A
arduino:samd:mkrzero 💚 -8 - -8 -0.0 - -0.0 🔺 +8 - +8 +0.02 - +0.02
Click for full report table
Board examples/Knob
flash
% examples/Knob
RAM for global variables
% examples/Sweep
flash
% examples/Sweep
RAM for global variables
%
arduino:avr:leonardo 8 0.03 2 0.08 8 0.03 2 0.08
arduino:avr:mega 8 0.0 2 0.02 8 0.0 2 0.02
arduino:avr:nano 8 0.03 2 0.1 8 0.03 2 0.1
arduino:mbed_nano:nano33ble 0 0.0 8 0.0 -64 -0.01 8 0.0
arduino:mbed_nano:nanorp2040connect -4 -0.0 8 0.0 -4 -0.0 8 0.0
arduino:mbed_portenta:envie_m4 0 0.0 8 0.0 0 0.0 8 0.0
arduino:mbed_portenta:envie_m7 0 0.0 8 0.0 0 0.0 8 0.0
arduino:megaavr:nona4809 8 0.02 2 0.03 8 0.02 2 0.03
arduino:sam:arduino_due_x_dbg -16 -0.0 N/A N/A -8 -0.0 N/A N/A
arduino:samd:mkrzero -8 -0.0 8 0.02 -8 -0.0 8 0.02
Click for full report CSV
Board,examples/Knob<br>flash,%,examples/Knob<br>RAM for global variables,%,examples/Sweep<br>flash,%,examples/Sweep<br>RAM for global variables,%
arduino:avr:leonardo,8,0.03,2,0.08,8,0.03,2,0.08
arduino:avr:mega,8,0.0,2,0.02,8,0.0,2,0.02
arduino:avr:nano,8,0.03,2,0.1,8,0.03,2,0.1
arduino:mbed_nano:nano33ble,0,0.0,8,0.0,-64,-0.01,8,0.0
arduino:mbed_nano:nanorp2040connect,-4,-0.0,8,0.0,-4,-0.0,8,0.0
arduino:mbed_portenta:envie_m4,0,0.0,8,0.0,0,0.0,8,0.0
arduino:mbed_portenta:envie_m7,0,0.0,8,0.0,0,0.0,8,0.0
arduino:megaavr:nona4809,8,0.02,2,0.03,8,0.02,2,0.03
arduino:sam:arduino_due_x_dbg,-16,-0.0,N/A,N/A,-8,-0.0,N/A,N/A
arduino:samd:mkrzero,-8,-0.0,8,0.02,-8,-0.0,8,0.02

@per1234 per1234 added type: imperfection Perceived defect in any part of project topic: code Related to content of the project itself labels Jun 26, 2022
@per1234 per1234 linked an issue Jul 19, 2022 that may be closed by this pull request
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
topic: code Related to content of the project itself type: imperfection Perceived defect in any part of project
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Attach with Min Max bug
3 participants