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 isConnected for reversed motors #19

Merged
merged 1 commit into from
Feb 3, 2025

Conversation

toxicdefender404
Copy link
Contributor

@toxicdefender404 toxicdefender404 commented Jan 30, 2025

get_plugged_type does not work for negative ports which means reversed motors in motor groups do nothing

@toxicdefender404 toxicdefender404 changed the title fix isConnected for reversed motors 🐛 fix isConnected for reversed motors Jan 30, 2025
@Miniongolf
Copy link
Contributor

Miniongolf commented Jan 30, 2025

Shouldn't the ReversibleSmartPort class handle the negative port
If it does, maybe we should switch m_port to a uint32_t to make it clearer

@toxicdefender404
Copy link
Contributor Author

Shouldn't the ReversibleSmartPort class handle the negative port If it does, maybe we should switch m_port to a uint32_t to make it clearer

Handle it in what way? The issue i see is that the pros motor specific functions don't have a reversed parameter, the only way to reverse them is via a negative port, but all the other functions have a reversed parameter and only work with positive ports.
The cleanest way IMO would be a pr to the pros kernel to make the api consistent but I don't feel like doing that.

@Miniongolf
Copy link
Contributor

Handle it in what way? The issue i see is that the pros motor specific functions don't have a reversed parameter, the only way to reverse them is via a negative port, but all the other functions have a reversed parameter and only work with positive ports. The cleanest way IMO would be a pr to the pros kernel to make the api consistent but I don't feel like doing that.

Ok yeah mb, I conflated the constructor flipping the port to positive when checking for validity with storing the port number as positive.

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.

LGTM

@SizzinSeal SizzinSeal merged commit f23fb3e into LemLib:main Feb 3, 2025
2 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.

3 participants