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

✨ Check ports at compile time #8

Merged
merged 7 commits into from
Jan 4, 2025

Conversation

ion098
Copy link
Contributor

@ion098 ion098 commented Nov 20, 2024

Closes #6

@ion098 ion098 marked this pull request as ready for review November 20, 2024 21:34
@ion098 ion098 changed the title ✨ Check ports at runtime ✨ Check ports at compile time Dec 24, 2024
@ion098 ion098 marked this pull request as draft December 24, 2024 19:48
@ion098 ion098 marked this pull request as ready for review December 26, 2024 17:15
Copy link
Member

@SizzinSeal SizzinSeal left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

just one question about a minor design choice, other than that it looks good. Oh, and also merge conflicts

* }
* @endcode
*/
V5RotationSensor(std::int8_t port);
static V5RotationSensor from_pros_rot(pros::Rotation encoder);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why do we not just overload the constructor?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Because it leads to issues with ambiguous calls, since Motor(1, 200_rpm) could be either the SmartPort ctor or the pros::Motor ctor

@SizzinSeal
Copy link
Member

LGTM

@SizzinSeal SizzinSeal merged commit 09344d2 into LemLib:main Jan 4, 2025
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.

✨ Static Port Range Checks
2 participants