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

Add guard for pin in range in pinMode #698

Merged
merged 1 commit into from
Jul 3, 2023

Conversation

MarcelRobitaille
Copy link
Contributor

Fix #693

The pinMode(pin_size_t pin, PinMode mode) function can be passed a pin number that is out of range, crashing the microcontroller. This PR adds the same test found in digitalWrite(pin_size_t pin, PinStatus val) and digitalRead(pin_size_t pin) to ensure that the pin is in range.

@CLAassistant
Copy link

CLAassistant commented Jun 16, 2023

CLA assistant check
All committers have signed the CLA.

@MarcelRobitaille
Copy link
Contributor Author

@facchinm Could you take a look?

@facchinm
Copy link
Member

facchinm commented Jul 3, 2023

Thank you for the ping @MarcelRobitaille , I lost the notification apparently 🙂

@facchinm facchinm merged commit f57f3fc into arduino:main Jul 3, 2023
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

pinMode does not accept NC / unused pin
3 participants